commandline.c File Reference

#include <config.h>
#include <stdio.h>
#include <isc/commandline.h>
#include <isc/msgs.h>
#include <isc/string.h>
#include <isc/util.h>

Go to the source code of this file.

Defines

#define BADOPT   '?'
#define BADARG   ':'
#define ENDOPT   &endopt

Functions

int isc_commandline_parse (int argc, char *const *argv, const char *options)
 parse command line

Variables

LIBISC_EXTERNAL_DATA int isc_commandline_index = 1
 Index into parent argv vector.
LIBISC_EXTERNAL_DATA int isc_commandline_option
 Character checked for validity.
LIBISC_EXTERNAL_DATA char * isc_commandline_argument
 Argument associated with option.
LIBISC_EXTERNAL_DATA char * isc_commandline_progname
 For printing error messages.
LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE
 Print error messages.
LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE
 Reset processing.
static char endopt = '\0'


Detailed Description

This file was adapted from the NetBSD project's source tree, RCS ID: NetBSD: getopt.c,v 1.15 1999/09/20 04:39:37 lukem Exp

The primary change has been to rename items to the ISC namespace and format in the ISC coding style.

Definition in file commandline.c.


Define Documentation

#define BADOPT   '?'

Definition at line 86 of file commandline.c.

Referenced by isc_commandline_parse().

#define BADARG   ':'

Definition at line 87 of file commandline.c.

Referenced by isc_commandline_parse().

#define ENDOPT   &endopt

Definition at line 88 of file commandline.c.

Referenced by isc_commandline_parse().


Function Documentation

int isc_commandline_parse ( int  argc,
char *const *  argv,
const char *  options 
)

parse command line

getopt -- Parse argc/argv argument vector.

Definition at line 95 of file commandline.c.

References BADARG, BADOPT, ENDOPT, isc_commandline_argument, isc_commandline_errprint, isc_commandline_index, isc_commandline_option, isc_commandline_progname, isc_commandline_reset, ISC_FALSE, ISC_MSG_ILLEGALOPT, ISC_MSG_OPTNEEDARG, isc_msgcat_get(), ISC_MSGSET_COMMANDLINE, and REQUIRE.

Referenced by main(), parse_args(), parse_command_line(), and pre_parse_args().


Variable Documentation

LIBISC_EXTERNAL_DATA int isc_commandline_index = 1

Index into parent argv vector.

Definition at line 72 of file commandline.c.

Referenced by isc_commandline_parse(), main(), parse_args(), parse_command_line(), and pre_parse_args().

LIBISC_EXTERNAL_DATA int isc_commandline_option

Character checked for validity.

Definition at line 74 of file commandline.c.

Referenced by isc_commandline_parse(), main(), parse_args(), parse_command_line(), and pre_parse_args().

LIBISC_EXTERNAL_DATA char* isc_commandline_argument

Argument associated with option.

Definition at line 76 of file commandline.c.

Referenced by isc_commandline_parse(), main(), parse_args(), parse_command_line(), and pre_parse_args().

LIBISC_EXTERNAL_DATA char* isc_commandline_progname

For printing error messages.

Definition at line 78 of file commandline.c.

Referenced by isc_commandline_parse().

LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_errprint = ISC_TRUE

Print error messages.

Print error message.

Definition at line 80 of file commandline.c.

Referenced by isc_commandline_parse(), main(), and parse_command_line().

LIBISC_EXTERNAL_DATA isc_boolean_t isc_commandline_reset = ISC_TRUE

Reset processing.

Reset getopt.

Definition at line 82 of file commandline.c.

Referenced by isc_commandline_parse(), main(), and pre_parse_args().

char endopt = '\0' [static]

Definition at line 84 of file commandline.c.


Generated on Tue Apr 28 17:41:14 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha