 |
ldns
1.7.0
|
Go to the documentation of this file.
58 while ((c = getc(f)) != EOF) {
61 if (c ==
'(' && prev_c !=
'\\' && !quoted) {
70 if (c ==
')' && prev_c !=
'\\' && !quoted) {
86 if (c ==
';' && quoted == 0) {
91 if (c ==
'\"' && com == 0 && prev_c !=
'\\') {
95 if (c ==
'\n' && com != 0) {
100 *line_nr = *line_nr + 1;
102 if (p == 0 && i > 0) {
116 if (c ==
'\n' && p != 0 && t > token) {
119 *line_nr = *line_nr + 1;
121 if (limit > 0 && (i >= limit || (
size_t)(t-token) >= limit)) {
131 for (d = del; *d; d++) {
132 if (c == *d && i > 0 && prev_c !=
'\\' && p == 0) {
133 if (c ==
'\n' && line_nr) {
134 *line_nr = *line_nr + 1;
139 if (c !=
'\0' && c !=
'\n') {
142 if (limit > 0 && (i >= limit || (
size_t)(t-token) >= limit)) {
146 if (c !=
'\0' && c !=
'\n') {
149 if (c ==
'\\' && prev_c ==
'\\')
181 const char *d_del,
size_t data_limit)
189 const char *d_del,
size_t data_limit,
int *line_nr)
254 if (c ==
'(' && lc !=
'\\' && !quoted) {
263 if (c ==
')' && lc !=
'\\' && !quoted) {
279 if (c ==
';' && quoted == 0) {
284 if (c ==
'"' && com == 0 && lc !=
'\\') {
288 if (c ==
'\n' && com != 0) {
302 if (c ==
'\n' && p != 0) {
310 for (d = del; *d; d++) {
311 if (c == *d && lc !=
'\\' && p == 0) {
317 if (limit > 0 && (i >= limit || (
size_t)(t-token) >= limit)) {
323 if (c ==
'\\' && lc ==
'\\') {
359 while(ldns_buffer_available_at(buffer, buffer->
_position,
sizeof(
char))) {
360 c = (char) ldns_buffer_read_u8_at(buffer, buffer->
_position);
362 for (d = s; *d; d++) {
388 while ((c = fgetc(fp)) != EOF) {
389 if (line_nr && c ==
'\n') {
390 *line_nr = *line_nr + 1;
393 for (d = s; *d; d++) {
408 *data,
const char *d_del,
size_t data_limit)
427 if (strncmp(fkeyword, keyword, strlen(keyword)) == 0) {
size_t _position
The current position used for reading/writing.
implementation of buffers to ease operations
ssize_t ldns_bget_token(ldns_buffer *b, char *token, const char *delim, size_t limit)
returns a token/char from the buffer b.
void ldns_bskipcs(ldns_buffer *buffer, const char *s)
skips all of the characters in the given string in the buffer, moving the position to the first chara...
ssize_t ldns_fget_keyword_data(FILE *f, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit)
#define LDNS_MAX_KEYWORDLEN
#define LDNS_PARSE_NORMAL
ssize_t ldns_bget_keyword_data(ldns_buffer *b, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit)
ldns_lookup_table ldns_directive_types[]
void ldns_fskipcs_l(FILE *fp, const char *s, int *line_nr)
skips all of the characters in the given string in the fp, moving the position to the first character...
#define LDNS_XMALLOC(type, count)
A general purpose lookup table.
size_t _limit
The read/write limit.
int ldns_bgetc(ldns_buffer *buffer)
returns the next character from a buffer.
ssize_t ldns_fget_keyword_data_l(FILE *f, const char *keyword, const char *k_del, char *data, const char *d_del, size_t data_limit, int *line_nr)
ssize_t ldns_fget_token(FILE *f, char *token, const char *delim, size_t limit)
returns a token/char from the stream F.
void ldns_fskipcs(FILE *fp, const char *s)
skips all of the characters in the given string in the fp, moving the position to the first character...
ssize_t ldns_fget_token_l(FILE *f, char *token, const char *delim, size_t limit, int *line_nr)
returns a token/char from the stream F.