2 * protos.h -- function prototypes for when the headers don't have them.
6 * Copyright (C) 1991 - 2002, 2011 the Free Software Foundation, Inc.
8 * This file is part of GAWK, the GNU implementation of the
9 * AWK Programming Language.
11 * GAWK is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * GAWK is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28 #define aptr_t void * /* arbitrary pointer type */
29 extern aptr_t malloc(MALLOC_ARG_T);
30 extern aptr_t realloc(aptr_t, MALLOC_ARG_T);
31 extern aptr_t calloc(MALLOC_ARG_T, MALLOC_ARG_T);
33 extern void free(aptr_t);
34 extern char *getenv(const char *);
36 #if ! defined(HAVE_STRING_H) && ! defined(HAVE_STRINGS_H)
37 extern char *strcpy(char *, const char *);
38 extern char *strcat(char *, const char *);
39 extern char *strncpy(char *, const char *, size_t);
40 extern int strcmp(const char *, const char *);
41 extern int strncmp(const char *, const char *, size_t);
42 extern char *strchr(const char *, int);
43 extern char *strrchr(const char *, int);
44 extern char *strstr(const char *s1, const char *s2);
45 extern size_t strlen(const char *);
46 extern long strtol(const char *, char **, int);
48 extern aptr_t memset(aptr_t, int, size_t);
49 extern aptr_t memcpy(aptr_t, const aptr_t, size_t);
50 extern aptr_t memmove(aptr_t, const aptr_t, size_t);
51 extern aptr_t memchr(const aptr_t, int, size_t);
52 extern int memcmp(const aptr_t, const aptr_t, size_t);
53 #endif /* ! defined(HAVE_STRING_H) && ! defined(HAVE_STRINGS_H) */
56 extern char *strerror(int);
58 extern char *strerror(int,...);
61 #if ! defined(__GNU_LIBRARY__)
62 extern size_t strftime(char *, size_t, const char *, const struct tm *);
64 extern time_t time(time_t *);
66 extern FILE *fdopen(int, const char *);
67 extern int fprintf(FILE *, const char *, ...);
68 #if ! defined(__GNU_LIBRARY__)
69 extern size_t fwrite(const aptr_t, size_t, size_t, FILE *);
71 extern int fputs(const char *, FILE *);
72 extern int unlink(const char *);
73 extern int fflush(FILE *);
74 extern int fclose(FILE *);
75 extern FILE *popen(const char *, const char *);
76 extern int pclose(FILE *);
78 extern int isatty(int);
79 extern void exit(int);
80 extern int system(const char *);
81 extern int sscanf(const char *, const char *, ...);
83 extern int toupper(int);
86 extern int tolower(int);
89 extern double pow(double x, double y);
90 extern double atof(const char *);
91 extern double strtod(const char *, char **);
92 extern int fstat(int, struct stat *);
93 extern int stat(const char *, struct stat *);
94 extern off_t lseek(int, off_t, int);
95 extern int close(int);
96 extern int creat(const char *, mode_t);
97 extern int open(const char *, int, ...);
98 extern int pipe(int *);
100 extern int dup2(int,int);
102 extern int execl(const char *, const char *, ...);
103 #ifndef HAVE_SYS_WAIT_H
104 extern int wait(int *);
106 extern void _exit(int);
110 #endif /* STDC_HEADERS */
113 /* prototypes for missing functions defined in missing_d/ */
115 #ifndef HAVE_STRNCASECMP
116 extern int strcasecmp(const char *s1, const char *s2);
117 extern int strncasecmp(const char *s1, const char *s2, register size_t n);
121 extern unsigned long int strtoul(const char *, char **endptr, int base);
129 extern time_t mktime(struct tm *tp);
132 #ifndef HAVE_SNPRINTF
133 extern int snprintf(char *restrict buf, size_t len, const char *restrict fmt, ...);
137 extern int usleep(unsigned int);
141 extern int setenv(const char *, const char *, int);
142 extern int unsetenv(const char *);
145 #if !defined(HAVE_STRCOLL)
146 extern int strcoll(const char *, const char *);