dhcpd-pools  3.0
ISC dhcpd lease usage analyser
Macros | Functions | Variables
getopt.c File Reference
#include <config.h>
#include "getopt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "gettext.h"
#include "getopt_int.h"
Include dependency graph for getopt.c:

Macros

#define _(msgid)   gettext (msgid)
 
#define flockfile(fp)   /* nop */
 
#define funlockfile(fp)   /* nop */
 
#define __libc_use_alloca(size)   0
 
#define alloca(size)   (abort (), (void *)0)
 
#define NONOPTION_P   (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
 
#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT)
 

Functions

static void exchange (char **argv, struct _getopt_data *d)
 
static int process_long_option (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, struct _getopt_data *d, int print_errors, const char *prefix)
 
static const char * _getopt_initialize (int argc _GL_UNUSED, char **argv _GL_UNUSED, const char *optstring, struct _getopt_data *d, int posixly_correct)
 
int _getopt_internal_r (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, struct _getopt_data *d, int posixly_correct)
 
int _getopt_internal (int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct)
 

Variables

char * optarg
 
int optind = 1
 
int opterr = 1
 
int optopt = '?'
 
static struct _getopt_data getopt_data
 

Macro Definition Documentation

◆ _

#define _ (   msgid)    gettext (msgid)

◆ __libc_use_alloca

#define __libc_use_alloca (   size)    0

◆ alloca

#define alloca (   size)    (abort (), (void *)0)

◆ flockfile

#define flockfile (   fp)    /* nop */

Referenced by process_long_option().

◆ funlockfile

#define funlockfile (   fp)    /* nop */

Referenced by process_long_option().

◆ GETOPT_ENTRY

#define GETOPT_ENTRY (   NAME,
  POSIXLY_CORRECT 
)
Value:
int \
NAME (int argc, char *const *argv, const char *optstring) \
{ \
return _getopt_internal (argc, (char **)argv, optstring, \
0, 0, 0, POSIXLY_CORRECT); \
}
int _getopt_internal(int argc, char **argv, const char *optstring, const struct option *longopts, int *longind, int long_only, int posixly_correct)
Definition: getopt.c:703

◆ NONOPTION_P

#define NONOPTION_P   (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')

Referenced by _getopt_internal_r().

Function Documentation

◆ _getopt_initialize()

static const char* _getopt_initialize ( int argc  _GL_UNUSED,
char **argv  _GL_UNUSED,
const char *  optstring,
struct _getopt_data d,
int  posixly_correct 
)
static

Referenced by _getopt_internal_r().

◆ _getopt_internal()

int _getopt_internal ( int  argc,
char **  argv,
const char *  optstring,
const struct option longopts,
int *  longind,
int  long_only,
int  posixly_correct 
)

Referenced by getopt_long(), and getopt_long_only().

Here is the call graph for this function:

◆ _getopt_internal_r()

int _getopt_internal_r ( int  argc,
char **  argv,
const char *  optstring,
const struct option longopts,
int *  longind,
int  long_only,
struct _getopt_data d,
int  posixly_correct 
)

Referenced by _getopt_internal(), _getopt_long_only_r(), and _getopt_long_r().

Here is the call graph for this function:

◆ exchange()

static void exchange ( char **  argv,
struct _getopt_data d 
)
static

Referenced by _getopt_internal_r().

◆ process_long_option()

static int process_long_option ( int  argc,
char **  argv,
const char *  optstring,
const struct option longopts,
int *  longind,
int  long_only,
struct _getopt_data d,
int  print_errors,
const char *  prefix 
)
static

Referenced by _getopt_internal_r().

Variable Documentation

◆ getopt_data

struct _getopt_data getopt_data
static

Referenced by _getopt_internal().

◆ optarg

char* optarg

◆ opterr

int opterr = 1

Referenced by _getopt_internal().

◆ optind

int optind = 1

◆ optopt

int optopt = '?'

Referenced by _getopt_internal().