gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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:

Go to the source code of this file.

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)
 
int getopt (int argc, char *const *argv, const char *optstring)
 

Variables

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

Macro Definition Documentation

◆ _

#define _ (   msgid)    gettext (msgid)

Definition at line 45 of file getopt.c.

◆ __libc_use_alloca

#define __libc_use_alloca (   size)    0

Definition at line 54 of file getopt.c.

◆ alloca

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

Definition at line 56 of file getopt.c.

◆ flockfile

#define flockfile (   fp)    /* nop */

Definition at line 50 of file getopt.c.

◆ funlockfile

#define funlockfile (   fp)    /* nop */

Definition at line 51 of file getopt.c.

◆ 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

Definition at line 727 of file getopt.c.

◆ NONOPTION_P

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

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

◆ _getopt_internal()

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

◆ _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 
)

◆ exchange()

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

◆ getopt()

int getopt ( int  argc,
char *const *  argv,
const char *  optstring 
)

Definition at line 739 of file getopt.c.

References c, optarg, and optind.

◆ 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

Variable Documentation

◆ getopt_data

struct _getopt_data getopt_data
static

Definition at line 115 of file getopt.c.

Referenced by _getopt_internal().

◆ optarg

char* optarg

Definition at line 89 of file getopt.c.

Referenced by _getopt_internal(), cmdline_parser_internal(), and getopt().

◆ opterr

int opterr = 1

Definition at line 109 of file getopt.c.

Referenced by _getopt_internal(), and cmdline_parser_internal().

◆ optind

int optind = 1

Definition at line 104 of file getopt.c.

Referenced by _getopt_internal(), cmdline_parser_internal(), and getopt().

◆ optopt

int optopt = '?'

Definition at line 115 of file getopt.c.

Referenced by _getopt_internal(), and cmdline_parser_internal().