stringid.h
1 #ifndef __STRING_ID_DOUBLE_ARRAY_H_
2 #define __STRING_ID_DOUBLE_ARRAY_H_
3
4
5
6 #define SI_OK 0
7 #define SI_EHDL ( -1 )
8 #define SI_EMEM ( -2 )
9 #define SI_EIO ( -3 )
10 #define SI_EARG ( -4 )
11 #define SI_EFMT ( -5 )
12 #define SI_EMAX ( -6 )
13 #define SI_EVER ( -7 )
14 #define SI_EKEY ( -8 )
15
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21
22
23 typedef struct SISet *hSISet;
24
25
26 typedef struct SIDic *hSIDic;
27
28
29 typedef struct SIStat
30 {
31 int nbc;
32 int ntail;
33 int size;
34 int nkey;
35 int maxlen;
36 } SIStat, *hSIStat;
37
38
39 typedef struct SISrc
40 {
41 const char *input;
42 const char *start;
43 int len;
44 int idx;
45 int id;
46 } SISrc, *hSISrc;
47
48
49
50 int SISet_Open( hSISet *h );
51
52 int SISet_Load( hSISet h, const char *path, const char *delim );
53
54 int SISet_Insert( hSISet h, const char *key );
55
56 int SISet_Close( hSISet h );
57
58
59 int SIDic_Build( hSIDic *h, hSISet set );
60
61 int SIDic_Open( hSIDic *h, const char *path );
62
63 int SIDic_Close( hSIDic h );
64
65 int SIDic_Save( hSIDic h, const char *path );
66
67
68 int SIDic_Status( hSIDic h, hSIStat st );
69
70
71 const char *SIDic_StrToID( hSIDic h, const char *s, int *id );
72
73 const char *SIDic_IDToStr( hSIDic h, int id );
74
75
76 int SISrc_Start( hSISrc h, const char *s );
77
78 const char *SIDic_Prefix( hSIDic h, hSISrc src );
79
80 const char *SIDic_Infix( hSIDic h, hSISrc src );
81
82
83 const char *SIDic_Error( int err );
84
85
86 #ifdef __cplusplus
87 }
88 #endif
89
90
91 #endif