9 #define HEAD 2*sizeof(int)
11 #define SIZE(p) ((int *)(p))[-1]
12 #define SET_SIZE(p, n) ((int *)(p))[-1] = n
13 #define CAPACITY(p) ((int *)(p))[-2]
16 { int s_size
; /* number of chars in string */
17 const symbol
* s
; /* search string */
18 int substring_i
;/* index to longest matching substring */
19 int result
; /* result of the lookup */
20 int (* function
)(struct SN_env
*);
23 extern symbol
* create_s(void);
24 extern void lose_s(symbol
* p
);
26 extern int skip_utf8(const symbol
* p
, int c
, int limit
, int n
);
28 extern int skip_b_utf8(const symbol
* p
, int c
, int limit
, int n
);
30 extern int in_grouping_U(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
31 extern int in_grouping_b_U(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
32 extern int out_grouping_U(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
33 extern int out_grouping_b_U(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
35 extern int in_grouping(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
36 extern int in_grouping_b(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
37 extern int out_grouping(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
38 extern int out_grouping_b(struct SN_env
* z
, const unsigned char * s
, int min
, int max
, int repeat
);
40 extern int eq_s(struct SN_env
* z
, int s_size
, const symbol
* s
);
41 extern int eq_s_b(struct SN_env
* z
, int s_size
, const symbol
* s
);
42 extern int eq_v(struct SN_env
* z
, const symbol
* p
);
43 extern int eq_v_b(struct SN_env
* z
, const symbol
* p
);
45 extern int find_among(struct SN_env
* z
, const struct among
* v
, int v_size
);
46 extern int find_among_b(struct SN_env
* z
, const struct among
* v
, int v_size
);
48 extern int replace_s(struct SN_env
* z
, int c_bra
, int c_ket
, int s_size
, const symbol
* s
, int * adjustment
);
49 extern int slice_from_s(struct SN_env
* z
, int s_size
, const symbol
* s
);
50 extern int slice_from_v(struct SN_env
* z
, const symbol
* p
);
51 extern int slice_del(struct SN_env
* z
);
53 extern int insert_s(struct SN_env
* z
, int bra
, int ket
, int s_size
, const symbol
* s
);
54 extern int insert_v(struct SN_env
* z
, int bra
, int ket
, const symbol
* p
);
56 extern symbol
* slice_to(struct SN_env
* z
, symbol
* p
);
57 extern symbol
* assign_to(struct SN_env
* z
, symbol
* p
);
59 extern int len_utf8(const symbol
* p
);
61 extern void debug(struct SN_env
* z
, int number
, int line_count
);