Permalink
Browse files

[enhance] opabsl&plugins: extract browser_canvas,crypto,irc,socket,un…

…ix plugins from bsl
  • Loading branch information...
1 parent 6f11459 commit 37ce9a6c9c7a6b632156284e4ca09e56a3775e15 @OpaOnWindowsNow OpaOnWindowsNow committed Oct 20, 2011
View
@@ -13,7 +13,6 @@ bslNumber.js
bslTime.js
bslReference.js
bslScheduler.js
-bslCrypto.js
bslBuffer.js
fbuffer.js
json2.js
@@ -28,7 +27,6 @@ bslSession.js
bslValue.js
bslClosure.js
bslDom.js
-bslCanvas.js
bslDomSupport.js
bool.js
View
@@ -1,7 +1,6 @@
# -*- conf -*-
bslNativeLib.ml
-bslUnix.ml
bslSys.ml
bslUtils.ml
bslScheduler.ml
@@ -21,14 +20,11 @@ bslGc.ml
bslPervasives.ml
bslString.ml
bslCactutf.ml
-bslCrypto.ml
bslFile.ml
bslMail.ml
bslReference.ml
bslNumber.ml
-bslIrc.ml
-bslSocket.ml
bslJson.ml
bslMinJs.ml
bslValue.ml
View
@@ -1,2 +1,6 @@
<*.{ml,byte,native,opa_plugin}>: use_libbase, use_libnet, use_appruntime, use_libtools, use_libsecurity, use_database, use_libqmlcompil, use_qmltop
-<xinha>: traverse
+<browser_canvas>: traverse
+<crypto>: traverse
+<irc>: traverse
+<unix>:traverse
+<socket>: traverse
@@ -0,0 +1,2 @@
+jschecker_browser_canvas.js
+bslCanvas.js
@@ -16,6 +16,7 @@
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*/
+##extern-type Dom.private.element
##extern-type Canvas.context
##extern-type Canvas.pattern
##extern-type Canvas.gradient
@@ -0,0 +1,2 @@
+var js_some, js_none, empty_constructor, add_field, static_field_of_name,make_record;
+
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,2 @@
+bslCrypto.ml
+bslCrypto.js
View
@@ -0,0 +1,30 @@
+(*
+ Copyright © 2011 MLstate
+
+ This file is part of OPA.
+
+ OPA is free software: you can redistribute it and/or modify it under the
+ terms of the GNU Affero General Public License, version 3, as published by
+ the Free Software Foundation.
+
+ OPA is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
+ more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with OPA. If not, see <http://www.gnu.org/licenses/>.
+*)
+let create_bot = IrcBot.create_bot
+let write_raw conn str = Scheduler.write (Scheduler.default) conn str
+ (fun _ -> ())
+let write_msg conn msg = write_raw conn (IrcBotCore.string_of_msg msg)
+
+##extern-type Irc.connection = Scheduler.connection_info
+##extern-type Irc.msg = IrcBotCore.msg
+
+##register create_bot: string, string, string, string, string, string, int,\
+ (Irc.connection -> void),\
+ (Irc.connection, string, string, string -> void) -> void
+##register write_raw: Irc.connection, string -> void
+##register write_msg: Irc.connection, Irc.msg -> void
@@ -0,0 +1 @@
+bslIrc.ml
@@ -19,6 +19,8 @@
module C = QmlCpsServerLib
open C.Ops
+##extern-type continuation('a) = 'a QmlCpsServerLib.continuation
+##extern-type SSL.secure_type = SslAS.secure_type
##extern-type Socket.connection = Scheduler.connection_info
let private_connect ?(secure_mode = Network.Unsecured) (addr: string) port
@@ -0,0 +1 @@
+bslSocket.ml
@@ -20,8 +20,20 @@
<!> Not for casual user
*)
-(* refactoring in progress *)
-module BslNativeLib = BslNativeLib
+##opa-type tuple_2('a, 'b)
+##extern-type 'a caml_list = 'a list
+
+(* ugly duplication, need to have dependencies between plugin *)
+let f1 = ServerLib.static_field_of_name "f1"
+let f2 = ServerLib.static_field_of_name "f2"
+let opa_tuple_2 (a, b) =
+ let record =
+ let acc = ServerLib.empty_record_constructor in
+ let acc = ServerLib.add_field acc f1 a in
+ let acc = ServerLib.add_field acc f2 b in
+ ServerLib.make_record acc
+ in
+ wrap_opa_tuple_2 record
##opa-type System.process_status
@@ -50,7 +62,7 @@ let opa_status = function
let return_pid_status (pid, status) =
let pid = ServerLib.wrap_int pid in
let status = opa_status status in
- BslNativeLib.opa_tuple_2 (pid, status)
+ opa_tuple_2 (pid, status)
##register wait : -> opa[tuple_2(int, System.process_status)]
let wait () =
@@ -0,0 +1 @@
+bslUnix.ml
View
@@ -16,6 +16,7 @@
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*/
package stdlib.apis.irc
+import-plugin irc
type Irc.connection = external
type Irc.msg = external
@@ -17,6 +17,7 @@
*/
import stdlib.core.{parser, date, rpc.core, web.{core,resource,request}, xhtml, args, i18n}
+import-plugin crypto
/**
View
@@ -34,6 +34,8 @@
* {1 Interface}
*/
+import-plugin crypto
+
Crypto = {{
Base64 = {{
@@ -15,6 +15,8 @@
You should have received a copy of the GNU Affero General Public
License along with OPA. If not, see <http://www.gnu.org/licenses/>.
*/
+import-plugin socket
+
type Socket.connection = external
/**
View
@@ -15,6 +15,8 @@
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*/
+import-plugin unix
+
/**
Binding with module System
<!> Not for casual user
@@ -25,6 +25,7 @@
*/
import stdlib.core.{web.core}
+import-plugin browser_canvas
/**
* {1 About this module}
@@ -118,8 +119,8 @@ Canvas = {{
You cannot see this image because your browser is not fully
compatible with the latest web standard, HTML5.
Please consider upgrading or switching to a more modern browser.
- </>;
- create_with(id, width, height, err_msg)
+ </p> ;
+ create_with(id, width, height, err_msg)
get(dom : dom) : option(Canvas.canvas) =
%% BslCanvas.get %%(Dom.of_selection(dom))
@@ -19,6 +19,7 @@
/**
* @author Adam Koprowski
**/
+import stdlib.web.canvas
type WBarChart.config = {

0 comments on commit 37ce9a6

Please sign in to comment.