nfs-ganesha 1.4
Defines | Functions | Variables

Getopt.c File Reference

GANESHA's version of getopt, to avoid portability issues. More...

#include "Getopt.h"
#include <string.h>

Go to the source code of this file.

Defines

#define NULL   0
#define EOF   (-1)
#define ERR(s, c)

Functions

int Getopt (int argc, char *argv[], char *opts)

Variables

int Opterr = 1
int Optind = 1
int Optopt
char * Optarg

Detailed Description

GANESHA's version of getopt, to avoid portability issues.

Author:
Author:
leibovic
Date:
Date:
2006/01/18 17:03:35
Version:
Revision:
1.4

This source code is an adaptation of the AT&T public domain source for getopt(3).

Log:
Getopt.c,v

Revision 1.4 2006/01/18 17:03:35 leibovic Removing some warnings.

Revision 1.2 2005/03/09 15:43:25 leibovic Multi-OS compiling.

Revision 1.1 2005/02/02 09:05:30 leibovic Adding our own version of getopt, to avoid portability issues.

Definition in file Getopt.c.


Define Documentation

#define EOF   (-1)

Definition at line 61 of file Getopt.c.

#define ERR (   s,
 
)
Value:
if(Opterr){\
    extern int write(int, void *, unsigned);\
    char errbuf[2];\
    errbuf[0] = (char)c; errbuf[1] = '\n';\
    (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
    (void) write(2, s, (unsigned)strlen(s));\
    (void) write(2, errbuf, 2);}

Definition at line 62 of file Getopt.c.

#define NULL   0

Definition at line 58 of file Getopt.c.


Function Documentation

int Getopt ( int  argc,
char *  argv[],
char *  opts 
)

Definition at line 75 of file Getopt.c.


Variable Documentation

char* Optarg

Definition at line 73 of file Getopt.c.

int Opterr = 1

Definition at line 70 of file Getopt.c.

int Optind = 1

Definition at line 71 of file Getopt.c.

int Optopt

Definition at line 72 of file Getopt.c.