diff options
author | alon@honor <none@none> | 2010-09-05 17:05:35 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-09-05 17:05:35 -0700 |
commit | ed6f0355817810a757e4e464474e03c69264ce5f (patch) | |
tree | 322d707b22cd75d594d78652920da05cca1b1c67 /src/snippets.js | |
parent | 3e6c745b828932f237e472c484bb2ac2abfb8e3e (diff) |
snippets work
Diffstat (limited to 'src/snippets.js')
-rw-r--r-- | src/snippets.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/snippets.js b/src/snippets.js index b9f6267f..a93fd0fd 100644 --- a/src/snippets.js +++ b/src/snippets.js @@ -1,5 +1,5 @@ var Snippets = { - _vsnprintf: function(dst, num, src, ptr) { + vsnprintf: function(dst, num, src, ptr) { var args = []; while (HEAP[ptr] != 0) { args.push(HEAP[ptr]); @@ -12,11 +12,19 @@ var Snippets = { } }, - _atexit: function(func) { + atexit: function(func) { __ATEXIT__.push(func); }, + + strspn: function(pstr, pset) { + var str = String_copy(pstr); + var set = String_copy(pset); + var i = 0; + while (set.indexOf(str[i]) != -1) i++; // Must halt, as 0 is in both + return i; + }, }; -// Synonyms -Snippets.___cxa_atexit = Snippets._atexit; +// Aliases +Snippets.__cxa_atexit = Snippets.atexit; |