BRL-CAD

Special portable re-entrant version of getopt. More...

#include "common.h"
#include <stdio.h>
#include <string.h>
#include "bu/getopt.h"
Include dependency graph for getopt.c:

Go to the source code of this file.

Macros

#define BADCH   (int)'?'
 
#define EMSG   ""
 
#define tell(s)
 

Functions

int bu_getopt (int nargc, char *const nargv[], const char *ostr)
 

Detailed Description

Special portable re-entrant version of getopt.

Everything is prefixed with bu_, to distinguish it from the various getopt routines found in libc.

Important note - If bu_getopt() is going to be used more than once, it is necessary to reinitialize bu_optind=1 before beginning on the next argument list.

Definition in file getopt.c.

Macro Definition Documentation

#define BADCH   (int)'?'

Definition at line 32 of file getopt.c.

#define EMSG   ""

Definition at line 33 of file getopt.c.

Referenced by bu_getopt().

#define tell (   s)
Value:
if (bu_opterr) { \
fputs(*nargv, stderr); \
fputs(s, stderr); \
fputc(bu_optopt, stderr); \
fputc('\n', stderr); \
} return BADCH;
if lu s
Definition: nmg_mod.c:3860
int bu_optopt
Definition: globals.c:90
int bu_opterr
Definition: globals.c:88
#define BADCH
Definition: getopt.c:32

Definition at line 34 of file getopt.c.

Referenced by bu_getopt().