/
usr
/
include
/
bind9
/
isc
/
/usr/include/bind9/isc
mkdir
upload
Name
Size
Mode
Actions
aes.h
1015
0644
edit
dl
rm
align.h
569
0644
edit
dl
rm
app.h
7139
0644
edit
dl
rm
assertions.h
2227
0644
edit
dl
rm
astack.h
1137
0644
edit
dl
rm
atomic.h
3082
0644
edit
dl
rm
backtrace.h
3894
0644
edit
dl
rm
barrier.h
1052
0644
edit
dl
rm
base32.h
4453
0644
edit
dl
rm
base64.h
2865
0644
edit
dl
rm
bind9.h
829
0644
edit
dl
rm
buffer.h
30625
0644
edit
dl
rm
bufferlist.h
1453
0644
edit
dl
rm
cmocka.h
1383
0644
edit
dl
rm
commandline.h
1711
0644
edit
dl
rm
condition.h
1914
0644
edit
dl
rm
counter.h
1922
0644
edit
dl
rm
crc64.h
998
0644
edit
dl
rm
deprecated.h
662
0644
edit
dl
rm
dir.h
1545
0644
edit
dl
rm
endian.h
4868
0644
edit
dl
rm
errno.h
659
0644
edit
dl
rm
errno2result.h
901
0644
edit
dl
rm
error.h
1434
0644
edit
dl
rm
event.h
3442
0644
edit
dl
rm
eventclass.h
1442
0644
edit
dl
rm
file.h
11669
0644
edit
dl
rm
formatcheck.h
940
0644
edit
dl
rm
fsaccess.h
7453
0644
edit
dl
rm
fuzz.h
593
0644
edit
dl
rm
hash.h
1649
0644
edit
dl
rm
heap.h
5263
0644
edit
dl
rm
hex.h
2805
0644
edit
dl
rm
hmac.h
3970
0644
edit
dl
rm
hp.h
4588
0644
edit
dl
rm
ht.h
4485
0644
edit
dl
rm
httpd.h
2291
0644
edit
dl
rm
interfaceiter.h
3141
0644
edit
dl
rm
iterated_hash.h
933
0644
edit
dl
rm
lang.h
686
0644
edit
dl
rm
lex.h
10004
0644
edit
dl
rm
lfsr.h
2955
0644
edit
dl
rm
lib.h
1155
0644
edit
dl
rm
likely.h
868
0644
edit
dl
rm
list.h
8085
0644
edit
dl
rm
log.h
26497
0644
edit
dl
rm
magic.h
999
0644
edit
dl
rm
managers.h
776
0644
edit
dl
rm
md.h
5760
0644
edit
dl
rm
mem.h
18086
0644
edit
dl
rm
meminfo.h
710
0644
edit
dl
rm
mutex.h
4178
0644
edit
dl
rm
mutexatomic.h
9790
0644
edit
dl
rm
mutexblock.h
1162
0644
edit
dl
rm
net.h
8564
0644
edit
dl
rm
netaddr.h
4786
0644
edit
dl
rm
netdb.h
860
0644
edit
dl
rm
netmgr.h
15732
0644
edit
dl
rm
netscope.h
966
0644
edit
dl
rm
nonce.h
743
0644
edit
dl
rm
offset.h
687
0644
edit
dl
rm
once.h
767
0644
edit
dl
rm
os.h
765
0644
edit
dl
rm
parseint.h
1541
0644
edit
dl
rm
platform.h
1859
0644
edit
dl
rm
pool.h
3491
0644
edit
dl
rm
portset.h
3294
0644
edit
dl
rm
print.h
680
0644
edit
dl
rm
queue.h
1337
0644
edit
dl
rm
quota.h
3560
0644
edit
dl
rm
radix.h
7019
0644
edit
dl
rm
random.h
1482
0644
edit
dl
rm
ratelimiter.h
3492
0644
edit
dl
rm
refcount.h
5103
0644
edit
dl
rm
regex.h
767
0644
edit
dl
rm
region.h
2234
0644
edit
dl
rm
resource.h
2860
0644
edit
dl
rm
result.h
5580
0644
edit
dl
rm
resultclass.h
1597
0644
edit
dl
rm
rwlock.h
2535
0644
edit
dl
rm
safe.h
1145
0644
edit
dl
rm
serial.h
1367
0644
edit
dl
rm
siphash.h
916
0644
edit
dl
rm
sockaddr.h
6275
0644
edit
dl
rm
socket.h
24120
0644
edit
dl
rm
stat.h
803
0644
edit
dl
rm
stats.h
6689
0644
edit
dl
rm
stdatomic.h
9116
0644
edit
dl
rm
stdio.h
1728
0644
edit
dl
rm
stdtime.h
1392
0644
edit
dl
rm
strerr.h
575
0644
edit
dl
rm
string.h
851
0644
edit
dl
rm
symtab.h
4325
0644
edit
dl
rm
syslog.h
843
0644
edit
dl
rm
task.h
17126
0644
edit
dl
rm
taskpool.h
3281
0644
edit
dl
rm
thread.h
1908
0644
edit
dl
rm
time.h
11106
0644
edit
dl
rm
timer.h
7961
0644
edit
dl
rm
tm.h
894
0644
edit
dl
rm
types.h
5854
0644
edit
dl
rm
url.h
2681
0644
edit
dl
rm
utf8.h
928
0644
edit
dl
rm
util.h
14291
0644
edit
dl
rm
version.h
499
0644
edit
dl
rm
Edit:
/usr/include/bind9/isc/lex.h
(10004B)
/* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef ISC_LEX_H #define ISC_LEX_H 1 /***** ***** Module Info *****/ /*! \file isc/lex.h * \brief The "lex" module provides a lightweight tokenizer. It can operate * on files or buffers, and can handle "include". It is designed for * parsing of DNS master files and the BIND configuration file, but * should be general enough to tokenize other things, e.g. HTTP. * * \li MP: * No synchronization is provided. Clients must ensure exclusive * access. * * \li Reliability: * No anticipated impact. * * \li Resources: * TBS * * \li Security: * No anticipated impact. * * \li Standards: * None. */ /*** *** Imports ***/ #include <stdbool.h> #include <stdio.h> #include <isc/lang.h> #include <isc/region.h> #include <isc/types.h> ISC_LANG_BEGINDECLS /*** *** Options ***/ /*@{*/ /*! * Various options for isc_lex_gettoken(). */ #define ISC_LEXOPT_EOL 0x0001 /*%< Want end-of-line token. */ #define ISC_LEXOPT_EOF 0x0002 /*%< Want end-of-file token. */ #define ISC_LEXOPT_INITIALWS 0x0004 /*%< Want initial whitespace. */ #define ISC_LEXOPT_NUMBER 0x0008 /*%< Recognize numbers. */ #define ISC_LEXOPT_QSTRING 0x0010 /*%< Recognize qstrings. */ /*@}*/ /*@{*/ /*! * The ISC_LEXOPT_DNSMULTILINE option handles the processing of '(' and ')' in * the DNS master file format. If this option is set, then the * ISC_LEXOPT_INITIALWS and ISC_LEXOPT_EOL options will be ignored when * the paren count is > 0. To use this option, '(' and ')' must be special * characters. */ #define ISC_LEXOPT_DNSMULTILINE 0x0020 /*%< Handle '(' and ')'. */ #define ISC_LEXOPT_NOMORE 0x0040 /*%< Want "no more" token. */ #define ISC_LEXOPT_CNUMBER 0x0080 /*%< Recognize octal and hex. */ #define ISC_LEXOPT_ESCAPE 0x0100 /*%< Recognize escapes. */ #define ISC_LEXOPT_QSTRINGMULTILINE 0x0200 /*%< Allow multiline "" strings */ #define ISC_LEXOPT_OCTAL 0x0400 /*%< Expect a octal number. */ #define ISC_LEXOPT_BTEXT 0x0800 /*%< Bracketed text. */ #define ISC_LEXOPT_VPAIR 0x1000 /*%< Recognize value pair. */ #define ISC_LEXOPT_QVPAIR 0x2000 /*%< Recognize quoted value pair. */ /*@}*/ /*@{*/ /*! * Various commenting styles, which may be changed at any time with * isc_lex_setcomments(). */ #define ISC_LEXCOMMENT_C 0x01 #define ISC_LEXCOMMENT_CPLUSPLUS 0x02 #define ISC_LEXCOMMENT_SHELL 0x04 #define ISC_LEXCOMMENT_DNSMASTERFILE 0x08 /*@}*/ /*** *** Types ***/ /*! Lex */ typedef char isc_lexspecials_t[256]; /* Tokens */ typedef enum { isc_tokentype_unknown = 0, isc_tokentype_string = 1, isc_tokentype_number = 2, isc_tokentype_qstring = 3, isc_tokentype_eol = 4, isc_tokentype_eof = 5, isc_tokentype_initialws = 6, isc_tokentype_special = 7, isc_tokentype_nomore = 8, isc_tokentype_btext = 9, isc_tokentype_vpair = 10, isc_tokentype_qvpair = 11, } isc_tokentype_t; typedef union { char as_char; unsigned long as_ulong; isc_region_t as_region; isc_textregion_t as_textregion; void *as_pointer; } isc_tokenvalue_t; typedef struct isc_token { isc_tokentype_t type; isc_tokenvalue_t value; } isc_token_t; /*** *** Functions ***/ isc_result_t isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp); /*%< * Create a lexer. * * 'max_token' is a hint of the number of bytes in the largest token. * * Requires: *\li '*lexp' is a valid lexer. * * Ensures: *\li On success, *lexp is attached to the newly created lexer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY */ void isc_lex_destroy(isc_lex_t **lexp); /*%< * Destroy the lexer. * * Requires: *\li '*lexp' is a valid lexer. * * Ensures: *\li *lexp == NULL */ unsigned int isc_lex_getcomments(isc_lex_t *lex); /*%< * Return the current lexer commenting styles. * * Requires: *\li 'lex' is a valid lexer. * * Returns: *\li The commenting styles which are currently allowed. */ void isc_lex_setcomments(isc_lex_t *lex, unsigned int comments); /*%< * Set allowed lexer commenting styles. * * Requires: *\li 'lex' is a valid lexer. * *\li 'comments' has meaningful values. */ void isc_lex_getspecials(isc_lex_t *lex, isc_lexspecials_t specials); /*%< * Put the current list of specials into 'specials'. * * Requires: *\li 'lex' is a valid lexer. */ void isc_lex_setspecials(isc_lex_t *lex, isc_lexspecials_t specials); /*!< * The characters in 'specials' are returned as tokens. Along with * whitespace, they delimit strings and numbers. * * Note: *\li Comment processing takes precedence over special character * recognition. * * Requires: *\li 'lex' is a valid lexer. */ isc_result_t isc_lex_openfile(isc_lex_t *lex, const char *filename); /*%< * Open 'filename' and make it the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li filename is a valid C string. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory *\li #ISC_R_NOTFOUND File not found *\li #ISC_R_NOPERM No permission to open file *\li #ISC_R_FAILURE Couldn't open file, not sure why *\li #ISC_R_UNEXPECTED */ isc_result_t isc_lex_openstream(isc_lex_t *lex, FILE *stream); /*%< * Make 'stream' the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li 'stream' is a valid C stream. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory */ isc_result_t isc_lex_openbuffer(isc_lex_t *lex, isc_buffer_t *buffer); /*%< * Make 'buffer' the current input source for 'lex'. * * Requires: *\li 'lex' is a valid lexer. * *\li 'buffer' is a valid buffer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMEMORY Out of memory */ isc_result_t isc_lex_close(isc_lex_t *lex); /*%< * Close the most recently opened object (i.e. file or buffer). * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_NOMORE No more input sources */ isc_result_t isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp); /*%< * Get the next token. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'options' contains valid options. * *\li '*tokenp' is a valid pointer. * * Returns: *\li #ISC_R_SUCCESS *\li #ISC_R_UNEXPECTEDEND *\li #ISC_R_NOMEMORY * * These two results are returned only if their corresponding lexer * options are not set. * *\li #ISC_R_EOF End of input source *\li #ISC_R_NOMORE No more input sources */ isc_result_t isc_lex_getmastertoken(isc_lex_t *lex, isc_token_t *token, isc_tokentype_t expect, bool eol); /*%< * Get the next token from a DNS master file type stream. This is a * convenience function that sets appropriate options and handles quoted * strings and end of line correctly for master files. It also ungets * unexpected tokens. If `eol` is set then expect end-of-line otherwise * eol is a error. * * Requires: *\li 'lex' is a valid lexer. * *\li 'token' is a valid pointer * * Returns: * * \li any return code from isc_lex_gettoken(). */ isc_result_t isc_lex_getoctaltoken(isc_lex_t *lex, isc_token_t *token, bool eol); /*%< * Get the next token from a DNS master file type stream. This is a * convenience function that sets appropriate options and handles end * of line correctly for master files. It also ungets unexpected tokens. * If `eol` is set then expect end-of-line otherwise eol is a error. * * Requires: *\li 'lex' is a valid lexer. * *\li 'token' is a valid pointer * * Returns: * * \li any return code from isc_lex_gettoken(). */ void isc_lex_ungettoken(isc_lex_t *lex, isc_token_t *tokenp); /*%< * Unget the current token. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'tokenp' points to a valid token. * *\li There is no ungotten token already. */ void isc_lex_getlasttokentext(isc_lex_t *lex, isc_token_t *tokenp, isc_region_t *r); /*%< * Returns a region containing the text of the last token returned. * * Requires: *\li 'lex' is a valid lexer. * *\li 'lex' has an input source. * *\li 'tokenp' points to a valid token. * *\li A token has been gotten and not ungotten. */ char * isc_lex_getsourcename(isc_lex_t *lex); /*%< * Return the input source name. * * Requires: *\li 'lex' is a valid lexer. * * Returns: * \li source name or NULL if no current source. *\li result valid while current input source exists. */ unsigned long isc_lex_getsourceline(isc_lex_t *lex); /*%< * Return the input source line number. * * Requires: *\li 'lex' is a valid lexer. * * Returns: *\li Current line number or 0 if no current source. */ isc_result_t isc_lex_setsourcename(isc_lex_t *lex, const char *name); /*%< * Assigns a new name to the input source. * * Requires: * * \li 'lex' is a valid lexer. * * Returns: * \li #ISC_R_SUCCESS * \li #ISC_R_NOMEMORY * \li #ISC_R_NOTFOUND - there are no sources. */ isc_result_t isc_lex_setsourceline(isc_lex_t *lex, unsigned long line); /*%< * Assigns a new line number to the input source. This can be used * when parsing a buffer that's been excerpted from the middle a file, * allowing logged messages to display the correct line number, * rather than the line number within the buffer. * * Requires: * * \li 'lex' is a valid lexer. * * Returns: * \li #ISC_R_SUCCESS * \li #ISC_R_NOTFOUND - there are no sources. */ bool isc_lex_isfile(isc_lex_t *lex); /*%< * Return whether the current input source is a file. * * Requires: *\li 'lex' is a valid lexer. * * Returns: * \li #true if the current input is a file, *\li #false otherwise. */ ISC_LANG_ENDDECLS #endif /* ISC_LEX_H */
Save
cmd:
run