File: bigstring-base_bigstring.js

package info (click to toggle)
js-of-ocaml 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,372 kB
  • sloc: ml: 70,468; javascript: 8,238; ansic: 319; makefile: 217; lisp: 23; sh: 6; perl: 4
file content (43 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

//The following are defined in Base_bigstring
//There are just provided here for compatibility reasons

//Provides: bigstring_alloc
//Requires: caml_ba_create
//Weakdef
function bigstring_alloc(_,size){ return caml_ba_create(12, 0, [0,size]) }
//Provides: bigstring_blit_stub
//Requires: caml_bigstring_blit_ba_to_ba
//Weakdef
var bigstring_blit_stub = caml_bigstring_blit_ba_to_ba
//Provides: bigstring_blit_bytes_bigstring_stub
//Requires: caml_bigstring_blit_string_to_ba
//Weakdef
var bigstring_blit_bytes_bigstring_stub = caml_bigstring_blit_string_to_ba
//Provides: bigstring_blit_string_bigstring_stub
//Requires: caml_bigstring_blit_string_to_ba
//Weakdef
var bigstring_blit_string_bigstring_stub = caml_bigstring_blit_string_to_ba
//Provides: bigstring_blit_bigstring_bytes_stub
//Requires: caml_bigstring_blit_ba_to_bytes
//Weakdef
var bigstring_blit_bigstring_bytes_stub = caml_bigstring_blit_ba_to_bytes;
//Provides: bigstring_blit_bigstring_string_stub
//Requires: caml_bigstring_blit_ba_to_bytes
//Weakdef
var bigstring_blit_bigstring_string_stub = caml_bigstring_blit_ba_to_bytes
//Provides: bigstring_memcmp_stub
//Requires: caml_bigstring_memcmp
//Weakdef
var bigstring_memcmp_stub = caml_bigstring_memcmp
//Provides: bigstring_find
//Requires: caml_ba_get_1
//Weakdef
function bigstring_find(bs, chr, pos, len){
  while(len > 0){
    if(caml_ba_get_1(bs,pos) == chr) return pos;
    pos++;
    len--;
  }
  return -1;
}