File: herc_getopt.h

package info (click to toggle)
hercules 3.05-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 13,520 kB
  • ctags: 16,438
  • sloc: ansic: 147,777; sh: 8,775; makefile: 737; perl: 202; sed: 16
file content (48 lines) | stat: -rw-r--r-- 1,265 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// $Id: herc_getopt.h,v 1.4 2006/12/08 09:43:25 jj Exp $
//
// $Log: herc_getopt.h,v $
// Revision 1.4  2006/12/08 09:43:25  jj
// Add CVS message log
//

#if !defined(__HERC_GETOPT_H__)
#    define  __HERC_GETOPT_H__

#include "hercules.h"
#include "getopt.h"

#if defined(NEED_GETOPT_OPTRESET)
  #define OPTRESET() optreset=1
#else
  #define OPTRESET()
#endif

#if defined(NEED_GETOPT_WRAPPER)

  // The following series of defines end up causing the source file
  // that happens to include "herc_getopt.h" to end up calling HERC's
  // version of getopt instead of the normal system getopt.

  #define  getopt         herc_getopt
  #define  optarg         herc_optarg
  #define  optind         herc_optind
  #define  optopt         herc_optopt
  #define  optreset       herc_optreset

  int herc_getopt(int,char * const *,const char *);

  #if defined(HAVE_GETOPT_LONG)
    #define  getopt_long    herc_getopt_long
    struct option; // (fwd ref)
    int herc_getopt_long(int,char * const *,const char *,const struct option *,int *);
  #endif

  extern char *herc_optarg;
  extern int   herc_optind;
  extern int   herc_opterr;
  extern int   herc_optopt;
  extern int   herc_optreset;

#endif /* defined(NEED_GETOPT_WRAPPER) */

#endif /* __HERC_GETOPT_H__ */