Lines Matching +full:ch +full:- +full:func
3 /*-
4 * SPDX-License-Identifier: BSD-2-Clause
63 obj->type = type; in _citrus_prop_object_init()
64 memset(&obj->u, 0, sizeof(obj->u)); in _citrus_prop_object_init()
71 if (obj->type == _CITRUS_PROP_STR) in _citrus_prop_object_uninit()
72 free(__DECONST(void *, obj->u.str)); in _citrus_prop_object_uninit()
83 int ch, cutlim, n; \
90 ch = _memstream_getc(ms); \
91 p = strchr(xdigit, _bcs_toupper(ch)); \
92 if (p == NULL || (n = (p - xdigit)) >= base) \
99 _memstream_ungetc(ms, ch); \
100 *result = neg ? -acc : acc; \
112 int base, ch, neg; \ in _CITRUS_PROP_READ_UINT_COMMON()
115 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON()
117 switch (ch) { \ in _CITRUS_PROP_READ_UINT_COMMON()
118 case '-': \ in _CITRUS_PROP_READ_UINT_COMMON()
121 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON()
124 if (ch == '0') { \ in _CITRUS_PROP_READ_UINT_COMMON()
125 base -= 2; \ in _CITRUS_PROP_READ_UINT_COMMON()
126 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON()
127 if (ch == 'x' || ch == 'X') { \ in _CITRUS_PROP_READ_UINT_COMMON()
128 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON()
129 if (_bcs_isxdigit(ch) == 0) { \ in _CITRUS_PROP_READ_UINT_COMMON()
130 _memstream_ungetc(ms, ch); \ in _CITRUS_PROP_READ_UINT_COMMON()
131 obj->u._func_ = 0; \ in _CITRUS_PROP_READ_UINT_COMMON()
136 } else if (_bcs_isdigit(ch) == 0) \ in _CITRUS_PROP_READ_UINT_COMMON()
138 _memstream_ungetc(ms, ch); \ in _CITRUS_PROP_READ_UINT_COMMON()
140 (ms, &obj->u._func_, base, neg)); \ in _CITRUS_PROP_READ_UINT_COMMON()
150 int base, ch; local
152 ch = _memstream_getc(ms);
153 if (ch != '\\')
154 *result = ch;
156 ch = _memstream_getc(ms);
158 switch (ch) {
182 _memstream_ungetc(ms, ch);
183 base -= 8;
191 *result = ch;
201 int ch, errnum; in _citrus_prop_read_character() local
204 ch = _memstream_getc(ms); in _citrus_prop_read_character()
205 if (ch != '\'') { in _citrus_prop_read_character()
206 _memstream_ungetc(ms, ch); in _citrus_prop_read_character()
209 errnum = _citrus_prop_read_character_common(ms, &ch); in _citrus_prop_read_character()
212 obj->u.chr = ch; in _citrus_prop_read_character()
213 ch = _memstream_getc(ms); in _citrus_prop_read_character()
214 if (ch != '\'') in _citrus_prop_read_character()
230 obj->u.boolean = true; in _citrus_prop_read_bool()
239 obj->u.boolean = false; in _citrus_prop_read_bool()
250 int ch, errnum, quot; in _citrus_prop_read_str() local
274 ++n, --m; in _citrus_prop_read_str()
287 ch = _memstream_getc(ms); in _citrus_prop_read_str()
288 if (quot == ch || (quot == EOF && in _citrus_prop_read_str()
289 (ch == ';' || _bcs_isspace(ch)))) { in _citrus_prop_read_str()
292 obj->u.str = (const char *)s; in _citrus_prop_read_str()
295 _memstream_ungetc(ms, ch); in _citrus_prop_read_str()
296 errnum = _citrus_prop_read_character_common(ms, &ch); in _citrus_prop_read_str()
301 s[n] = ch; in _citrus_prop_read_str()
302 ++n, --m; in _citrus_prop_read_str()
323 int ch; in _citrus_prop_read_symbol() local
327 ch = _memstream_getc(ms); in _citrus_prop_read_symbol()
328 if (ch != '_' && _bcs_isalnum(ch) == 0) in _citrus_prop_read_symbol()
330 s[m] = ch; in _citrus_prop_read_symbol()
332 ch = _memstream_getc(ms); in _citrus_prop_read_symbol()
333 if (ch == '_' || _bcs_isalnum(ch) != 0) in _citrus_prop_read_symbol()
337 _memstream_ungetc(ms, ch); in _citrus_prop_read_symbol()
347 int ch, errnum; in _citrus_prop_parse_element() local
356 for (hint = hints; hint->name != NULL; ++hint) in _citrus_prop_parse_element()
357 if (_citrus_bcs_strcasecmp(name, hint->name) == 0) in _citrus_prop_parse_element()
363 ch = _memstream_getc(ms); in _citrus_prop_parse_element()
364 if (ch != '=' && ch != ':') in _citrus_prop_parse_element()
365 _memstream_ungetc(ms, ch); in _citrus_prop_parse_element()
367 _citrus_prop_object_init(&ostart, hint->type); in _citrus_prop_parse_element()
368 _citrus_prop_object_init(&oend, hint->type); in _citrus_prop_parse_element()
369 errnum = (*readers[hint->type])(ms, &ostart); in _citrus_prop_parse_element()
373 ch = _memstream_getc(ms); in _citrus_prop_parse_element()
374 switch (hint->type) { in _citrus_prop_parse_element()
380 if (ch != '-') in _citrus_prop_parse_element()
382 errnum = (*readers[hint->type])(ms, &oend); in _citrus_prop_parse_element()
386 ch = _memstream_getc(ms); in _citrus_prop_parse_element()
390 errnum = (*hint->cb._func_.func)(context, \ in _citrus_prop_parse_element()
391 hint->name, ostart.u._func_); \ in _citrus_prop_parse_element()
395 errnum = (*hint->cb._func_.func)(context, \ in _citrus_prop_parse_element()
396 hint->name, ostart.u._func_, oend.u._func_);\ in _citrus_prop_parse_element()
398 switch (hint->type) { in _citrus_prop_parse_element()
421 } while (ch == ','); in _citrus_prop_parse_element()
422 if (ch != ';') in _citrus_prop_parse_element()
423 _memstream_ungetc(ms, ch); in _citrus_prop_parse_element()
432 int ch, errnum; in _citrus_prop_parse_variable() local
437 ch = _memstream_getc(&ms); in _citrus_prop_parse_variable()
438 if (ch == EOF || ch == '\0') in _citrus_prop_parse_variable()
440 _memstream_ungetc(&ms, ch); in _citrus_prop_parse_variable()