00001
00002 #ifndef FISH_FALLBACK_H
00003 #define FISH_FALLBACK_H
00004
00005 #include <stdio.h>
00006 #include <stdint.h>
00007 #include <stdarg.h>
00008 #include <wctype.h>
00009 #include <wchar.h>
00010 #include <limits.h>
00011 #include <sys/time.h>
00012 #include <sys/types.h>
00013 #include <signal.h>
00014
00015 #ifndef WCHAR_MAX
00016
00019 #define WCHAR_MAX INT_MAX
00020 #endif
00021
00027 #if __STDC_VERSION__ < 199901L
00028 # if __GNUC__ >= 2
00029 # define __func__ __FUNCTION__
00030 # else
00031 # define __func__ "<unknown>"
00032 # endif
00033 #endif
00034
00042 #ifdef NCURSES_VERSION
00043 typedef int tputs_arg_t;
00044 #else
00045 typedef char tputs_arg_t;
00046 #endif
00047
00048 #ifndef SIGIO
00049 #define SIGIO SIGUSR1
00050 #endif
00051
00052 #ifndef SIGWINCH
00053 #define SIGWINCH SIGUSR2
00054 #endif
00055
00056 #ifndef HAVE_WINSIZE
00057
00060 struct winsize
00061 {
00065 unsigned short ws_row;
00069 unsigned short ws_col;
00070 }
00071 ;
00072
00073 #endif
00074
00075 #ifdef TPUTS_KLUDGE
00076
00081 int tputs(const char *str, int affcnt, int (*fish_putc)(tputs_arg_t));
00082
00083 #endif
00084
00085 #ifdef TPARM_SOLARIS_KLUDGE
00086
00092 #define tparm tparm_solaris_kludge
00093 char *tparm_solaris_kludge( char *str, ... );
00094
00095 #endif
00096
00097 #ifndef HAVE_FWPRINTF
00098
00106 int fwprintf( FILE *f, const wchar_t *format, ... );
00107
00108
00116 int swprintf( wchar_t *str, size_t l, const wchar_t *format, ... );
00117
00125 int wprintf( const wchar_t *format, ... );
00126
00134 int vwprintf( const wchar_t *filter, va_list va );
00135
00143 int vfwprintf( FILE *f, const wchar_t *filter, va_list va );
00144
00152 int vswprintf( wchar_t *out, size_t n, const wchar_t *filter, va_list va );
00153
00154 #endif
00155
00156 #ifndef HAVE_FGETWC
00157
00160 wint_t fgetwc(FILE *stream);
00161
00165 wint_t getwc(FILE *stream);
00166
00167 #endif
00168
00169 #ifndef HAVE_FPUTWC
00170
00174 wint_t fputwc(wchar_t wc, FILE *stream);
00178 wint_t putwc(wchar_t wc, FILE *stream);
00179
00180 #endif
00181
00182 #ifndef HAVE_WCSTOK
00183
00187 wchar_t *wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **ptr);
00188
00189 #endif
00190
00191 #ifndef HAVE_WCWIDTH
00192
00204 int wcwidth( wchar_t c );
00205
00206 #endif
00207
00208 #ifndef HAVE_WCSDUP
00209
00214 wchar_t *wcsdup(const wchar_t *in);
00215
00216 #endif
00217
00218 #ifndef HAVE_WCSLEN
00219
00223 size_t wcslen(const wchar_t *in);
00224
00225 #endif
00226
00227 #ifndef HAVE_WCSCASECMP
00228
00239 int wcscasecmp( const wchar_t *a, const wchar_t *b );
00240
00241 #endif
00242
00243 #ifndef HAVE_WCSNCASECMP
00244
00256 int wcsncasecmp( const wchar_t *a, const wchar_t *b, int count );
00257
00265 #endif
00266
00267 #ifndef HAVE_WCSNDUP
00268
00273 wchar_t *wcsndup( const wchar_t *in, int c );
00274
00275 #endif
00276
00282 long convert_digit( wchar_t d, int base );
00283
00284 #ifndef HAVE_WCSTOL
00285
00294 long wcstol(const wchar_t *nptr,
00295 wchar_t **endptr,
00296 int base);
00297
00298 #endif
00299 #ifndef HAVE_WCSLCAT
00300
00312 size_t wcslcat( wchar_t *dst, const wchar_t *src, size_t siz );
00313
00314 #endif
00315 #ifndef HAVE_WCSLCPY
00316
00325 size_t wcslcpy( wchar_t *dst, const wchar_t *src, size_t siz );
00326
00327 #endif
00328
00329 #ifdef HAVE_BROKEN_DEL_CURTERM
00330
00334 #define del_curterm(oterm) OK
00335 #endif
00336
00337 #ifndef HAVE_LRAND48_R
00338
00342 struct drand48_data
00343 {
00347 unsigned int seed;
00348 }
00349 ;
00350
00354 int lrand48_r( struct drand48_data *buffer, long int *result );
00355
00359 int srand48_r( long int seedval, struct drand48_data *buffer );
00360
00361 #endif
00362
00363 #ifndef HAVE_FUTIMES
00364
00365 int futimes( int fd, const struct timeval *times );
00366
00367 #endif
00368
00369 #ifndef HAVE_GETTEXT
00370
00374 char * gettext( const char * msgid );
00375
00379 char * bindtextdomain( const char * domainname, const char * dirname );
00380
00384 char * textdomain( const char * domainname );
00385
00386 #endif
00387
00388 #ifndef HAVE_DCGETTEXT
00389
00393 char * dcgettext ( const char * domainname,
00394 const char * msgid,
00395 int category );
00396
00397 #endif
00398
00399 #ifndef HAVE__NL_MSG_CAT_CNTR
00400
00406 extern int _nl_msg_cat_cntr;
00407
00408 #endif
00409
00410
00411 #ifndef HAVE_KILLPG
00412
00415 int killpg( int pgr, int sig );
00416 #endif
00417
00418
00419 #ifndef HAVE_WORKING_GETOPT_LONG
00420
00424 struct option
00425 {
00429 const char *name;
00433 int has_arg;
00437 int *flag;
00441 int val;
00442 }
00443 ;
00444
00445 #ifndef no_argument
00446 #define no_argument 0
00447 #endif
00448
00449 #ifndef required_argument
00450 #define required_argument 1
00451 #endif
00452
00453 #ifndef optional_argument
00454 #define optional_argument 2
00455 #endif
00456
00457 int getopt_long(int argc,
00458 char * const argv[],
00459 const char *optstring,
00460 const struct option *longopts,
00461 int *longindex);
00462
00463 #endif
00464
00465 #ifndef HAVE_SYSCONF
00466
00467 #define _SC_ARG_MAX 1
00468 long sysconf(int name);
00469
00470 #endif
00471
00472 #ifndef HAVE_NAN
00473 double nan(char *tagp);
00474 #endif
00475
00476
00477 #endif