PostgreSQL Source Code
git master
header.h
Go to the documentation of this file.
1
2
#include <limits.h>
3
4
#include "
api.h
"
5
6
#define MAXINT INT_MAX
7
#define MININT INT_MIN
8
9
#define HEAD 2*sizeof(int)
10
11
#define SIZE(p) ((int *)(p))[-1]
12
#define SET_SIZE(p, n) ((int *)(p))[-1] = n
13
#define CAPACITY(p) ((int *)(p))[-2]
14
15
struct
among
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
*);
21
};
22
23
extern
symbol
*
create_s
(
void
);
24
extern
void
lose_s
(
symbol
*
p
);
25
26
extern
int
skip_utf8
(
const
symbol
*
p
,
int
c
,
int
limit,
int
n);
27
28
extern
int
skip_b_utf8
(
const
symbol
*
p
,
int
c
,
int
limit,
int
n);
29
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
);
34
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
);
39
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
);
44
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);
47
48
extern
int
replace_s
(
struct
SN_env
* z,
int
c_bra,
int
c_ket,
int
s_size,
const
symbol
* s,
int
* adjptr);
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);
52
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
);
55
56
extern
symbol
*
slice_to
(
struct
SN_env
* z,
symbol
*
p
);
57
extern
symbol
*
assign_to
(
struct
SN_env
* z,
symbol
*
p
);
58
59
extern
int
len_utf8
(
const
symbol
*
p
);
60
61
extern
void
debug
(
struct
SN_env
* z,
int
number,
int
line_count);
api.h
symbol
unsigned char symbol
Definition:
api.h:2
insert_v
int insert_v(struct SN_env *z, int bra, int ket, const symbol *p)
Definition:
utilities.c:444
find_among_b
int find_among_b(struct SN_env *z, const struct among *v, int v_size)
Definition:
utilities.c:298
out_grouping_U
int out_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:141
insert_s
int insert_s(struct SN_env *z, int bra, int ket, int s_size, const symbol *s)
Definition:
utilities.c:435
slice_del
int slice_del(struct SN_env *z)
Definition:
utilities.c:431
in_grouping_U
int in_grouping_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:117
eq_v_b
int eq_v_b(struct SN_env *z, const symbol *p)
Definition:
utilities.c:229
assign_to
symbol * assign_to(struct SN_env *z, symbol *p)
Definition:
utilities.c:466
in_grouping
int in_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:167
eq_s
int eq_s(struct SN_env *z, int s_size, const symbol *s)
Definition:
utilities.c:215
replace_s
int replace_s(struct SN_env *z, int c_bra, int c_ket, int s_size, const symbol *s, int *adjptr)
Definition:
utilities.c:374
slice_to
symbol * slice_to(struct SN_env *z, symbol *p)
Definition:
utilities.c:448
eq_v
int eq_v(struct SN_env *z, const symbol *p)
Definition:
utilities.c:225
lose_s
void lose_s(symbol *p)
Definition:
utilities.c:15
create_s
symbol * create_s(void)
Definition:
utilities.c:5
out_grouping_b
int out_grouping_b(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:203
in_grouping_b_U
int in_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:129
skip_b_utf8
int skip_b_utf8(const symbol *p, int c, int limit, int n)
Definition:
utilities.c:52
eq_s_b
int eq_s_b(struct SN_env *z, int s_size, const symbol *s)
Definition:
utilities.c:220
out_grouping
int out_grouping(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:191
out_grouping_b_U
int out_grouping_b_U(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:153
slice_from_v
int slice_from_v(struct SN_env *z, const symbol *p)
Definition:
utilities.c:427
find_among
int find_among(struct SN_env *z, const struct among *v, int v_size)
Definition:
utilities.c:233
skip_utf8
int skip_utf8(const symbol *p, int c, int limit, int n)
Definition:
utilities.c:27
slice_from_s
int slice_from_s(struct SN_env *z, int s_size, const symbol *s)
Definition:
utilities.c:422
in_grouping_b
int in_grouping_b(struct SN_env *z, const unsigned char *s, int min, int max, int repeat)
Definition:
utilities.c:179
len_utf8
int len_utf8(const symbol *p)
Definition:
utilities.c:478
debug
void debug(struct SN_env *z, int number, int line_count)
repeat
Datum repeat(PG_FUNCTION_ARGS)
Definition:
oracle_compat.c:1121
c
char * c
Definition:
preproc-cursor.c:31
SN_env
Definition:
api.h:14
SN_env::p
symbol * p
Definition:
api.h:15
SN_env::ket
int ket
Definition:
api.h:16
SN_env::bra
int bra
Definition:
api.h:16
among
Definition:
header.h:16
among::result
int result
Definition:
header.h:19
among::substring_i
int substring_i
Definition:
header.h:18
among::s_size
int s_size
Definition:
header.h:16
among::s
const symbol * s
Definition:
header.h:17
src
include
snowball
libstemmer
header.h
Generated on Mon Dec 2 2024 18:13:25 for PostgreSQL Source Code by
1.9.1