Skip to content

Commit

Permalink
add javascript stub
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragsoni committed May 5, 2021
1 parent 9e69d88 commit db125fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ function bigstringaf_memcmp_string(ba, ba_off, str, str_off, len) {
}
return 0;
}

//Provides: bigstringaf_memchr
//Requires: caml_ba_get_1
function bigstringaf_memchr(ba, ba_off, chr, len) {
for (var i = 0; i < len; i++) {
if (caml_ba_get_1(ba, ba_off + i) == chr) {
return (ba_off + i);
}
}
return -1;
}

0 comments on commit db125fe

Please sign in to comment.