aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-12-09 20:37:23 -0800
committerAlon Zakai <azakai@mozilla.com>2010-12-09 20:37:23 -0800
commitcac39316acdecebaa2387ef3c27ef89be0962455 (patch)
treeb7d6d802f214f3de8f98d523c7e23e3433e35749 /src/library.js
parent1c5355c76c0389775f3e11b5b962311e7501ad31 (diff)
memchr
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 6a8e426d..374a0952 100644
--- a/src/library.js
+++ b/src/library.js
@@ -290,6 +290,15 @@ var Library = {
return 0;
},
+ memchr: function(ptr, chr, num) {
+ chr = unSign(chr);
+ for (var i = 0; i < num; i++) {
+ if (IHEAP[ptr] == chr) return ptr;
+ ptr++;
+ }
+ return 0;
+ },
+
strchr: function(ptr, chr) {
ptr--;
do {