lex_test.c revision 01cc5813ca716d48c46960302d9845ef7c984f93
a7038d1a0513c8e804937ebc95fc9cb3a46c04f5Mark Andrews * Copyright (C) 1998, 1999 Internet Software Consortium.
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * Permission to use, copy, modify, and distribute this software for any
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * purpose with or without fee is hereby granted, provided that the above
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
15a44745412679c30a6d022733925af70a38b715David Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
15a44745412679c30a6d022733925af70a38b715David Lawrence * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
15a44745412679c30a6d022733925af70a38b715David Lawrence * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
15a44745412679c30a6d022733925af70a38b715David Lawrence * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrenceprint_token(isc_token_t *tokenp, FILE *stream) {
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence fprintf(stream, "NUMBER %lu", tokenp->value.as_ulong);
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson fprintf(stream, "SPECIAL %c", tokenp->value.as_char);
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson FATAL_ERROR(__FILE__, __LINE__, "Unexpected type %d",
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson unsigned int options = 0;
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson while ((c = getopt(argc, argv, "qmcs")) != -1) {
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS);
c00a1eb423623442aff428336bb55590f79013bbMark Andrews RUNTIME_CHECK(isc_lex_create(mctx, 256, &lex) == ISC_R_SUCCESS);
28d8b4118da7abed531ca09136a6d1402837d721Mark Andrews /* Set up to lex DNS master file. */
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence isc_lex_setcomments(lex, ISC_LEXCOMMENT_DNSMASTERFILE);
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence /* Set up to lex DNS config file. */
if (!quiet) {