"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.11.23/lib/isc/include/isc/commandline.h" (7 Sep 2020, 1712 Bytes) of package /linux/misc/dns/bind9/9.11.23/bind-9.11.23.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "commandline.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 
   13 #ifndef ISC_COMMANDLINE_H
   14 #define ISC_COMMANDLINE_H 1
   15 
   16 /*! \file isc/commandline.h */
   17 
   18 #include <stdbool.h>
   19 
   20 #include <isc/lang.h>
   21 #include <isc/platform.h>
   22 #include <isc/result.h>
   23 
   24 /*% Index into parent argv vector. */
   25 LIBISC_EXTERNAL_DATA extern int isc_commandline_index;
   26 /*% Character checked for validity. */
   27 LIBISC_EXTERNAL_DATA extern int isc_commandline_option;
   28 /*% Argument associated with option. */
   29 LIBISC_EXTERNAL_DATA extern char *isc_commandline_argument;
   30 /*% For printing error messages. */
   31 LIBISC_EXTERNAL_DATA extern char *isc_commandline_progname;
   32 /*% Print error message. */
   33 LIBISC_EXTERNAL_DATA extern bool isc_commandline_errprint;
   34 /*% Reset getopt. */
   35 LIBISC_EXTERNAL_DATA extern bool isc_commandline_reset;
   36 
   37 ISC_LANG_BEGINDECLS
   38 
   39 int
   40 isc_commandline_parse(int argc, char * const *argv, const char *options);
   41 /*%<
   42  * Parse a command line (similar to getopt())
   43  */
   44 
   45 isc_result_t
   46 isc_commandline_strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp,
   47               char ***argvp, unsigned int n);
   48 /*%<
   49  * Tokenize the string "s" into whitespace-separated words,
   50  * returning the number of words in '*argcp' and an array
   51  * of pointers to the words in '*argvp'.  The caller
   52  * must free the array using isc_mem_free().  The string
   53  * is modified in-place.
   54  */
   55 
   56 ISC_LANG_ENDDECLS
   57 
   58 #endif /* ISC_COMMANDLINE_H */