summaryrefslogtreecommitdiff
path: root/src/include/token822.h
blob: 565cf5b29668a55c6392e639396f722c2fdde446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef TOKEN822_H
#define TOKEN822_H

#include "genalloc.h"
#include "stralloc.h"

#define TOKEN822_ATOM    1
#define TOKEN822_QUOTE   2
#define TOKEN822_LITERAL 3
#define TOKEN822_COMMENT 4
#define TOKEN822_LEFT    5
#define TOKEN822_RIGHT   6
#define TOKEN822_AT      7
#define TOKEN822_COMMA   8
#define TOKEN822_SEMI    9
#define TOKEN822_COLON   10
#define TOKEN822_DOT     11

struct token822 {
  int type;
  char *s;
  int slen;
};

GEN_ALLOC_typedef(token822_alloc, struct token822, t, len, a);
GEN_ALLOC_ready(token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_ready);
GEN_ALLOC_readyplus(token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_readyplus);
GEN_ALLOC_append(
    token822_alloc, struct token822, t, len, a, i, n, x, 30, token822_readyplus, token822_append);

int token822_parse(token822_alloc *, stralloc *, stralloc *);
int token822_addrlist(
    token822_alloc *taout, token822_alloc *taaddr, token822_alloc *ta, int (*callback)());
int token822_unquote(stralloc *, token822_alloc *);
int token822_unparse(stralloc *, token822_alloc *, unsigned int);
void token822_free();
void token822_reverse(token822_alloc *);

#endif