/[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.5 by wl, Sat Apr 30 07:03:14 2005 UTC revision 1.6 by wl, Mon May 2 10:25:02 2005 UTC
# Line 1  Line 1 
1  /* Declarations for getopt.  /* Declarations for getopt.
2     Copyright (C) 1989-1994,1996-1999,2001,2003,2004     Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc.
    Free Software Foundation, Inc.  
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4    
5     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 35  Line 34 
34  # include <ctype.h>  # include <ctype.h>
35  #endif  #endif
36    
 #ifndef __THROW  
 # ifndef __GNUC_PREREQ  
 #  define __GNUC_PREREQ(maj, min) (0)  
 # endif  
 # if defined __cplusplus && __GNUC_PREREQ (2,8)  
 #  define __THROW       throw ()  
 # else  
 #  define __THROW  
 # endif  
 #endif  
   
37  #ifdef  __cplusplus  #ifdef  __cplusplus
38  extern "C" {  extern "C" {
39  #endif  #endif
# Line 105  extern int optopt; Line 93  extern int optopt;
93    
94  struct option  struct option
95  {  {
96    # if (defined __STDC__ && __STDC__) || defined __cplusplus
97    const char *name;    const char *name;
98    # else
99      char *name;
100    # endif
101    /* has_arg can't be an enum because some compilers complain about    /* has_arg can't be an enum because some compilers complain about
102       type mismatches in all the code that assumes it is an int.  */       type mismatches in all the code that assumes it is an int.  */
103    int has_arg;    int has_arg;
# Line 145  struct option Line 137  struct option
137     arguments to the option '\0'.  This behavior is specific to the GNU     arguments to the option '\0'.  This behavior is specific to the GNU
138     `getopt'.  */     `getopt'.  */
139    
140  #ifdef __GNU_LIBRARY__  #if (defined __STDC__ && __STDC__) || defined __cplusplus
141    # ifdef __GNU_LIBRARY__
142  /* Many other libraries have conflicting prototypes for getopt, with  /* Many other libraries have conflicting prototypes for getopt, with
143     differences in the consts, in stdlib.h.  To avoid compilation     differences in the consts, in stdlib.h.  To avoid compilation
144     errors, only prototype getopt for the GNU C library.  */     errors, only prototype getopt for the GNU C library.  */
145  extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)  extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
146         __THROW;  # else /* not __GNU_LIBRARY__ */
 #else /* not __GNU_LIBRARY__ */  
147  extern int getopt ();  extern int getopt ();
148  #endif /* __GNU_LIBRARY__ */  # endif /* __GNU_LIBRARY__ */
149    
150  #ifndef __need_getopt  # ifndef __need_getopt
151  extern int getopt_long (int ___argc, char *const *___argv,  extern int getopt_long (int ___argc, char *const *___argv,
152                          const char *__shortopts,                          const char *__shortopts,
153                          const struct option *__longopts, int *__longind)                          const struct option *__longopts, int *__longind);
        __THROW;  
154  extern int getopt_long_only (int ___argc, char *const *___argv,  extern int getopt_long_only (int ___argc, char *const *___argv,
155                               const char *__shortopts,                               const char *__shortopts,
156                               const struct option *__longopts, int *__longind)                               const struct option *__longopts, int *__longind);
        __THROW;  
157    
158  #endif  /* Internal only.  Users should not call this directly.  */
159    extern int _getopt_internal (int ___argc, char *const *___argv,
160                                 const char *__shortopts,
161                                 const struct option *__longopts, int *__longind,
162                                 int __long_only);
163    # endif
164    #else /* not __STDC__ */
165    extern int getopt ();
166    # ifndef __need_getopt
167    extern int getopt_long ();
168    extern int getopt_long_only ();
169    
170    extern int _getopt_internal ();
171    # endif
172    #endif /* __STDC__ */
173    
174  #ifdef  __cplusplus  #ifdef  __cplusplus
175  }  }

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

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