94 ConfigNode *root = serverconfig_parse(parser, cx_strn(buf.space, buf.size)); |
94 ConfigNode *root = serverconfig_parse(parser, cx_strn(buf.space, buf.size)); |
95 cxBufferDestroy(&buf); |
95 cxBufferDestroy(&buf); |
96 return root; |
96 return root; |
97 } |
97 } |
98 |
98 |
|
99 static int scfg_char_is_delim(char c) { |
|
100 static const char *scfg_tokenizer_delim = "()+-/*%"; |
|
101 for(int i=0;i<sizeof(scfg_tokenizer_delim)-1;i++) { |
|
102 if(c == scfg_tokenizer_delim[i]) { |
|
103 return 1; |
|
104 } |
|
105 } |
|
106 return 0; |
|
107 } |
99 |
108 |
100 static CFGToken get_next_token(cxstring content, int *pos) { |
109 static CFGToken get_next_token(cxstring content, int *pos) { |
101 CFGToken token = { {NULL, 0}, CFG_NO_TOKEN }; |
110 CFGToken token = { {NULL, 0}, CFG_NO_TOKEN }; |
102 CFGTokenType type = CFG_TOKEN; |
111 CFGTokenType type = CFG_TOKEN; |
103 |
112 |