]> jfr.im git - irc/quakenet/newserv.git/blame - lib/sstring.h
Add iterators to newsearch, along with an example channel iterator function.
[irc/quakenet/newserv.git] / lib / sstring.h
CommitLineData
c86edd1d
Q
1/* sstring.h - Declaration of "static strings" functions */
2
3#ifndef __SSTRING_H
4#define __SSTRING_H
5
0628b795 6/* Externally visibly max string length */
7#define SSTRING_MAX 512
8
c86edd1d
Q
9#ifdef COMPILING_SSTRING
10/* Internal version of structure */
11typedef struct {
12 char *content;
13 union {
14 struct {
15 short length;
16 short alloc;
17 } l;
18 void *next;
19 } u;
20} sstring;
21
22/* Internal defines */
23
0628b795 24/* SSTRING_MAXLEN is the internal version of SSTRING_MAX which includes
25 * space for the trailing NUL */
26#define SSTRING_MAXLEN (SSTRING_MAX + 1)
c86edd1d
Q
27#define SSTRING_SLACK 8
28#define SSTRING_STRUCTALLOC 4096
29#define SSTRING_DATAALLOC 4096
30
31#else
32/* External (simpler) version */
33
34typedef struct {
35 char *content;
36 short length;
37} sstring;
38
39#endif /* COMPILING_SSTRING */
40
41sstring *getsstring(const char *, int);
42void freesstring(sstring *);
43int sstringcompare(sstring *ss1, sstring *ss2);
44void initsstring();
010f1c74 45void finisstring();
c86edd1d
Q
46
47#endif /* __SSTRING_H */