bglibs
|
Data Structures | |
struct | striter |
Macros | |
#define | str_copyiter(STR, ITER) str_copyb(STR,(ITER)->startptr,(ITER)->len) |
#define | str_catiter(STR, ITER) str_catb(STR,(ITER)->startptr,(ITER)->len) |
#define | obuf_putiter(OBUF, ITER) obuf_write(OBUF,(ITER)->startptr,(ITER)->len) |
#define | striter_loop(ITER, STR, SEP) for(striter_start(ITER,STR,SEP);striter_valid(ITER);striter_advance(ITER)) |
Functions | |
void | striter_start (striter *iter, const struct str *s, char sep) |
int | striter_valid (striter *) |
int | striter_advance (striter *) |
0
(false) if the function failed or the iterator is no longer valid, and non-zero (true) otherwise. #define obuf_putiter | ( | OBUF, | |
ITER | |||
) | obuf_write(OBUF,(ITER)->startptr,(ITER)->len) |
Output the current striter substring to an obuf.
Referenced by path_match().
#define str_catiter | ( | STR, | |
ITER | |||
) | str_catb(STR,(ITER)->startptr,(ITER)->len) |
Append the current striter substring to a str.
#define str_copyiter | ( | STR, | |
ITER | |||
) | str_copyb(STR,(ITER)->startptr,(ITER)->len) |
Assign the current striter substring to a str.
#define striter_loop | ( | ITER, | |
STR, | |||
SEP | |||
) | for(striter_start(ITER,STR,SEP);striter_valid(ITER);striter_advance(ITER)) |
Loop macro; use in place of for
(...)
Referenced by dns_read_resolvconf(), and envstr_find().
int striter_advance | ( | striter * | iter | ) |
Advance a striter to the next substring.
References len, str::len, str::s, sep, start, startptr, str, and str_findnext().
Referenced by envstr_make_array(), and path_match().
Start (initialize) a striter.
References len, str::s, start, startptr, and str.
Referenced by envstr_make_array(), and path_match().
int striter_valid | ( | striter * | iter | ) |
Determine if a striter is valid (after initialization or advancing).
References str::len, start, and str.
Referenced by envstr_make_array(), and path_match().