/[groff]/groff/src/include/getopt.h
ViewVC logotype

Diff of /groff/src/include/getopt.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wlemb, Fri Aug 24 23:37:49 2001 UTC revision 1.5 by wl, Sat Apr 30 07:03:14 2005 UTC
# Line 1  Line 1 
1  /* Declarations for getopt.  /* Declarations for getopt.
2     Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.     Copyright (C) 1989-1994,1996-1999,2001,2003,2004
3       Free Software Foundation, Inc.
4     This file is part of the GNU C Library.     This file is part of the GNU C Library.
5    
6     The GNU C Library is free software; you can redistribute it and/or     The GNU C Library is free software; you can redistribute it and/or
# Line 34  Line 35 
35  # include <ctype.h>  # include <ctype.h>
36  #endif  #endif
37    
38    #ifndef __THROW
39    # ifndef __GNUC_PREREQ
40    #  define __GNUC_PREREQ(maj, min) (0)
41    # endif
42    # if defined __cplusplus && __GNUC_PREREQ (2,8)
43    #  define __THROW       throw ()
44    # else
45    #  define __THROW
46    # endif
47    #endif
48    
49  #ifdef  __cplusplus  #ifdef  __cplusplus
50  extern "C" {  extern "C" {
51  #endif  #endif
# Line 93  extern int optopt; Line 105  extern int optopt;
105    
106  struct option  struct option
107  {  {
 # if (defined __STDC__ && __STDC__) || defined __cplusplus  
108    const char *name;    const char *name;
 # else  
   char *name;  
 # endif  
109    /* has_arg can't be an enum because some compilers complain about    /* has_arg can't be an enum because some compilers complain about
110       type mismatches in all the code that assumes it is an int.  */       type mismatches in all the code that assumes it is an int.  */
111    int has_arg;    int has_arg;
# Line 137  struct option Line 145  struct option
145     arguments to the option '\0'.  This behavior is specific to the GNU     arguments to the option '\0'.  This behavior is specific to the GNU
146     `getopt'.  */     `getopt'.  */
147    
148  #if (defined __STDC__ && __STDC__) || defined __cplusplus  #ifdef __GNU_LIBRARY__
 # ifdef __GNU_LIBRARY__  
149  /* Many other libraries have conflicting prototypes for getopt, with  /* Many other libraries have conflicting prototypes for getopt, with
150     differences in the consts, in stdlib.h.  To avoid compilation     differences in the consts, in stdlib.h.  To avoid compilation
151     errors, only prototype getopt for the GNU C library.  */     errors, only prototype getopt for the GNU C library.  */
152  extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);  extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
153  # else /* not __GNU_LIBRARY__ */         __THROW;
154    #else /* not __GNU_LIBRARY__ */
155  extern int getopt ();  extern int getopt ();
156  # endif /* __GNU_LIBRARY__ */  #endif /* __GNU_LIBRARY__ */
157    
158  # ifndef __need_getopt  #ifndef __need_getopt
159  extern int getopt_long (int ___argc, char *const *___argv,  extern int getopt_long (int ___argc, char *const *___argv,
160                          const char *__shortopts,                          const char *__shortopts,
161                          const struct option *__longopts, int *__longind);                          const struct option *__longopts, int *__longind)
162           __THROW;
163  extern int getopt_long_only (int ___argc, char *const *___argv,  extern int getopt_long_only (int ___argc, char *const *___argv,
164                               const char *__shortopts,                               const char *__shortopts,
165                               const struct option *__longopts, int *__longind);                               const struct option *__longopts, int *__longind)
166           __THROW;
167    
168  /* Internal only.  Users should not call this directly.  */  #endif
 extern int _getopt_internal (int ___argc, char *const *___argv,  
                              const char *__shortopts,  
                              const struct option *__longopts, int *__longind,  
                              int __long_only);  
 # endif  
 #else /* not __STDC__ */  
 extern int getopt ();  
 # ifndef __need_getopt  
 extern int getopt_long ();  
 extern int getopt_long_only ();  
   
 extern int _getopt_internal ();  
 # endif  
 #endif /* __STDC__ */  
169    
170  #ifdef  __cplusplus  #ifdef  __cplusplus
171  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26