Back to index

glibc  2.9
argp-namefrob.h
Go to the documentation of this file.
00001 /* Name frobnication for compiling argp outside of glibc
00002    Copyright (C) 1997, 2003 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Written by Miles Bader <miles@gnu.ai.mit.edu>.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #if !_LIBC
00022 /* This code is written for inclusion in gnu-libc, and uses names in the
00023    namespace reserved for libc.  If we're not compiling in libc, define those
00024    names to be the normal ones instead.  */
00025 
00026 /* argp-parse functions */
00027 #undef __argp_parse
00028 #define __argp_parse argp_parse
00029 #undef __option_is_end
00030 #define __option_is_end _option_is_end
00031 #undef __option_is_short
00032 #define __option_is_short _option_is_short
00033 #undef __argp_input
00034 #define __argp_input _argp_input
00035 
00036 /* argp-help functions */
00037 #undef __argp_help
00038 #define __argp_help argp_help
00039 #undef __argp_error
00040 #define __argp_error argp_error
00041 #undef __argp_failure
00042 #define __argp_failure argp_failure
00043 #undef __argp_state_help
00044 #define __argp_state_help argp_state_help
00045 #undef __argp_usage
00046 #define __argp_usage argp_usage
00047 
00048 /* argp-fmtstream functions */
00049 #undef __argp_make_fmtstream
00050 #define __argp_make_fmtstream argp_make_fmtstream
00051 #undef __argp_fmtstream_free
00052 #define __argp_fmtstream_free argp_fmtstream_free
00053 #undef __argp_fmtstream_putc
00054 #define __argp_fmtstream_putc argp_fmtstream_putc
00055 #undef __argp_fmtstream_puts
00056 #define __argp_fmtstream_puts argp_fmtstream_puts
00057 #undef __argp_fmtstream_write
00058 #define __argp_fmtstream_write argp_fmtstream_write
00059 #undef __argp_fmtstream_printf
00060 #define __argp_fmtstream_printf argp_fmtstream_printf
00061 #undef __argp_fmtstream_set_lmargin
00062 #define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
00063 #undef __argp_fmtstream_set_rmargin
00064 #define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
00065 #undef __argp_fmtstream_set_wmargin
00066 #define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
00067 #undef __argp_fmtstream_point
00068 #define __argp_fmtstream_point argp_fmtstream_point
00069 #undef __argp_fmtstream_update
00070 #define __argp_fmtstream_update _argp_fmtstream_update
00071 #undef __argp_fmtstream_ensure
00072 #define __argp_fmtstream_ensure _argp_fmtstream_ensure
00073 #undef __argp_fmtstream_lmargin
00074 #define __argp_fmtstream_lmargin argp_fmtstream_lmargin
00075 #undef __argp_fmtstream_rmargin
00076 #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
00077 #undef __argp_fmtstream_wmargin
00078 #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
00079 
00080 #include "mempcpy.h"
00081 #include "strcase.h"
00082 #include "strchrnul.h"
00083 #include "strndup.h"
00084 
00085 /* normal libc functions we call */
00086 #undef __flockfile
00087 #define __flockfile flockfile
00088 #undef __funlockfile
00089 #define __funlockfile funlockfile
00090 #undef __mempcpy
00091 #define __mempcpy mempcpy
00092 #undef __sleep
00093 #define __sleep sleep
00094 #undef __strcasecmp
00095 #define __strcasecmp strcasecmp
00096 #undef __strchrnul
00097 #define __strchrnul strchrnul
00098 #undef __strerror_r
00099 #define __strerror_r strerror_r
00100 #undef __strndup
00101 #define __strndup strndup
00102 #undef __vsnprintf
00103 #define __vsnprintf vsnprintf
00104 
00105 #if defined(HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
00106 # define clearerr_unlocked(x) clearerr (x)
00107 #endif
00108 #if defined(HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
00109 # define feof_unlocked(x) feof (x)
00110 # endif
00111 #if defined(HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
00112 # define ferror_unlocked(x) ferror (x)
00113 # endif
00114 #if defined(HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
00115 # define fflush_unlocked(x) fflush (x)
00116 # endif
00117 #if defined(HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
00118 # define fgets_unlocked(x,y,z) fgets (x,y,z)
00119 # endif
00120 #if defined(HAVE_DECL_FPUTC_UNLOCKED) && !HAVE_DECL_FPUTC_UNLOCKED
00121 # define fputc_unlocked(x,y) fputc (x,y)
00122 # endif
00123 #if defined(HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
00124 # define fputs_unlocked(x,y) fputs (x,y)
00125 # endif
00126 #if defined(HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
00127 # define fread_unlocked(w,x,y,z) fread (w,x,y,z)
00128 # endif
00129 #if defined(HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
00130 # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
00131 # endif
00132 #if defined(HAVE_DECL_GETC_UNLOCKED) && !HAVE_DECL_GETC_UNLOCKED
00133 # define getc_unlocked(x) getc (x)
00134 # endif
00135 #if defined(HAVE_DECL_GETCHAR_UNLOCKED) && !HAVE_DECL_GETCHAR_UNLOCKED
00136 #  define getchar_unlocked() getchar ()
00137 # endif
00138 #if defined(HAVE_DECL_PUTC_UNLOCKED) && !HAVE_DECL_PUTC_UNLOCKED
00139 # define putc_unlocked(x,y) putc (x,y)
00140 # endif
00141 #if defined(HAVE_DECL_PUTCHAR_UNLOCKED) && !HAVE_DECL_PUTCHAR_UNLOCKED
00142 # define putchar_unlocked(x) putchar (x)
00143 # endif
00144 
00145 extern char *__argp_basename (char *name);
00146 
00147 #endif /* !_LIBC */
00148 
00149 #ifndef __set_errno
00150 #define __set_errno(e) (errno = (e))
00151 #endif
00152 
00153 #if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
00154 # define __argp_short_program_name()      (program_invocation_short_name)
00155 #else
00156 extern char *__argp_short_program_name (void);
00157 #endif