diff --git a/js/sql/c2.js b/js/sql/c2.js new file mode 100644 index 0000000..e1125e9 --- /dev/null +++ b/js/sql/c2.js @@ -0,0 +1,45 @@ +/** Module convention: + * A.js: + * this.Ae=; + * var As=; + * function As(){} + * Ag= + * + * B.js: + * open('A',this) + * this.Ae + * Ag + * + * + */ + +/** GLOBALS **/ +/* C2JS Compat. */ +_=null; +/* Define a reference variable with an initial container value */ +ref = function (init) { return {ref:init }} +/* Return container value of a reference */ +$ = function (r) { return r.ref!=undefined?r.ref:r } +/* Set new container value of a reference variable */ +$$ = function (r,x) { r.ref=x } +sizeof = function (x) { return x.length } +strlen = function (x) { return x.length } +// buffer.copy(target, targetStart, sourceStart, sourceEnd); +memcpy = function (dst,src,n,doff,soff) { if (!doff) doff=0; if (!soff) soff=0; src.copy(dst,doff,soff,n-soff)} +memcmp = function (s1,s2,len) { var i; for (i=0;i