]> jfr.im git - irc/quakenet/newserv.git/blob - lib/sstring-new.h
Added new recycling version of sstring as sstring-new.[ch]
[irc/quakenet/newserv.git] / lib / sstring-new.h
1 /* sstring.h - Declaration of "static strings" functions */
2
3 #ifndef __SSTRING_H
4 #define __SSTRING_H
5
6 /* Externally visibly max string length */
7 #define SSTRING_MAX 512
8
9 typedef struct sstring {
10 short length;
11 short alloc;
12 struct sstring *next;
13 char content[];
14 } sstring;
15
16 #ifdef COMPILING_SSTRING
17
18 /* Internal defines */
19
20 /* SSTRING_MAXLEN is the internal version of SSTRING_MAX which includes
21 * space for the trailing NUL */
22 #define SSTRING_MAXLEN (SSTRING_MAX + 1)
23 #define SSTRING_SLACK 8
24 #define SSTRING_ALLOC 16384
25
26 #define SSTRING_HASHSIZE 85243
27
28 #endif /* COMPILING_SSTRING */
29
30 sstring *getsstring(const char *, int);
31 void freesstring(sstring *);
32 int sstringcompare(sstring *ss1, sstring *ss2);
33 void initsstring();
34 void finisstring();
35
36 #endif /* __SSTRING_H */