Lines Matching refs:cs
121 static int _lex(cstate *cs, int value) in _lex() argument
127 data = cs->data; in _lex()
129 if(cs->next != 0) { in _lex()
130 c = cs->next; in _lex()
131 cs->next = 0; in _lex()
150 cs->data = data; in _lex()
153 cs->data = data + 1; in _lex()
162 cs->data = data; in _lex()
166 cs->data = data; in _lex()
170 cs->data = data; in _lex()
179 cs->data = data; in _lex()
183 cs->data = data + 1; in _lex()
201 cs->data = data + 1; in _lex()
206 cs->data = data; in _lex()
211 cs->next = *data; in _lex()
213 cs->data = data + 1; in _lex()
224 cs->text = s; in _lex()
231 static int lex(cstate *cs, int value)
233 int tok = _lex(cs, value);
235 tok == T_TEXT ? cs->text : "");
239 #define lex(cs,v) _lex(cs,v) argument
242 static int parse_expr(cstate *cs, cnode *node);
244 static int parse_block(cstate *cs, cnode *node) in parse_block() argument
247 switch(lex(cs, 0)){ in parse_block()
249 if(parse_expr(cs, node)) return -1; in parse_block()
261 static int parse_expr(cstate *cs, cnode *root) in parse_expr() argument
266 node = config_find(root, cs->text); in parse_expr()
268 node = _config_create(root, cs->text); in parse_expr()
271 switch(lex(cs, 1)) { in parse_expr()
273 if(lex(cs, 0) != T_TEXT) in parse_expr()
275 node = _config_create(node, cs->text); in parse_expr()
279 node->value = cs->text; in parse_expr()
283 return parse_block(cs, node); in parse_expr()
294 cstate cs; in config_load() local
295 cs.data = data; in config_load()
296 cs.next = 0; in config_load()
299 switch(lex(&cs, 0)) { in config_load()
301 if(parse_expr(&cs, root)) in config_load()