]>
jfr.im git - irc/quakenet/newserv.git/blob - lib/sstring.h
1 /* sstring.h - Declaration of "static strings" functions */
8 #ifdef COMPILING_SSTRING
12 /* this is here for compatibility reasons with old sstring */
13 /* this should be used when old sstring is removed entirely */
16 typedef struct sstring
{
24 unsigned long refcount
;
28 #define sstring_content(x) (x)->__content
30 #else /* SSTRING_COMPAT */
32 typedef struct sstring
{
39 unsigned long refcount
;
43 #define sstring_content(x) (x)->content
45 #endif /* SSTRING_COMPAT */
47 #else /* SSTRING_NEW */
49 /* this is the old format */
51 /* Internal version of structure */
63 #endif /* SSTRING_NEW */
65 /* Internal defines */
67 /* SSTRING_MAXLEN is the internal version of SSTRING_MAX which includes
68 * space for the trailing NUL */
69 #define SSTRING_MAXLEN (SSTRING_MAX + 1)
70 #define SSTRING_SLACK 8
72 /* new sstring defines */
73 #define SSTRING_ALLOC 16384
75 #define SSTRING_HASHSIZE 85243
77 /* old sstring defines */
78 #define SSTRING_STRUCTALLOC 4096
79 #define SSTRING_DATAALLOC 4096
83 typedef struct sstring
{
88 #endif /* COMPILING_SSTRING */
90 /* Externally visibly max string length */
91 #define SSTRING_MAX 512
93 sstring
*getsstring(const char *, int);
94 void freesstring(sstring
*);
95 int sstringcompare(sstring
*ss1
, sstring
*ss2
);
99 #endif /* __SSTRING_H */