Ticket #2203: headers-ansi-2008-05-10.diff
File headers-ansi-2008-05-10.diff, 19.6 KB (added by , 16 years ago) |
---|
-
headers/posix/limits.h
1 1 #ifndef _LIBC_LIMITS_H_ 2 2 #define _LIBC_LIMITS_H_ 3 / / Note: The header guard is checked in gcc's limits.h.3 /* Note: The header guard is checked in gcc's limits.h. */ 4 4 5 5 #include <float.h> /* for DBL_DIG, FLT_DIG, etc */ 6 6 -
headers/posix/stdint.h
131 131 132 132 #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) 133 133 134 / / Macros of Integer Constant Expressions134 /* Macros of Integer Constant Expressions */ 135 135 #define INT8_C(value) value 136 136 #define INT16_C(value) value 137 137 #define INT32_C(value) value … … 142 142 #define UINT32_C(value) value ## U 143 143 #define UINT64_C(value) value ## ULL 144 144 145 / / Macros for greatest-width integer constant expressions145 /* Macros for greatest-width integer constant expressions */ 146 146 #define INTMAX_C(value) value ## LL 147 147 #define UINTMAX_C(value) value ## ULL 148 148 -
headers/posix/string.h
37 37 extern char *strstr(const char *string, const char *searchString); 38 38 39 39 extern char *strchrnul(const char *string, int character); 40 / / this is a GNU extension40 /* this is a GNU extension */ 41 41 42 42 extern char *strpbrk(const char *string, const char *set); 43 43 extern char *strtok(char *string, const char *set); … … 66 66 67 67 extern size_t strnlen(const char *string, size_t count); 68 68 69 / /extern char *strlwr(char *string);70 / /extern char *strupr(char *string);69 /* extern char *strlwr(char *string); */ 70 /* extern char *strupr(char *string); */ 71 71 72 / /extern char *strsep(char **stringPointer, const char *delimiter);72 /* extern char *strsep(char **stringPointer, const char *delimiter); */ 73 73 74 74 extern const char *strsignal(int signal); 75 75 -
headers/posix/fcntl.h
53 53 #define O_RSYNC 0x00020000 /* read synchronized I/O file integrity */ 54 54 #define O_DSYNC 0x00040000 /* write synchronized I/O data integrity */ 55 55 56 / / TODO: currently not implemented additions:56 /* TODO: currently not implemented additions: */ 57 57 #define O_NOFOLLOW 0x00080000 58 58 /* should we implement this? it's similar to O_NOTRAVERSE but will fail on symlinks */ 59 59 #define O_NOCACHE 0x00100000 /* doesn't use the file system cache if possible */ -
headers/posix/netinet/ip_var.h
138 138 int32_t ips_outhwcsum; /* hardware checksummed on output */ 139 139 }; 140 140 141 / /#ifdef _KERNEL_MODE141 /* #ifdef _KERNEL_MODE */ 142 142 143 143 #define IP_FORWARDING 0x1 /* most of ip header exists */ 144 144 #define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */ … … 147 147 #define IP_MTUDISC 0x10 /* pmtu discovery, set DF */ 148 148 149 149 #if 0 150 / /struct ipstat ipstat;150 /* struct ipstat ipstat; */ 151 151 152 152 void ipv4_input(struct mbuf *, int); 153 153 int ipv4_output(struct mbuf *, struct mbuf *, struct route *, int, void *); -
headers/posix/netinet/in.h
22 22 * and we are not allowed to import all the BeOS types here. 23 23 */ 24 24 #ifndef htonl 25 / / extern uint32_t __swap_int32(uint32_t);/* private */25 /* extern uint32_t __swap_int32(uint32_t); */ /* private */ 26 26 extern unsigned long __swap_int32(unsigned long); /* private */ 27 27 extern uint16_t __swap_int16(uint16_t); /* private */ 28 28 #if BYTE_ORDER == LITTLE_ENDIAN -
headers/posix/stdio.h
10 10 #include <stdarg.h> 11 11 12 12 13 / /Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:14 // __gnuc_va_list 13 /* Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string: 14 * __gnuc_va_list */ 15 15 16 16 17 17 #define BUFSIZ 1024 -
headers/posix/pthread.h
72 72 #define PTHREAD_PRIO_INHERIT 1 73 73 #define PTHREAD_PRIO_PROTECT 2 74 74 75 / /extern pthread_mutexattr_t pthread_mutexattr_default;75 /* extern pthread_mutexattr_t pthread_mutexattr_default; */ 76 76 77 77 /* private structure */ 78 78 struct __pthread_cleanup_handler { … … 176 176 177 177 #if 0 /* Unimplemented attribute functions: */ 178 178 179 / / mandatory!179 /* mandatory! */ 180 180 extern int pthread_attr_getschedparam(const pthread_attr_t *attr, 181 181 struct sched_param *param); 182 182 extern int pthread_attr_setschedparam(pthread_attr_t *attr, 183 183 const struct sched_param *param); 184 184 185 / / [TPS]185 /* [TPS] */ 186 186 extern int pthread_attr_getinheritsched(const pthread_attr_t *attr, 187 187 int *inheritsched); 188 188 extern int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched); … … 194 194 int *contentionscope); 195 195 extern int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope); 196 196 197 / / [XSI]197 /* [XSI] */ 198 198 extern int pthread_attr_getguardsize(const pthread_attr_t *attr, 199 199 size_t *guardsize); 200 200 extern int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize); 201 201 202 / / [TSA]202 /* [TSA] */ 203 203 extern int pthread_attr_getstackaddr(const pthread_attr_t *attr, 204 204 void **stackaddr); 205 205 extern int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr); 206 206 207 / / [TSA TSS]207 /* [TSA TSS] */ 208 208 extern int pthread_attr_getstack(const pthread_attr_t *attr, 209 209 void **stackaddr, size_t *stacksize); 210 210 extern int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize); -
headers/posix/wchar_t.h
3 3 * Distributed under the terms of the MIT License. 4 4 */ 5 5 6 / / Include GCC's stddef.h. It defines wchar_t.6 /* Include GCC's stddef.h. It defines wchar_t. */ 7 7 #include <stddef.h> -
headers/posix/math.h
34 34 #define __huge_valf_t union { unsigned char __c[4]; long __l; float __f; } 35 35 #define HUGE_VALF (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f) 36 36 37 / / ToDo: define HUGE_VALL for long doubles37 /* ToDo: define HUGE_VALL for long doubles */ 38 38 39 39 #define __NAN_VALF_v 0x7fc00000L 40 40 #define NAN (((__huge_valf_t) { __l: __NAN_VALF_v }).__f) … … 146 146 extern long double roundl(long double x); 147 147 extern long lroundl(long double x); 148 148 149 / / TODO: add and fix those!149 /* TODO: add and fix those! */ 150 150 extern /*long*/ double lgamma(/*long*/ double x); 151 151 152 152 /* some BSD non-ANSI or POSIX math functions */ -
headers/posix/size_t.h
7 7 8 8 #include <stddef.h> 9 9 10 / /TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.11 //typedef long signed int ssize_t; 10 /* TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this. 11 * typedef long signed int ssize_t; */ 12 12 13 13 #endif /* _SIZE_T_H_ */ -
headers/posix/libio.h
138 138 struct _IO_FILE *_chain; 139 139 140 140 int _fileno; 141 / / int _blksize;141 /* int _blksize; */ 142 142 int _flags2; 143 143 off_t _old_offset; /* This used to be _offset but it's too small. */ 144 144 /* -> not true on BeOS, but who cares */ … … 151 151 _IO_lock_t *_lock; 152 152 153 153 off_t _offset; 154 / /#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T154 /* #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T */ 155 155 /* Wide character stream stuff. */ 156 156 struct _IO_codecvt *_codecvt; 157 157 struct _IO_wide_data *_wide_data; 158 / /#else159 //void *__pad1;160 //void *__pad2;161 //#endif 158 /* #else 159 * void *__pad1; 160 * void *__pad2; 161 * #endif */ 162 162 int _mode; 163 163 /* Make sure we don't get into trouble again. */ 164 164 char _unused2[15 * sizeof (int) - 2 * sizeof (void *)]; -
headers/posix/net/route.h
20 20 #define RTF_BLACKHOLE 0x00001000 21 21 #define RTF_LOCAL 0x00200000 22 22 23 / /This structure is used to pass routes to and from the network stack24 // (via struct ifreq) 23 /* This structure is used to pass routes to and from the network stack 24 * (via struct ifreq) */ 25 25 26 26 struct route_entry { 27 27 struct sockaddr *destination; -
headers/posix/assert.h
7 7 #undef assert 8 8 9 9 #ifndef NDEBUG 10 / / defining NDEBUG disables assert() functionality10 /* defining NDEBUG disables assert() functionality */ 11 11 12 12 #ifdef __cplusplus 13 13 extern "C" { … … 26 26 #define assert(assertion) \ 27 27 ((assertion) ? (void)0 : __assert_fail(#assertion, __FILE__, __LINE__, __PRETTY_FUNCTION__)) 28 28 29 #else / / NDEBUG30 # define assert(condition) ;29 #else /* NDEBUG */ 30 # define assert(condition) ((void)0) 31 31 #endif 32 32 33 33 #endif /* _ASSERT_H_ */ -
headers/posix/setjmp.h
7 7 8 8 #include <signal.h> 9 9 10 / / include architecture specific definitions10 /* include architecture specific definitions */ 11 11 #ifdef __INTEL__ 12 12 #include <arch/x86/arch_setjmp.h> 13 13 #elif __POWERPC__ -
headers/posix/wchar.h
10 10 #include <stddef.h> 11 11 #include <stdio.h> 12 12 13 / /stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.14 // In all other cases we will do that. 13 /* stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does. 14 * In all other cases we will do that. */ 15 15 #ifndef _WINT_T 16 16 #define _WINT_T 17 17 … … 21 21 22 22 typedef __WINT_TYPE__ wint_t; 23 23 24 #endif / / _WINT_T24 #endif /* _WINT_T */ 25 25 26 26 typedef int wctype_t; 27 27 -
headers/posix/unistd.h
208 208 extern char *optarg; 209 209 extern int optind, opterr, optopt; 210 210 211 / / ToDo: should be moved to stdlib.h211 /* ToDo: should be moved to stdlib.h */ 212 212 extern char **environ; 213 213 214 214 #ifdef __cplusplus -
headers/posix/signal.h
25 25 #define SIG_ERR ((sighandler_t)-1) /* an error occurred during signal processing */ 26 26 #define SIG_HOLD ((sighandler_t)3) /* the signal was hold */ 27 27 28 / /TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do29 //this properly we need real-time signal support. Both are commented out for30 // the time being to not make "configure" scripts think we do support them. 28 /* TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do 29 * this properly we need real-time signal support. Both are commented out for 30 * the time being to not make "configure" scripts think we do support them. */ 31 31 #if 0 32 32 typedef struct { 33 33 int si_signo; /* signal number */ … … 61 61 #define SA_NODEFER 0x08 62 62 #define SA_RESTART 0x10 63 63 #define SA_ONSTACK 0x20 64 / /#define SA_SIGINFO 0x4064 /* #define SA_SIGINFO 0x40 */ 65 65 #define SA_NOMASK SA_NODEFER 66 66 #define SA_STACK SA_ONSTACK 67 67 #define SA_ONESHOT SA_RESETHAND … … 248 248 249 249 typedef struct vregs vregs; 250 250 251 / / include architecture specific definitions251 /* include architecture specific definitions */ 252 252 #ifdef __INTEL__ 253 253 #include <arch/x86/signal.h> 254 254 #elif __POWERPC__ -
headers/posix/inttypes.h
204 204 205 205 extern intmax_t strtoimax(const char *string, char **_end, int base); 206 206 extern uintmax_t strtoumax(const char *string, char **_end, int base); 207 / /extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int);208 / /extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int);207 /* extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int); */ 208 /* extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int); */ 209 209 210 210 #ifdef __cplusplus 211 211 } -
headers/posix/ctype.h
74 74 } 75 75 #endif 76 76 77 #endif / / _CTYPE_H77 #endif /* _CTYPE_H */ -
headers/posix/shadow.h
49 49 #endif 50 50 51 51 52 #endif / / _SHADOW_H_52 #endif /* _SHADOW_H_ */ -
headers/posix/stdio_post.h
4 4 #ifndef _STDIO_POST_H_ 5 5 #define _STDIO_POST_H_ 6 6 7 / / "Private"/inline functions of our BeOS compatible stdio implementation7 /* "Private"/inline functions of our BeOS compatible stdio implementation */ 8 8 9 / /ToDo: this is a work in progress to make our stdio10 //BeOS' GNU/libio (almost) binary compatible11 // We may not yet be compatible! 9 /* ToDo: this is a work in progress to make our stdio 10 * BeOS' GNU/libio (almost) binary compatible 11 * We may not yet be compatible! */ 12 12 13 13 #ifndef _STDIO_H_ 14 14 # error "This file must be included from stdio.h!" … … 19 19 #endif 20 20 21 21 extern char _single_threaded; 22 / /this boolean value is true (1) if there is only the main thread23 //running - as soon as you spawn the first thread, it's set to24 // false (0)22 /* this boolean value is true (1) if there is only the main thread 23 * running - as soon as you spawn the first thread, it's set to 24 * false (0) */ 25 25 26 26 #ifdef __cplusplus 27 27 } -
headers/posix/sys/wait.h
27 27 #define WIFCORED(value) ((value) & 0x10000) 28 28 #define WIFCONTINUED(value) ((value) & 0x20000) 29 29 30 / /TODO: waitid() is part of the real-time signal extension. Uncomment when31 // implemented! 30 /* TODO: waitid() is part of the real-time signal extension. Uncomment when 31 * implemented! */ 32 32 #if 0 33 33 /* ID types for waitid() */ 34 34 typedef enum { … … 36 36 P_PID, /* wait for the child whose process ID matches */ 37 37 P_PGID /* wait for any child whose process group ID matches */ 38 38 } idtype_t; 39 #endif / / 039 #endif /* 0 */ 40 40 41 41 42 42 #ifdef __cplusplus … … 45 45 46 46 extern pid_t wait(int *_status); 47 47 extern pid_t waitpid(pid_t pid, int *_status, int options); 48 / /extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options);48 /* extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options); */ 49 49 50 50 #ifdef __cplusplus 51 51 } -
headers/posix/sys/poll.h
7 7 8 8 9 9 #include <poll.h> 10 / / for compatibility with legacy applications10 /* for compatibility with legacy applications */ 11 11 12 12 13 13 #endif /* _SYS_POLL_H */ -
headers/posix/sys/stat.h
24 24 time_t st_ctime; /* last change time, not creation time */ 25 25 time_t st_crtime; /* creation time */ 26 26 27 / /Haiku extensions:28 //TODO: we might also define special types for files and TTYs29 //TODO: we should find another solution for this, as BStatable::GetStat()30 // can only retrieve the R5 stat structure27 /* Haiku extensions: 28 * TODO: we might also define special types for files and TTYs 29 * TODO: we should find another solution for this, as BStatable::GetStat() 30 * can only retrieve the R5 stat structure */ 31 31 unsigned int st_type; /* attribute/index type */ 32 32 }; 33 33 … … 110 110 extern int mkfifo(const char *path, mode_t mode); 111 111 extern mode_t umask(mode_t cmask); 112 112 113 / / This achieves backwards compatibility with R5114 #if 0 / /def HAIKU_TARGET_PLATFORM_HAIKU113 /* This achieves backwards compatibility with R5 */ 114 #if 0 /* def HAIKU_TARGET_PLATFORM_HAIKU */ 115 115 #define stat(fd, st) _stat(fd, st, sizeof(struct stat)) 116 116 #define fstat(fd, st) _fstat(fd, st, sizeof(struct stat)) 117 117 #define lstat(fd, st) _lstat(fd, st, sizeof(struct stat)) 118 118 #else 119 / / ... and this fixes the build for R5 for now119 /* ... and this fixes the build for R5 for now */ 120 120 extern int stat(const char *path, struct stat *st); 121 121 extern int fstat(int fd, struct stat *st); 122 122 extern int lstat(const char *path, struct stat *st); -
headers/posix/sys/resource.h
17 17 rlim_t rlim_max; /* hard limit */ 18 18 }; 19 19 20 / / ToDo: the only supported mode is RLIMIT_NOFILE right now20 /* ToDo: the only supported mode is RLIMIT_NOFILE right now */ 21 21 #define RLIMIT_CORE 0 /* size of the core file */ 22 22 #define RLIMIT_CPU 1 /* CPU time per team */ 23 23 #define RLIMIT_DATA 2 /* data segment size */ … … 62 62 extern int getrlimit(int resource, struct rlimit * rlp); 63 63 extern int setrlimit(int resource, const struct rlimit * rlp); 64 64 65 / /ToDo: The following POSIX calls are missing (in BeOS as well):66 //int getpriority(int which, id_t who);67 //int setpriority(int which, id_t who, int priority); 65 /* ToDo: The following POSIX calls are missing (in BeOS as well): 66 * int getpriority(int which, id_t who); 67 * int setpriority(int which, id_t who, int priority); */ 68 68 69 69 #ifdef __cplusplus 70 70 } -
headers/posix/sys/mman.h
9 9 #include <sys/types.h> 10 10 11 11 12 / / memory protection for mmap() and others12 /* memory protection for mmap() and others */ 13 13 #define PROT_READ 0x01 14 14 #define PROT_WRITE 0x02 15 15 #define PROT_EXEC 0x04 16 16 #define PROT_NONE 0x00 17 17 18 / / mmap() flags18 /* mmap() flags */ 19 19 #define MAP_SHARED 0x01 /* changes are seen by others */ 20 20 #define MAP_PRIVATE 0x02 /* changes are only seen by caller */ 21 21 #define MAP_FIXED 0x04 /* require mapping to specified addr */ 22 22 #define MAP_ANONYMOUS 0x08 /* no underlying object */ 23 23 #define MAP_ANON MAP_ANONYMOUS 24 24 25 / / mmap() error return code25 /* mmap() error return code */ 26 26 #define MAP_FAILED ((void*)-1) 27 27 28 28 … … 38 38 __END_DECLS 39 39 40 40 41 #endif / / _SYS_MMAN_H41 #endif /* _SYS_MMAN_H */