Introduced -devel and -extras subpackages for gawk
[platform/upstream/gawk.git] / protos.h
1 /*
2  * protos.h -- function prototypes for when the headers don't have them.
3  */
4
5 /* 
6  * Copyright (C) 1991 - 2002, 2011 the Free Software Foundation, Inc.
7  * 
8  * This file is part of GAWK, the GNU implementation of the
9  * AWK Programming Language.
10  * 
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.
15  * 
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.
20  * 
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
24  */
25
26 #ifndef STDC_HEADERS
27
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);
32
33 extern void free(aptr_t);
34 extern char *getenv(const char *);
35
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);
47
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) */
54
55 #ifndef VMS
56 extern char *strerror(int);
57 #else
58 extern char *strerror(int,...);
59 #endif
60
61 #if ! defined(__GNU_LIBRARY__)
62 extern size_t strftime(char *, size_t, const char *, const struct tm *);
63 #endif
64 extern time_t time(time_t *);
65
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 *);
70 #endif
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 *);
77 extern void abort();
78 extern int isatty(int);
79 extern void exit(int);
80 extern int system(const char *);
81 extern int sscanf(const char *, const char *, ...);
82 #ifndef toupper
83 extern int toupper(int);
84 #endif
85 #ifndef tolower
86 extern int tolower(int);
87 #endif
88
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 *);
99 extern int dup(int);
100 extern int dup2(int,int);
101 extern int fork();
102 extern int execl(const char *, const char *, ...);
103 #ifndef HAVE_SYS_WAIT_H
104 extern int wait(int *);
105 #endif
106 extern void _exit(int);
107
108 #undef aptr_t
109
110 #endif /* STDC_HEADERS */
111
112
113 /* prototypes for missing functions defined in missing_d/ */
114
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);
118 #endif
119
120 #ifndef HAVE_STRTOUL
121 extern unsigned long int strtoul(const char *, char **endptr, int base);
122 #endif
123
124 #ifndef HAVE_TZSET
125 extern void tzset();
126 #endif
127  
128 #ifndef HAVE_MKTIME
129 extern time_t mktime(struct tm *tp);
130 #endif
131
132 #ifndef HAVE_SNPRINTF
133 extern int snprintf(char *restrict buf, size_t len, const char *restrict fmt, ...);
134 #endif
135
136 #ifndef HAVE_USLEEP
137 extern int usleep(unsigned int);
138 #endif
139
140 #ifndef HAVE_SETENV
141 extern int setenv(const char *, const char *, int);
142 extern int unsetenv(const char *);
143 #endif
144
145 #if !defined(HAVE_STRCOLL)
146 extern int strcoll(const char *, const char *);
147 #endif
148