From 6c3c6d58252c9780607ff6a4d578517a6e32e5ed Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 30 Mar 2020 15:41:10 -0400 Subject: initial commit --- aio.h | 106 ++++++ assert.h | 41 +++ complex.h | 188 +++++++++++ cpio.h | 92 +++++ ctype.h | 77 +++++ curses.h | 912 ++++++++++++++++++++++++++++++++++++++++++++++++++ dirent.h | 90 +++++ errno.h | 235 +++++++++++++ fcntl.h | 162 +++++++++ fenv.h | 96 ++++++ float.h | 97 ++++++ fmtmsg.h | 89 +++++ fnmatch.h | 65 ++++ ftw.h | 120 +++++++ glob.h | 96 ++++++ grp.h | 86 +++++ iconv.h | 71 ++++ inttypes.h | 462 +++++++++++++++++++++++++ iso646.h | 56 ++++ langinfo.h | 174 ++++++++++ libgen.h | 50 +++ limits.h | 296 ++++++++++++++++ locale.h | 137 ++++++++ math.h | 481 ++++++++++++++++++++++++++ monetary.h | 80 +++++ mqueue.h | 93 ++++++ ndbm.h | 77 +++++ nl_types.h | 62 ++++ poll.h | 101 ++++++ pwd.h | 95 ++++++ re_comp.h | 38 +++ regex.h | 131 ++++++++ regexp.h | 49 +++ sched.h | 92 +++++ search.h | 109 ++++++ semaphore.h | 81 +++++ setjmp.h | 86 +++++ signal.h | 451 +++++++++++++++++++++++++ stdarg.h | 50 +++ stdbool.h | 42 +++ stddef.h | 71 ++++ stdint.h | 327 ++++++++++++++++++ stdio.h | 281 ++++++++++++++++ stdlib.h | 286 ++++++++++++++++ string.h | 125 +++++++ strings.h | 73 ++++ stropts.h | 255 ++++++++++++++ sys/ipc.h | 113 +++++++ sys/mman.h | 107 ++++++ sys/msg.h | 133 ++++++++ sys/resource.h | 112 +++++++ sys/sem.h | 150 +++++++++ sys/shm.h | 131 ++++++++ sys/stat.h | 243 ++++++++++++++ sys/statvfs.h | 89 +++++ sys/time.h | 105 ++++++ sys/timeb.h | 59 ++++ sys/times.h | 75 +++++ sys/types.h | 179 ++++++++++ sys/uio.h | 50 +++ sys/utsname.h | 67 ++++ sys/wait.h | 158 +++++++++ syslog.h | 110 ++++++ tar.h | 100 ++++++ term.h | 1020 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ termios.h | 318 ++++++++++++++++++ time.h | 205 ++++++++++++ ucontext.h | 94 ++++++ ulimit.h | 43 +++ unctrl.h | 45 +++ unistd.h | 658 ++++++++++++++++++++++++++++++++++++ utime.h | 74 ++++ utmpx.h | 81 +++++ varargs.h | 46 +++ wchar.h | 274 +++++++++++++++ wctype.h | 99 ++++++ wordexp.h | 98 ++++++ 77 files changed, 12370 insertions(+) create mode 100644 aio.h create mode 100644 assert.h create mode 100644 complex.h create mode 100644 cpio.h create mode 100644 ctype.h create mode 100644 curses.h create mode 100644 dirent.h create mode 100644 errno.h create mode 100644 fcntl.h create mode 100644 fenv.h create mode 100644 float.h create mode 100644 fmtmsg.h create mode 100644 fnmatch.h create mode 100644 ftw.h create mode 100644 glob.h create mode 100644 grp.h create mode 100644 iconv.h create mode 100644 inttypes.h create mode 100644 iso646.h create mode 100644 langinfo.h create mode 100644 libgen.h create mode 100644 limits.h create mode 100644 locale.h create mode 100644 math.h create mode 100644 monetary.h create mode 100644 mqueue.h create mode 100644 ndbm.h create mode 100644 nl_types.h create mode 100644 poll.h create mode 100644 pwd.h create mode 100644 re_comp.h create mode 100644 regex.h create mode 100644 regexp.h create mode 100644 sched.h create mode 100644 search.h create mode 100644 semaphore.h create mode 100644 setjmp.h create mode 100644 signal.h create mode 100644 stdarg.h create mode 100644 stdbool.h create mode 100644 stddef.h create mode 100644 stdint.h create mode 100644 stdio.h create mode 100644 stdlib.h create mode 100644 string.h create mode 100644 strings.h create mode 100644 stropts.h create mode 100644 sys/ipc.h create mode 100644 sys/mman.h create mode 100644 sys/msg.h create mode 100644 sys/resource.h create mode 100644 sys/sem.h create mode 100644 sys/shm.h create mode 100644 sys/stat.h create mode 100644 sys/statvfs.h create mode 100644 sys/time.h create mode 100644 sys/timeb.h create mode 100644 sys/times.h create mode 100644 sys/types.h create mode 100644 sys/uio.h create mode 100644 sys/utsname.h create mode 100644 sys/wait.h create mode 100644 syslog.h create mode 100644 tar.h create mode 100644 term.h create mode 100644 termios.h create mode 100644 time.h create mode 100644 ucontext.h create mode 100644 ulimit.h create mode 100644 unctrl.h create mode 100644 unistd.h create mode 100644 utime.h create mode 100644 utmpx.h create mode 100644 varargs.h create mode 100644 wchar.h create mode 100644 wctype.h create mode 100644 wordexp.h diff --git a/aio.h b/aio.h new file mode 100644 index 0000000..9da120f --- /dev/null +++ b/aio.h @@ -0,0 +1,106 @@ +#ifndef __AIO_H__ +#define __AIO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/aio/AIO_ALLDONE.c */ +#define AIO_ALLDONE 0 +/* ./src/aio/AIO_CANCELED.c */ +#define AIO_CANCELED 1 +/* ./src/aio/AIO_NOTCANCELED.c */ +#define AIO_NOTCANCELED 2 +/* ./src/aio/LIO_NOP.c */ +#define LIO_NOP 0 +/* ./src/aio/LIO_NOWAIT.c */ +#define LIO_NOWAIT 1 +/* ./src/aio/LIO_READ.c */ +#define LIO_READ 2 +/* ./src/aio/LIO_WAIT.c */ +#define LIO_WAIT 3 +/* ./src/aio/LIO_WRITE.c */ +#define LIO_WRITE 4 +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/aio/struct_aiocb.c */ +#ifndef __TYPE_struct_aiocb_DEFINED__ +#define __TYPE_struct_aiocb_DEFINED__ +struct aiocb { + int aio_fildes; + off_t aio_offset; + volatile void * aio_buf; + size_t aio_nbytes; + int aio_reqprio; + struct sigevent aio_sigevent; + int aio_lio_opcode; +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/aio/aio_cancel.c */ +int aio_cancel(int __fildes, struct aiocb *__aiocbp); +/* ./src/aio/aio_error.c */ +int aio_error(const struct aiocb * __aiocbp); +/* ./src/aio/aio_fsync.c */ +int aio_fsync(int __op, struct aiocb * __aiocbp); +/* ./src/aio/aio_read.c */ +int aio_read(struct aiocb * __aiocbp); +/* ./src/aio/aio_return.c */ +ssize_t aio_return(struct aiocb *__aiocbp); +/* ./src/aio/aio_suspend.c */ +int aio_suspend(const struct aiocb * const list[], int __nent, const struct timespec * __timeout); +/* ./src/aio/aio_write.c */ +int aio_write(struct aiocb * __aiocbp); +/* ./src/aio/lio_listio.c */ +int lio_listio(int __mode, struct aiocb * const list[restrict], int __nent, struct sigevent * restrict __sig); +#endif + + +#endif diff --git a/assert.h b/assert.h new file mode 100644 index 0000000..b19387d --- /dev/null +++ b/assert.h @@ -0,0 +1,41 @@ +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/* ./src/assert/assert.c */ +#undef assert +#ifdef NDEBUG +#define assert(__exp) ((void)0) +#else +#if __STDC_VERSION__ < 199901L +#define __func__ ((char*)0) +#endif +#define assert(__exp) \ + ((void)((__exp) || (__assert(#__exp, __FILE__, __LINE__, __func__), 0))) +#endif + +/* ./src/assert/__assert.c */ +void __assert(const char *__expr, const char *__file, int __line, const char *__func); + diff --git a/complex.h b/complex.h new file mode 100644 index 0000000..66e0286 --- /dev/null +++ b/complex.h @@ -0,0 +1,188 @@ +#ifndef __COMPLEX_H__ +#define __COMPLEX_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/complex/I.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define I _Imaginary_I +#else +#define I _Complex_I +#endif +/* ./src/complex/_Complex_I.c */ +#define _Complex_I \ + (((union { \ + float _Complex __c; \ + float __f[2]; \ + }){ .__f = { 0.0, 1.0 } }).__c) +/* ./src/complex/_Imaginary_I.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define _Imaginary_I \ + (((union { \ + float _Imaginary __i; \ + float __f; \ + }){ .__f = 1.0 }).__i) +#endif +/* ./src/complex/complex.c */ +#define complex _Complex +/* ./src/complex/imaginary.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define imaginary _Imaginary +#endif +#endif + +#if (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__) +/* ./src/complex/CMPLX.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define CMPLX(__x, __y) \ + ((double complex)((double)(__x) + _Imaginary_I * (double)(__y))) +#else +#define CMPLX(__x, __y) \ + (((union { \ + double complex __c; \ + double __d[2]; \ + }){ .__d = { __x, __y } }).__c) +#endif +/* ./src/complex/CMPLXF.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define CMPLXF(__x, __y) \ + ((float complex)((float)(__x) + _Imaginary_I * (float)(__y))) +#else +#define CMPLXF(__x, __y) \ + (((union { \ + float complex __c; \ + float __f[2]; \ + }){ .__f = { __x, __y } }).__c) +#endif +/* ./src/complex/CMPLXL.c */ +#ifdef __STDC_IEC_559_COMPLEX__ +#define CMPLXL(__x, __y) \ + ((long double complex)((long double)(__x) + \ + _Imaginary_I * (long double)(__y))) +#else +#define CMPLXL(__x, __y) \ + (((union { \ + long double complex __c; \ + long double __ld[2]; \ + }){ .__ld = { __x, __y } }).__c) +#endif +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/complex/cabs.c */ +double cabs(double complex z); +float cabsf(float complex z); +long double cabsl(long double complex z); +/* ./src/complex/cacos.c */ +double complex cacos(double complex z); +float complex cacosf(float complex z); +long double complex cacosl(long double complex z); +/* ./src/complex/cacosh.c */ +double complex cacosh(double complex z); +float complex cacoshf(float complex z); +long double complex cacoshl(long double complex z); +/* ./src/complex/carg.c */ +double carg(double complex z); +float cargf(float complex z); +long double cargl(long double complex z); +/* ./src/complex/casin.c */ +double complex casin(double complex z); +float complex casinf(float complex z); +long double complex casinl(long double complex z); +/* ./src/complex/casinh.c */ +double complex casinh(double complex z); +float complex casinhf(float complex z); +long double complex casinhl(long double complex z); +/* ./src/complex/catan.c */ +double complex catan(double complex z); +float complex catanf(float complex z); +long double complex catanl(long double complex z); +/* ./src/complex/catanh.c */ +double complex catanh(double complex z); +float complex catanhf(float complex z); +long double complex catanhl(long double complex z); +/* ./src/complex/ccos.c */ +double complex ccos(double complex z); +float complex ccosf(float complex z); +long double complex ccosl(long double complex z); +/* ./src/complex/ccosh.c */ +double complex ccosh(double complex z); +float complex ccoshf(float complex z); +long double complex ccoshl(long double complex z); +/* ./src/complex/cexp.c */ +double complex cexp(double complex z); +float complex cexpf(float complex z); +long double complex cexpl(long double complex z); +/* ./src/complex/cimag.c */ +double cimag(double complex z); +float cimagf(float complex z); +long double cimagl(long double complex z); +/* ./src/complex/clog.c */ +double complex clog(double complex z); +float complex clogf(float complex z); +long double complex clogl(long double complex z); +/* ./src/complex/conj.c */ +double complex conj(double complex z); +float complex conjf(float complex z); +long double complex conjl(long double complex z); +/* ./src/complex/cpow.c */ +double complex cpow(double complex x, double complex y); +float complex cpowf(float complex x, float complex y); +long double complex cpowl(long double complex x, long double complex y); +/* ./src/complex/cproj.c */ +double complex cproj(double complex z); +float complex cprojf(float complex z); +long double complex cprojl(long double complex z); +/* ./src/complex/creal.c */ +double creal(double complex z); +float crealf(float complex z); +long double creall(long double complex z); +/* ./src/complex/csin.c */ +double complex csin(double complex z); +float complex csinf(float complex z); +long double complex csinl(long double complex z); +/* ./src/complex/csinh.c */ +double complex csinh(double complex z); +float complex csinhf(float complex z); +long double complex csinhl(long double complex z); +/* ./src/complex/csqrt.c */ +double complex csqrt(double complex z); +float complex csqrtf(float complex z); +long double complex csqrtl(long double complex z); +/* ./src/complex/ctan.c */ +double complex ctan(double complex z); +float complex ctanf(float complex z); +long double complex ctanl(long double complex z); +/* ./src/complex/ctanh.c */ +double complex ctanh(double complex z); +float complex ctanhf(float complex z); +long double complex ctanhl(long double complex z); +#endif + + +#endif diff --git a/cpio.h b/cpio.h new file mode 100644 index 0000000..754e9d7 --- /dev/null +++ b/cpio.h @@ -0,0 +1,92 @@ +#ifndef __CPIO_H__ +#define __CPIO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/cpio/C_IRGRP.c */ +#define C_IRGRP 0000040 +/* ./src/cpio/C_IROTH.c */ +#define C_IROTH 0000004 +/* ./src/cpio/C_IRUSR.c */ +#define C_IRUSR 0000400 +/* ./src/cpio/C_ISBLK.c */ +#define C_ISBLK 0060000 +/* ./src/cpio/C_ISCHR.c */ +#define C_ISCHR 0020000 +/* ./src/cpio/C_ISCTG.c */ +#define C_ISCTG 0110000 +/* ./src/cpio/C_ISDIR.c */ +#define C_ISDIR 0040000 +/* ./src/cpio/C_ISFIFO.c */ +#define C_ISFIFO 0010000 +/* ./src/cpio/C_ISGID.c */ +#define C_ISGID 0002000 +/* ./src/cpio/C_ISLNK.c */ +#define C_ISLNK 0120000 +/* ./src/cpio/C_ISREG.c */ +#define C_ISREG 0100000 +/* ./src/cpio/C_ISSOCK.c */ +#define C_ISSOCK 0140000 +/* ./src/cpio/C_ISUID.c */ +#define C_ISUID 0004000 +/* ./src/cpio/C_ISVTX.c */ +#define C_ISVTX 0001000 +/* ./src/cpio/C_IWGRP.c */ +#define C_IWGRP 0000020 +/* ./src/cpio/C_IWOTH.c */ +#define C_IWOTH 0000002 +/* ./src/cpio/C_IWUSR.c */ +#define C_IWUSR 0000200 +/* ./src/cpio/C_IXGRP.c */ +#define C_IXGRP 0000010 +/* ./src/cpio/C_IXOTH.c */ +#define C_IXOTH 0000001 +/* ./src/cpio/C_IXUSR.c */ +#define C_IXUSR 0000100 +/* ./src/cpio/MAGIC.c */ +#define MAGIC "070707" +#endif + + +#endif diff --git a/ctype.h b/ctype.h new file mode 100644 index 0000000..960f276 --- /dev/null +++ b/ctype.h @@ -0,0 +1,77 @@ +#ifndef __CTYPE_H__ +#define __CTYPE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* ./src/ctype/_tolower.c */ +#define _tolower(__c) tolower(__c) +/* ./src/ctype/_toupper.c */ +#define _toupper(__c) toupper(__c) +#endif + +/* ./src/ctype/isalnum.c */ +int isalnum(int __c); +/* ./src/ctype/isalpha.c */ +int isalpha(int __c); +/* ./src/ctype/iscntrl.c */ +int iscntrl(int __c); +/* ./src/ctype/isdigit.c */ +int isdigit(int __c); +/* ./src/ctype/isgraph.c */ +int isgraph(int __c); +/* ./src/ctype/islower.c */ +int islower(int __c); +/* ./src/ctype/isprint.c */ +int isprint(int __c); +/* ./src/ctype/ispunct.c */ +int ispunct(int __c); +/* ./src/ctype/isspace.c */ +int isspace(int __c); +/* ./src/ctype/isupper.c */ +int isupper(int __c); +/* ./src/ctype/isxdigit.c */ +int isxdigit(int __c); +/* ./src/ctype/tolower.c */ +int tolower(int __c); +/* ./src/ctype/toupper.c */ +int toupper(int __c); + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/ctype/isblank.c */ +int isblank(int __c); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/ctype/isascii.c */ +int isascii(int __c); +/* ./src/ctype/toascii.c */ +int toascii(int __c); +#endif + + +#endif diff --git a/curses.h b/curses.h new file mode 100644 index 0000000..a621fba --- /dev/null +++ b/curses.h @@ -0,0 +1,912 @@ +#ifndef __CURSES_H__ +#define __CURSES_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* ./src/curses/A_ATTRIBUTES.c */ +#define A_ATTRIBUTES (0x1ff00) +/* ./src/curses/A_BLINK.c */ +#define A_BLINK (1<<9) +/* ./src/curses/A_BOLD.c */ +#define A_BOLD (1<<10) +/* ./src/curses/A_CHARTEXT.c */ +#define A_CHARTEXT (0xff) +/* ./src/curses/A_DIM.c */ +#define A_DIM (1<<11) +/* ./src/curses/A_REVERSE.c */ +#define A_REVERSE (1<<14) +/* ./src/curses/A_STANDOUT.c */ +#define A_STANDOUT (1<<15) +/* ./src/curses/A_UNDERLINE.c */ +#define A_UNDERLINE (1<<16) +/* ./src/curses/ERR.c */ +#define ERR (-1) +/* ./src/curses/FALSE.c */ +#define FALSE (0) +/* ./src/curses/KEY_A1.c */ +#define KEY_A1 /* TODO */ +/* ./src/curses/KEY_A3.c */ +#define KEY_A3 /* TODO */ +/* ./src/curses/KEY_B2.c */ +#define KEY_B2 /* TODO */ +/* ./src/curses/KEY_BACKSPACE.c */ +#define KEY_BACKSPACE /* TODO */ +/* ./src/curses/KEY_BREAK.c */ +#define KEY_BREAK /* TODO */ +/* ./src/curses/KEY_C1.c */ +#define KEY_C1 /* TODO */ +/* ./src/curses/KEY_C3.c */ +#define KEY_C3 /* TODO */ +/* ./src/curses/KEY_CATAB.c */ +#define KEY_CATAB /* TODO */ +/* ./src/curses/KEY_CLEAR.c */ +#define KEY_CLEAR /* TODO */ +/* ./src/curses/KEY_CTAB.c */ +#define KEY_CTAB /* TODO */ +/* ./src/curses/KEY_DC.c */ +#define KEY_DC /* TODO */ +/* ./src/curses/KEY_DL.c */ +#define KEY_DL /* TODO */ +/* ./src/curses/KEY_DOWN.c */ +#define KEY_DOWN /* TODO */ +/* ./src/curses/KEY_EIC.c */ +#define KEY_EIC /* TODO */ +/* ./src/curses/KEY_ENTER.c */ +#define KEY_ENTER /* TODO */ +/* ./src/curses/KEY_EOL.c */ +#define KEY_EOL /* TODO */ +/* ./src/curses/KEY_EOS.c */ +#define KEY_EOS /* TODO */ +/* ./src/curses/KEY_F0.c */ +#define KEY_F0 /* TODO */ +/* ./src/curses/KEY_HOME.c */ +#define KEY_HOME /* TODO */ +/* ./src/curses/KEY_IC.c */ +#define KEY_IC /* TODO */ +/* ./src/curses/KEY_IL.c */ +#define KEY_IL /* TODO */ +/* ./src/curses/KEY_LEFT.c */ +#define KEY_LEFT /* TODO */ +/* ./src/curses/KEY_LL.c */ +#define KEY_LL /* TODO */ +/* ./src/curses/KEY_NPAGE.c */ +#define KEY_NPAGE /* TODO */ +/* ./src/curses/KEY_PPAGE.c */ +#define KEY_PPAGE /* TODO */ +/* ./src/curses/KEY_PRINT.c */ +#define KEY_PRINT /* TODO */ +/* ./src/curses/KEY_RESET.c */ +#define KEY_RESET /* TODO */ +/* ./src/curses/KEY_RIGHT.c */ +#define KEY_RIGHT /* TODO */ +/* ./src/curses/KEY_SF.c */ +#define KEY_SF /* TODO */ +/* ./src/curses/KEY_SR.c */ +#define KEY_SR /* TODO */ +/* ./src/curses/KEY_SRESET.c */ +#define KEY_SRESET /* TODO */ +/* ./src/curses/KEY_STAB.c */ +#define KEY_STAB /* TODO */ +/* ./src/curses/KEY_UP.c */ +#define KEY_UP /* TODO */ +/* ./src/curses/OK.c */ +#define OK (0) +/* ./src/curses/TRUE.c */ +#define TRUE (1) +/* ./src/curses/getyx.c */ +#define getyx(_win, _y, _x) /* TODO */ +/* src/stdio/EOF.c */ +#define EOF (-1) +/* src/wctype/WEOF.c */ +#define WEOF ((wint_t)(-1)) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/curses/ACS_BLOCK.c */ +#define ACS_BLOCK /* TODO */ +/* ./src/curses/ACS_BOARD.c */ +#define ACS_BOARD /* TODO */ +/* ./src/curses/ACS_BTEE.c */ +#define ACS_BTEE /* TODO */ +/* ./src/curses/ACS_BULLET.c */ +#define ACS_BULLET /* TODO */ +/* ./src/curses/ACS_CKBOARD.c */ +#define ACS_CKBOARD /* TODO */ +/* ./src/curses/ACS_DARROW.c */ +#define ACS_DARROW /* TODO */ +/* ./src/curses/ACS_DEGREE.c */ +#define ACS_DEGREE /* TODO */ +/* ./src/curses/ACS_DIAMOND.c */ +#define ACS_DIAMOND /* TODO */ +/* ./src/curses/ACS_HLINE.c */ +#define ACS_HLINE /* TODO */ +/* ./src/curses/ACS_LANTERN.c */ +#define ACS_LANTERN /* TODO */ +/* ./src/curses/ACS_LARROW.c */ +#define ACS_LARROW /* TODO */ +/* ./src/curses/ACS_LLCORNER.c */ +#define ACS_LLCORNER /* TODO */ +/* ./src/curses/ACS_LRCORNER.c */ +#define ACS_LRCORNER /* TODO */ +/* ./src/curses/ACS_LTEE.c */ +#define ACS_LTEE /* TODO */ +/* ./src/curses/ACS_PLMINUS.c */ +#define ACS_PLMINUS /* TODO */ +/* ./src/curses/ACS_PLUS.c */ +#define ACS_PLUS /* TODO */ +/* ./src/curses/ACS_RARROW.c */ +#define ACS_RARROW /* TODO */ +/* ./src/curses/ACS_RTEE.c */ +#define ACS_RTEE /* TODO */ +/* ./src/curses/ACS_S1.c */ +#define ACS_S1 /* TODO */ +/* ./src/curses/ACS_S9.c */ +#define ACS_S9 /* TODO */ +/* ./src/curses/ACS_TTEE.c */ +#define ACS_TTEE /* TODO */ +/* ./src/curses/ACS_UARROW.c */ +#define ACS_UARROW /* TODO */ +/* ./src/curses/ACS_ULCORNER.c */ +#define ACS_ULCORNER /* TODO */ +/* ./src/curses/ACS_URCORNER.c */ +#define ACS_URCORNER /* TODO */ +/* ./src/curses/ACS_VLINE.c */ +#define ACS_VLINE /* TODO */ +/* ./src/curses/A_ALTCHARSET.c */ +#define A_ALTCHARSET (1<<8) +/* ./src/curses/A_COLOR.c */ +#define A_COLOR (0xff000000) +/* ./src/curses/A_INVIS.c */ +#define A_INVIS (1<<12) +/* ./src/curses/A_PROTECT.c */ +#define A_PROTECT (1<<13) +/* ./src/curses/COLOR_BLACK.c */ +#define COLOR_BLACK (0) +/* ./src/curses/COLOR_BLUE.c */ +#define COLOR_BLUE (4) +/* ./src/curses/COLOR_CYAN.c */ +#define COLOR_CYAN (6) +/* ./src/curses/COLOR_GREEN.c */ +#define COLOR_GREEN (2) +/* ./src/curses/COLOR_MAGENTA.c */ +#define COLOR_MAGENTA (5) +/* ./src/curses/COLOR_PAIR.c */ +#define COLOR_PAIR(__n) /* TODO */ +/* ./src/curses/COLOR_RED.c */ +#define COLOR_RED (1) +/* ./src/curses/COLOR_WHITE.c */ +#define COLOR_WHITE (7) +/* ./src/curses/COLOR_YELLOW.c */ +#define COLOR_YELLOW (3) +/* ./src/curses/KEY_BEG.c */ +#define KEY_BEG /* TODO */ +/* ./src/curses/KEY_BTAB.c */ +#define KEY_BTAB /* TODO */ +/* ./src/curses/KEY_CANCEL.c */ +#define KEY_CANCEL /* TODO */ +/* ./src/curses/KEY_CLOSE.c */ +#define KEY_CLOSE /* TODO */ +/* ./src/curses/KEY_COMMAND.c */ +#define KEY_COMMAND /* TODO */ +/* ./src/curses/KEY_COPY.c */ +#define KEY_COPY /* TODO */ +/* ./src/curses/KEY_CREATE.c */ +#define KEY_CREATE /* TODO */ +/* ./src/curses/KEY_END.c */ +#define KEY_END /* TODO */ +/* ./src/curses/KEY_EXIT.c */ +#define KEY_EXIT /* TODO */ +/* ./src/curses/KEY_FIND.c */ +#define KEY_FIND /* TODO */ +/* ./src/curses/KEY_HELP.c */ +#define KEY_HELP /* TODO */ +/* ./src/curses/KEY_MARK.c */ +#define KEY_MARK /* TODO */ +/* ./src/curses/KEY_MESSAGE.c */ +#define KEY_MESSAGE /* TODO */ +/* ./src/curses/KEY_MOVE.c */ +#define KEY_MOVE /* TODO */ +/* ./src/curses/KEY_NEXT.c */ +#define KEY_NEXT /* TODO */ +/* ./src/curses/KEY_OPEN.c */ +#define KEY_OPEN /* TODO */ +/* ./src/curses/KEY_OPTIONS.c */ +#define KEY_OPTIONS /* TODO */ +/* ./src/curses/KEY_PREVIOUS.c */ +#define KEY_PREVIOUS /* TODO */ +/* ./src/curses/KEY_REDO.c */ +#define KEY_REDO /* TODO */ +/* ./src/curses/KEY_REFERENCE.c */ +#define KEY_REFERENCE /* TODO */ +/* ./src/curses/KEY_REFRESH.c */ +#define KEY_REFRESH /* TODO */ +/* ./src/curses/KEY_REPLACE.c */ +#define KEY_REPLACE /* TODO */ +/* ./src/curses/KEY_RESTART.c */ +#define KEY_RESTART /* TODO */ +/* ./src/curses/KEY_RESUME.c */ +#define KEY_RESUME /* TODO */ +/* ./src/curses/KEY_SAVE.c */ +#define KEY_SAVE /* TODO */ +/* ./src/curses/KEY_SBEG.c */ +#define KEY_SBEG /* TODO */ +/* ./src/curses/KEY_SCANCEL.c */ +#define KEY_SCANCEL /* TODO */ +/* ./src/curses/KEY_SCOMMAND.c */ +#define KEY_SCOMMAND /* TODO */ +/* ./src/curses/KEY_SCOPY.c */ +#define KEY_SCOPY /* TODO */ +/* ./src/curses/KEY_SCREATE.c */ +#define KEY_SCREATE /* TODO */ +/* ./src/curses/KEY_SDC.c */ +#define KEY_SDC /* TODO */ +/* ./src/curses/KEY_SDL.c */ +#define KEY_SDL /* TODO */ +/* ./src/curses/KEY_SELECT.c */ +#define KEY_SELECT /* TODO */ +/* ./src/curses/KEY_SEND.c */ +#define KEY_SEND /* TODO */ +/* ./src/curses/KEY_SEOL.c */ +#define KEY_SEOL /* TODO */ +/* ./src/curses/KEY_SEXIT.c */ +#define KEY_SEXIT /* TODO */ +/* ./src/curses/KEY_SFIND.c */ +#define KEY_SFIND /* TODO */ +/* ./src/curses/KEY_SHELP.c */ +#define KEY_SHELP /* TODO */ +/* ./src/curses/KEY_SHOME.c */ +#define KEY_SHOME /* TODO */ +/* ./src/curses/KEY_SIX.c */ +#define KEY_SIX /* TODO */ +/* ./src/curses/KEY_SLEFT.c */ +#define KEY_SLEFT /* TODO */ +/* ./src/curses/KEY_SMESSAGE.c */ +#define KEY_SMESSAGE /* TODO */ +/* ./src/curses/KEY_SMOVE.c */ +#define KEY_SMOVE /* TODO */ +/* ./src/curses/KEY_SNEXT.c */ +#define KEY_SNEXT /* TODO */ +/* ./src/curses/KEY_SOPTIONS.c */ +#define KEY_SOPTIONS /* TODO */ +/* ./src/curses/KEY_SPREVIOUS.c */ +#define KEY_SPREVIOUS /* TODO */ +/* ./src/curses/KEY_SPRINT.c */ +#define KEY_SPRINT /* TODO */ +/* ./src/curses/KEY_SREDO.c */ +#define KEY_SREDO /* TODO */ +/* ./src/curses/KEY_SREPLACE.c */ +#define KEY_SREPLACE /* TODO */ +/* ./src/curses/KEY_SRIGHT.c */ +#define KEY_SRIGHT /* TODO */ +/* ./src/curses/KEY_SRSUME.c */ +#define KEY_SRSUME /* TODO */ +/* ./src/curses/KEY_SSAVE.c */ +#define KEY_SSAVE /* TODO */ +/* ./src/curses/KEY_SSUSPEND.c */ +#define KEY_SSUSPEND /* TODO */ +/* ./src/curses/KEY_SUNDO.c */ +#define KEY_SUNDO /* TODO */ +/* ./src/curses/KEY_SUSPEND.c */ +#define KEY_SUSPEND /* TODO */ +/* ./src/curses/KEY_UNDO.c */ +#define KEY_UNDO /* TODO */ +/* ./src/curses/PAIR_NUMBER.c */ +#define PAIR_NUMBER(__value) /* TODO */ +/* ./src/curses/WACS_BLOCK.c */ +#define WACS_BLOCK /* TODO */ +/* ./src/curses/WACS_BOARD.c */ +#define WACS_BOARD /* TODO */ +/* ./src/curses/WACS_BTEE.c */ +#define WACS_BTEE /* TODO */ +/* ./src/curses/WACS_BULLET.c */ +#define WACS_BULLET /* TODO */ +/* ./src/curses/WACS_CKBOARD.c */ +#define WACS_CKBOARD /* TODO */ +/* ./src/curses/WACS_DARROW.c */ +#define WACS_DARROW /* TODO */ +/* ./src/curses/WACS_DEGREE.c */ +#define WACS_DEGREE /* TODO */ +/* ./src/curses/WACS_DIAMOND.c */ +#define WACS_DIAMOND /* TODO */ +/* ./src/curses/WACS_HLINE.c */ +#define WACS_HLINE /* TODO */ +/* ./src/curses/WACS_LANTERN.c */ +#define WACS_LANTERN /* TODO */ +/* ./src/curses/WACS_LARROW.c */ +#define WACS_LARROW /* TODO */ +/* ./src/curses/WACS_LLCORNER.c */ +#define WACS_LLCORNER /* TODO */ +/* ./src/curses/WACS_LRCORNER.c */ +#define WACS_LRCORNER /* TODO */ +/* ./src/curses/WACS_LTEE.c */ +#define WACS_LTEE /* TODO */ +/* ./src/curses/WACS_PLMINUS.c */ +#define WACS_PLMINUS /* TODO */ +/* ./src/curses/WACS_PLUS.c */ +#define WACS_PLUS /* TODO */ +/* ./src/curses/WACS_RARROW.c */ +#define WACS_RARROW /* TODO */ +/* ./src/curses/WACS_RTEE.c */ +#define WACS_RTEE /* TODO */ +/* ./src/curses/WACS_S1.c */ +#define WACS_S1 /* TODO */ +/* ./src/curses/WACS_S9.c */ +#define WACS_S9 /* TODO */ +/* ./src/curses/WACS_TTEE.c */ +#define WACS_TTEE /* TODO */ +/* ./src/curses/WACS_UARROW.c */ +#define WACS_UARROW /* TODO */ +/* ./src/curses/WACS_ULCORNER.c */ +#define WACS_ULCORNER /* TODO */ +/* ./src/curses/WACS_URCORNER.c */ +#define WACS_URCORNER /* TODO */ +/* ./src/curses/WACS_VLINE.c */ +#define WACS_VLINE /* TODO */ +/* ./src/curses/WA_ALTCHARSET.c */ +#define WA_ALTCHARSET (1<<0) +/* ./src/curses/WA_BLINK.c */ +#define WA_BLINK (1<<1) +/* ./src/curses/WA_BOLD.c */ +#define WA_BOLD (1<<2) +/* ./src/curses/WA_DIM.c */ +#define WA_DIM (1<<3) +/* ./src/curses/WA_HORIZONTAL.c */ +#define WA_HORIZONTAL (1<<4) +/* ./src/curses/WA_INVIS.c */ +#define WA_INVIS (1<<5) +/* ./src/curses/WA_LEFT.c */ +#define WA_LEFT (1<<6) +/* ./src/curses/WA_LOW.c */ +#define WA_LOW (1<<7) +/* ./src/curses/WA_PROTECT.c */ +#define WA_PROTECT (1<<8) +/* ./src/curses/WA_REVERSE.c */ +#define WA_REVERSE (1<<9) +/* ./src/curses/WA_RIGHT.c */ +#define WA_RIGHT (1<<10) +/* ./src/curses/WA_STANDOUT.c */ +#define WA_STANDOUT (1<<11) +/* ./src/curses/WA_TOP.c */ +#define WA_TOP (1<<12) +/* ./src/curses/WA_UNDERLINE.c */ +#define WA_UNDERLINE (1<<13) +/* ./src/curses/_XOPEN_CURSES.c */ +#define _XOPEN_CURSES (_XOPEN_SOURCE) +/* ./src/curses/getbegyx.c */ +#define getbegyx(_win, _y, _x) /* TODO */ +/* ./src/curses/getmaxyx.c */ +#define getmaxyx(_win, _y, _x) /* TODO */ +/* ./src/curses/getparyx.c */ +#define getparyx(_win, _y, _x) /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && 700 <= _XOPEN_SOURCE) +/* ./src/curses/KEY_CODE_YES.c */ +#define KEY_CODE_YES (1) +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/curses/SCREEN.c */ +#ifndef __TYPE_SCREEN_DEFINED__ +#define __TYPE_SCREEN_DEFINED__ +typedef struct __SCREEN SCREEN; +#endif + +/* ./src/curses/WINDOW.c */ +#ifndef __TYPE_WINDOW_DEFINED__ +#define __TYPE_WINDOW_DEFINED__ +typedef struct __WINDOW WINDOW; +#endif + +/* ./src/curses/bool.c */ +#ifndef __TYPE_bool_DEFINED__ +#define __TYPE_bool_DEFINED__ +#if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ +typedef _Bool bool; +#else +typedef int bool; +#endif +#endif + +/* ./src/curses/chtype.c */ +#ifndef __TYPE_chtype_DEFINED__ +#define __TYPE_chtype_DEFINED__ +typedef unsigned int chtype; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/curses/attr_t.c */ +#ifndef __TYPE_attr_t_DEFINED__ +#define __TYPE_attr_t_DEFINED__ +typedef unsigned int attr_t; +#endif + +/* ./src/curses/cchar_t.c */ +#ifndef __TYPE_cchar_t_DEFINED__ +#define __TYPE_cchar_t_DEFINED__ +typedef wchar_t * cchar_t; +#endif + +/* src/stddef/wchar_t.c */ +#ifndef __TYPE_wchar_t_DEFINED__ +#define __TYPE_wchar_t_DEFINED__ +typedef int wchar_t; +#endif + +/* src/wctype/wint_t.c */ +#ifndef __TYPE_wint_t_DEFINED__ +#define __TYPE_wint_t_DEFINED__ +typedef int wint_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/curses/COLS.c */ +extern int COLS; +/* ./src/curses/LINES.c */ +extern int LINES; +/* ./src/curses/curscr.c */ +extern SCREEN *curscr; +/* ./src/curses/stdscr.c */ +extern WINDOW *stdscr; +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/curses/COLORS.c */ +extern int COLORS; +/* ./src/curses/COLOR_PAIRS.c */ +extern int COLOR_PAIRS; +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/curses/add_wchnstr.c */ +int wadd_wchnstr(WINDOW * __win, const cchar_t * __wchstr, int __n); +/* ./src/curses/addch.c */ +int waddch(WINDOW * __win, const chtype __ch); +/* ./src/curses/addchstr.c */ +int waddchstr(WINDOW * __win, const chtype * __chstr); +/* ./src/curses/attroff.c */ +int wattroff(WINDOW * __win, int __attrs); +/* ./src/curses/attron.c */ +int wattron(WINDOW * __win, int __attrs); +/* ./src/curses/attrset.c */ +int wattrset(WINDOW * __win, int __attrs); +/* ./src/curses/baudrate.c */ +int baudrate(void); +/* ./src/curses/beep.c */ +int beep(void); +/* ./src/curses/box.c */ +int box(WINDOW * __win, chtype __verch, chtype __horch); +/* ./src/curses/cbreak.c */ +int cbreak(void); +/* ./src/curses/clear.c */ +int wclear(WINDOW * __win); +/* ./src/curses/clearok.c */ +int clearok(WINDOW * __win, bool __bf); +/* ./src/curses/clrtobot.c */ +int wclrtobot(WINDOW * __win); +/* ./src/curses/clrtoeol.c */ +int wclrtoeol(WINDOW * __win); +/* ./src/curses/def_prog_mode.c */ +int def_prog_mode(void); +/* ./src/curses/def_shell_mode.c */ +int def_shell_mode(void); +/* ./src/curses/delay_output.c */ +int delay_output(int __ms); +/* ./src/curses/delch.c */ +int wdelch(WINDOW * __win); +/* ./src/curses/deleteln.c */ +int wdeleteln(WINDOW * __win); +/* ./src/curses/delwin.c */ +void delwin(WINDOW * __win); +/* ./src/curses/doupdate.c */ +int doupdate(void); +/* ./src/curses/echo.c */ +int echo(void); +/* ./src/curses/endwin.c */ +int endwin(void); +/* ./src/curses/erase.c */ +int werase(WINDOW * __win); +/* ./src/curses/erasechar.c */ +char erasechar(void); +/* ./src/curses/flash.c */ +int flash(void); +/* ./src/curses/flushinp.c */ +int flushinp(void); +/* ./src/curses/getch.c */ +int wgetch(WINDOW * __win); +/* ./src/curses/getnstr.c */ +int wgetnstr(WINDOW * __win, char * __str, int __n); +/* ./src/curses/getstr.c */ +int wgetstr(WINDOW * __win, char * __str); +/* ./src/curses/has_ic.c */ +bool has_ic(void); +/* ./src/curses/has_il.c */ +bool has_il(void); +/* ./src/curses/idlok.c */ +int idlok(WINDOW * __win, bool __bf); +/* ./src/curses/inch.c */ +chtype winch(WINDOW * __win); +/* ./src/curses/initscr.c */ +WINDOW * initscr(void); +/* ./src/curses/insch.c */ +int winsch(WINDOW * __win, chtype __ch); +/* ./src/curses/insertln.c */ +int winsertln(WINDOW * __win); +/* ./src/curses/intrflush.c */ +int intrflush(WINDOW * __win, bool __bf); +/* ./src/curses/keypad.c */ +int keypad(WINDOW * __win, bool __bf); +/* ./src/curses/killchar.c */ +char killchar(void); +/* ./src/curses/leaveok.c */ +int leaveok(WINDOW * __win, bool __bf); +/* ./src/curses/longname.c */ +char * longname(void); +/* ./src/curses/move.c */ +int wmove(WINDOW * __win, int __y, int __x); +/* ./src/curses/mvprintw.c */ +int mvprintw(int __y, int __x, const char * __fmt, ...); +/* ./src/curses/mvscanw.c */ +int mvscanw(int __y, int __x, const char * __fmt, ...); +/* ./src/curses/mvwin.c */ +int mvwin(WINDOW * __win, int __y, int __x); +/* ./src/curses/mvwprintw.c */ +int mvwprintw(WINDOW * __win, int __y, int __x, const char * __fmt, ...); +/* ./src/curses/mvwscanw.c */ +int mvwscanw(WINDOW * __win, int __y, int __x, const char * __fmt, ...); +/* ./src/curses/newpad.c */ +WINDOW * newpad(int __nlines, int __ncols); +/* ./src/curses/newterm.c */ +SCREEN * newterm(const char * __type, FILE * __outfile, FILE * __infile); +/* ./src/curses/newwin.c */ +WINDOW * newwin(int __nlines, int __ncols, int __begin_y, int __begin_x); +/* ./src/curses/nl.c */ +int nl(void); +/* ./src/curses/nocbreak.c */ +int nocbreak(void); +/* ./src/curses/nodelay.c */ +int nodelay(WINDOW * __win, bool __bf); +/* ./src/curses/noecho.c */ +int noecho(void); +/* ./src/curses/nonl.c */ +int nonl(void); +/* ./src/curses/noraw.c */ +int noraw(void); +/* ./src/curses/overlay.c */ +int overlay(const WINDOW * __srcwin, WINDOW * __dstwin); +/* ./src/curses/overwrite.c */ +int overwrite(const WINDOW * __srcwin, WINDOW * __dstwin); +/* ./src/curses/pnoutrefresh.c */ +int pnoutrefresh(WINDOW * __pad, int __pminrow, int __pmincol, int __sminrow, int __smincol, int __smaxrow, int __smaxcol); +/* ./src/curses/prefresh.c */ +int prefresh(WINDOW * __pad, int __pminrow, int __pmincol, int __sminrow, int __smincol, int __smaxrow, int __smaxcol); +/* ./src/curses/printw.c */ +int printw(const char * __fmt, ...); +/* ./src/curses/raw.c */ +int raw(void); +/* ./src/curses/refresh.c */ +int wrefresh(WINDOW * __win); +/* ./src/curses/reset_prog_mode.c */ +int reset_prog_mode(void); +/* ./src/curses/reset_shell_mode.c */ +int reset_shell_mode(void); +/* ./src/curses/resetty.c */ +int resetty(void); +/* ./src/curses/savetty.c */ +int savetty(void); +/* ./src/curses/scanw.c */ +int scanw(const char * __fmt, ...); +/* ./src/curses/scrollok.c */ +int scrollok(WINDOW * __win, bool __bf); +/* ./src/curses/set_term.c */ +SCREEN * set_term(SCREEN * __new); +/* ./src/curses/setscrreg.c */ +int wsetscrreg(WINDOW * __win, int __top, int __bot); +/* ./src/curses/standend.c */ +int wstandend(WINDOW * __win); +/* ./src/curses/standout.c */ +int wstandout(WINDOW * __win); +/* ./src/curses/subwin.c */ +WINDOW * subwin(WINDOW * __orig, int __nlines, int __ncols, int __begin_y, int __begin_x); +/* ./src/curses/touchwin.c */ +int touchwin(WINDOW * __win); +/* ./src/curses/typeahead.c */ +int typeahead(int __fildes); +/* ./src/curses/wnoutrefresh.c */ +int wnoutrefresh(WINDOW * __win); +/* ./src/curses/wprintw.c */ +int wprintw(WINDOW * __win, const char * __fmt, ...); +/* ./src/curses/wscanw.c */ +int wscanw(WINDOW * __win, const char * __fmt, ...); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/curses/add_wch.c */ +int wadd_wch(WINDOW * __win, const cchar_t * __wch); +/* ./src/curses/add_wchstr.c */ +int wadd_wchstr(WINDOW * __win, const cchar_t * __wchstr); +/* ./src/curses/addchnstr.c */ +int waddchnstr(WINDOW * __win, const chtype * __chstr, int __n); +/* ./src/curses/addnstr.c */ +int waddnstr(WINDOW * __win, const char * __str, int __n); +/* ./src/curses/addnwstr.c */ +int waddnwstr(WINDOW * __win, const wchar_t * __wstr, int __n); +/* ./src/curses/addstr.c */ +int waddstr(WINDOW *__win, const char * __str); +/* ./src/curses/addwstr.c */ +int waddwstr(WINDOW * __win, const wchar_t * __wstr); +/* ./src/curses/attr_get.c */ +int wattr_get(WINDOW * __win, attr_t * __attrs, short * __color_pair_number, void * __opts); +/* ./src/curses/attr_off.c */ +int wattr_off(WINDOW * __win, attr_t __attrs, void * __opts); +/* ./src/curses/attr_on.c */ +int wattr_on(WINDOW * __win, attr_t __attrs, void * __opts); +/* ./src/curses/attr_set.c */ +int wattr_set(WINDOW * __win, attr_t __attrs, short __color_pair_number, void * __opts); +/* ./src/curses/bkgd.c */ +int wbkgd(WINDOW * __win, chtype __ch); +/* ./src/curses/bkgdset.c */ +void wbkgdset(WINDOW * __win, chtype __ch); +/* ./src/curses/bkgrnd.c */ +int wbkgrnd(WINDOW * __win, const cchar_t * __wch); +/* ./src/curses/bkgrndset.c */ +void wbkgrndset(WINDOW * __win, const cchar_t * __wch); +/* ./src/curses/border.c */ +int wborder(WINDOW * __win, chtype __ls, chtype __rs, chtype __ts, chtype __bs, chtype __tl, chtype __tr, chtype __bl, chtype __br); +/* ./src/curses/border_set.c */ +int wborder_set(WINDOW * __win, const cchar_t * __ls, const cchar_t * __rs, const cchar_t * __ts, const cchar_t * __bs, const cchar_t * __tl, const cchar_t * __tr, const cchar_t * __bl, const cchar_t * __br); +/* ./src/curses/box_set.c */ +int box_set(WINDOW * __win, const cchar_t * __verch, const cchar_t * __horch); +/* ./src/curses/can_change_color.c */ +bool can_change_color(void); +/* ./src/curses/chgat.c */ +int wchgat(WINDOW * __win, int __n, attr_t __attr, short __color, const void * __opts); +/* ./src/curses/color_content.c */ +int color_content(short __color, short * __red, short * __green, short * __blue); +/* ./src/curses/color_set.c */ +int wcolor_set(WINDOW * __win, short __color_pair_number, void * __opts); +/* ./src/curses/copywin.c */ +int copywin(const WINDOW * __srcwin, WINDOW * __dstwin, int __sminrow, int __smincol, int __dminrow, int __dmincol, int __dmaxrow, int __dmaxcol, int __overlay); +/* ./src/curses/curs_set.c */ +int curs_set(int __visibility); +/* ./src/curses/delscreen.c */ +void delscreen(SCREEN * __sp); +/* ./src/curses/derwin.c */ +WINDOW * derwin(WINDOW * __orig, int __nlines, int __ncols, int __begin_y, int __begin_x); +/* ./src/curses/dupwin.c */ +WINDOW * dupwin(WINDOW * __win); +/* ./src/curses/echo_wchar.c */ +int wecho_wchar(WINDOW * __win, const cchar_t * __wch); +/* ./src/curses/echochar.c */ +int wechochar(WINDOW * __win, const chtype __wch); +/* ./src/curses/erasewchar.c */ +int erasewchar(wchar_t * __ch); +/* ./src/curses/filter.c */ +void filter(void); +/* ./src/curses/get_wch.c */ +int wget_wch(WINDOW * __win, wint_t * __ch); +/* ./src/curses/get_wstr.c */ +int wget_wstr(WINDOW * __win, wint_t * __wstr); +/* ./src/curses/getbkgd.c */ +chtype getbkgd(WINDOW * __win); +/* ./src/curses/getbkgrnd.c */ +chtype wgetbkgrnd(WINDOW * __win, cchar_t * __wch); +/* ./src/curses/getcchar.c */ +int getcchar(const cchar_t * __wcval, wchar_t * __wch, attr_t * __attrs, short * __color_pair, void * __opts); +/* ./src/curses/getn_wstr.c */ +int wgetn_wstr(WINDOW * __win, wint_t * __wstr, int __n); +/* ./src/curses/getwin.c */ +WINDOW * getwin(FILE * __filep); +/* ./src/curses/halfdelay.c */ +int halfdelay(int __tenths); +/* ./src/curses/has_colors.c */ +bool has_colors(void); +/* ./src/curses/hline.c */ +int whline(WINDOW * __win, chtype __ch, int __n); +/* ./src/curses/hline_set.c */ +int whline_set(WINDOW * __win, const cchar_t * __wch, int __n); +/* ./src/curses/idcok.c */ +void idcok(WINDOW * __win, bool __bf); +/* ./src/curses/immedok.c */ +void immedok(WINDOW * __win, bool __bf); +/* ./src/curses/in_wch.c */ +int win_wch(WINDOW * __win, cchar_t * __wcval); +/* ./src/curses/in_wchnstr.c */ +int win_wchnstr(WINDOW * __win, cchar_t * __wcstr, int __n); +/* ./src/curses/in_wchstr.c */ +int win_wchstr(WINDOW * __win, cchar_t * __wcstr); +/* ./src/curses/inchnstr.c */ +int winchnstr(WINDOW * __win, chtype * __chstr, int __n); +/* ./src/curses/inchstr.c */ +int winchstr(WINDOW * __win, chtype * __chstr); +/* ./src/curses/init_color.c */ +int init_color(short __color, short __red, short __green, short __blue); +/* ./src/curses/init_pair.c */ +int init_pair(short __pai, short __f, short __b); +/* ./src/curses/innstr.c */ +int winnstr(WINDOW * __win, char * __str, int __n); +/* ./src/curses/innwstr.c */ +int winnwstr(WINDOW * __win, wchar_t * __wstr, int __n); +/* ./src/curses/ins_nwstr.c */ +int ins_nwstr(WINDOW * __win, const wchar_t * __wstr, int __n); +/* ./src/curses/ins_wch.c */ +int ins_wch(WINDOW * __win, const cchar_t * __wch); +/* ./src/curses/ins_wstr.c */ +int ins_wstr(WINDOW * __win, const wchar_t * __wstr); +/* ./src/curses/insdelln.c */ +int winsdelln(WINDOW * __win, int __n); +/* ./src/curses/insnstr.c */ +int winsnstr(WINDOW * __win, const char * __str, int __n); +/* ./src/curses/insstr.c */ +int winsstr(WINDOW * __win, const char * __str); +/* ./src/curses/instr.c */ +int winstr(WINDOW * __win, char * __str); +/* ./src/curses/inwstr.c */ +int winwstr(WINDOW * __win, wchar_t * __wstr); +/* ./src/curses/is_linetouched.c */ +bool is_linetouched(WINDOW * __win, int __line); +/* ./src/curses/is_wintouched.c */ +bool is_wintouched(WINDOW * __win); +/* ./src/curses/isendwin.c */ +bool isendwin(void); +/* ./src/curses/key_name.c */ +char * key_name(wchar_t __c); +/* ./src/curses/keyname.c */ +char * keyname(int __c); +/* ./src/curses/killwchar.c */ +int killwchar(wchar_t * __ch); +/* ./src/curses/meta.c */ +int meta(WINDOW * __win, bool __bf); +/* ./src/curses/mvcur.c */ +int mvcur(int __oldrow, int __oldcol, int __newrow, int __newcol); +/* ./src/curses/mvderwin.c */ +WINDOW * mvderwin(WINDOW * __orig, int __par_y, int __par_x); +/* ./src/curses/napms.c */ +int napms(int __ms); +/* ./src/curses/noqiflush.c */ +void noqiflush(void); +/* ./src/curses/notimeout.c */ +int notimeout(WINDOW * __win, bool __bf); +/* ./src/curses/pair_content.c */ +int pair_content(short __pair, short * __f, short * __b); +/* ./src/curses/pecho_wchar.c */ +int pecho_wchar(WINDOW * __pad, const cchar_t * __wch); +/* ./src/curses/pechochar.c */ +int pechochar(WINDOW * __pad, chtype __ch); +/* ./src/curses/putwin.c */ +int putwin(WINDOW * __win, FILE * __filep); +/* ./src/curses/qiflush.c */ +void qiflush(void); +/* ./src/curses/redrawwin.c */ +int redrawwin(WINDOW * __win); +/* ./src/curses/ripoffline.c */ +int ripoffline(int __line, int (*__init)(WINDOW * __win, int __columns)); +/* ./src/curses/scr_dump.c */ +int scr_dump(const char * __filename); +/* ./src/curses/scr_init.c */ +int scr_init(const char * __filename); +/* ./src/curses/scr_restore.c */ +int scr_restore(const char * __filename); +/* ./src/curses/scr_set.c */ +int scr_set(const char * __filename); +/* ./src/curses/scrl.c */ +int wscrl(WINDOW * __win, int __n); +/* ./src/curses/setcchar.c */ +int setcchar(cchar_t * __wcval, const wchar_t * __wch, const attr_t __attrs, short __color_pair, const void * __opts); +/* ./src/curses/slk_attr_off.c */ +int slk_attr_off(const chtype __attrs, void * __opts); +/* ./src/curses/slk_attr_on.c */ +int slk_attr_on(const chtype __attrs, void * __opts); +/* ./src/curses/slk_attr_set.c */ +int slk_attr_set(const chtype __attrs, short __color_pair_number, void * __opts); +/* ./src/curses/slk_attroff.c */ +int slk_attroff(const chtype __attrs); +/* ./src/curses/slk_attron.c */ +int slk_attron(const chtype __attrs); +/* ./src/curses/slk_attrset.c */ +int slk_attrset(const chtype __attrs); +/* ./src/curses/slk_clear.c */ +int slk_clear(void); +/* ./src/curses/slk_color.c */ +int slk_color(short __color_pair_number); +/* ./src/curses/slk_init.c */ +int slk_init(int __fmt); +/* ./src/curses/slk_label.c */ +char * slk_label(int __labnum); +/* ./src/curses/slk_noutrefresh.c */ +int slk_noutrefresh(void); +/* ./src/curses/slk_refresh.c */ +int slk_refresh(void); +/* ./src/curses/slk_restore.c */ +int slk_restore(void); +/* ./src/curses/slk_set.c */ +int slk_set(int __labnum, const char * __label, int __justify); +/* ./src/curses/slk_touch.c */ +int slk_touch(void); +/* ./src/curses/slk_wset.c */ +int slk_wset(int __labnum, const wchar_t * __label, int __justify); +/* ./src/curses/start_color.c */ +int start_color(void); +/* ./src/curses/subpad.c */ +WINDOW * subpad(WINDOW * __orig, int __nlines, int __ncols, int __begin_y, int __begin_x); +/* ./src/curses/syncok.c */ +int syncok(WINDOW * __win, bool __bf); +/* ./src/curses/term_attrs.c */ +attr_t terma_ttrs(void); +/* ./src/curses/termattrs.c */ +chtype termattrs(void); +/* ./src/curses/termname.c */ +char * termname(void); +/* ./src/curses/timeout.c */ +void wtimeout(int __delay); +/* ./src/curses/touchline.c */ +int touchline(WINDOW * __win, int __start, int __count); +/* ./src/curses/unget_wch.c */ +int unget_wch(const wchar_t __wch); +/* ./src/curses/ungetch.c */ +int ungetch(int __ch); +/* ./src/curses/untouchwin.c */ +int untouchwin(WINDOW * __win); +/* ./src/curses/use_env.c */ +void use_env(bool __boolval); +/* ./src/curses/vid_attr.c */ +int vid_ttr(attr_t __attr, short __color_pair_number, void * __opt); +/* ./src/curses/vid_puts.c */ +int vid_puts(attr_t __attr, short __color_pair_number, void * __opt, int (*__putfunc)(int)); +/* ./src/curses/vidattr.c */ +int vidattr(chtype __attr); +/* ./src/curses/vidputs.c */ +int vidputs(chtype __attr, int (*__putfunc)(int)); +/* ./src/curses/vline.c */ +int wvline(WINDOW * __win, chtype __ch, int __n); +/* ./src/curses/vline_set.c */ +int wvline_set(WINDOW * __win, const cchar_t * __wch, int __n); +/* ./src/curses/vw_printw.c */ +int vw_printw(WINDOW * __win, const char * __fmt, va_list __varglist); +/* ./src/curses/vw_scanw.c */ +int vw_scanw(WINDOW * __win, const char * __fmt, va_list __varglist); +/* ./src/curses/wcursyncup.c */ +void wcursyncup(WINDOW * __win); +/* ./src/curses/wredrawln.c */ +int wredrawln(WINDOW * __win, int __beg_line, int __num_lines); +/* ./src/curses/wsyncdown.c */ +void wsyncdown(WINDOW * __win); +/* ./src/curses/wsyncup.c */ +void wsyncup(WINDOW * __win); +/* ./src/curses/wtouchln.c */ +int wtouchln(WINDOW * __win, int __y, int __x, int __changed); +/* ./src/curses/wunctrl.c */ +wchar_t * wunctrl(cchar_t * __wc); +#endif + + +#endif diff --git a/dirent.h b/dirent.h new file mode 100644 index 0000000..8055968 --- /dev/null +++ b/dirent.h @@ -0,0 +1,90 @@ +#ifndef __DIRENT_H__ +#define __DIRENT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/dirent/DIR.c */ +#ifndef __TYPE_DIR_DEFINED__ +#define __TYPE_DIR_DEFINED__ +typedef struct __DIR DIR; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/dirent/struct_dirent.c */ +#ifndef __TYPE_struct_dirent_DEFINED__ +#define __TYPE_struct_dirent_DEFINED__ +struct dirent { + #if (defined _XOPEN_SOURCE) + ino_t d_ino; + #else + unsigned long long int __padding; + #endif + char d_name[]; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/dirent/closedir.c */ +int closedir(DIR *__dirp); +/* ./src/dirent/opendir.c */ +DIR * opendir(const char * __dirname); +/* ./src/dirent/readdir.c */ +struct dirent * readdir(DIR * __dirp); +/* ./src/dirent/rewinddir.c */ +void rewinddir(DIR * __dirp); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/dirent/seekdir.c */ +void seekdir(DIR * __dirp, long __loc); +/* ./src/dirent/telldir.c */ +long telldir(DIR * __dirp); +#endif + + +#endif diff --git a/errno.h b/errno.h new file mode 100644 index 0000000..b83bed7 --- /dev/null +++ b/errno.h @@ -0,0 +1,235 @@ +#ifndef __ERRNO_H__ +#define __ERRNO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/errno/EDOM.c */ +#define EDOM (1) +/* ./src/errno/ERANGE.c */ +#define ERANGE (2) +/* ./src/errno/errno.c */ +#define errno (*__errno()) + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/errno/EILSEQ.c */ +#define EILSEQ (3) +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/errno/E2BIG.c */ +#define E2BIG (10) +/* ./src/errno/EACCES.c */ +#define EACCES (11) +/* ./src/errno/EAGAIN.c */ +#define EAGAIN (12) +/* ./src/errno/EBADF.c */ +#define EBADF (13) +/* ./src/errno/EBUSY.c */ +#define EBUSY (14) +/* ./src/errno/ECHILD.c */ +#define ECHILD (15) +/* ./src/errno/EDEADLK.c */ +#define EDEADLK (16) +/* ./src/errno/EEXIST.c */ +#define EEXIST (17) +/* ./src/errno/EFAULT.c */ +#define EFAULT (18) +/* ./src/errno/EFBIG.c */ +#define EFBIG (19) +/* ./src/errno/EINTR.c */ +#define EINTR (20) +/* ./src/errno/EINVAL.c */ +#define EINVAL (21) +/* ./src/errno/EIO.c */ +#define EIO (22) +/* ./src/errno/EISDIR.c */ +#define EISDIR (23) +/* ./src/errno/EMFILE.c */ +#define EMFILE (24) +/* ./src/errno/EMLINK.c */ +#define EMLINK (25) +/* ./src/errno/ENAMETOOLONG.c */ +#define ENAMETOOLONG (26) +/* ./src/errno/ENFILE.c */ +#define ENFILE (27) +/* ./src/errno/ENODEV.c */ +#define ENODEV (28) +/* ./src/errno/ENOENT.c */ +#define ENOENT (29) +/* ./src/errno/ENOEXEC.c */ +#define ENOEXEC (30) +/* ./src/errno/ENOLCK.c */ +#define ENOLCK (31) +/* ./src/errno/ENOMEM.c */ +#define ENOMEM (32) +/* ./src/errno/ENOSPC.c */ +#define ENOSPC (33) +/* ./src/errno/ENOSYS.c */ +#define ENOSYS (34) +/* ./src/errno/ENOTDIR.c */ +#define ENOTDIR (35) +/* ./src/errno/ENOTEMPTY.c */ +#define ENOTEMPTY (36) +/* ./src/errno/ENOTTY.c */ +#define ENOTTY (37) +/* ./src/errno/ENXIO.c */ +#define ENXIO (38) +/* ./src/errno/EPERM.c */ +#define EPERM (39) +/* ./src/errno/EPIPE.c */ +#define EPIPE (40) +/* ./src/errno/EROFS.c */ +#define EROFS (41) +/* ./src/errno/ESRCH.c */ +#define ESRCH (43) +/* ./src/errno/EXDEV.c */ +#define EXDEV (44) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/errno/ECANCELED.c */ +#define ECANCELED (20) +/* ./src/errno/ENOTSUP.c */ +#define ENOTSUP (68) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/errno/EBADMSG.c */ +#define EBADMSG (18) +/* ./src/errno/EINPROGRESS.c */ +#define EINPROGRESS (33) +/* ./src/errno/EMSGSIZE.c */ +#define EMSGSIZE (42) +#endif + +#if (defined _POSIX_C_SOURCE && 199506 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/errno/ETIMEDOUT.c */ +#define ETIMEDOUT (84) +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/errno/EIDRM.c */ +#define EIDRM (32) +/* ./src/errno/ENOMSG.c */ +#define ENOMSG (57) +/* ./src/errno/ETXTBSY.c */ +#define ETXTBSY (85) +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/errno/EADDRINUSE.c */ +#define EADDRINUSE (12) +/* ./src/errno/EADDRNOTAVAIL.c */ +#define EADDRNOTAVAIL (13) +/* ./src/errno/EAFNOSUPPORT.c */ +#define EAFNOSUPPORT (14) +/* ./src/errno/EALREADY.c */ +#define EALREADY (16) +/* ./src/errno/ECONNABORTED.c */ +#define ECONNABORTED (22) +/* ./src/errno/ECONNREFUSED.c */ +#define ECONNREFUSED (23) +/* ./src/errno/ECONNRESET.c */ +#define ECONNRESET (24) +/* ./src/errno/EDESTADDRREQ.c */ +#define EDESTADDRREQ (26) +/* ./src/errno/EDQUOT.c */ +#define EDQUOT (27) +/* ./src/errno/EHOSTUNREACH.c */ +#define EHOSTUNREACH (31) +/* ./src/errno/EISCONN.c */ +#define EISCONN (37) +/* ./src/errno/ELOOP.c */ +#define ELOOP (39) +/* ./src/errno/EMULTIHOP.c */ +#define EMULTIHOP (43) +/* ./src/errno/ENETDOWN.c */ +#define ENETDOWN (45) +/* ./src/errno/ENETUNREACH.c */ +#define ENETUNREACH (47) +/* ./src/errno/ENOBUFS.c */ +#define ENOBUFS (49) +/* ./src/errno/ENOLINK.c */ +#define ENOLINK (55) +/* ./src/errno/ENOPROTOOPT.c */ +#define ENOPROTOOPT (58) +/* ./src/errno/ENOTCONN.c */ +#define ENOTCONN (63) +/* ./src/errno/ENOTSOCK.c */ +#define ENOTSOCK (67) +/* ./src/errno/EOPNOTSUPP.c */ +#define EOPNOTSUPP (71) +/* ./src/errno/EPROTO.c */ +#define EPROTO (76) +/* ./src/errno/EPROTONOSUPPORT.c */ +#define EPROTONOSUPPORT (77) +/* ./src/errno/EPROTOTYPE.c */ +#define EPROTOTYPE (78) +/* ./src/errno/ESTALE.c */ +#define ESTALE (82) +/* ./src/errno/EWOULDBLOCK.c */ +#define EWOULDBLOCK (86) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/errno/ENODATA.c */ +#define ENODATA (50) +/* ./src/errno/ENOSR.c */ +#define ENOSR (60) +/* ./src/errno/ENOSTR.c */ +#define ENOSTR (61) +/* ./src/errno/EOVERFLOW.c */ +#define EOVERFLOW (72) +/* ./src/errno/ETIME.c */ +#define ETIME (83) +#endif + +/* ./src/errno/__errno.c */ +int *__errno(void); + + +#endif diff --git a/fcntl.h b/fcntl.h new file mode 100644 index 0000000..501cd38 --- /dev/null +++ b/fcntl.h @@ -0,0 +1,162 @@ +#ifndef __FCNTL_H__ +#define __FCNTL_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/fcntl/FD_CLOEXEC.c */ +#define FD_CLOEXEC (1) +/* ./src/fcntl/F_DUPFD.c */ +#define F_DUPFD (1) +/* ./src/fcntl/F_GETFD.c */ +#define F_GETFD (3) +/* ./src/fcntl/F_GETFL.c */ +#define F_GETFL (5) +/* ./src/fcntl/F_GETLK.c */ +#define F_GETLK (7) +/* ./src/fcntl/F_RDLCK.c */ +#define F_RDLCK (1) +/* ./src/fcntl/F_SETFD.c */ +#define F_SETFD (4) +/* ./src/fcntl/F_SETFL.c */ +#define F_SETFL (6) +/* ./src/fcntl/F_SETLK.c */ +#define F_SETLK (8) +/* ./src/fcntl/F_SETLKW.c */ +#define F_SETLKW (9) +/* ./src/fcntl/F_UNLCK.c */ +#define F_UNLCK (2) +/* ./src/fcntl/F_WRLCK.c */ +#define F_WRLCK (3) +/* ./src/fcntl/O_ACCMODE.c */ +#define O_ACCMODE (O_EXEC|O_RDONLY|O_RDWR|O_SEARCH|O_WRONLY) +/* ./src/fcntl/O_APPEND.c */ +#define O_APPEND (1<<8) +/* ./src/fcntl/O_CREAT.c */ +#define O_CREAT (1<<1) +/* ./src/fcntl/O_EXCL.c */ +#define O_EXCL (1<<3) +/* ./src/fcntl/O_NOCTTY.c */ +#define O_NOCTTY (1<<4) +/* ./src/fcntl/O_NONBLOCK.c */ +#define O_NONBLOCK (1<<10) +/* ./src/fcntl/O_RDONLY.c */ +#define O_RDONLY (1<<14) +/* ./src/fcntl/O_RDWR.c */ +#define O_RDWR (1<<15) +/* ./src/fcntl/O_TRUNC.c */ +#define O_TRUNC (1<<6) +/* ./src/fcntl/O_WRONLY.c */ +#define O_WRONLY (1<<17) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/fcntl/O_DSYNC.c */ +#define O_DSYNC (1<<9) +/* ./src/fcntl/O_RSYNC.c */ +#define O_RSYNC (1<<11) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/fcntl/O_SYNC.c */ +#define O_SYNC (1<<12) +#endif + +#if (defined _XOPEN_SOURCE) +/* src/stdio/SEEK_CUR.c */ +#define SEEK_CUR (1) +/* src/stdio/SEEK_END.c */ +#define SEEK_END (2) +/* src/stdio/SEEK_SET.c */ +#define SEEK_SET (3) +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/mode_t.c */ +#ifndef __TYPE_mode_t_DEFINED__ +#define __TYPE_mode_t_DEFINED__ +typedef unsigned long int mode_t; +#endif + +/* src/sys/types/off_t.c */ +#ifndef __TYPE_off_t_DEFINED__ +#define __TYPE_off_t_DEFINED__ +typedef long int + off_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/fcntl/struct_flock.c */ +#ifndef __TYPE_struct_flock_DEFINED__ +#define __TYPE_struct_flock_DEFINED__ +struct flock { + short l_type; + short l_whence; + off_t l_start; + off_t l_len; + pid_t l_pid; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/fcntl/creat.c */ +int creat(const char *__path, mode_t __mode); +/* ./src/fcntl/fcntl.c */ +int fcntl(int __fildes, int __cmd, ...); +/* ./src/fcntl/open.c */ +int open(const char *__path, int __oflag, ...); +#endif + + +#endif diff --git a/fenv.h b/fenv.h new file mode 100644 index 0000000..6a5859e --- /dev/null +++ b/fenv.h @@ -0,0 +1,96 @@ +#ifndef __FENV_H__ +#define __FENV_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/fenv/FE_ALL_EXCEPT.c */ +#define FE_ALL_EXCEPT (FE_DIVBYZERO|FE_INEXACT|FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW) +/* ./src/fenv/FE_DFL_ENV.c */ +#define FE_DFL_ENV ((const fenv_t*)FE_DFL_ENV) +/* ./src/fenv/FE_DIVBYZERO.c */ +#define FE_DIVBYZERO (1<<0) +/* ./src/fenv/FE_DOWNWARD.c */ +#define FE_DOWNWARD (3) +/* ./src/fenv/FE_INEXACT.c */ +#define FE_INEXACT (1<<1) +/* ./src/fenv/FE_INVALID.c */ +#define FE_INVALID (1<<2) +/* ./src/fenv/FE_OVERFLOW.c */ +#define FE_OVERFLOW (1<<3) +/* ./src/fenv/FE_TONEAREST.c */ +#define FE_TONEAREST (1) +/* ./src/fenv/FE_TOWARDZERO.c */ +#define FE_TOWARDZERO (0) +/* ./src/fenv/FE_UNDERFLOW.c */ +#define FE_UNDERFLOW (1<<4) +/* ./src/fenv/FE_UPWARD.c */ +#define FE_UPWARD (2) +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/fenv/fenv_t.c */ +#ifndef __TYPE_fenv_t_DEFINED__ +#define __TYPE_fenv_t_DEFINED__ +typedef unsigned long long int fenv_t; +#endif + +/* ./src/fenv/fexcept_t.c */ +#ifndef __TYPE_fexcept_t_DEFINED__ +#define __TYPE_fexcept_t_DEFINED__ +typedef unsigned long long int fexcept_t; +#endif + +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/fenv/feclearexcept.c */ +int feclearexcept(int __excepts); +/* ./src/fenv/fegetenv.c */ +int fegetenv(fenv_t *__envp); +/* ./src/fenv/fegetexceptflag.c */ +int fegetexceptflag(fexcept_t *__flagp, int __excepts); +/* ./src/fenv/fegetround.c */ +int fegetround(void); +/* ./src/fenv/feholdexcept.c */ +int feholdexcept(fenv_t *__envp); +/* ./src/fenv/feraiseexcept.c */ +int feraiseexcept(int __excepts); +/* ./src/fenv/fesetenv.c */ +int fesetenv(const fenv_t *__envp); +/* ./src/fenv/fesetexceptflag.c */ +int fesetexceptflag(const fexcept_t *__flagp, int __excepts); +/* ./src/fenv/fesetround.c */ +int fesetround(int __round); +/* ./src/fenv/fetestexcept.c */ +int fetestexcept(int __excepts); +/* ./src/fenv/feupdateenv.c */ +int feupdateenv(const fenv_t *__envp); +#endif + + +#endif diff --git a/float.h b/float.h new file mode 100644 index 0000000..e478b02 --- /dev/null +++ b/float.h @@ -0,0 +1,97 @@ +#ifndef __FLOAT_H__ +#define __FLOAT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/* ./src/float/DBL_DIG.c */ +#define DBL_DIG (15) +/* ./src/float/DBL_EPSILON.c */ +#define DBL_EPSILON (2.220446E-16) +/* ./src/float/DBL_MANT_DIG.c */ +#define DBL_MANT_DIG (53) +/* ./src/float/DBL_MAX.c */ +#define DBL_MAX (1.797693E+308) +/* ./src/float/DBL_MAX_10_EXP.c */ +#define DBL_MAX_10_EXP (308) +/* ./src/float/DBL_MAX_EXP.c */ +#define DBL_MAX_EXP (1024) +/* ./src/float/DBL_MIN.c */ +#define DBL_MIN (2.225074E-308) +/* ./src/float/DBL_MIN_10_EXP.c */ +#define DBL_MIN_10_EXP (-307) +/* ./src/float/DBL_MIN_EXP.c */ +#define DBL_MIN_EXP (-1021) +/* ./src/float/FLT_DIG.c */ +#define FLT_DIG (6) +/* ./src/float/FLT_EPSILON.c */ +#define FLT_EPSILON (1.192093E-07) +/* ./src/float/FLT_MANT_DIG.c */ +#define FLT_MANT_DIG (24) +/* ./src/float/FLT_MAX.c */ +#define FLT_MAX (3.402823E+38) +/* ./src/float/FLT_MAX_10_EXP.c */ +#define FLT_MAX_10_EXP (38) +/* ./src/float/FLT_MAX_EXP.c */ +#define FLT_MAX_EXP (128) +/* ./src/float/FLT_MIN.c */ +#define FLT_MIN (1.175494E-38) +/* ./src/float/FLT_MIN_10_EXP.c */ +#define FLT_MIN_10_EXP (-37) +/* ./src/float/FLT_MIN_EXP.c */ +#define FLT_MIN_EXP (-125) +/* ./src/float/FLT_RADIX.c */ +#define FLT_RADIX (2) +/* ./src/float/FLT_ROUNDS.c */ +#define FLT_ROUNDS fegetround() +/* ./src/float/LDBL_DIG.c */ +#define LDBL_DIG (15) +/* ./src/float/LDBL_EPSILON.c */ +#define LDBL_EPSILON (2.220446E-16) +/* ./src/float/LDBL_MANT_DIG.c */ +#define LDBL_MANT_DIG (53) +/* ./src/float/LDBL_MAX.c */ +#define LDBL_MAX (1.797693E+308) +/* ./src/float/LDBL_MAX_10_EXP.c */ +#define LDBL_MAX_10_EXP (308) +/* ./src/float/LDBL_MAX_EXP.c */ +#define LDBL_MAX_EXP (1024) +/* ./src/float/LDBL_MIN.c */ +#define LDBL_MIN (2.225074E-308) +/* ./src/float/LDBL_MIN_10_EXP.c */ +#define LDBL_MIN_10_EXP (-37) +/* ./src/float/LDBL_MIN_EXP.c */ +#define LDBL_MIN_EXP (-1021) + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/float/DECIMAL_DIG.c */ +#define DECIMAL_DIG (10) +/* ./src/float/FLT_EVAL_METHOD.c */ +#define FLT_EVAL_METHOD (-1) +#endif + + +#endif diff --git a/fmtmsg.h b/fmtmsg.h new file mode 100644 index 0000000..5ba459e --- /dev/null +++ b/fmtmsg.h @@ -0,0 +1,89 @@ +#ifndef __FMTMSG_H__ +#define __FMTMSG_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/fmtmsg/MM_APPL.c */ +#define MM_APPL 3 +/* ./src/fmtmsg/MM_CONSOLE.c */ +#define MM_CONSOLE 14 +/* ./src/fmtmsg/MM_ERROR.c */ +#define MM_ERROR 9 +/* ./src/fmtmsg/MM_FIRM.c */ +#define MM_FIRM 2 +/* ./src/fmtmsg/MM_HALT.c */ +#define MM_HALT 8 +/* ./src/fmtmsg/MM_HARD.c */ +#define MM_HARD 0 +/* ./src/fmtmsg/MM_INFO.c */ +#define MM_INFO 11 +/* ./src/fmtmsg/MM_NOCON.c */ +#define MM_NOCON 3 +/* ./src/fmtmsg/MM_NOMSG.c */ +#define MM_NOMSG 2 +/* ./src/fmtmsg/MM_NOSEV.c */ +#define MM_NOSEV 12 +/* ./src/fmtmsg/MM_NOTOK.c */ +#define MM_NOTOK 1 +/* ./src/fmtmsg/MM_NRECOV.c */ +#define MM_NRECOV 7 +/* ./src/fmtmsg/MM_NULLACT.c */ +#define MM_NULLACT (char*)0 +/* ./src/fmtmsg/MM_NULLLBL.c */ +#define MM_NULLLBL (char*)0 +/* ./src/fmtmsg/MM_NULLMC.c */ +#define MM_NULLMC 0L +/* ./src/fmtmsg/MM_NULLSEV.c */ +#define MM_NULLSEV 0 +/* ./src/fmtmsg/MM_NULLTAG.c */ +#define MM_NULLTAG (char*)0 +/* ./src/fmtmsg/MM_NULLTXT.c */ +#define MM_NULLTXT (char*)0 +/* ./src/fmtmsg/MM_OK.c */ +#define MM_OK 0 +/* ./src/fmtmsg/MM_OPSYS.c */ +#define MM_OPSYS 5 +/* ./src/fmtmsg/MM_PRINT.c */ +#define MM_PRINT 13 +/* ./src/fmtmsg/MM_RECOVER.c */ +#define MM_RECOVER 6 +/* ./src/fmtmsg/MM_SOFT.c */ +#define MM_SOFT 1 +/* ./src/fmtmsg/MM_UTIL.c */ +#define MM_UTIL 4 +/* ./src/fmtmsg/MM_WARNING.c */ +#define MM_WARNING 10 +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/fmtmsg/fmtmsg.c */ +int fmtmsg(long __classification, const char * __label, int __severity, const char * __text, const char * __action, const char * __tag); +#endif + + +#endif diff --git a/fnmatch.h b/fnmatch.h new file mode 100644 index 0000000..f98eed3 --- /dev/null +++ b/fnmatch.h @@ -0,0 +1,65 @@ +#ifndef __FNMATCH_H__ +#define __FNMATCH_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/fnmatch/FNM_NOESCAPE.c */ +#define FNM_NOESCAPE (1<<2) +/* ./src/fnmatch/FNM_NOMATCH.c */ +#define FNM_NOMATCH (-1) +/* ./src/fnmatch/FNM_NOSYS.c */ +#define FNM_NOSYS (-2) +/* ./src/fnmatch/FNM_PATHNAME.c */ +#define FNM_PATHNAME (1<<0) +/* ./src/fnmatch/FNM_PERIOD.c */ +#define FNM_PERIOD (1<<1) +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/fnmatch/fnmatch.c */ +int fnmatch(const char * __pattern, const char * __string, int __flags); +#endif + + +#endif diff --git a/ftw.h b/ftw.h new file mode 100644 index 0000000..eefb85c --- /dev/null +++ b/ftw.h @@ -0,0 +1,120 @@ +#ifndef __FTW_H__ +#define __FTW_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/ftw/FTW_D.c */ +#define FTW_D (1<<1) +/* ./src/ftw/FTW_DNR.c */ +#define FTW_DNR (1<<2) +/* ./src/ftw/FTW_F.c */ +#define FTW_F (1<<0) +/* ./src/ftw/FTW_NS.c */ +#define FTW_NS (1<<4) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ftw/FTW_CHDIR.c */ +#define FTW_CHDIR (1<<3) +/* ./src/ftw/FTW_DEPTH.c */ +#define FTW_DEPTH (1<<2) +/* ./src/ftw/FTW_MOUNT.c */ +#define FTW_MOUNT (1<<1) +/* ./src/ftw/FTW_PHYS.c */ +#define FTW_PHYS (1<<0) +/* ./src/ftw/FTW_SL.c */ +#define FTW_SL (1<<5) +/* ./src/ftw/FTW_SLN.c */ +#define FTW_SLN (1<<6) +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/stat/struct_stat.c */ +#ifndef __TYPE_struct_stat_DEFINED__ +#define __TYPE_struct_stat_DEFINED__ +struct stat { + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + #if 0 + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + blksize_t st_blksize; + blkcnt_t st_blocks; + #endif +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ftw/struct_FTW.c */ +#ifndef __TYPE_struct_FTW_DEFINED__ +#define __TYPE_struct_FTW_DEFINED__ +struct FTW { + int base; + int level; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/ftw/ftw.c */ +int ftw(const char * __path, int (*__fn) (const char *, const struct stat * __ptr, int __flag), int __ndirs); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ftw/nftw.c */ +int nftw(const char * __path, int (*__fn) (const char *, const struct stat *, __int, struct FTW *), int __fd_limit, int __flags); +#endif + + +#endif diff --git a/glob.h b/glob.h new file mode 100644 index 0000000..1d5f1f2 --- /dev/null +++ b/glob.h @@ -0,0 +1,96 @@ +#ifndef __GLOB_H__ +#define __GLOB_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/glob/GLOB_ABORTED.c */ +#define GLOB_ABORTED 1 +/* ./src/glob/GLOB_APPEND.c */ +#define GLOB_APPEND (1<<0) +/* ./src/glob/GLOB_DOOFFS.c */ +#define GLOB_DOOFFS (1<<1) +/* ./src/glob/GLOB_ERR.c */ +#define GLOB_ERR (1<<2) +/* ./src/glob/GLOB_MARK.c */ +#define GLOB_MARK (1<<3) +/* ./src/glob/GLOB_NOCHECK.c */ +#define GLOB_NOCHECK (1<<4) +/* ./src/glob/GLOB_NOESCAPE.c */ +#define GLOB_NOESCAPE (1<<5) +/* ./src/glob/GLOB_NOMATCH.c */ +#define GLOB_NOMATCH 2 +/* ./src/glob/GLOB_NOSORT.c */ +#define GLOB_NOSORT (1<<6) +/* ./src/glob/GLOB_NOSPACE.c */ +#define GLOB_NOSPACE 3 +/* ./src/glob/GLOB_NOSYS.c */ +#define GLOB_NOSYS (-2) +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/glob/glob_t.c */ +#ifndef __TYPE_glob_t_DEFINED__ +#define __TYPE_glob_t_DEFINED__ +typedef struct { + size_t gl_pathc; + char ** gl_pathv; + size_t gl_offs; +} glob_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/glob/glob.c */ +int glob(const char * restrict __pattern, int __flags, int (*__errfunc) (const char * __epath, int __eerrno), glob_t * restrict __pglob); +/* ./src/glob/globfree.c */ +void globfree(glob_t * __pglob); +#endif + + +#endif diff --git a/grp.h b/grp.h new file mode 100644 index 0000000..450c816 --- /dev/null +++ b/grp.h @@ -0,0 +1,86 @@ +#ifndef __GRP_H__ +#define __GRP_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/grp/struct_group.c */ +#ifndef __TYPE_struct_group_DEFINED__ +#define __TYPE_struct_group_DEFINED__ +struct group { + char * gr_name; + gid_t gr_gid; + char ** gr_mem; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/grp/getgrgid.c */ +struct group * getgrgid(gid_t __gid); +/* ./src/grp/getgrnam.c */ +struct group * getgrnam(const char * __name); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/grp/endgrent.c */ +void endgrent(void); +/* ./src/grp/getgrent.c */ +struct group * getgrent(void); +/* ./src/grp/setgrent.c */ +void setgrent(void); +#endif + + +#endif diff --git a/iconv.h b/iconv.h new file mode 100644 index 0000000..5cc2673 --- /dev/null +++ b/iconv.h @@ -0,0 +1,71 @@ +#ifndef __ICONV_H__ +#define __ICONV_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/iconv/iconv_t.c */ +#ifndef __TYPE_iconv_t_DEFINED__ +#define __TYPE_iconv_t_DEFINED__ +typedef unsigned long int iconv_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/iconv/iconv.c */ +size_t iconv(iconv_t __cd, char ** restrict __inbuf, size_t * restrict __inbytesleft, char ** restrict __outbuf, size_t * restrict __outbytesleft); +/* ./src/iconv/iconv_close.c */ +int iconv_close(iconv_t __cd); +/* ./src/iconv/iconv_open.c */ +iconv_t iconv_open(const char * __tocode, const char * __fromcode); +#endif + + +#endif diff --git a/inttypes.h b/inttypes.h new file mode 100644 index 0000000..219e32e --- /dev/null +++ b/inttypes.h @@ -0,0 +1,462 @@ +#ifndef __INTTYPES_H__ +#define __INTTYPES_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/inttypes/stdint.ref */ +#include +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/inttypes/PRIX16.c */ +#define PRIX16 "hX" +/* ./src/inttypes/PRIX32.c */ +#define PRIX32 "lX" +/* ./src/inttypes/PRIX64.c */ +#define PRIX64 "llX" +/* ./src/inttypes/PRIX8.c */ +#define PRIX8 "hhX" +/* ./src/inttypes/PRIXFAST16.c */ +#define PRIXFAST16 "hX" +/* ./src/inttypes/PRIXFAST32.c */ +#define PRIXFAST32 "lX" +/* ./src/inttypes/PRIXFAST64.c */ +#define PRIXFAST64 "llX" +/* ./src/inttypes/PRIXFAST8.c */ +#define PRIXFAST8 "hhX" +/* ./src/inttypes/PRIXLEAST16.c */ +#define PRIXLEAST16 "hX" +/* ./src/inttypes/PRIXLEAST32.c */ +#define PRIXLEAST32 "lX" +/* ./src/inttypes/PRIXLEAST64.c */ +#define PRIXLEAST64 "llX" +/* ./src/inttypes/PRIXLEAST8.c */ +#define PRIXLEAST8 "hhX" +/* ./src/inttypes/PRIXMAX.c */ +#define PRIXMAX "llX" +/* ./src/inttypes/PRIXPTR.c */ +#if WORD_BIT == 64 +#define PRIXPTR "llX" +#else +#define PRIXPTR "lX" +#endif +/* ./src/inttypes/PRId16.c */ +#define PRId16 "hd" +/* ./src/inttypes/PRId32.c */ +#define PRId32 "ld" +/* ./src/inttypes/PRId64.c */ +#define PRId64 "lld" +/* ./src/inttypes/PRId8.c */ +#define PRId8 "hhd" +/* ./src/inttypes/PRIdFAST16.c */ +#define PRIdFAST16 "hd" +/* ./src/inttypes/PRIdFAST32.c */ +#define PRIdFAST32 "ld" +/* ./src/inttypes/PRIdFAST64.c */ +#define PRIdFAST64 "lld" +/* ./src/inttypes/PRIdFAST8.c */ +#define PRIdFAST8 "hhd" +/* ./src/inttypes/PRIdLEAST16.c */ +#define PRIdLEAST16 "hd" +/* ./src/inttypes/PRIdLEAST32.c */ +#define PRIdLEAST32 "ld" +/* ./src/inttypes/PRIdLEAST64.c */ +#define PRIdLEAST64 "lld" +/* ./src/inttypes/PRIdLEAST8.c */ +#define PRIdLEAST8 "hhd" +/* ./src/inttypes/PRIdMAX.c */ +#define PRIdMAX "lld" +/* ./src/inttypes/PRIdPTR.c */ +#if WORD_BIT == 64 +#define PRIdPTR "lld" +#else +#define PRIdPTR "ld" +#endif +/* ./src/inttypes/PRIi16.c */ +#define PRIi16 "hi" +/* ./src/inttypes/PRIi32.c */ +#define PRIi32 "li" +/* ./src/inttypes/PRIi64.c */ +#define PRIi64 "lli" +/* ./src/inttypes/PRIi8.c */ +#define PRIi8 "hhi" +/* ./src/inttypes/PRIiFAST16.c */ +#define PRIiFAST16 "hi" +/* ./src/inttypes/PRIiFAST32.c */ +#define PRIiFAST32 "li" +/* ./src/inttypes/PRIiFAST64.c */ +#define PRIiFAST64 "lli" +/* ./src/inttypes/PRIiFAST8.c */ +#define PRIiFAST8 "hhi" +/* ./src/inttypes/PRIiLEAST16.c */ +#define PRIiLEAST16 "hi" +/* ./src/inttypes/PRIiLEAST32.c */ +#define PRIiLEAST32 "li" +/* ./src/inttypes/PRIiLEAST64.c */ +#define PRIiLEAST64 "lli" +/* ./src/inttypes/PRIiLEAST8.c */ +#define PRIiLEAST8 "hhi" +/* ./src/inttypes/PRIiMAX.c */ +#define PRIiMAX "lli" +/* ./src/inttypes/PRIiPTR.c */ +#if WORD_BIT == 64 +#define PRIiPTR "lli" +#else +#define PRIiPTR "li" +#endif +/* ./src/inttypes/PRIo16.c */ +#define PRIo16 "ho" +/* ./src/inttypes/PRIo32.c */ +#define PRIo32 "lo" +/* ./src/inttypes/PRIo64.c */ +#define PRIo64 "llo" +/* ./src/inttypes/PRIo8.c */ +#define PRIo8 "hho" +/* ./src/inttypes/PRIoFAST16.c */ +#define PRIoFAST16 "ho" +/* ./src/inttypes/PRIoFAST32.c */ +#define PRIoFAST32 "lo" +/* ./src/inttypes/PRIoFAST64.c */ +#define PRIoFAST64 "llo" +/* ./src/inttypes/PRIoFAST8.c */ +#define PRIoFAST8 "hho" +/* ./src/inttypes/PRIoLEAST16.c */ +#define PRIoLEAST16 "ho" +/* ./src/inttypes/PRIoLEAST32.c */ +#define PRIoLEAST32 "lo" +/* ./src/inttypes/PRIoLEAST64.c */ +#define PRIoLEAST64 "llo" +/* ./src/inttypes/PRIoLEAST8.c */ +#define PRIoLEAST8 "hho" +/* ./src/inttypes/PRIoMAX.c */ +#define PRIoMAX "llo" +/* ./src/inttypes/PRIoPTR.c */ +#if WORD_BIT == 64 +#define PRIoPTR "llo" +#else +#define PRIoPTR "lo" +#endif +/* ./src/inttypes/PRIu16.c */ +#define PRIu16 "hu" +/* ./src/inttypes/PRIu32.c */ +#define PRIu32 "lu" +/* ./src/inttypes/PRIu64.c */ +#define PRIu64 "llu" +/* ./src/inttypes/PRIu8.c */ +#define PRIu8 "hhu" +/* ./src/inttypes/PRIuFAST16.c */ +#define PRIuFAST16 "hu" +/* ./src/inttypes/PRIuFAST32.c */ +#define PRIuFAST32 "lu" +/* ./src/inttypes/PRIuFAST64.c */ +#define PRIuFAST64 "llu" +/* ./src/inttypes/PRIuFAST8.c */ +#define PRIuFAST8 "hhu" +/* ./src/inttypes/PRIuLEAST16.c */ +#define PRIuLEAST16 "hu" +/* ./src/inttypes/PRIuLEAST32.c */ +#define PRIuLEAST32 "lu" +/* ./src/inttypes/PRIuLEAST64.c */ +#define PRIuLEAST64 "llu" +/* ./src/inttypes/PRIuLEAST8.c */ +#define PRIuLEAST8 "hhu" +/* ./src/inttypes/PRIuMAX.c */ +#define PRIuMAX "llu" +/* ./src/inttypes/PRIuPTR.c */ +#if WORD_BIT == 64 +#define PRIuPTR "llu" +#else +#define PRIuPTR "lu" +#endif +/* ./src/inttypes/PRIx16.c */ +#define PRIx16 "hx" +/* ./src/inttypes/PRIx32.c */ +#define PRIx32 "lx" +/* ./src/inttypes/PRIx64.c */ +#define PRIx64 "llx" +/* ./src/inttypes/PRIx8.c */ +#define PRIx8 "hhx" +/* ./src/inttypes/PRIxFAST16.c */ +#define PRIxFAST16 "hx" +/* ./src/inttypes/PRIxFAST32.c */ +#define PRIxFAST32 "lx" +/* ./src/inttypes/PRIxFAST64.c */ +#define PRIxFAST64 "llx" +/* ./src/inttypes/PRIxFAST8.c */ +#define PRIxFAST8 "hhx" +/* ./src/inttypes/PRIxLEAST16.c */ +#define PRIxLEAST16 "hx" +/* ./src/inttypes/PRIxLEAST32.c */ +#define PRIxLEAST32 "lx" +/* ./src/inttypes/PRIxLEAST64.c */ +#define PRIxLEAST64 "llx" +/* ./src/inttypes/PRIxLEAST8.c */ +#define PRIxLEAST8 "hhx" +/* ./src/inttypes/PRIxMAX.c */ +#define PRIxMAX "llx" +/* ./src/inttypes/PRIxPTR.c */ +#if WORD_BIT == 64 +#define PRIxPTR "llx" +#else +#define PRIxPTR "lx" +#endif +/* ./src/inttypes/SCNX16.c */ +#define SCNX16 "hX" +/* ./src/inttypes/SCNX32.c */ +#define SCNX32 "lX" +/* ./src/inttypes/SCNX64.c */ +#define SCNX64 "llX" +/* ./src/inttypes/SCNX8.c */ +#define SCNX8 "hhX" +/* ./src/inttypes/SCNXFAST16.c */ +#define SCNXFAST16 "hX" +/* ./src/inttypes/SCNXFAST32.c */ +#define SCNXFAST32 "lX" +/* ./src/inttypes/SCNXFAST64.c */ +#define SCNXFAST64 "llX" +/* ./src/inttypes/SCNXFAST8.c */ +#define SCNXFAST8 "hhX" +/* ./src/inttypes/SCNXLEAST16.c */ +#define SCNXLEAST16 "hX" +/* ./src/inttypes/SCNXLEAST32.c */ +#define SCNXLEAST32 "lX" +/* ./src/inttypes/SCNXLEAST64.c */ +#define SCNXLEAST64 "llX" +/* ./src/inttypes/SCNXLEAST8.c */ +#define SCNXLEAST8 "hhX" +/* ./src/inttypes/SCNXMAX.c */ +#define SCNXMAX "llX" +/* ./src/inttypes/SCNXPTR.c */ +#if WORD_BIT == 64 +#define SCNXPTR "llX" +#else +#define SCNXPTR "lX" +#endif +/* ./src/inttypes/SCNd16.c */ +#define SCNd16 "hd" +/* ./src/inttypes/SCNd32.c */ +#define SCNd32 "ld" +/* ./src/inttypes/SCNd64.c */ +#define SCNd64 "lld" +/* ./src/inttypes/SCNd8.c */ +#define SCNd8 "hhd" +/* ./src/inttypes/SCNdFAST16.c */ +#define SCNdFAST16 "hd" +/* ./src/inttypes/SCNdFAST32.c */ +#define SCNdFAST32 "ld" +/* ./src/inttypes/SCNdFAST64.c */ +#define SCNdFAST64 "lld" +/* ./src/inttypes/SCNdFAST8.c */ +#define SCNdFAST8 "hhd" +/* ./src/inttypes/SCNdLEAST16.c */ +#define SCNdLEAST16 "hd" +/* ./src/inttypes/SCNdLEAST32.c */ +#define SCNdLEAST32 "ld" +/* ./src/inttypes/SCNdLEAST64.c */ +#define SCNdLEAST64 "lld" +/* ./src/inttypes/SCNdLEAST8.c */ +#define SCNdLEAST8 "hhd" +/* ./src/inttypes/SCNdMAX.c */ +#define SCNdMAX "lld" +/* ./src/inttypes/SCNdPTR.c */ +#if WORD_BIT == 64 +#define SCNdPTR "lld" +#else +#define SCNdPTR "ld" +#endif +/* ./src/inttypes/SCNi16.c */ +#define SCNi16 "hi" +/* ./src/inttypes/SCNi32.c */ +#define SCNi32 "li" +/* ./src/inttypes/SCNi64.c */ +#define SCNi64 "lli" +/* ./src/inttypes/SCNi8.c */ +#define SCNi8 "hhi" +/* ./src/inttypes/SCNiFAST16.c */ +#define SCNiFAST16 "hi" +/* ./src/inttypes/SCNiFAST32.c */ +#define SCNiFAST32 "li" +/* ./src/inttypes/SCNiFAST64.c */ +#define SCNiFAST64 "lli" +/* ./src/inttypes/SCNiFAST8.c */ +#define SCNiFAST8 "hhi" +/* ./src/inttypes/SCNiLEAST16.c */ +#define SCNiLEAST16 "hi" +/* ./src/inttypes/SCNiLEAST32.c */ +#define SCNiLEAST32 "li" +/* ./src/inttypes/SCNiLEAST64.c */ +#define SCNiLEAST64 "lli" +/* ./src/inttypes/SCNiLEAST8.c */ +#define SCNiLEAST8 "hhi" +/* ./src/inttypes/SCNiMAX.c */ +#define SCNiMAX "lli" +/* ./src/inttypes/SCNiPTR.c */ +#if WORD_BIT == 64 +#define SCNiPTR "lli" +#else +#define SCNiPTR "li" +#endif +/* ./src/inttypes/SCNo16.c */ +#define SCNo16 "ho" +/* ./src/inttypes/SCNo32.c */ +#define SCNo32 "lo" +/* ./src/inttypes/SCNo64.c */ +#define SCNo64 "llo" +/* ./src/inttypes/SCNo8.c */ +#define SCNo8 "hho" +/* ./src/inttypes/SCNoFAST16.c */ +#define SCNoFAST16 "ho" +/* ./src/inttypes/SCNoFAST32.c */ +#define SCNoFAST32 "lo" +/* ./src/inttypes/SCNoFAST64.c */ +#define SCNoFAST64 "llo" +/* ./src/inttypes/SCNoFAST8.c */ +#define SCNoFAST8 "hho" +/* ./src/inttypes/SCNoLEAST16.c */ +#define SCNoLEAST16 "ho" +/* ./src/inttypes/SCNoLEAST32.c */ +#define SCNoLEAST32 "lo" +/* ./src/inttypes/SCNoLEAST64.c */ +#define SCNoLEAST64 "llo" +/* ./src/inttypes/SCNoLEAST8.c */ +#define SCNoLEAST8 "hho" +/* ./src/inttypes/SCNoMAX.c */ +#define SCNoMAX "llo" +/* ./src/inttypes/SCNoPTR.c */ +#if WORD_BIT == 64 +#define SCNoPTR "llo" +#else +#define SCNoPTR "lo" +#endif +/* ./src/inttypes/SCNu16.c */ +#define SCNu16 "hu" +/* ./src/inttypes/SCNu32.c */ +#define SCNu32 "lu" +/* ./src/inttypes/SCNu64.c */ +#define SCNu64 "llu" +/* ./src/inttypes/SCNu8.c */ +#define SCNu8 "hhu" +/* ./src/inttypes/SCNuFAST16.c */ +#define SCNuFAST16 "hu" +/* ./src/inttypes/SCNuFAST32.c */ +#define SCNuFAST32 "lu" +/* ./src/inttypes/SCNuFAST64.c */ +#define SCNuFAST64 "llu" +/* ./src/inttypes/SCNuFAST8.c */ +#define SCNuFAST8 "hhu" +/* ./src/inttypes/SCNuLEAST16.c */ +#define SCNuLEAST16 "hu" +/* ./src/inttypes/SCNuLEAST32.c */ +#define SCNuLEAST32 "lu" +/* ./src/inttypes/SCNuLEAST64.c */ +#define SCNuLEAST64 "llu" +/* ./src/inttypes/SCNuLEAST8.c */ +#define SCNuLEAST8 "hhu" +/* ./src/inttypes/SCNuMAX.c */ +#define SCNuMAX "llu" +/* ./src/inttypes/SCNuPTR.c */ +#if WORD_BIT == 64 +#define SCNuPTR "llu" +#else +#define SCNuPTR "lu" +#endif +/* ./src/inttypes/SCNx16.c */ +#define SCNx16 "hx" +/* ./src/inttypes/SCNx32.c */ +#define SCNx32 "lx" +/* ./src/inttypes/SCNx64.c */ +#define SCNx64 "llx" +/* ./src/inttypes/SCNx8.c */ +#define SCNx8 "hhx" +/* ./src/inttypes/SCNxFAST16.c */ +#define SCNxFAST16 "hx" +/* ./src/inttypes/SCNxFAST32.c */ +#define SCNxFAST32 "lx" +/* ./src/inttypes/SCNxFAST64.c */ +#define SCNxFAST64 "llx" +/* ./src/inttypes/SCNxFAST8.c */ +#define SCNxFAST8 "hhx" +/* ./src/inttypes/SCNxLEAST16.c */ +#define SCNxLEAST16 "hx" +/* ./src/inttypes/SCNxLEAST32.c */ +#define SCNxLEAST32 "lx" +/* ./src/inttypes/SCNxLEAST64.c */ +#define SCNxLEAST64 "llx" +/* ./src/inttypes/SCNxLEAST8.c */ +#define SCNxLEAST8 "hhx" +/* ./src/inttypes/SCNxMAX.c */ +#define SCNxMAX "llx" +/* ./src/inttypes/SCNxPTR.c */ +#if WORD_BIT == 64 +#define SCNxPTR "llx" +#else +#define SCNxPTR "lx" +#endif +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/inttypes/imaxdiv_t.c */ +#ifndef __TYPE_imaxdiv_t_DEFINED__ +#define __TYPE_imaxdiv_t_DEFINED__ +typedef struct { + intmax_t quot; + intmax_t rem; +} imaxdiv_t; +#endif + +/* ./src/inttypes/intmax_t.c */ +#ifndef __TYPE_intmax_t_DEFINED__ +#define __TYPE_intmax_t_DEFINED__ +typedef long long int intmax_t; +#endif + +/* ./src/inttypes/uintmax_t.c */ +#ifndef __TYPE_uintmax_t_DEFINED__ +#define __TYPE_uintmax_t_DEFINED__ +typedef unsigned long long int uintmax_t; +#endif + +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/inttypes/imaxabs.c */ +intmax_t imaxabs(intmax_t __j); +/* ./src/inttypes/imaxdiv.c */ +imaxdiv_t imaxdiv(intmax_t __numer, intmax_t __denom); +/* ./src/inttypes/strtoimax.c */ +intmax_t strtoimax(const char * restrict __nptr, char ** restrict __endptr, int __base); +/* ./src/inttypes/strtoumax.c */ +uintmax_t strtoumax(const char *restrict __nptr, char ** restrict __endptr, int __base); +/* ./src/inttypes/wcstoimax.c */ +intmax_t wcstoimax(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +/* ./src/inttypes/wcstoumax.c */ +uintmax_t wcstoumax(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +#endif + + +#endif diff --git a/iso646.h b/iso646.h new file mode 100644 index 0000000..61656b8 --- /dev/null +++ b/iso646.h @@ -0,0 +1,56 @@ +#ifndef __ISO646_H__ +#define __ISO646_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/iso646/and.c */ +#define and && +/* ./src/iso646/and_eq.c */ +#define and_eq &= +/* ./src/iso646/bitand.c */ +#define bitand & +/* ./src/iso646/bitor.c */ +#define bitor | +/* ./src/iso646/compl.c */ +#define compl ~ +/* ./src/iso646/not.c */ +#define not ! +/* ./src/iso646/not_eq.c */ +#define not_eq != +/* ./src/iso646/or.c */ +#define or || +/* ./src/iso646/or_eq.c */ +#define or_eq |= +/* ./src/iso646/xor.c */ +#define xor ^ +/* ./src/iso646/xor_eq.c */ +#define xor_eq ^= +#endif + + +#endif diff --git a/langinfo.h b/langinfo.h new file mode 100644 index 0000000..82e4812 --- /dev/null +++ b/langinfo.h @@ -0,0 +1,174 @@ +#ifndef __LANGINFO_H__ +#define __LANGINFO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/langinfo/ABDAY_1.c */ +#define ABDAY_1 ((nl_item)15) +/* ./src/langinfo/ABDAY_2.c */ +#define ABDAY_2 ((nl_item)16) +/* ./src/langinfo/ABDAY_3.c */ +#define ABDAY_3 ((nl_item)17) +/* ./src/langinfo/ABDAY_4.c */ +#define ABDAY_4 ((nl_item)18) +/* ./src/langinfo/ABDAY_5.c */ +#define ABDAY_5 ((nl_item)19) +/* ./src/langinfo/ABDAY_6.c */ +#define ABDAY_6 ((nl_item)20) +/* ./src/langinfo/ABDAY_7.c */ +#define ABDAY_7 ((nl_item)21) +/* ./src/langinfo/ABMON_1.c */ +#define ABMON_1 ((nl_item)34) +/* ./src/langinfo/ABMON_10.c */ +#define ABMON_10 ((nl_item)43) +/* ./src/langinfo/ABMON_11.c */ +#define ABMON_11 ((nl_item)44) +/* ./src/langinfo/ABMON_12.c */ +#define ABMON_12 ((nl_item)45) +/* ./src/langinfo/ABMON_2.c */ +#define ABMON_2 ((nl_item)35) +/* ./src/langinfo/ABMON_3.c */ +#define ABMON_3 ((nl_item)36) +/* ./src/langinfo/ABMON_4.c */ +#define ABMON_4 ((nl_item)37) +/* ./src/langinfo/ABMON_5.c */ +#define ABMON_5 ((nl_item)38) +/* ./src/langinfo/ABMON_6.c */ +#define ABMON_6 ((nl_item)39) +/* ./src/langinfo/ABMON_7.c */ +#define ABMON_7 ((nl_item)40) +/* ./src/langinfo/ABMON_8.c */ +#define ABMON_8 ((nl_item)41) +/* ./src/langinfo/ABMON_9.c */ +#define ABMON_9 ((nl_item)42) +/* ./src/langinfo/ALT_DIGITS.c */ +#define ALT_DIGITS ((nl_item)50) +/* ./src/langinfo/AM_STR.c */ +#define AM_STR ((nl_item)6) +/* ./src/langinfo/CODESET.c */ +#define CODESET ((nl_item)1) +/* ./src/langinfo/CRNCYSTR.c */ +#define CRNCYSTR ((nl_item)55) +/* ./src/langinfo/DAY_1.c */ +#define DAY_1 ((nl_item)8) +/* ./src/langinfo/DAY_2.c */ +#define DAY_2 ((nl_item)9) +/* ./src/langinfo/DAY_3.c */ +#define DAY_3 ((nl_item)10) +/* ./src/langinfo/DAY_4.c */ +#define DAY_4 ((nl_item)11) +/* ./src/langinfo/DAY_5.c */ +#define DAY_5 ((nl_item)12) +/* ./src/langinfo/DAY_6.c */ +#define DAY_6 ((nl_item)13) +/* ./src/langinfo/DAY_7.c */ +#define DAY_7 ((nl_item)14) +/* ./src/langinfo/D_FMT.c */ +#define D_FMT ((nl_item)3) +/* ./src/langinfo/D_T_FMT.c */ +#define D_T_FMT ((nl_item)2) +/* ./src/langinfo/ERA.c */ +#define ERA ((nl_item)46) +/* ./src/langinfo/ERA_D_FMT.c */ +#define ERA_D_FMT ((nl_item)47) +/* ./src/langinfo/ERA_D_T_FMT.c */ +#define ERA_D_T_FMT ((nl_item)48) +/* ./src/langinfo/ERA_T_FMT.c */ +#define ERA_T_FMT ((nl_item)49) +/* ./src/langinfo/MON_1.c */ +#define MON_1 ((nl_item)22) +/* ./src/langinfo/MON_10.c */ +#define MON_10 ((nl_item)31) +/* ./src/langinfo/MON_11.c */ +#define MON_11 ((nl_item)32) +/* ./src/langinfo/MON_12.c */ +#define MON_12 ((nl_item)33) +/* ./src/langinfo/MON_2.c */ +#define MON_2 ((nl_item)23) +/* ./src/langinfo/MON_3.c */ +#define MON_3 ((nl_item)24) +/* ./src/langinfo/MON_4.c */ +#define MON_4 ((nl_item)25) +/* ./src/langinfo/MON_5.c */ +#define MON_5 ((nl_item)26) +/* ./src/langinfo/MON_6.c */ +#define MON_6 ((nl_item)27) +/* ./src/langinfo/MON_7.c */ +#define MON_7 ((nl_item)28) +/* ./src/langinfo/MON_8.c */ +#define MON_8 ((nl_item)29) +/* ./src/langinfo/MON_9.c */ +#define MON_9 ((nl_item)30) +/* ./src/langinfo/NOEXPR.c */ +#define NOEXPR ((nl_item)54) +/* ./src/langinfo/PM_STR.c */ +#define PM_STR ((nl_item)7) +/* ./src/langinfo/RADIXCHAR.c */ +#define RADIXCHAR ((nl_item)51) +/* ./src/langinfo/THOUSEP.c */ +#define THOUSEP ((nl_item)52) +/* ./src/langinfo/T_FMT.c */ +#define T_FMT ((nl_item)4) +/* ./src/langinfo/T_FMT_AMPM.c */ +#define T_FMT_AMPM ((nl_item)5) +/* ./src/langinfo/YESEXPR.c */ +#define YESEXPR ((nl_item)53) +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/langinfo/NOSTR.c */ +#define NOSTR /* TODO */ +/* ./src/langinfo/YESSTR.c */ +#define YESSTR /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/langinfo/nl_langinfo.c */ +char * nl_langinfo(nl_item __item); +#endif + + +#endif diff --git a/libgen.h b/libgen.h new file mode 100644 index 0000000..4f52129 --- /dev/null +++ b/libgen.h @@ -0,0 +1,50 @@ +#ifndef __LIBGEN_H__ +#define __LIBGEN_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/libgen/__loc1.c */ +extern char *__loc1; +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/libgen/basename.c */ +char * basename(char * __path); +/* ./src/libgen/dirname.c */ +char * dirname(char * __path); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/libgen/regcmp.c */ +char *regcmp(const char *__string1, ... /*, (char*)0 */); +/* ./src/libgen/regex.c */ +char *regex(const char *__re, const char *__subject, ...); +#endif + + +#endif diff --git a/limits.h b/limits.h new file mode 100644 index 0000000..a0d7854 --- /dev/null +++ b/limits.h @@ -0,0 +1,296 @@ +#ifndef __LIMITS_H__ +#define __LIMITS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/limits/CHAR_BIT.c */ +#define CHAR_BIT (8) +/* ./src/limits/CHAR_MAX.c */ +#ifdef __CHAR_IS_UNSIGNED__ +#define CHAR_MAX (255) +#else +#define CHAR_MAX (127) +#endif +/* ./src/limits/CHAR_MIN.c */ +#ifdef __CHAR_IS_UNSIGNED__ +#define CHAR_MIN (0) +#else +#define CHAR_MIN (-128) +#endif +/* ./src/limits/INT_MAX.c */ +#if defined __LP32__ +#define INT_MAX (32767) +#elif defined __ILP32__ || defined __LLP64__ || defined __LP64__ +#define INT_MAX (2147483647) +#elif defined __ILP64__ +#define INT_MAX (9223372036854775807) +#endif +/* ./src/limits/INT_MIN.c */ +#define INT_MIN (-INT_MAX -1) +/* ./src/limits/LONG_MAX.c */ +#if defined __LP32__ || defined __ILP32__ || defined __LLP64__ +#define LONG_MAX (2147483647L) +#elif defined __ILP64__ || defined __LP64__ +#define LONG_MAX (9223372036854775807L) +#endif +/* ./src/limits/LONG_MIN.c */ +#define LONG_MIN (-LONG_MAX - 1L) +/* ./src/limits/MB_LEN_MAX.c */ +#define MB_LEN_MAX (4) +/* ./src/limits/SCHAR_MAX.c */ +#define SCHAR_MAX (127) +/* ./src/limits/SCHAR_MIN.c */ +#define SCHAR_MIN (-128) +/* ./src/limits/SHRT_MAX.c */ +#define SHRT_MAX (32767) +/* ./src/limits/SHRT_MIN.c */ +#define SHRT_MIN (-32768) +/* ./src/limits/UCHAR_MAX.c */ +#define UCHAR_MAX (255) +/* ./src/limits/UINT_MAX.c */ +#if defined __LP32__ +#define UINT_MAX (65535U) +#elif defined __ILP32__ || defined __LLP64__ || defined __LP64__ +#define UINT_MAX (4294967295U) +#elif defined __ILP64__ +#define UINT_MAX (18446744073709551616U) +#endif +/* ./src/limits/ULONG_MAX.c */ +#if defined __LP32__ || defined __ILP32__ || defined __LLP64__ +#define ULONG_MAX (4294967295UL) +#elif defined __ILP64__ || defined __LP64__ +#define ULONG_MAX (18446744073709551615UL) +#endif +/* ./src/limits/USHRT_MAX.c */ +#define USHRT_MAX (65535) + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/limits/LLONG_MAX.c */ +#define LLONG_MAX (9223372036854775807LL) +/* ./src/limits/LLONG_MIN.c */ +#define LLONG_MIN (-LLONG_MAX - 1LL) +/* ./src/limits/ULLONG_MAX.c */ +#define ULLONG_MAX (18446744073709551615ULL) +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/limits/ARG_MAX.c */ +/* ./src/limits/CHILD_MAX.c */ +/* ./src/limits/LINK_MAX.c */ +/* ./src/limits/MAX_CANON.c */ +/* ./src/limits/MAX_INPUT.c */ +/* ./src/limits/NAME_MAX.c */ +/* ./src/limits/NGROUPS_MAX.c */ +#define NGROUPS_MAX _POSIX_NGROUPS_MAX +/* ./src/limits/OPEN_MAX.c */ +/* ./src/limits/PATH_MAX.c */ +/* ./src/limits/PIPE_BUF.c */ +/* ./src/limits/SSIZE_MAX.c */ +#define SSIZE_MAX (2147483647) +/* ./src/limits/STREAM_MAX.c */ +/* ./src/limits/TZNAME_MAX.c */ +/* ./src/limits/_POSIX_ARG_MAX.c */ +#define _POSIX_ARG_MAX (4096) +/* ./src/limits/_POSIX_CHILD_MAX.c */ +#define _POSIX_CHILD_MAX (6) +/* ./src/limits/_POSIX_LINK_MAX.c */ +#define _POSIX_LINK_MAX (8) +/* ./src/limits/_POSIX_MAX_CANON.c */ +#define _POSIX_MAX_CANON (255) +/* ./src/limits/_POSIX_MAX_INPUT.c */ +#define _POSIX_MAX_INPUT (255) +/* ./src/limits/_POSIX_NAME_MAX.c */ +#define _POSIX_NAME_MAX (14) +/* ./src/limits/_POSIX_NGROUPS_MAX.c */ +#define _POSIX_NGROUPS_MAX (0) +/* ./src/limits/_POSIX_OPEN_MAX.c */ +#define _POSIX_OPEN_MAX (16) +/* ./src/limits/_POSIX_PATH_MAX.c */ +#define _POSIX_PATH_MAX (256) +/* ./src/limits/_POSIX_PIPE_BUF.c */ +#define _POSIX_PIPE_BUF (512) +/* ./src/limits/_POSIX_SSIZE_MAX.c */ +#define _POSIX_SSIZE_MAX (32767) +/* ./src/limits/_POSIX_STREAM_MAX.c */ +#define _POSIX_STREAM_MAX (8) +/* ./src/limits/_POSIX_TZNAME_MAX.c */ +#define _POSIX_TZNAME_MAX (3) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/limits/AIO_LISTIO_MAX.c */ +/* ./src/limits/AIO_MAX.c */ +/* ./src/limits/AIO_PRIO_DELTA_MAX.c */ +/* ./src/limits/DELAYTIMER_MAX.c */ +/* ./src/limits/MQ_OPEN_MAX.c */ +/* ./src/limits/MQ_PRIO_MAX.c */ +/* ./src/limits/RTSIG_MAX.c */ +/* ./src/limits/SEM_NSEMS_MAX.c */ +/* ./src/limits/SEM_VALUE_MAX.c */ +/* ./src/limits/SIGQUEUE_MAX.c */ +/* ./src/limits/TIMER_MAX.c */ +/* ./src/limits/_POSIX_AIO_LISTIO_MAX.c */ +#define _POSIX_AIO_LISTIO_MAX (2) +/* ./src/limits/_POSIX_AIO_MAX.c */ +#define _POSIX_AIO_MAX (1) +/* ./src/limits/_POSIX_CLOCKRES_MIN.c */ +#define _POSIX_CLOCKRES_MIN (20000000) +/* ./src/limits/_POSIX_DELAYTIMER_MAX.c */ +#define _POSIX_DELAYTIMER_MAX (32) +/* ./src/limits/_POSIX_MQ_OPEN_MAX.c */ +#define _POSIX_MQ_OPEN_MAX (8) +/* ./src/limits/_POSIX_MQ_PRIO_MAX.c */ +#define _POSIX_MQ_PRIO_MAX (32) +/* ./src/limits/_POSIX_RTSIG_MAX.c */ +#define _POSIX_RTSIG_MAX (8) +/* ./src/limits/_POSIX_SEM_NSEMS_MAX.c */ +#define _POSIX_SEM_NSEMS_MAX (256) +/* ./src/limits/_POSIX_SEM_VALUE_MAX.c */ +#define _POSIX_SEM_VALUE_MAX (32767) +/* ./src/limits/_POSIX_SIGQUEUE_MAX.c */ +#define _POSIX_SIGQUEUE_MAX (32) +/* ./src/limits/_POSIX_TIMER_MAX.c */ +#define _POSIX_TIMER_MAX (32) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/limits/PAGESIZE.c */ +#define PAGESIZE /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/limits/BC_BASE_MAX.c */ +#define BC_BASE_MAX _POSIX2_BC_BASE_MAX +/* ./src/limits/BC_DIM_MAX.c */ +#define BC_DIM_MAX _POSIX2_BC_DIM_MAX +/* ./src/limits/BC_SCALE_MAX.c */ +#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX +/* ./src/limits/BC_STRING_MAX.c */ +#define BC_STRING_MAX _POSIX2_BC_STRING_MAX +/* ./src/limits/COLL_WEIGHTS_MAX.c */ +#define COLL_WEIGHTS_MAX _POSIX2_COLL_WEIGHTS_MAX +/* ./src/limits/EXPR_NEST_MAX.c */ +#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX +/* ./src/limits/LINE_MAX.c */ +#define LINE_MAX _POSIX2_LINE_MAX +/* ./src/limits/RE_DUP_MAX.c */ +#define RE_DUP_MAX _POSIX2_RE_DUP_MAX +/* ./src/limits/_POSIX2_BC_BASE_MAX.c */ +#define _POSIX2_BC_BASE_MAX (99) +/* ./src/limits/_POSIX2_BC_DIM_MAX.c */ +#define _POSIX2_BC_DIM_MAX (2048) +/* ./src/limits/_POSIX2_BC_SCALE_MAX.c */ +#define _POSIX2_BC_SCALE_MAX (99) +/* ./src/limits/_POSIX2_BC_STRING_MAX.c */ +#define _POSIX2_BC_STRING_MAX (1000) +/* ./src/limits/_POSIX2_COLL_WEIGHTS_MAX.c */ +#define _POSIX2_COLL_WEIGHTS_MAX (2) +/* ./src/limits/_POSIX2_EXPR_NEST_MAX.c */ +#define _POSIX2_EXPR_NEST_MAX (32) +/* ./src/limits/_POSIX2_LINE_MAX.c */ +#define _POSIX2_LINE_MAX (2048) +/* ./src/limits/_POSIX2_RE_DUP_MAX.c */ +#define _POSIX2_RE_DUP_MAX (255) +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/limits/CHARCLASS_NAME_MAX.c */ +#define CHARCLASS_NAME_MAX _POSIX2_CHARCLASS_NAME_MAX +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/limits/LONG_BIT.c */ +#define LONG_BIT (32) +/* ./src/limits/NL_ARGMAX.c */ +#define NL_ARGMAX (9) +/* ./src/limits/NL_LANGMAX.c */ +#define NL_LANGMAX (14) +/* ./src/limits/NL_MSGMAX.c */ +#define NL_MSGMAX (32767) +/* ./src/limits/NL_SETMAX.c */ +#define NL_SETMAX (255) +/* ./src/limits/NL_TEXTMAX.c */ +#define NL_TEXTMAX _POSIX2_LINE_MAX +/* ./src/limits/WORD_BIT.c */ +#define WORD_BIT (32) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/limits/ATEXIT_MAX.c */ +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/limits/NZERO.c */ +#define NZERO (20) +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/limits/PASS_MAX.c */ +/* ./src/limits/TMP_MAX.c */ +#define TMP_MAX (10000) +#endif + +/* ./src/limits/NL_NMAX.c */ +#define NL_NMAX (1) +/* src/float/DBL_DIG.c */ +#define DBL_DIG (15) +/* src/float/DBL_MAX.c */ +#define DBL_MAX (1.797693E+308) +/* src/float/FLT_DIG.c */ +#define FLT_DIG (6) +/* src/float/FLT_MAX.c */ +#define FLT_MAX (3.402823E+38) + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/limits/IOV_MAX.c */ +/* ./src/limits/PAGE_SIZE.c */ +/* ./src/limits/_XOPEN_IOV_MAX.c */ +#define _XOPEN_IOV_MAX (16) +#endif + + +#endif diff --git a/locale.h b/locale.h new file mode 100644 index 0000000..87df95a --- /dev/null +++ b/locale.h @@ -0,0 +1,137 @@ +#ifndef __LOCALE_H__ +#define __LOCALE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/locale/LC_ALL.c */ +#define LC_ALL (0) +/* ./src/locale/LC_COLLATE.c */ +#define LC_COLLATE (1) +/* ./src/locale/LC_CTYPE.c */ +#define LC_CTYPE (2) +/* ./src/locale/LC_MONETARY.c */ +#define LC_MONETARY (3) +/* ./src/locale/LC_NUMERIC.c */ +#define LC_NUMERIC (4) +/* ./src/locale/LC_TIME.c */ +#define LC_TIME (5) +/* src/stddef/NULL.c */ +#define NULL ((void*)0) + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/locale/LC_MESSAGES.c */ +#define LC_MESSAGES (6) +#endif + +/* ./src/locale/struct_lconv.c */ +#ifndef __TYPE_struct_lconv_DEFINED__ +#define __TYPE_struct_lconv_DEFINED__ +struct lconv { + /** The character that separates the whole and decimal portions of non-monetary values **/ + char *decimal_point; /* "." */ + /** The character that separates groups of digits in the whole portion of non-monetary values **/ + char *thousands_sep; /* "" */ + /** A string indicating how to group digits of monetary values */ + char *grouping; /* "" */ + /** The three character ISO 4217 currency symbol of the current locale, followed by a fourth separating character **/ + char *int_curr_symbol; /* "" */ + /** The locale currency symbol in the current locale **/ + char *currency_symbol; /* "" */ + /** The character used for decimal points in monetary values **/ + char *mon_decimal_point; /* "" */ + /** The character separating digit groups in monetary values **/ + char *mon_thousands_sep; /* "" */ + /** A string indicating how to group digits in monetary values **/ + char *mon_grouping; /* "" */ + /** A string to indicate positive monetary values **/ + char *positive_sign; /* "" */ + /** A string to indicate negative monetary values **/ + char *negative_sign; /* "" */ + /** The number of digits after the decimal point in international monetary values **/ + char int_frac_digits; /* CHAR_MAX */ + /** The number of digits after the decimal point in monetary values **/ + char frac_digits; /* CHAR_MAX */ + /** Whether field(currency_symbol) precedes (1) or follows (0) positive monetary values **/ + char p_cs_precedes; /* CHAR_MAX */ + /** Whether field(currency_symbol) is (1) or is not (0) separated from positive monetary values by a space **/ + char p_sep_by_space; /* CHAR_MAX */ + /** Whether field(currency_symbol) precedes (1) or follows (0) negative monetary values **/ + char n_cs_precedes; /* CHAR_MAX */ + /** Whether field(currency_symbol) is (1) or is not(0) separated from negative monetary values by a space **/ + char n_sep_by_space; /* CHAR_MAX */ + /** The position of field(positive_sign) for positive monetary values **/ + char p_sign_posn; /* CHAR_MAX */ + /** The position of field(positive_sign) for negative monetary values **/ + char n_sign_posn; /* CHAR_MAX */ + #if __STDC_VERSION__ >= 199901L + /** Whether field(currency_symbol) precedes (1) or follows (0) positive international monetary values **/ + char int_p_cs_precedes; /* CHAR_MAX */ + /** Whether field(currency_symbol) is (1) or is not (0) separated from positive international monetary values by a space **/ + char int_p_sep_by_space; /* CHAR_MAX */ + /** Whether field(currency_symbol) precedes (1) or follows (0) negative international monetary values **/ + char int_n_cs_precedes; /* CHAR_MAX */ + /** Whether field(currency_symbol) is (1) or is not(0) separated from negative international monetary values by a space **/ + char int_n_sep_by_space; /* CHAR_MAX */ + /** The position of field(positive_sign) for positive international monetary values **/ + char int_p_sign_posn; /* CHAR_MAX */ + /** The position of field(positive_sign) for negative international monetary values **/ + char int_n_sign_posn; /* CHAR_MAX */ + #else + char __int_p_cs_precedes; + char __int_p_sep_by_space; + char __int_n_cs_precedes; + char __int_n_sep_by_space; + char __int_p_sign_posn; + char __int_n_sign_posn; + #endif +}; +#endif + + +/* ./src/locale/localeconv.c */ +struct lconv * localeconv(void); +/* ./src/locale/setlocale.c */ +char * setlocale(int __category, const char *__locale); + + +#endif diff --git a/math.h b/math.h new file mode 100644 index 0000000..6ea714e --- /dev/null +++ b/math.h @@ -0,0 +1,481 @@ +#ifndef __MATH_H__ +#define __MATH_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/math/HUGE_VAL.c */ +#define HUGE_VAL (1.0) /* TODO: massive positive double */ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/math/FP_FAST_FMA.c */ +#if 0 /* if fma is generally as fast or faster than multiply and add */ +#define FP_FAST_FMA +#else +#undef FP_FAST_FMA +#endif +/* ./src/math/FP_FAST_FMAF.c */ +#if 0 /* if fmaf is generally as fast or faster than multiply and add */ +#define FP_FAST_FMAF +#else +#undef FP_FAST_FMAF +#endif +/* ./src/math/FP_FAST_FMAL.c */ +#if 0 /* if fmal is generally as fast or faster than multiply and add */ +#define FP_FAST_FMAL +#else +#undef FP_FAST_FMAL +#endif +/* ./src/math/FP_ILOGB0.c */ +#define FP_ILOGB0 INT_MIN +/* ./src/math/FP_ILOGBNAN.c */ +#define FP_ILOGBNAN INT_MAX +/* ./src/math/FP_INFINITE.c */ +#define FP_INFINITE 0 +/* ./src/math/FP_NAN.c */ +#define FP_NAN 1 +/* ./src/math/FP_NORMAL.c */ +#define FP_NORMAL 2 +/* ./src/math/FP_SUBNORMAL.c */ +#define FP_SUBNORMAL 3 +/* ./src/math/FP_ZERO.c */ +#define FP_ZERO 4 +/* ./src/math/HUGE_VALF.c */ +#define HUGE_VALF 0.0 /* TODO: massive positive float */ +/* ./src/math/HUGE_VALL.c */ +#define HUGE_VALL 0.0 /* TODO: massive positive long double */ +/* ./src/math/INFINITY.c */ +#define INFINITY 9e999 /* TODO: positive or unsigned float infinity */ +/* ./src/math/MATH_ERREXCEPT.c */ +#define MATH_ERREXCEPT 2 +/* ./src/math/MATH_ERRNO.c */ +#define MATH_ERRNO 1 +/* ./src/math/NAN.c */ +#define NAN 0.0 /* TODO: float quiet NaN */ +/* ./src/math/fpclassify.c */ +#define fpclassify(__x) \ + ((sizeof (__x) == sizeof (float)) ? __fpclassifyf(__x) : \ + (sizeof (__x) == sizeof (double)) ? __fpclassify(__x) : \ + __fpclassifyl(__x)) +/* ./src/math/isfinite.c */ +#define isfinite(__x) (fpclassify(__x) != FP_INFINITE) +/* ./src/math/isgreater.c */ +#define isgreater(__x, __y) ((__x) > (__y)) +/* ./src/math/isgreaterequal.c */ +#define isgreaterequal(__x, __y) ((__x) >= (__y)) +/* ./src/math/isinf.c */ +#define isinf(__x) (fpclassify(__x) == FP_INFINITE) +/* ./src/math/isless.c */ +#define isless(__x, __y) ((__x) < (__y)) +/* ./src/math/islessequal.c */ +#define islessequal(__x, __y) ((__x) <= (__y)) +/* ./src/math/islessgreater.c */ +#define islessgreater(__x, __y) ((__x) < (__y) || (__x) > (__y)) +/* ./src/math/isnan.c */ +#define isnan(__x) (fpclassify(__x) == FP_NAN) +/* ./src/math/isnormal.c */ +#define isnormal(__x) (fpclassify(__x) == FP_NORMAL) +/* ./src/math/isunordered.c */ +#define isunordered(__x, __y) /* TODO */ +/* ./src/math/math_errhandling.c */ +#define math_errhandling (MATH_ERRNO | MATH_ERREXCEPT) +/* ./src/math/signbit.c */ +#define signbit(__x) \ + (sizeof(__x) == sizeof(long double) ? \ + ((((union { \ + long double __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) : \ + sizeof(__x) == sizeof(double) ? \ + ((((union { \ + double __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) : \ + (((union { \ + float __f; \ + char __c[sizeof(__x)]; \ + }){.__f = (__x)}).__c[sizeof(__x)-1] & 0x80) == 0x80 ? 1 : 0) +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/math/MAXFLOAT.c */ +#define MAXFLOAT 1E+37 +/* ./src/math/M_1_PI.c */ +#define M_1_PI 1.0/3.14159 +/* ./src/math/M_2_PI.c */ +#define M_2_PI 2.0/3.14159 +/* ./src/math/M_2_SQRTPI.c */ +#define M_2_SQRTPI 2.0/sqrt(3.14159) +/* ./src/math/M_E.c */ +#define M_E value of e +/* ./src/math/M_LN10.c */ +#define M_LN10 // log_e 10 +/* ./src/math/M_LN2.c */ +#define M_LN2 // log_e 2 +/* ./src/math/M_LOG10E.c */ +#define M_LOG10E // log_10 e +/* ./src/math/M_LOG2E.c */ +#define M_LOG2E // log_2 e +/* ./src/math/M_PI.c */ +#define M_PI 3.14159 +/* ./src/math/M_PI_2.c */ +#define M_PI_2 3.14159/2.0 +/* ./src/math/M_PI_4.c */ +#define M_PI_4 3.14159/4.0 +/* ./src/math/M_SQRT1_2.c */ +#define M_SQRT1_2 1.0/sqrt(2.0) +/* ./src/math/M_SQRT2.c */ +#define M_SQRT2 sqrt(2.0) +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/math/double_t.c */ +#ifndef __TYPE_double_t_DEFINED__ +#define __TYPE_double_t_DEFINED__ +#if FLT_EVAL_METHOD == 0 +typedef double double_t; +#elif FLT_EVAL_METHOD == 1 +typedef double double_t; +#elif FLT_EVAL_METHOD == 2 +typedef long double double_t; +#else + /* implementation defined */ +#endif +#endif + +/* ./src/math/float_t.c */ +#ifndef __TYPE_float_t_DEFINED__ +#define __TYPE_float_t_DEFINED__ +#if FLT_EVAL_METHOD == 0 +typedef float float_t; +#elif FLT_EVAL_METHOD == 1 +typedef double float_t; +#elif FLT_EVAL_METHOD == 2 +typedef long double float_t; +#else + /* implementation defined */ +#endif +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/math/signgam.c */ +extern int signgam; +#endif + +/* ./src/math/__fpclassify.c */ +int __fpclassify(double x); +int __fpclassifyf(float x); +int __fpclassifyl(long double x); + +/* ./src/math/acos.c */ +double acos(double x); +float acosf(float x); +long double acosl(long double x); +/* ./src/math/asin.c */ +double asin(double x); +float asinf(float x); +long double asinl(long double x); +/* ./src/math/atan.c */ +double atan(double x); +float atanf(float x); +long double atanl(long double x); +/* ./src/math/atan2.c */ +double atan2(double y, double x); +float atan2f(float y, float x); +long double atan2l(long double y, long double x); +/* ./src/math/ceil.c */ +double ceil(double x); +float ceilf(float x); +long double ceill(long double x); +/* ./src/math/cos.c */ +double cos(double x); +float cosf(float x); +long double cosl(long double x); +/* ./src/math/cosh.c */ +double cosh(double x); +float coshf(float x); +long double coshl(long double x); +/* ./src/math/exp.c */ +double exp(double x); +float expf(float x); +long double expl(long double x); +/* ./src/math/fabs.c */ +double fabs(double x); +float fabsf(float x); +long double fabsl(long double x); +/* ./src/math/floor.c */ +double floor(double x); +float floorf(float x); +long double floorl(long double x); +/* ./src/math/fmod.c */ +double fmod(double x, double y); +float fmodf(float x, float y); +long double fmodl(long double x, long double y); +/* ./src/math/frexp.c */ +double frexp(double value, int *exp); +float frexpf(float value, int *exp); +long double frexpl(long double value, int *exp); +/* ./src/math/ldexp.c */ +double ldexp(double x, int exp); +float ldexpf(float x, int exp); +long double ldexpl(long double x, int exp); +/* ./src/math/log.c */ +double log(double x); +float logf(float x); +long double logl(long double x); +/* ./src/math/log10.c */ +double log10(double x); +float log10f(float x); +long double log10l(long double x); +/* ./src/math/modf.c */ +double modf(double value, double *iptr); +float modff(float value, float *iptr); +long double modfl(long double value, long double *iptr); +/* ./src/math/pow.c */ +double pow(double x, double y); +float powf(float x, float y); +long double powl(long double x, long double y); +/* ./src/math/sin.c */ +double sin(double x); +float sinf(float x); +long double sinl(long double x); +/* ./src/math/sinh.c */ +double sinh(double x); +float sinhf(float x); +long double sinhl(long double x); +/* ./src/math/sqrt.c */ +double sqrt(double x); +float sqrtf(float x); +long double sqrtl(long double x); +/* ./src/math/tan.c */ +double tan(double x); +float tanf(float x); +long double tanl(long double x); +/* ./src/math/tanh.c */ +double tanh(double x); +float tanhf(float x); +long double tanhl(long double x); + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/math/copysign.c */ +double copysign(double x, double y); +float copysignf(float x, float y); +long double copysignl(long double x, long double y); +/* ./src/math/exp2.c */ +double exp2(double x); +float exp2f(float x); +long double exp2l(long double x); +/* ./src/math/fdim.c */ +double fdim(double x, double y); +float fdimf(float x, float y); +long double fdiml(long double x, long double y); +/* ./src/math/fma.c */ +double fma(double x, double y, double z); +float fmaf(float x, float y, float z); +long double fmal(long double x, long double y, long double z); +/* ./src/math/fmax.c */ +double fmax(double x, double y); +float fmaxf(float x, float y); +long double fmaxl(long double x, long double y); +/* ./src/math/fmin.c */ +double fmin(double x, double y); +float fminf(float x, float y); +long double fminl(long double x, long double y); +/* ./src/math/llrint.c */ +long long int llrint(double x); +long long int llrintf(float x); +long long int llrintl(long double x); +/* ./src/math/llround.c */ +long long int llround(double x); +long long int llroundf(float x); +long long int llroundl(long double x); +/* ./src/math/log2.c */ +double log2(double x); +float log2f(float x); +long double log2l(long double x); +/* ./src/math/lrint.c */ +long int lrint(double x); +long int lrintf(float x); +long int lrintl(long double x); +/* ./src/math/lround.c */ +long int lround(double x); +long int lroundf(float x); +long int lroundl(long double x); +/* ./src/math/nan.c */ +double nan(const char *tagp); +float nanf(const char *tagp); +long double nanl(const char *tagp); +/* ./src/math/nearbyint.c */ +double nearbyint(double x); +float nearbyintf(float x); +long double nearbyintl(long double x); +/* ./src/math/nexttoward.c */ +double nexttoward(double x, double y); +float nexttowardf(float x, float y); +long double nexttowardl(long double x, long double y); +/* ./src/math/remquo.c */ +double remquo(double x, double y, int *quo); +float remquof(float x, float y, int *quo); +long double remquol(long double x, long double y, int *quo); +/* ./src/math/round.c */ +double round(double x); +float roundf(float x); +long double roundl(long double x); +/* ./src/math/scalbln.c */ +double scalbln(double x, long int n); +float scalblnf(float x, long int n); +long double scalblnl(long double x, long int n); +/* ./src/math/scalbn.c */ +double scalbn(double x, int n); +float scalbnf(float x, int n); +long double scalbnl(long double x, int n); +/* ./src/math/tgamma.c */ +double tgamma(double x); +float tgammaf(float x); +long double tgammal(long double x); +/* ./src/math/trunc.c */ +double trunc(double x); +float truncf(float x); +long double truncl(long double x); +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) || \ + (defined _XOPEN_SOURCE) +/* ./src/math/erf.c */ +double erf(double x); +float erff(float x); +long double erfl(long double x); +/* ./src/math/erfc.c */ +double erfc(double x); +float erfcf(float x); +long double erfcl(long double x); +/* ./src/math/hypot.c */ +double hypot(double x, double y); +float hypotf(float x, float y); +long double hypotl(long double x, long double y); +/* ./src/math/lgamma.c */ +double lgamma(double x); +float lgammaf(float x); +long double lgammal(long double x); +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/math/acosh.c */ +double acosh(double x); +float acoshf(float x); +long double acoshl(long double x); +/* ./src/math/asinh.c */ +double asinh(double x); +float asinhf(float x); +long double asinhl(long double x); +/* ./src/math/atanh.c */ +double atanh(double x); +float atanhf(float x); +long double atanhl(long double x); +/* ./src/math/cbrt.c */ +double cbrt(double x); +float cbrtf(float x); +long double cbrtl(long double x); +/* ./src/math/expm1.c */ +double expm1(double x); +float expm1f(float x); +long double expm1l(long double x); +/* ./src/math/ilogb.c */ +int ilogb(double x); +int ilogbf(float x); +int ilogbl(long double x); +/* ./src/math/log1p.c */ +double log1p(double x); +float log1pf(float x); +long double log1pl(long double x); +/* ./src/math/logb.c */ +double logb(double x); +float logbf(float x); +long double logbl(long double x); +/* ./src/math/nextafter.c */ +double nextafter(double x, double y); +float nextafterf(float x, float y); +long double nextafterl(long double x, long double y); +/* ./src/math/rint.c */ +double rint(double x); +float rintf(float x); +long double rintl(long double x); +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/math/remainder.c */ +double remainder(double x, double y); +float remainderf(float x, float y); +long double remainderl(long double x, long double y); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/math/j0.c */ +double j0(double __x); +/* ./src/math/j1.c */ +double j1(double __x); +/* ./src/math/jn.c */ +double jn(int __n, double __x); +/* ./src/math/y0.c */ +double y0(double __x); +/* ./src/math/y1.c */ +double y1(double __x); +/* ./src/math/yn.c */ +double yn(int __n, double __x); +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/math/gamma.c */ +double gamma(double __x); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/math/scalb.c */ +double scalb(double __x, double __n); +#endif + + +#endif diff --git a/monetary.h b/monetary.h new file mode 100644 index 0000000..aa74177 --- /dev/null +++ b/monetary.h @@ -0,0 +1,80 @@ +#ifndef __MONETARY_H__ +#define __MONETARY_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/sys/types/ssize_t.c */ +#ifndef __TYPE_ssize_t_DEFINED__ +#define __TYPE_ssize_t_DEFINED__ +typedef long int ssize_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/monetary/strfmon.c */ +ssize_t strfmon(char * restrict __s, size_t __maxsize, const char * restrict __format, ...); +#endif + + +#endif diff --git a/mqueue.h b/mqueue.h new file mode 100644 index 0000000..0fe4df4 --- /dev/null +++ b/mqueue.h @@ -0,0 +1,93 @@ +#ifndef __MQUEUE_H__ +#define __MQUEUE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/mqueue/mqd_t.c */ +#ifndef __TYPE_mqd_t_DEFINED__ +#define __TYPE_mqd_t_DEFINED__ +typedef unsigned long int mqd_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/mqueue/struct_mq_attr.c */ +#ifndef __TYPE_struct_mq_attr_DEFINED__ +#define __TYPE_struct_mq_attr_DEFINED__ +struct mq_attr { + long mq_flags; + long mq_maxmsg; + long mq_msgsize; + long mq_curmsgs; +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/mqueue/mq_close.c */ +int mq_close(mqd_t __mqdes); +/* ./src/mqueue/mq_getattr.c */ +int mq_getattr(mqd_t __mqdes, struct mq_attr * __mqstat); +/* ./src/mqueue/mq_notify.c */ +int mq_notify(mqd_t __mqdes, const struct sigevent * __notification); +/* ./src/mqueue/mq_open.c */ +mqd_t mq_open(const char * __name, int __oflag, ...); +/* ./src/mqueue/mq_receive.c */ +ssize_t mq_receive(mqd_t __mqdes, char * __msg_ptr, size_t __msg_len, unsigned * __msg_prio); +/* ./src/mqueue/mq_send.c */ +int mq_send(mqd_t __mqdes, const char * __msg_ptr, size_t __msg_len, unsigned __msg_prio); +/* ./src/mqueue/mq_setattr.c */ +int mq_setattr(mqd_t __mqdes, const struct mq_attr * restrict __mqstat, struct mq_attr * restrict __omqstat); +/* ./src/mqueue/mq_unlink.c */ +int mq_unlink(const char * __name); +#endif + + +#endif diff --git a/ndbm.h b/ndbm.h new file mode 100644 index 0000000..5a873c0 --- /dev/null +++ b/ndbm.h @@ -0,0 +1,77 @@ +#ifndef __NDBM_H__ +#define __NDBM_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ndbm/DBM_INSERT.c */ +#define DBM_INSERT 1 +/* ./src/ndbm/DBM_REPLACE.c */ +#define DBM_REPLACE 2 +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ndbm/DBM.c */ +#ifndef __TYPE_DBM_DEFINED__ +#define __TYPE_DBM_DEFINED__ +typedef struct __DBM DBM; +#endif + +/* ./src/ndbm/datum.c */ +#ifndef __TYPE_datum_DEFINED__ +#define __TYPE_datum_DEFINED__ +typedef struct { + void * dptr; + size_t dsize; +} datum; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/ndbm/dbm_clearerr.c */ +int dbm_clearerr(DBM * __db); +/* ./src/ndbm/dbm_close.c */ +void dbm_close(DBM * __db); +/* ./src/ndbm/dbm_delete.c */ +int dbm_delete(DBM * __db, datum __key); +/* ./src/ndbm/dbm_error.c */ +int dbm_error(DBM * __db); +/* ./src/ndbm/dbm_fetch.c */ +datum dbm_fetch(DBM * __db, datum __key); +/* ./src/ndbm/dbm_firstkey.c */ +datum dbm_firstkey(DBM * __db); +/* ./src/ndbm/dbm_nextkey.c */ +datum dbm_nextkey(DBM * __db); +/* ./src/ndbm/dbm_open.c */ +DBM *dbm_open(const char * __file, int __open_flags, mode_t __file_mode); +/* ./src/ndbm/dbm_store.c */ +int dbm_store(DBM * __db, datum __key, datum __content, int __store_mode); +#endif + + +#endif diff --git a/nl_types.h b/nl_types.h new file mode 100644 index 0000000..83eee85 --- /dev/null +++ b/nl_types.h @@ -0,0 +1,62 @@ +#ifndef __NL_TYPES_H__ +#define __NL_TYPES_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* ./src/nl_types/NL_CAT_LOCALE.c */ +#define NL_CAT_LOCALE 1 +/* ./src/nl_types/NL_SETD.c */ +#define NL_SETD 1 +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/nl_types/nl_catd.c */ +#ifndef __TYPE_nl_catd_DEFINED__ +#define __TYPE_nl_catd_DEFINED__ +typedef unsigned long int nl_catd; +#endif + +/* ./src/nl_types/nl_item.c */ +#ifndef __TYPE_nl_item_DEFINED__ +#define __TYPE_nl_item_DEFINED__ +typedef int nl_item; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/nl_types/catclose.c */ +int catclose(nl_catd __catd); +/* ./src/nl_types/catgets.c */ +char * catgets(nl_catd __catd, int __set_id, int __msg_id, const char * __s); +/* ./src/nl_types/catopen.c */ +nl_catd catopen(const char* __name, int __oflag); +#endif + + +#endif diff --git a/poll.h b/poll.h new file mode 100644 index 0000000..6bfebac --- /dev/null +++ b/poll.h @@ -0,0 +1,101 @@ +#ifndef __POLL_H__ +#define __POLL_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/poll/POLLERR.c */ +#define POLLERR (8) +/* ./src/poll/POLLHUP.c */ +#define POLLHUP (9) +/* ./src/poll/POLLIN.c */ +#define POLLIN (1) +/* ./src/poll/POLLNVAL.c */ +#define POLLNVAL (10) +/* ./src/poll/POLLOUT.c */ +#define POLLOUT (5) +/* ./src/poll/POLLPRI.c */ +#define POLLPRI (4) +/* ./src/poll/POLLRDBAND.c */ +#define POLLRDBAND (3) +/* ./src/poll/POLLRDNORM.c */ +#define POLLRDNORM (2) +/* ./src/poll/POLLWRBAND.c */ +#define POLLWRBAND (7) +/* ./src/poll/POLLWRNORM.c */ +#define POLLWRNORM (6) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/poll/nfds_t.c */ +#ifndef __TYPE_nfds_t_DEFINED__ +#define __TYPE_nfds_t_DEFINED__ +typedef unsigned int nfds_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/poll/struct_pollfd.c */ +#ifndef __TYPE_struct_pollfd_DEFINED__ +#define __TYPE_struct_pollfd_DEFINED__ +struct pollfd { + int fd; + short events; + short revents; +}; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/poll/poll.c */ +int poll(struct pollfd fds[], nfds_t __nfds, int __timeout); +#endif + + +#endif diff --git a/pwd.h b/pwd.h new file mode 100644 index 0000000..870d482 --- /dev/null +++ b/pwd.h @@ -0,0 +1,95 @@ +#ifndef __PWD_H__ +#define __PWD_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +/* src/sys/types/uid_t.c */ +#ifndef __TYPE_uid_t_DEFINED__ +#define __TYPE_uid_t_DEFINED__ +typedef unsigned long int + uid_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/pwd/struct_passwd.c */ +#ifndef __TYPE_struct_passwd_DEFINED__ +#define __TYPE_struct_passwd_DEFINED__ +struct passwd { + char * pw_name; + uid_t pw_uid; + gid_t pw_gid; + char * pw_dir; + char * pw_shell; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/pwd/getpwnam.c */ +struct passwd * getpwnam(const char * __name); +/* ./src/pwd/getpwuid.c */ +struct passwd * getpwuid(uid_t __uid); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/pwd/endpwent.c */ +void endpwent(void); +/* ./src/pwd/getpwent.c */ +struct passwd * getpwent(void); +/* ./src/pwd/setpwent.c */ +void setpwent(void); +#endif + + +#endif diff --git a/re_comp.h b/re_comp.h new file mode 100644 index 0000000..9539cac --- /dev/null +++ b/re_comp.h @@ -0,0 +1,38 @@ +#ifndef __RE_COMP_H__ +#define __RE_COMP_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/re_comp/re_comp.c */ +char *re_comp(const char *__string); +/* ./src/re_comp/re_exec.c */ +int re_exec(const char *__string); +#endif + + +#endif diff --git a/regex.h b/regex.h new file mode 100644 index 0000000..381ebc2 --- /dev/null +++ b/regex.h @@ -0,0 +1,131 @@ +#ifndef __REGEX_H__ +#define __REGEX_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/regex/REG_BADBR.c */ +#define REG_BADBR (10) +/* ./src/regex/REG_BADPAT.c */ +#define REG_BADPAT (2) +/* ./src/regex/REG_BADRPT.c */ +#define REG_BADRPT (13) +/* ./src/regex/REG_EBRACE.c */ +#define REG_EBRACE (9) +/* ./src/regex/REG_EBRACK.c */ +#define REG_EBRACK (7) +/* ./src/regex/REG_ECOLLATE.c */ +#define REG_ECOLLATE (3) +/* ./src/regex/REG_ECTYPE.c */ +#define REG_ECTYPE (4) +/* ./src/regex/REG_EESCAPE.c */ +#define REG_EESCAPE (5) +/* ./src/regex/REG_ENOSYS.c */ +#define REG_ENOSYS (-1) +/* ./src/regex/REG_EPAREN.c */ +#define REG_EPAREN (8) +/* ./src/regex/REG_ERANGE.c */ +#define REG_ERANGE (11) +/* ./src/regex/REG_ESPACE.c */ +#define REG_ESPACE (12) +/* ./src/regex/REG_ESUBREG.c */ +#define REG_ESUBREG (6) +/* ./src/regex/REG_EXTENDED.c */ +#define REG_EXTENDED (1<<0) +/* ./src/regex/REG_ICASE.c */ +#define REG_ICASE (1<<1) +/* ./src/regex/REG_NEWLINE.c */ +#define REG_NEWLINE (1<<3) +/* ./src/regex/REG_NOMATCH.c */ +#define REG_NOMATCH (1) +/* ./src/regex/REG_NOSUB.c */ +#define REG_NOSUB (1<<2) +/* ./src/regex/REG_NOTBOL.c */ +#define REG_NOTBOL (1<<0) +/* ./src/regex/REG_NOTEOL.c */ +#define REG_NOTEOL (1<<1) +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/regex/regex_t.c */ +#ifndef __TYPE_regex_t_DEFINED__ +#define __TYPE_regex_t_DEFINED__ +typedef struct { + size_t re_nsub; +} regex_t; +#endif + +/* ./src/regex/regmatch_t.c */ +#ifndef __TYPE_regmatch_t_DEFINED__ +#define __TYPE_regmatch_t_DEFINED__ +typedef struct { + regoff_t rm_so; + regoff_t rm_eo; +} regmatch_t; +#endif + +/* ./src/regex/regoff_t.c */ +#ifndef __TYPE_regoff_t_DEFINED__ +#define __TYPE_regoff_t_DEFINED__ +typedef long long int regoff_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/regex/regcomp.c */ +int regcomp(regex_t * restrict __preg, const char * restrict __pattern, int __cflags); +/* ./src/regex/regerror.c */ +size_t regerror(int __errcode, const regex_t * restrict __preg, char * restrict __errbuf, size_t __errbuf_size); +/* ./src/regex/regexec.c */ +int regexec(const regex_t * restrict __preg, const char * restrict __string, size_t __nmatch, regmatch_t pmatch[restrict], int __eflags); +/* ./src/regex/regfree.c */ +void regfree(regex_t * __preg); +#endif + + +#endif diff --git a/regexp.h b/regexp.h new file mode 100644 index 0000000..94492f5 --- /dev/null +++ b/regexp.h @@ -0,0 +1,49 @@ +#ifndef __REGEXP_H__ +#define __REGEXP_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/regexp/loc1.c */ +extern char *loc1; +/* ./src/regexp/loc2.c */ +extern char *loc2; +/* ./src/regexp/locs.c */ +extern char *locs; +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/regexp/advance.c */ +int advance(const char *__string, const char *__expbuf); +/* ./src/regexp/compile.c */ +char *compile(char *__instring, char *__expbuf, const char *__endbuf, int __eof); +/* ./src/regexp/step.c */ +int step(const char *__string, const char *__expbuf); +#endif + + +#endif diff --git a/sched.h b/sched.h new file mode 100644 index 0000000..5190a51 --- /dev/null +++ b/sched.h @@ -0,0 +1,92 @@ +#ifndef __SCHED_H__ +#define __SCHED_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sched/SCHED_FIFO.c */ +#define SCHED_FIFO (0) +/* ./src/sched/SCHED_OTHER.c */ +#define SCHED_OTHER (3) +/* ./src/sched/SCHED_RR.c */ +#define SCHED_RR (1) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sched/struct_sched_param.c */ +#ifndef __TYPE_struct_sched_param_DEFINED__ +#define __TYPE_struct_sched_param_DEFINED__ +struct sched_param { + int sched_priority; + #if defined _POSIX_SS || defined _POSIX_TSP + int sched_ss_low_priority; + struct timespec sched_ss_repl_period; + struct timespec sched_ss_init_budget; + int sched_ss_max_repl; + #endif +}; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sched/sched_get_priority_max.c */ +int sched_get_priority_max(int __policy); +/* ./src/sched/sched_get_priority_min.c */ +int sched_get_priority_min(int __policy); +/* ./src/sched/sched_getparam.c */ +int sched_getparam(pid_t __pid, struct sched_param * __param); +/* ./src/sched/sched_getscheduler.c */ +int sched_getscheduler(pid_t __pid); +/* ./src/sched/sched_rr_get_interval.c */ +int sched_rr_get_interval(pid_t __pid, struct timespec * __interval); +/* ./src/sched/sched_setparam.c */ +int sched_setparam(pid_t __pid, const struct sched_param * __param); +/* ./src/sched/sched_setscheduler.c */ +int sched_setscheduler(pid_t __pid, int __policy, const struct sched_param * __param); +/* ./src/sched/sched_yield.c */ +int sched_yield(void); +#endif + + +#endif diff --git a/search.h b/search.h new file mode 100644 index 0000000..539aa69 --- /dev/null +++ b/search.h @@ -0,0 +1,109 @@ +#ifndef __SEARCH_H__ +#define __SEARCH_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* ./src/search/ACTION.c */ +#ifndef __TYPE_ACTION_DEFINED__ +#define __TYPE_ACTION_DEFINED__ +typedef enum { + FIND, + ENTER +} ACTION; +#endif + +/* ./src/search/ENTRY.c */ +#ifndef __TYPE_ENTRY_DEFINED__ +#define __TYPE_ENTRY_DEFINED__ +typedef struct { + char * key; + void * data; +} ENTRY; +#endif + +/* ./src/search/VISIT.c */ +#ifndef __TYPE_VISIT_DEFINED__ +#define __TYPE_VISIT_DEFINED__ +typedef enum { + preorder, + postorder, + endorder, + leaf +} VISIT; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/search/hcreate.c */ +int hcreate(size_t __nel); +/* ./src/search/hdestroy.c */ +void hdestroy(void); +/* ./src/search/hsearch.c */ +ENTRY * hsearch(ENTRY __item, ACTION __action); +/* ./src/search/lfind.c */ +void * lfind(const void * __key, const void * __base, size_t * __nelp, size_t __width, int (*__compar) (const void *, const void *)); +/* ./src/search/lsearch.c */ +void * lsearch(const void * __key, void * __base, size_t * __nelp, size_t __width, int (*__compar) (const void *, const void *)); +/* ./src/search/tdelete.c */ +void *tdelete(const void * restrict __key, void ** restrict __rootp, int (*__compar) (const void *, const void *)); +/* ./src/search/tfind.c */ +void *tfind(const void * __key, void * const * __rootp, int (*__compar) (const void *, const void *)); +/* ./src/search/tsearch.c */ +void *tsearch(const void * __key, void ** __rootp, int (*__compar) (const void *, const void *)); +/* ./src/search/twalk.c */ +void twalk(const void * __root, void (*__action) (const void *, __VISIT, __int)); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/search/insque.c */ +void insque(void * __element, void * __pred); +/* ./src/search/remque.c */ +void remque(void * __element); +#endif + + +#endif diff --git a/semaphore.h b/semaphore.h new file mode 100644 index 0000000..b6e6ef1 --- /dev/null +++ b/semaphore.h @@ -0,0 +1,81 @@ +#ifndef __SEMAPHORE_H__ +#define __SEMAPHORE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/semaphore/sem_t.c */ +#ifndef __TYPE_sem_t_DEFINED__ +#define __TYPE_sem_t_DEFINED__ +typedef struct __sem_t sem_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/semaphore/sem_close.c */ +int sem_close(sem_t *__sem); +/* ./src/semaphore/sem_destroy.c */ +int sem_destroy(sem_t * __sem); +/* ./src/semaphore/sem_getvalue.c */ +int sem_getvalue(sem_t * restrict __sem, int * restrict __sval); +/* ./src/semaphore/sem_init.c */ +int sem_init(sem_t * __sem, int __pshared, unsigned __value); +/* ./src/semaphore/sem_open.c */ +sem_t * sem_open(const char * __name, int __oflag, ...); +/* ./src/semaphore/sem_post.c */ +int sem_post(sem_t * __sem); +/* ./src/semaphore/sem_trywait.c */ +int sem_trywait(sem_t * __sem); +/* ./src/semaphore/sem_unlink.c */ +int sem_unlink(const char * __name); +/* ./src/semaphore/sem_wait.c */ +int sem_wait(sem_t * __sem); +#endif + + +#endif diff --git a/setjmp.h b/setjmp.h new file mode 100644 index 0000000..2143d34 --- /dev/null +++ b/setjmp.h @@ -0,0 +1,86 @@ +#ifndef __SETJMP_H__ +#define __SETJMP_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/setjmp/jmp_buf.c */ +#ifndef __TYPE_jmp_buf_DEFINED__ +#define __TYPE_jmp_buf_DEFINED__ +typedef unsigned long int jmp_buf[32]; +#endif + + +#if (defined _POSIX_SOURCE) +/* ./src/setjmp/sigjmp_buf.c */ +#ifndef __TYPE_sigjmp_buf_DEFINED__ +#define __TYPE_sigjmp_buf_DEFINED__ +typedef jmp_buf sigjmp_buf; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 200112L) +#define _Noreturn +#endif + +/* ./src/setjmp/longjmp.c */ +_Noreturn void longjmp(jmp_buf __env, int __val); +/* ./src/setjmp/setjmp.c */ +int setjmp(jmp_buf __env); + +#if (defined _POSIX_SOURCE) +/* ./src/setjmp/siglongjmp.c */ +void siglongjmp(sigjmp_buf __env, int __val); +/* ./src/setjmp/sigsetjmp.c */ +int sigsetjmp(sigjmp_buf __env, int __savemask); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/setjmp/_longjmp.c */ +void _longjmp(jmp_buf __env, int __val); +/* ./src/setjmp/_setjmp.c */ +int _setjmp(jmp_buf __env); +#endif + + +#endif diff --git a/signal.h b/signal.h new file mode 100644 index 0000000..9b5bc85 --- /dev/null +++ b/signal.h @@ -0,0 +1,451 @@ +#ifndef __SIGNAL_H__ +#define __SIGNAL_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/signal/SIGABRT.c */ +#define SIGABRT (6) +/* ./src/signal/SIGFPE.c */ +#define SIGFPE (4) +/* ./src/signal/SIGILL.c */ +#define SIGILL (5) +/* ./src/signal/SIGINT.c */ +#define SIGINT (2) +/* ./src/signal/SIGSEGV.c */ +#define SIGSEGV (7) +/* ./src/signal/SIGTERM.c */ +#define SIGTERM (15) +/* ./src/signal/SIG_DFL.c */ +#define SIG_DFL ((void(*)(int))-1) +/* ./src/signal/SIG_ERR.c */ +#define SIG_ERR ((void(*)(int))-2) +/* ./src/signal/SIG_IGN.c */ +#define SIG_IGN ((void(*)(int))-3) + +#if (defined _POSIX_SOURCE) +/* ./src/signal/SA_NOCLDSTOP.c */ +#define SA_NOCLDSTOP (1<<0) +/* ./src/signal/SIGALRM.c */ +#define SIGALRM (14) +/* ./src/signal/SIGCHLD.c */ +#define SIGCHLD (13) +/* ./src/signal/SIGCONT.c */ +#define SIGCONT (14) +/* ./src/signal/SIGHUP.c */ +#define SIGHUP (0) +/* ./src/signal/SIGKILL.c */ +#define SIGKILL (9) +/* ./src/signal/SIGPIPE.c */ +#define SIGPIPE (16) +/* ./src/signal/SIGQUIT.c */ +#define SIGQUIT (3) +/* ./src/signal/SIGSTOP.c */ +#define SIGSTOP (31) +/* ./src/signal/SIGTSTP.c */ +#define SIGTSTP (18) +/* ./src/signal/SIGTTIN.c */ +#define SIGTTIN (19) +/* ./src/signal/SIGTTOU.c */ +#define SIGTTOU (20) +/* ./src/signal/SIGUSR1.c */ +#define SIGUSR1 (21) +/* ./src/signal/SIGUSR2.c */ +#define SIGUSR2 (22) +/* ./src/signal/SIG_BLOCK.c */ +#define SIG_BLOCK (1) +/* ./src/signal/SIG_SETMASK.c */ +#define SIG_SETMASK (3) +/* ./src/signal/SIG_UNBLOCK.c */ +#define SIG_UNBLOCK (2) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/signal/SIGEV_NONE.c */ +#define SIGEV_NONE (0) +/* ./src/signal/SIGEV_SIGNAL.c */ +#define SIGEV_SIGNAL (1) +/* ./src/signal/SIGRTMAX.c */ +#define SIGRTMAX /* maximum real time signal */ +/* ./src/signal/SIGRTMIN.c */ +#define SIGRTMIN /* minimum real-time signal */ +/* ./src/signal/SI_ASYNCIO.c */ +#define SI_ASYNCIO (14) +/* ./src/signal/SI_MESGQ.c */ +#define SI_MESGQ (15) +/* ./src/signal/SI_QUEUE.c */ +#define SI_QUEUE (12) +/* ./src/signal/SI_TIMER.c */ +#define SI_TIMER (13) +/* ./src/signal/SI_USER.c */ +#define SI_USER (11) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/SA_SIGINFO.c */ +#define SA_SIGINFO (1<<4) +/* ./src/signal/SIGBUS.c */ +#define SIGBUS (12) +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/SIGURG.c */ +#define SIGURG (27) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/BUS_ADRALN.c */ +#define BUS_ADRALN (1) +/* ./src/signal/BUS_ADRERR.c */ +#define BUS_ADRERR (2) +/* ./src/signal/BUS_OBJERR.c */ +#define BUS_OBJERR (3) +/* ./src/signal/CLD_CONTINUED.c */ +#define CLD_CONTINUED (6) +/* ./src/signal/CLD_DUMPED.c */ +#define CLD_DUMPED (3) +/* ./src/signal/CLD_EXITED.c */ +#define CLD_EXITED (1) +/* ./src/signal/CLD_KILLED.c */ +#define CLD_KILLED (2) +/* ./src/signal/CLD_STOPPED.c */ +#define CLD_STOPPED (5) +/* ./src/signal/CLD_TRAPPED.c */ +#define CLD_TRAPPED (4) +/* ./src/signal/FPE_FLTDIV.c */ +#define FPE_FLTDIV (3) +/* ./src/signal/FPE_FLTINV.c */ +#define FPE_FLTINV (7) +/* ./src/signal/FPE_FLTOVF.c */ +#define FPE_FLTOVF (4) +/* ./src/signal/FPE_FLTRES.c */ +#define FPE_FLTRES (6) +/* ./src/signal/FPE_FLTSUB.c */ +#define FPE_FLTSUB (8) +/* ./src/signal/FPE_FLTUND.c */ +#define FPE_FLTUND (5) +/* ./src/signal/FPE_INTDIV.c */ +#define FPE_INTDIV (1) +/* ./src/signal/FPE_INTOVF.c */ +#define FPE_INTOVF (2) +/* ./src/signal/ILL_BADSTK.c */ +#define ILL_BADSTK (8) +/* ./src/signal/ILL_COPROC.c */ +#define ILL_COPROC (7) +/* ./src/signal/ILL_ILLADR.c */ +#define ILL_ILLADR (3) +/* ./src/signal/ILL_ILLOPC.c */ +#define ILL_ILLOPC (1) +/* ./src/signal/ILL_ILLOPN.c */ +#define ILL_ILLOPN (2) +/* ./src/signal/ILL_ILLTRP.c */ +#define ILL_ILLTRP (4) +/* ./src/signal/ILL_PRVOPC.c */ +#define ILL_PRVOPC (5) +/* ./src/signal/ILL_PRVREG.c */ +#define ILL_PRVREG (6) +/* ./src/signal/SA_NOCLDWAIT.c */ +#define SA_NOCLDWAIT (1<<5) +/* ./src/signal/SA_NODEFER.c */ +#define SA_NODEFER (1<<6) +/* ./src/signal/SA_RESETHAND.c */ +#define SA_RESETHAND (1<<2) +/* ./src/signal/SA_RESTART.c */ +#define SA_RESTART (1<<3) +/* ./src/signal/SEGV_ACCERR.c */ +#define SEGV_ACCERR (2) +/* ./src/signal/SEGV_MAPERR.c */ +#define SEGV_MAPERR (1) +/* ./src/signal/TRAP_TRACE.c */ +#define TRAP_TRACE (2) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/MINSIGSTKSZ.c */ +#define MINSIGSTKSZ (1024) +/* ./src/signal/POLL_ERR.c */ +#define POLL_ERR (4) +/* ./src/signal/POLL_HUP.c */ +#define POLL_HUP (6) +/* ./src/signal/POLL_IN.c */ +#define POLL_IN (1) +/* ./src/signal/POLL_MSG.c */ +#define POLL_MSG (3) +/* ./src/signal/POLL_OUT.c */ +#define POLL_OUT (2) +/* ./src/signal/POLL_PRI.c */ +#define POLL_PRI (5) +/* ./src/signal/SA_ONSTACK.c */ +#define SA_ONSTACK (1<<1) +/* ./src/signal/SIGPOLL.c */ +#define SIGPOLL (23) +/* ./src/signal/SIGPROF.c */ +#define SIGPROF (24) +/* ./src/signal/SIGSTKSZ.c */ +#define SIGSTKSZ (1024) +/* ./src/signal/SIGSYS.c */ +#define SIGSYS (25) +/* ./src/signal/SIGTRAP.c */ +#define SIGTRAP (26) +/* ./src/signal/SIGVTALRM.c */ +#define SIGVTALRM (28) +/* ./src/signal/SIGXCPU.c */ +#define SIGXCPU (29) +/* ./src/signal/SIGXFSZ.c */ +#define SIGXFSZ (30) +/* ./src/signal/SIG_HOLD.c */ +#define SIG_HOLD /* TODO */ +/* ./src/signal/SS_DISABLE.c */ +#define SS_DISABLE (1<<8) +/* ./src/signal/SS_ONSTACK.c */ +#define SS_ONSTACK (1<<7) +/* ./src/signal/TRAP_BRKPT.c */ +#define TRAP_BRKPT (1) +#endif + +/* ./src/signal/sig_atomic_t.c */ +#ifndef __TYPE_sig_atomic_t_DEFINED__ +#define __TYPE_sig_atomic_t_DEFINED__ +typedef volatile int sig_atomic_t; +#endif + + +#if (defined _POSIX_SOURCE) +/* ./src/signal/sigset_t.c */ +#ifndef __TYPE_sigset_t_DEFINED__ +#define __TYPE_sigset_t_DEFINED__ +typedef unsigned int sigset_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/siginfo_t.c */ +#ifndef __TYPE_siginfo_t_DEFINED__ +#define __TYPE_siginfo_t_DEFINED__ +typedef struct { + int si_signo; + int si_code; + pid_t si_pid; + uid_t si_uid; + void *si_addr; + int si_status; + long si_band; + int si_errno; + union sigval si_value; +} siginfo_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/stack_t.c */ +#ifndef __TYPE_stack_t_DEFINED__ +#define __TYPE_stack_t_DEFINED__ +typedef struct { + void *ss_sp; /* Stack base or pointer */ + size_t ss_size; /* Stack size */ + int ss_flags; /* Flags */ +} stack_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/ucontext/ucontext_t.c */ +#ifndef __TYPE_ucontext_t_DEFINED__ +#define __TYPE_ucontext_t_DEFINED__ +typedef struct ucontext_t { + struct ucontext_t * uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; +} ucontext_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/signal/struct_sigaction.c */ +#ifndef __TYPE_struct_sigaction_DEFINED__ +#define __TYPE_struct_sigaction_DEFINED__ +struct sigaction { + void (*sa_handler)(int); + sigset_t sa_mask; + int sa_flags; + #if (_POSIX_C_SOURCE >= 199506L) || (defined _XOPEN_SOURCE && defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) + void (*sa_sigaction)(int, siginfo_t *, void *); + #else + void (*__padding)(int, void *, void *); + #endif +}; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/signal/struct_sigevent.c */ +#ifndef __TYPE_struct_sigevent_DEFINED__ +#define __TYPE_struct_sigevent_DEFINED__ +struct sigevent { + int sigev_notify; + int sigev_signo; + union sigval sigev_value; + void (*sigev_notify_function)(union sigval); + pthread_attr_t *siegev_notify_attributes; +}; +#endif + +/* ./src/signal/union_sigval.c */ +#ifndef __TYPE_union_sigval_DEFINED__ +#define __TYPE_union_sigval_DEFINED__ +union sigval { + int sival_int; + void *sival_ptr; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/signal/struct_sigstack.c */ +#ifndef __TYPE_struct_sigstack_DEFINED__ +#define __TYPE_struct_sigstack_DEFINED__ +struct sigstack { + int ss_onstack; + void *ss_sp; +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +/* ./src/signal/raise.c */ +int raise(int __sig); +/* ./src/signal/signal.c */ +void (*signal(int __sig, void (*__func)(int)))(int); + +#if (defined _POSIX_SOURCE) +/* ./src/signal/kill.c */ +int kill(pid_t __pid, int __sig); +/* ./src/signal/sigaction.c */ +int sigaction(int __sig, const struct sigaction * restrict __act, struct sigaction * restrict __oact); +/* ./src/signal/sigaddset.c */ +int sigaddset(sigset_t * __set, int __signo); +/* ./src/signal/sigdelset.c */ +int sigdelset(sigset_t * __set, int __signo); +/* ./src/signal/sigemptyset.c */ +int sigemptyset(sigset_t * __set); +/* ./src/signal/sigfillset.c */ +int sigfillset(sigset_t * __set); +/* ./src/signal/sigismember.c */ +int sigismember(const sigset_t * __set, int __signo); +/* ./src/signal/sigpending.c */ +int sigpending(sigset_t * __set); +/* ./src/signal/sigprocmask.c */ +int sigprocmask(int __how, const sigset_t * restrict __set, sigset_t * restrict __oset); +/* ./src/signal/sigsuspend.c */ +int sigsuspend(const sigset_t * __sigmask); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/signal/sigqueue.c */ +int sigqueue(pid_t __pid, int __signo, const union sigval __value); +/* ./src/signal/sigtimedwait.c */ +int sigtimedwait(const sigset_t * restrict __set, siginfo_t * restrict __info, const struct timespec * restrict __timeout); +/* ./src/signal/sigwaitinfo.c */ +int sigwaitinfo(const sigset_t * restrict __set, siginfo_t * restrict __info); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/signal/killpg.c */ +int killpg(pid_t __pgrp, int __sig); +/* ./src/signal/sigaltstack.c */ +int sigaltstack(const stack_t * restrict __ss, stack_t * restrict __oss); +/* ./src/signal/sighold.c */ +int sighold(int __sig); +/* ./src/signal/sigignore.c */ +int sigignore(int __sig); +/* ./src/signal/siginterrupt.c */ +int siginterrupt(int __sig, int __flag); +/* ./src/signal/sigpause.c */ +int sigpause(int __sig); +/* ./src/signal/sigrelse.c */ +int sigrelse(int __sig); +/* ./src/signal/sigset.c */ +void (*sigset(int __sig, void (*__disp)(int)))(int); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 500) +/* ./src/signal/sigmask.c */ +int sigmask(int __signum); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/signal/sigstack.c */ +int sigstack(struct sigstack *__ss, struct sigstack *__oss); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/signal/bsd_signal.c */ +void (*bsd_signal(int __sig, void (*__func)(int)))(int); +#endif + + +#endif diff --git a/stdarg.h b/stdarg.h new file mode 100644 index 0000000..3ee270b --- /dev/null +++ b/stdarg.h @@ -0,0 +1,50 @@ +#ifndef __STDARG_H__ +#define __STDARG_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/* ./src/stdarg/va_arg.c */ +#define va_arg(__ap, __type) __builtin_va_arg(__ap, __type) +/* ./src/stdarg/va_end.c */ +#define va_end(__ap) __builtin_va_end(__ap) +/* ./src/stdarg/va_start.c */ +#define va_start(__ap, __parmN) __builtin_va_start(__ap, __parmN) + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdarg/va_copy.c */ +#define va_copy(__dest, __src) __builtin_va_copy(__dest, __src) +#endif + +/* ./src/stdarg/va_list.c */ +#ifndef __TYPE_va_list_DEFINED__ +#define __TYPE_va_list_DEFINED__ +typedef __builtin_va_list va_list; +#endif + + + +#endif diff --git a/stdbool.h b/stdbool.h new file mode 100644 index 0000000..3768ec9 --- /dev/null +++ b/stdbool.h @@ -0,0 +1,42 @@ +#ifndef __STDBOOL_H__ +#define __STDBOOL_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdbool/__bool_true_false_are_defined.c */ +#define __bool_true_false_are_defined (1) +/* ./src/stdbool/bool.c */ +#define bool _Bool +/* ./src/stdbool/false.c */ +#define false (0) +/* ./src/stdbool/true.c */ +#define true (1) +#endif + + +#endif diff --git a/stddef.h b/stddef.h new file mode 100644 index 0000000..6337ffe --- /dev/null +++ b/stddef.h @@ -0,0 +1,71 @@ +#ifndef __STDDEF_H__ +#define __STDDEF_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +/* ./src/stddef/NULL.c */ +#define NULL ((void*)0) +/* ./src/stddef/offsetof.c */ +#define offsetof(__type, __member) ((size_t)((void*)&(((__type*)0)->__member))) + +/* ./src/stddef/ptrdiff_t.c */ +#ifndef __TYPE_ptrdiff_t_DEFINED__ +#define __TYPE_ptrdiff_t_DEFINED__ +#ifdef __LLP64__ +# if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef __int64 ptrdiff_t; +# else +typedef long long int ptrdiff_t; +# endif +#else +typedef long int ptrdiff_t; +#endif +#endif + +/* ./src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* ./src/stddef/wchar_t.c */ +#ifndef __TYPE_wchar_t_DEFINED__ +#define __TYPE_wchar_t_DEFINED__ +typedef int wchar_t; +#endif + + + +#endif diff --git a/stdint.h b/stdint.h new file mode 100644 index 0000000..b116f05 --- /dev/null +++ b/stdint.h @@ -0,0 +1,327 @@ +#ifndef __STDINT_H__ +#define __STDINT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdint/INT16_C.c */ +#define INT16_C(__value) ((int_least16_t)__value) +/* ./src/stdint/INT16_MAX.c */ +#define INT16_MAX (32767) +/* ./src/stdint/INT16_MIN.c */ +#define INT16_MIN (-32768) +/* ./src/stdint/INT32_C.c */ +#define INT32_C(__value) ((int_least32_t)__value##L) +/* ./src/stdint/INT32_MAX.c */ +#define INT32_MAX (2147483647) +/* ./src/stdint/INT32_MIN.c */ +#define INT32_MIN (-2147483648) +/* ./src/stdint/INT64_C.c */ +#define INT64_C(__value) ((int_least64_t)__value##LL) +/* ./src/stdint/INT64_MAX.c */ +#define INT64_MAX (9223372036854775807LL) +/* ./src/stdint/INT64_MIN.c */ +#define INT64_MIN (-9223372036854775808LL) +/* ./src/stdint/INT8_C.c */ +#define INT8_C(__value) ((int_least8_t)__value) +/* ./src/stdint/INT8_MAX.c */ +#define INT8_MAX (127) +/* ./src/stdint/INT8_MIN.c */ +#define INT8_MIN (-128) +/* ./src/stdint/INTMAX_C.c */ +#define INTMAX_C(__value) ((intmax_t)__value##LL) +/* ./src/stdint/INTMAX_MAX.c */ +#define INTMAX_MAX (9223372036854775807LL) +/* ./src/stdint/INTMAX_MIN.c */ +#define INTMAX_MIN (-INTMAX_MAX - 1LL) +/* ./src/stdint/INTPTR_MAX.c */ +#define INTPTR_MAX /* FIXME */ (32767) +/* ./src/stdint/INTPTR_MIN.c */ +#define INTPTR_MIN /* FIXME */ (-32767) +/* ./src/stdint/INT_FAST16_MAX.c */ +#define INT_FAST16_MAX (32767) +/* ./src/stdint/INT_FAST16_MIN.c */ +#define INT_FAST16_MIN (-32768) +/* ./src/stdint/INT_FAST32_MAX.c */ +#define INT_FAST32_MAX (2147483647) +/* ./src/stdint/INT_FAST32_MIN.c */ +#define INT_FAST32_MIN (-2147483648) +/* ./src/stdint/INT_FAST64_MAX.c */ +#define INT_FAST64_MAX (9223372036854775807LL) +/* ./src/stdint/INT_FAST64_MIN.c */ +#define INT_FAST64_MIN (-9223372036854775808LL) +/* ./src/stdint/INT_FAST8_MAX.c */ +#define INT_FAST8_MAX (127) +/* ./src/stdint/INT_FAST8_MIN.c */ +#define INT_FAST8_MIN (-128) +/* ./src/stdint/INT_LEAST16_MAX.c */ +#define INT_LEAST16_MAX (32767) +/* ./src/stdint/INT_LEAST16_MIN.c */ +#define INT_LEAST16_MIN (-32768) +/* ./src/stdint/INT_LEAST32_MAX.c */ +#define INT_LEAST32_MAX (2147483647) +/* ./src/stdint/INT_LEAST32_MIN.c */ +#define INT_LEAST32_MIN (-2147483648) +/* ./src/stdint/INT_LEAST64_MAX.c */ +#define INT_LEAST64_MAX (9223372036854775807LL) +/* ./src/stdint/INT_LEAST64_MIN.c */ +#define INT_LEAST64_MIN (-9223372036854775808LL) +/* ./src/stdint/INT_LEAST8_MAX.c */ +#define INT_LEAST8_MAX (127) +/* ./src/stdint/INT_LEAST8_MIN.c */ +#define INT_LEAST8_MIN (-128) +/* ./src/stdint/PTRDIFF_MAX.c */ +#define PTRDIFF_MAX /* FIXME */ (65535) +/* ./src/stdint/PTRDIFF_MIN.c */ +#define PTRDIFF_MIN /* FIXME */ (-65535) +/* ./src/stdint/SIG_ATOMIC_MAX.c */ +#define SIG_ATOMIC_MAX (127) +/* ./src/stdint/SIG_ATOMIC_MIN.c */ +#define SIG_ATOMIC_MIN (-127) +/* ./src/stdint/SIZE_MAX.c */ +#define SIZE_MAX /* FIXME */ (65535) +/* ./src/stdint/UINT16_C.c */ +#define UINT16_C(__value) ((uint_least16_t)__value) +/* ./src/stdint/UINT16_MAX.c */ +#define UINT16_MAX (65535) +/* ./src/stdint/UINT32_C.c */ +#define UINT32_C(__value) ((uint_least32_t)__value##U) +/* ./src/stdint/UINT32_MAX.c */ +#define UINT32_MAX (4294967295U) +/* ./src/stdint/UINT64_C.c */ +#define UINT64_C(__value) ((uint_least32_t)__value##ULL) +/* ./src/stdint/UINT64_MAX.c */ +#define UINT64_MAX (18446744073709551616ULL) +/* ./src/stdint/UINT8_C.c */ +#define UINT8_C(__value) ((uint_least8_t)__value) +/* ./src/stdint/UINT8_MAX.c */ +#define UINT8_MAX (255) +/* ./src/stdint/UINTMAX_C.c */ +#define UINTMAX_C(__value) ((uintmax_t)__value##ULL) +/* ./src/stdint/UINTMAX_MAX.c */ +#define UINTMAX_MAX (18446744073709551615ULL) +/* ./src/stdint/UINTPTR_MAX.c */ +#define UINTPTR_MAX /* FIXME */ (65535) +/* ./src/stdint/UINT_FAST16_MAX.c */ +#define UINT_FAST16_MAX (65535) +/* ./src/stdint/UINT_FAST32_MAX.c */ +#define UINT_FAST32_MAX (4294967295U) +/* ./src/stdint/UINT_FAST64_MAX.c */ +#define UINT_FAST64_MAX (18446744073709551616ULL) +/* ./src/stdint/UINT_FAST8_MAX.c */ +#define UINT_FAST8_MAX (255) +/* ./src/stdint/UINT_LEAST16_MAX.c */ +#define UINT_LEAST16_MAX (65535) +/* ./src/stdint/UINT_LEAST32_MAX.c */ +#define UINT_LEAST32_MAX (4294967295U) +/* ./src/stdint/UINT_LEAST64_MAX.c */ +#define UINT_LEAST64_MAX (18446744073709551616ULL) +/* ./src/stdint/UINT_LEAST8_MAX.c */ +#define UINT_LEAST8_MAX (255) +/* ./src/stdint/WINT_MAX.c */ +#define WINT_MAX (2147483647) +/* ./src/stdint/WINT_MIN.c */ +#define WINT_MIN (-2147483648) +/* src/wchar/WCHAR_MAX.c */ +#define WCHAR_MAX (0x10FFFF) +/* src/wchar/WCHAR_MIN.c */ +#define WCHAR_MIN (0) +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdint/int16_t.c */ +#ifndef __TYPE_int16_t_DEFINED__ +#define __TYPE_int16_t_DEFINED__ +typedef short int int16_t; +#endif + +/* ./src/stdint/int32_t.c */ +#ifndef __TYPE_int32_t_DEFINED__ +#define __TYPE_int32_t_DEFINED__ +typedef int int32_t; +#endif + +/* ./src/stdint/int64_t.c */ +#ifndef __TYPE_int64_t_DEFINED__ +#define __TYPE_int64_t_DEFINED__ +typedef long long int int64_t; +#endif + +/* ./src/stdint/int8_t.c */ +#ifndef __TYPE_int8_t_DEFINED__ +#define __TYPE_int8_t_DEFINED__ +typedef signed char int8_t; +#endif + +/* ./src/stdint/int_fast16_t.c */ +#ifndef __TYPE_int_fast16_t_DEFINED__ +#define __TYPE_int_fast16_t_DEFINED__ +typedef short int int_fast16_t; +#endif + +/* ./src/stdint/int_fast32_t.c */ +#ifndef __TYPE_int_fast32_t_DEFINED__ +#define __TYPE_int_fast32_t_DEFINED__ +typedef long int int_fast32_t; +#endif + +/* ./src/stdint/int_fast64_t.c */ +#ifndef __TYPE_int_fast64_t_DEFINED__ +#define __TYPE_int_fast64_t_DEFINED__ +typedef long long int int_fast64_t; +#endif + +/* ./src/stdint/int_fast8_t.c */ +#ifndef __TYPE_int_fast8_t_DEFINED__ +#define __TYPE_int_fast8_t_DEFINED__ +typedef signed char int_fast8_t; +#endif + +/* ./src/stdint/int_least16_t.c */ +#ifndef __TYPE_int_least16_t_DEFINED__ +#define __TYPE_int_least16_t_DEFINED__ +typedef short int int_least16_t; +#endif + +/* ./src/stdint/int_least32_t.c */ +#ifndef __TYPE_int_least32_t_DEFINED__ +#define __TYPE_int_least32_t_DEFINED__ +typedef long int int_least32_t; +#endif + +/* ./src/stdint/int_least64_t.c */ +#ifndef __TYPE_int_least64_t_DEFINED__ +#define __TYPE_int_least64_t_DEFINED__ +typedef long long int int_least64_t; +#endif + +/* ./src/stdint/int_least8_t.c */ +#ifndef __TYPE_int_least8_t_DEFINED__ +#define __TYPE_int_least8_t_DEFINED__ +typedef signed char int_least8_t; +#endif + +/* ./src/stdint/intmax_t.c */ +#ifndef __TYPE_intmax_t_DEFINED__ +#define __TYPE_intmax_t_DEFINED__ +typedef long long int intmax_t; +#endif + +/* ./src/stdint/intptr_t.c */ +#ifndef __TYPE_intptr_t_DEFINED__ +#define __TYPE_intptr_t_DEFINED__ +typedef unsigned long int intptr_t; +#endif + +/* ./src/stdint/uint16_t.c */ +#ifndef __TYPE_uint16_t_DEFINED__ +#define __TYPE_uint16_t_DEFINED__ +typedef unsigned short int uint16_t; +#endif + +/* ./src/stdint/uint32_t.c */ +#ifndef __TYPE_uint32_t_DEFINED__ +#define __TYPE_uint32_t_DEFINED__ +typedef unsigned int uint32_t; +#endif + +/* ./src/stdint/uint64_t.c */ +#ifndef __TYPE_uint64_t_DEFINED__ +#define __TYPE_uint64_t_DEFINED__ +typedef unsigned long long int uint64_t; +#endif + +/* ./src/stdint/uint8_t.c */ +#ifndef __TYPE_uint8_t_DEFINED__ +#define __TYPE_uint8_t_DEFINED__ +typedef unsigned char uint8_t; +#endif + +/* ./src/stdint/uint_fast16_t.c */ +#ifndef __TYPE_uint_fast16_t_DEFINED__ +#define __TYPE_uint_fast16_t_DEFINED__ +typedef unsigned short int uint_fast16_t; +#endif + +/* ./src/stdint/uint_fast32_t.c */ +#ifndef __TYPE_uint_fast32_t_DEFINED__ +#define __TYPE_uint_fast32_t_DEFINED__ +typedef unsigned int uint_fast32_t; +#endif + +/* ./src/stdint/uint_fast64_t.c */ +#ifndef __TYPE_uint_fast64_t_DEFINED__ +#define __TYPE_uint_fast64_t_DEFINED__ +typedef unsigned long long int uint_fast64_t; +#endif + +/* ./src/stdint/uint_fast8_t.c */ +#ifndef __TYPE_uint_fast8_t_DEFINED__ +#define __TYPE_uint_fast8_t_DEFINED__ +typedef unsigned char uint_fast8_t; +#endif + +/* ./src/stdint/uint_least16_t.c */ +#ifndef __TYPE_uint_least16_t_DEFINED__ +#define __TYPE_uint_least16_t_DEFINED__ +typedef unsigned short int uint_least16_t; +#endif + +/* ./src/stdint/uint_least32_t.c */ +#ifndef __TYPE_uint_least32_t_DEFINED__ +#define __TYPE_uint_least32_t_DEFINED__ +typedef unsigned long int uint_least32_t; +#endif + +/* ./src/stdint/uint_least64_t.c */ +#ifndef __TYPE_uint_least64_t_DEFINED__ +#define __TYPE_uint_least64_t_DEFINED__ +typedef unsigned long long int uint_least64_t; +#endif + +/* ./src/stdint/uint_least8_t.c */ +#ifndef __TYPE_uint_least8_t_DEFINED__ +#define __TYPE_uint_least8_t_DEFINED__ +typedef unsigned char uint_least8_t; +#endif + +/* ./src/stdint/uintmax_t.c */ +#ifndef __TYPE_uintmax_t_DEFINED__ +#define __TYPE_uintmax_t_DEFINED__ +typedef unsigned long long int uintmax_t; +#endif + +/* ./src/stdint/uintptr_t.c */ +#ifndef __TYPE_uintptr_t_DEFINED__ +#define __TYPE_uintptr_t_DEFINED__ +typedef unsigned long long int uintptr_t; +#endif + +#endif + + +#endif diff --git a/stdio.h b/stdio.h new file mode 100644 index 0000000..b6e6708 --- /dev/null +++ b/stdio.h @@ -0,0 +1,281 @@ +#ifndef __STDIO_H__ +#define __STDIO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/stdio/BUFSIZ.c */ +#define BUFSIZ (4096) +/* ./src/stdio/EOF.c */ +#define EOF (-1) +/* ./src/stdio/FILENAME_MAX.c */ +#define FILENAME_MAX (255) +/* ./src/stdio/FOPEN_MAX.c */ +#define FOPEN_MAX (8) +/* ./src/stdio/L_tmpnam.c */ +#define L_tmpnam (255) +/* ./src/stdio/SEEK_CUR.c */ +#define SEEK_CUR (1) +/* ./src/stdio/SEEK_END.c */ +#define SEEK_END (2) +/* ./src/stdio/SEEK_SET.c */ +#define SEEK_SET (3) +/* ./src/stdio/TMP_MAX.c */ +#define TMP_MAX (10000) +/* ./src/stdio/_IOFBF.c */ +#define _IOFBF (1) +/* ./src/stdio/_IOLBF.c */ +#define _IOLBF (2) +/* ./src/stdio/_IONBF.c */ +#define _IONBF (3) +/* ./src/stdio/stderr.c */ +#define stderr __stderr +/* ./src/stdio/stdin.c */ +#define stdin __stdin +/* ./src/stdio/stdout.c */ +#define stdout __stdout +/* src/stddef/NULL.c */ +#define NULL ((void*)0) + +#if (defined _POSIX_SOURCE) +/* ./src/stdio/L_ctermid.c */ +#define L_ctermid (255) +#endif + +#if (defined _POSIX_SOURCE && (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 200112)) +/* ./src/stdio/L_cuserid.c */ +#define L_cuserid (255) +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/stdio/P_tmpdir.c */ +#define P_tmpdir "/tmp" +#endif + +/* ./src/stdio/FILE.c */ +#ifndef __TYPE_FILE_DEFINED__ +#define __TYPE_FILE_DEFINED__ +typedef struct __FILE FILE; +#endif + +/* ./src/stdio/fpos_t.c */ +#ifndef __TYPE_fpos_t_DEFINED__ +#define __TYPE_fpos_t_DEFINED__ +typedef struct __fpos_t * fpos_t; +#endif + +/* src/stdarg/va_list.c */ +#ifndef __TYPE_va_list_DEFINED__ +#define __TYPE_va_list_DEFINED__ +typedef __builtin_va_list va_list; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + + +/* ./src/stdio/__stderr.c */ +extern FILE *__stderr; +/* ./src/stdio/__stdin.c */ +extern FILE *__stdin; +/* ./src/stdio/__stdout.c */ +extern FILE *__stdout; + +#if (defined _XOPEN_SOURCE) +/* src/unistd/optarg.c */ +extern char * optarg; +/* src/unistd/opterr.c */ +extern int opterr; +/* src/unistd/optind.c */ +extern int optind; +/* src/unistd/optopt.c */ +extern int optopt; +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +/* ./src/stdio/clearerr.c */ +void clearerr(FILE * __stream); +/* ./src/stdio/fclose.c */ +int fclose(FILE *__stream); +/* ./src/stdio/feof.c */ +int feof(FILE *__stream); +/* ./src/stdio/ferror.c */ +int ferror(FILE *__stream); +/* ./src/stdio/fflush.c */ +int fflush(FILE *__stream); +/* ./src/stdio/fgetc.c */ +int fgetc(FILE *__stream); +/* ./src/stdio/fgetpos.c */ +int fgetpos(FILE * restrict __stream, fpos_t * restrict __pos); +/* ./src/stdio/fgets.c */ +char * fgets(char * restrict __s, int __n, FILE * restrict __stream); +/* ./src/stdio/fopen.c */ +FILE * fopen(const char * restrict __filename, const char * restrict __mode); +/* ./src/stdio/fprintf.c */ +int fprintf(FILE * restrict __stream, const char * restrict __format, ...); +/* ./src/stdio/fputc.c */ +int fputc(int __c, FILE *__stream); +/* ./src/stdio/fputs.c */ +int fputs(const char * restrict __s, FILE * restrict __stream); +/* ./src/stdio/fread.c */ +size_t fread(void * restrict __ptr, size_t __size, size_t __nmemb, FILE * restrict __stream); +/* ./src/stdio/freopen.c */ +FILE * freopen(const char * restrict __filename, const char * restrict __mode, FILE * restrict __stream); +/* ./src/stdio/fscanf.c */ +int fscanf(FILE * restrict __stream, const char * restrict __format, ...); +/* ./src/stdio/fseek.c */ +int fseek(FILE *__stream, long int __offset, int __whence); +/* ./src/stdio/fsetpos.c */ +int fsetpos(FILE *__stream, const fpos_t *__pos); +/* ./src/stdio/ftell.c */ +long int ftell(FILE *__stream); +/* ./src/stdio/fwrite.c */ +size_t fwrite(const void * restrict __ptr, size_t __size, size_t __nmemb, FILE * restrict __stream); +/* ./src/stdio/getc.c */ +int getc(FILE *__stream); +/* ./src/stdio/getchar.c */ +int getchar(void); +/* ./src/stdio/perror.c */ +void perror(const char *__s); +/* ./src/stdio/printf.c */ +int printf(const char *__format, ...); +/* ./src/stdio/putc.c */ +int putc(int __c, FILE *__stream); +/* ./src/stdio/putchar.c */ +int putchar(int __c); +/* ./src/stdio/puts.c */ +int puts(const char *__s); +/* ./src/stdio/remove.c */ +int remove(const char *__filename); +/* ./src/stdio/rename.c */ +int rename(const char *__old, const char *__new); +/* ./src/stdio/rewind.c */ +void rewind(FILE *__stream); +/* ./src/stdio/scanf.c */ +int scanf(const char * restrict __format, ...); +/* ./src/stdio/setbuf.c */ +void setbuf(FILE * restrict __stream, char * restrict __buf); +/* ./src/stdio/setvbuf.c */ +int setvbuf(FILE *__stream, char *__buf, int __mode, size_t __size); +/* ./src/stdio/sprintf.c */ +int sprintf(char * restrict __s, const char * restrict __format, ...); +/* ./src/stdio/sscanf.c */ +int sscanf(const char * restrict __s, const char * restrict __format, ...); +/* ./src/stdio/tmpfile.c */ +FILE * tmpfile(void); +/* ./src/stdio/tmpnam.c */ +char * tmpnam(char *__s); +/* ./src/stdio/ungetc.c */ +int ungetc(int __c, FILE *__stream); +/* ./src/stdio/vfprintf.c */ +int vfprintf(FILE * restrict __stream, const char * restrict __format, va_list __arg); +/* ./src/stdio/vprintf.c */ +int vprintf(const char * restrict __format, va_list __arg); +/* ./src/stdio/vsprintf.c */ +int vsprintf(char *__s, const char *__format, va_list __arg); + +#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +/* ./src/stdio/gets.c */ +char * gets(char *__s); +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdio/snprintf.c */ +int snprintf(char * restrict __s, size_t __n, const char * restrict __format, ...); +/* ./src/stdio/vfscanf.c */ +int vfscanf(FILE * restrict __stream, const char * restrict __format, va_list __arg); +/* ./src/stdio/vscanf.c */ +int vscanf(const char * restrict __format, va_list __arg); +/* ./src/stdio/vsnprintf.c */ +int vsnprintf(char * restrict __s, size_t __n, const char *__format, va_list __arg); +/* ./src/stdio/vsscanf.c */ +int vsscanf(const char * restrict __s, const char * restrict __format, va_list __arg); +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/stdio/fdopen.c */ +FILE * fdopen(int __fildes, const char * __mode); +/* ./src/stdio/fileno.c */ +int fileno(FILE * __stream); +/* src/unistd/ctermid.c */ +char * ctermid(char * __s); +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/stdio/pclose.c */ +int pclose(FILE * __stream); +/* ./src/stdio/popen.c */ +FILE * popen(const char * __command, const char * __mode); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/stdio/tempnam.c */ +char * tempnam(const char * __dir, const char * __pfx); +/* src/unistd/getopt.c */ +int getopt(int __argc, char * const argv[], const char *__optstring); +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/stdio/getw.c */ +int getw(FILE *__stream); +/* ./src/stdio/putw.c */ +int putw(int __w, FILE *__stream); +/* src/unistd/cuserid.c */ +char *cuserid(char *__s); +#endif + + +#endif diff --git a/stdlib.h b/stdlib.h new file mode 100644 index 0000000..140f407 --- /dev/null +++ b/stdlib.h @@ -0,0 +1,286 @@ +#ifndef __STDLIB_H__ +#define __STDLIB_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/stdlib/EXIT_FAILURE.c */ +#define EXIT_FAILURE (1) +/* ./src/stdlib/EXIT_SUCCESS.c */ +#define EXIT_SUCCESS (0) +/* ./src/stdlib/MB_CUR_MAX.c */ +#define MB_CUR_MAX (4) +/* ./src/stdlib/RAND_MAX.c */ +#define RAND_MAX (32767) +/* src/stddef/NULL.c */ +#define NULL ((void*)0) + +#if (defined _XOPEN_SOURCE) +/* src/sys/wait/WEXITSTATUS.c */ +#define WEXITSTATUS(__stat_val) (__stat_val & 0xff) +/* src/sys/wait/WIFEXITED.c */ +#define WIFEXITED(__stat_val) (__stat_val <= 255) +/* src/sys/wait/WIFSIGNALED.c */ +#define WIFSIGNALED(__stat_val) (__stat_val & 0x100) +/* src/sys/wait/WIFSTOPPED.c */ +#define WIFSTOPPED(__stat_val) (__stat_val & 0x200) +/* src/sys/wait/WNOHANG.c */ +#define WNOHANG (1<<0) +/* src/sys/wait/WSTOPSIG.c */ +#define WSTOPSIG(__stat_val) (__stat_val & 0xff) +/* src/sys/wait/WTERMSIG.c */ +#define WTERMSIG(__stat_val) (__stat_val & 0xff) +/* src/sys/wait/WUNTRACED.c */ +#define WUNTRACED (1<<1) +#endif + +/* ./src/stdlib/div_t.c */ +#ifndef __TYPE_div_t_DEFINED__ +#define __TYPE_div_t_DEFINED__ +typedef struct { + int quot; + int rem; +} div_t; +#endif + +/* ./src/stdlib/ldiv_t.c */ +#ifndef __TYPE_ldiv_t_DEFINED__ +#define __TYPE_ldiv_t_DEFINED__ +typedef struct { + long int quot; + long int rem; +} ldiv_t; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/stddef/wchar_t.c */ +#ifndef __TYPE_wchar_t_DEFINED__ +#define __TYPE_wchar_t_DEFINED__ +typedef int wchar_t; +#endif + + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdlib/lldiv_t.c */ +#ifndef __TYPE_lldiv_t_DEFINED__ +#define __TYPE_lldiv_t_DEFINED__ +typedef struct { + long long int quot; + long long int rem; +} lldiv_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 200112L) +#define _Noreturn +#endif + +/* ./src/stdlib/abort.c */ +_Noreturn void abort(void); +/* ./src/stdlib/abs.c */ +int abs(int __j); +/* ./src/stdlib/atexit.c */ +int atexit(void (*__func)(void)); +/* ./src/stdlib/atof.c */ +double atof(const char * __nptr); +/* ./src/stdlib/atoi.c */ +int atoi(const char * __nptr); +/* ./src/stdlib/atol.c */ +long int atol(const char * __nptr); +/* ./src/stdlib/bsearch.c */ +void * bsearch(const void * __key, const void * __base, size_t __nmemb, size_t __size, int (*__compar)(const void *, const void*)); +/* ./src/stdlib/calloc.c */ +void * calloc(size_t __nmemb, size_t __size); +/* ./src/stdlib/div.c */ +div_t div(int __numer, int __denom); +/* ./src/stdlib/exit.c */ +_Noreturn void exit(int __status); +/* ./src/stdlib/free.c */ +void free(void * __ptr); +/* ./src/stdlib/getenv.c */ +char * getenv(const char * __name); +/* ./src/stdlib/labs.c */ +long int labs(long int __j); +/* ./src/stdlib/ldiv.c */ +ldiv_t ldiv(long int __numer, long int __denom); +/* ./src/stdlib/malloc.c */ +void * malloc(size_t __size); +/* ./src/stdlib/mblen.c */ +int mblen(const char * __s, size_t __n); +/* ./src/stdlib/mbstowcs.c */ +size_t mbstowcs(wchar_t * restrict __pwcs, const char * restrict __s, size_t __n); +/* ./src/stdlib/mbtowc.c */ +int mbtowc(wchar_t * restrict __pwc, const char * restrict __s, size_t __n); +/* ./src/stdlib/qsort.c */ +void qsort(void * __base, size_t __nmemb, size_t __size, int (*__compar)(const void *, const void *)); +/* ./src/stdlib/rand.c */ +int rand(void); +/* ./src/stdlib/realloc.c */ +void * realloc(void * __ptr, size_t __size); +/* ./src/stdlib/srand.c */ +void srand(unsigned int __seed); +/* ./src/stdlib/strtod.c */ +double strtod(const char * restrict __nptr, char ** restrict __endptr); +/* ./src/stdlib/strtol.c */ +long int strtol(const char * restrict __nptr, char ** restrict __endptr, int __base); +/* ./src/stdlib/strtoul.c */ +unsigned long int strtoul(const char * __nptr, char ** __endptr, int __base); +/* ./src/stdlib/system.c */ +int system(const char * __string); +/* ./src/stdlib/wcstombs.c */ +size_t wcstombs(char * restrict __s, const wchar_t * restrict __pwcs, size_t __n); +/* ./src/stdlib/wctomb.c */ +int wctomb(char * __s, wchar_t __wchar); + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/stdlib/_Exit.c */ +_Noreturn void _Exit(int __status); +/* ./src/stdlib/atoll.c */ +long long int atoll(const char *__nptr); +/* ./src/stdlib/llabs.c */ +long long int llabs(long long int __j); +/* ./src/stdlib/lldiv.c */ +lldiv_t lldiv(long long int __numer, long long int __denom); +/* ./src/stdlib/strtof.c */ +float strtof(const char * restrict __nptr, char ** restrict __endptr); +/* ./src/stdlib/strtold.c */ +long double strtold(const char * restrict __nptr, char ** restrict __endptr); +/* ./src/stdlib/strtoll.c */ +long long int strtoll(const char * restrict __nptr, char ** restrict __endptr, int __base); +/* ./src/stdlib/strtoull.c */ +unsigned long long int strtoull(const char * restrict __nptr, char ** restrict __endptr, int __base); +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/stdlib/getsubopt.c */ +int getsubopt(char ** __optionp, char * const * __keylistp, char ** __valuep); +/* ./src/stdlib/mkstemp.c */ +int mkstemp(char * __template); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/stdlib/drand48.c */ +double drand48(void); +/* ./src/stdlib/erand48.c */ +double erand48(unsigned short xsubi[3]); +/* ./src/stdlib/jrand48.c */ +long jrand48(unsigned short xsub[3]); +/* ./src/stdlib/lcong48.c */ +void lcong48(unsigned short param[7]); +/* ./src/stdlib/lrand48.c */ +long lrand48(void); +/* ./src/stdlib/mrand48.c */ +long mrand48(void); +/* ./src/stdlib/nrand48.c */ +long nrand48(unsigned short xsubi[3]); +/* ./src/stdlib/putenv.c */ +int putenv(char * __string); +/* ./src/stdlib/seed48.c */ +unsigned short * seed48(unsigned short seed16v[3]); +/* ./src/stdlib/setkey.c */ +void setkey(const char * __key); +/* ./src/stdlib/srand48.c */ +void srand48(long __seedval); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/stdlib/a64l.c */ +long a64l(const char *__s); +/* ./src/stdlib/grantpt.c */ +int grantpt(int __fildes); +/* ./src/stdlib/initstate.c */ +char * initstate(unsigned __seed, char * __state, size_t __size); +/* ./src/stdlib/l64a.c */ +char * l64a(long __value); +/* ./src/stdlib/ptsname.c */ +char * ptsname(int __fildes); +/* ./src/stdlib/random.c */ +long random(void); +/* ./src/stdlib/realpath.c */ +char * realpath(const char * restrict __file_name, char * restrict __resolved_name); +/* ./src/stdlib/setstate.c */ +char * setstate(char * __state); +/* ./src/stdlib/srandom.c */ +void srandom(unsigned __seed); +/* ./src/stdlib/unlockpt.c */ +int unlockpt(int __fildes); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/stdlib/ttyslot.c */ +int ttyslot(void); +/* ./src/stdlib/valloc.c */ +void *valloc(size_t __size); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/stdlib/ecvt.c */ +char *ecvt(double __value, int __ndigit, int *__decpt, int *__sign); +/* ./src/stdlib/fcvt.c */ +char *fcvt(double __value, int __ndigit, int *__decpt, int *__sign); +/* ./src/stdlib/gcvt.c */ +char *gcvt(double __value, int __ndigit, char *__buf); +/* ./src/stdlib/mktemp.c */ +char *mktemp(char *__template); +#endif + + +#endif diff --git a/string.h b/string.h new file mode 100644 index 0000000..dccd5dd --- /dev/null +++ b/string.h @@ -0,0 +1,125 @@ +#ifndef __STRING_H__ +#define __STRING_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* src/stddef/NULL.c */ +#define NULL ((void*)0) + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +/* ./src/string/memchr.c */ +void * memchr(const void *__s, int __c, size_t __n); +/* ./src/string/memcmp.c */ +int memcmp(const void *__s1, const void *__s2, size_t __n); +/* ./src/string/memcpy.c */ +void * memcpy(void * restrict __s1, const void * restrict __s2, size_t __n); +/* ./src/string/memmove.c */ +void * memmove(void *__s1, const void *__s2, size_t __n); +/* ./src/string/memset.c */ +void * memset(void *__s, int __c, size_t __n); +/* ./src/string/strcat.c */ +char * strcat(char * restrict __s1, const char * restrict __s2); +/* ./src/string/strchr.c */ +char * strchr(const char *__s, int __c); +/* ./src/string/strcmp.c */ +int strcmp(const char *__s1, const char *__s2); +/* ./src/string/strcoll.c */ +int strcoll(const char *__s1, const char *__s2); +/* ./src/string/strcpy.c */ +char * strcpy(char * restrict __s1, const char * restrict __s2); +/* ./src/string/strcspn.c */ +size_t strcspn(const char *__s1, const char *__s2); +/* ./src/string/strerror.c */ +char * strerror(int __errnum); +/* ./src/string/strlen.c */ +size_t strlen(const char *__s); +/* ./src/string/strncat.c */ +char * strncat(char * restrict __s1, const char * restrict __s2, size_t __n); +/* ./src/string/strncmp.c */ +int strncmp(const char *__s1, const char *__s2, size_t __n); +/* ./src/string/strncpy.c */ +char * strncpy(char * restrict __s1, const char * restrict __s2, size_t __n); +/* ./src/string/strpbrk.c */ +char * strpbrk(const char *__s1, const char *__s2); +/* ./src/string/strrchr.c */ +char * strrchr(const char *__s, int __c); +/* ./src/string/strspn.c */ +size_t strspn(const char *__s1, const char *__s2); +/* ./src/string/strstr.c */ +char * strstr(const char *__s1, const char *__s2); +/* ./src/string/strtok.c */ +char * strtok(char * restrict __s1, const char * restrict __s2); +/* ./src/string/strxfrm.c */ +size_t strxfrm(char * restrict __s1, const char * restrict __s2, size_t __n); + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/string/strdup.c */ +char * strdup(const char *__s); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/string/memccpy.c */ +void *memccpy(void * restrict __s1, const void * restrict __s2, int __c, size_t __n); +#endif + + +#endif diff --git a/strings.h b/strings.h new file mode 100644 index 0000000..27b166d --- /dev/null +++ b/strings.h @@ -0,0 +1,73 @@ +#ifndef __STRINGS_H__ +#define __STRINGS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/strings/strcasecmp.c */ +int strcasecmp(const char *__s1, const char *__s2); +/* ./src/strings/strncasecmp.c */ +int strncasecmp(const char *__s1, const char *__s2, size_t __n); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/strings/ffs.c */ +int ffs(int __i); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/strings/bcmp.c */ +int bcmp(const void *__s1, const void *__s2, size_t __n); +/* ./src/strings/bcopy.c */ +int bcopy(const void *__s1, void *__s2, size_t __n); +/* ./src/strings/bzero.c */ +void bzero(void*__s, size_t __n); +/* ./src/strings/index.c */ +char *index(const char *__s, int __c); +/* ./src/strings/rindex.c */ +char *rindex(const char *__s, int __c); +#endif + + +#endif diff --git a/stropts.h b/stropts.h new file mode 100644 index 0000000..954badf --- /dev/null +++ b/stropts.h @@ -0,0 +1,255 @@ +#ifndef __STROPTS_H__ +#define __STROPTS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/stropts/ANYMARK.c */ +#define ANYMARK /* TODO */ +/* ./src/stropts/FLUSHR.c */ +#define FLUSHR /* TODO */ +/* ./src/stropts/FLUSHRW.c */ +#define FLUSHRW /* TODO */ +/* ./src/stropts/FLUSHW.c */ +#define FLUSHW /* TODO */ +/* ./src/stropts/FMNAMESZ.c */ +#define FMNAMESZ /* TODO */ +/* ./src/stropts/I_ATMARK.c */ +#define I_ATMARK /* TODO */ +/* ./src/stropts/I_CANPUT.c */ +#define I_CANPUT /* TODO */ +/* ./src/stropts/I_CKBAND.c */ +#define I_CKBAND /* TODO */ +/* ./src/stropts/I_FDINSERT.c */ +#define I_FDINSERT /* TODO */ +/* ./src/stropts/I_FIND.c */ +#define I_FIND /* TODO */ +/* ./src/stropts/I_FLUSH.c */ +#define I_FLUSH /* TODO */ +/* ./src/stropts/I_FLUSHBAND.c */ +#define I_FLUSHBAND /* TODO */ +/* ./src/stropts/I_GETBAND.c */ +#define I_GETBAND /* TODO */ +/* ./src/stropts/I_GETCLTIME.c */ +#define I_GETCLTIME /* TODO */ +/* ./src/stropts/I_GETSIG.c */ +#define I_GETSIG /* TODO */ +/* ./src/stropts/I_GRDOPT.c */ +#define I_GRDOPT /* TODO */ +/* ./src/stropts/I_GWROPT.c */ +#define I_GWROPT /* TODO */ +/* ./src/stropts/I_LINK.c */ +#define I_LINK /* TODO */ +/* ./src/stropts/I_LIST.c */ +#define I_LIST /* TODO */ +/* ./src/stropts/I_LOOK.c */ +#define I_LOOK /* TODO */ +/* ./src/stropts/I_NREAD.c */ +#define I_NREAD /* TODO */ +/* ./src/stropts/I_PEEK.c */ +#define I_PEEK /* TODO */ +/* ./src/stropts/I_PLINK.c */ +#define I_PLINK /* TODO */ +/* ./src/stropts/I_POP.c */ +#define I_POP /* TODO */ +/* ./src/stropts/I_PUNLINK.c */ +#define I_PUNLINK /* TODO */ +/* ./src/stropts/I_PUSH.c */ +#define I_PUSH /* TODO */ +/* ./src/stropts/I_RECVFD.c */ +#define I_RECVFD /* TODO */ +/* ./src/stropts/I_SENDFD.c */ +#define I_SENDFD /* TODO */ +/* ./src/stropts/I_SETCLTIME.c */ +#define I_SETCLTIME /* TODO */ +/* ./src/stropts/I_SETSIG.c */ +#define I_SETSIG /* TODO */ +/* ./src/stropts/I_SRDOPT.c */ +#define I_SRDOPT /* TODO */ +/* ./src/stropts/I_STR.c */ +#define I_STR /* TODO */ +/* ./src/stropts/I_SWROPT.c */ +#define I_SWROPT /* TODO */ +/* ./src/stropts/I_UNLINK.c */ +#define I_UNLINK /* TODO */ +/* ./src/stropts/LASTMARK.c */ +#define LASTMARK /* TODO */ +/* ./src/stropts/MORECTL.c */ +#define MORECTL /* TODO */ +/* ./src/stropts/MOREDATA.c */ +#define MOREDATA /* TODO */ +/* ./src/stropts/MSG_ANY.c */ +#define MSG_ANY /* TODO */ +/* ./src/stropts/MSG_BAND.c */ +#define MSG_BAND /* TODO */ +/* ./src/stropts/MSG_HIPRI.c */ +#define MSG_HIPRI /* TODO */ +/* ./src/stropts/MUXID_ALL.c */ +#define MUXID_ALL /* TODO */ +/* ./src/stropts/RMSGD.c */ +#define RMSGD /* TODO */ +/* ./src/stropts/RMSGN.c */ +#define RMSGN /* TODO */ +/* ./src/stropts/RNORM.c */ +#define RNORM /* TODO */ +/* ./src/stropts/RPOTNORM.c */ +#define RPOTNORM /* TODO */ +/* ./src/stropts/RPROTDAT.c */ +#define RPROTDAT /* TODO */ +/* ./src/stropts/RPROTDIS.c */ +#define RPROTDIS /* TODO */ +/* ./src/stropts/RS_HIPRI.c */ +#define RS_HIPRI /* TODO */ +/* ./src/stropts/SNDZERO.c */ +#define SNDZERO /* TODO */ +/* ./src/stropts/S_BANDURG.c */ +#define S_BANDURG /* TODO */ +/* ./src/stropts/S_ERROR.c */ +#define S_ERROR /* TODO */ +/* ./src/stropts/S_HANGUP.c */ +#define S_HANGUP /* TODO */ +/* ./src/stropts/S_HIPRI.c */ +#define S_HIPRI /* TODO */ +/* ./src/stropts/S_INPUT.c */ +#define S_INPUT /* TODO */ +/* ./src/stropts/S_MSG.c */ +#define S_MSG /* TODO */ +/* ./src/stropts/S_OUTPUT.c */ +#define S_OUTPUT /* TODO */ +/* ./src/stropts/S_RDBAND.c */ +#define S_RDBAND /* TODO */ +/* ./src/stropts/S_RDNORM.c */ +#define S_RDNORM /* TODO */ +/* ./src/stropts/S_WRBAND.c */ +#define S_WRBAND /* TODO */ +/* ./src/stropts/S_WRNORM.c */ +#define S_WRNORM /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/stropts/struct_bandinfo.c */ +#ifndef __TYPE_struct_bandinfo_DEFINED__ +#define __TYPE_struct_bandinfo_DEFINED__ +struct bandinfo { + unsigned char bi_pri; + int bi_flag; +}; +#endif + +/* ./src/stropts/struct_str_list.c */ +#ifndef __TYPE_struct_str_list_DEFINED__ +#define __TYPE_struct_str_list_DEFINED__ +struct str_list { + int sl_nmods; + struct str_mlist *sl_modlist; +}; +#endif + +/* ./src/stropts/struct_str_mlist.c */ +#ifndef __TYPE_struct_str_mlist_DEFINED__ +#define __TYPE_struct_str_mlist_DEFINED__ +struct str_mlist { + char l_name[FMNAMESZ+1]; +}; +#endif + +/* ./src/stropts/struct_strbuf.c */ +#ifndef __TYPE_struct_strbuf_DEFINED__ +#define __TYPE_struct_strbuf_DEFINED__ +struct strbuf { + int maxlen; + int len; + char *buf; +}; +#endif + +/* ./src/stropts/struct_strfdinsert.c */ +#ifndef __TYPE_struct_strfdinsert_DEFINED__ +#define __TYPE_struct_strfdinsert_DEFINED__ +struct strfdinsert { + struct strbuf ctlbuf; + struct strbuf databuf; + long flags; + int fildes; + int offset; +}; +#endif + +/* ./src/stropts/struct_strioctl.c */ +#ifndef __TYPE_struct_strioctl_DEFINED__ +#define __TYPE_struct_strioctl_DEFINED__ +struct strioctl { + int ic_cmd; + int ic_timeout; + int ic_len; + char *ic_dp; +}; +#endif + +/* ./src/stropts/struct_strpeek.c */ +#ifndef __TYPE_struct_strpeek_DEFINED__ +#define __TYPE_struct_strpeek_DEFINED__ +struct strpeek { + int maxlen; + int len; + char *buf; +}; +#endif + +/* ./src/stropts/struct_strrecvfd.c */ +#ifndef __TYPE_struct_strrecvfd_DEFINED__ +#define __TYPE_struct_strrecvfd_DEFINED__ +struct strrecvfd { + int fd; + uid_t uid; + gid_t gid; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/stropts/fattach.c */ +int fattach(int __fildes, const char * path ); +/* ./src/stropts/fdetach.c */ +int fdetach(const char * path ); +/* ./src/stropts/getmsg.c */ +int getmsg(int fd , struct strbuf * ctlptr , struct strbuf * dataptr , int * flagsp ); +/* ./src/stropts/getpmsg.c */ +int getpmsg(int fd , struct strbuf * ctlptr , struct strbuf * dataptr , int * bandp , int * flagsp ); +/* ./src/stropts/ioctl.c */ +int ioctl(int fildes , int request , ... ); +/* ./src/stropts/isastream.c */ +int isastream(int fildes ); +/* ./src/stropts/putmsg.c */ +int putmsg(int fd , const struct strbuf * ctlptr , const struct strbuf * dataptr , int flags ); +/* ./src/stropts/putpmsg.c */ +int putpmsg(int fd , const struct strbuf * ctlptr , const struct strbuf * dataptr , int band , int flags ); +#endif + + +#endif diff --git a/sys/ipc.h b/sys/ipc.h new file mode 100644 index 0000000..e03bfce --- /dev/null +++ b/sys/ipc.h @@ -0,0 +1,113 @@ +#ifndef __SYS_IPC_H__ +#define __SYS_IPC_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/ipc/IPC_CREAT.c */ +#define IPC_CREAT 1 +/* ./src/sys/ipc/IPC_EXCL.c */ +#define IPC_EXCL 2 +/* ./src/sys/ipc/IPC_NOWAIT.c */ +#define IPC_NOWAIT 3 +/* ./src/sys/ipc/IPC_PRIVATE.c */ +#define IPC_PRIVATE 4 +/* ./src/sys/ipc/IPC_RMID.c */ +#define IPC_RMID 5 +/* ./src/sys/ipc/IPC_SET.c */ +#define IPC_SET 6 +/* ./src/sys/ipc/IPC_STAT.c */ +#define IPC_STAT 7 +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +/* src/sys/types/key_t.c */ +#ifndef __TYPE_key_t_DEFINED__ +#define __TYPE_key_t_DEFINED__ +typedef unsigned long long int key_t; +#endif + +/* src/sys/types/mode_t.c */ +#ifndef __TYPE_mode_t_DEFINED__ +#define __TYPE_mode_t_DEFINED__ +typedef unsigned long int mode_t; +#endif + +/* src/sys/types/uid_t.c */ +#ifndef __TYPE_uid_t_DEFINED__ +#define __TYPE_uid_t_DEFINED__ +typedef unsigned long int + uid_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/ipc/struct_ipc_perm.c */ +#ifndef __TYPE_struct_ipc_perm_DEFINED__ +#define __TYPE_struct_ipc_perm_DEFINED__ +struct ipc_perm { + uid_t uid; /* Owner's user ID */ + gid_t gid; /* Owner's group ID */ + uid_t cuid; /* Creator's user ID */ + uid_t cgid; /* Creator's group ID */ + mode_t mode; /* Read/write permission */ +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/ipc/ftok.c */ +key_t ftok(const char *__path, int __id); +#endif + + +#endif diff --git a/sys/mman.h b/sys/mman.h new file mode 100644 index 0000000..faad2c5 --- /dev/null +++ b/sys/mman.h @@ -0,0 +1,107 @@ +#ifndef __SYS_MMAN_H__ +#define __SYS_MMAN_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sys/mman/MAP_FAILED.c */ +#define MAP_FAILED ((void*)-1) +/* ./src/sys/mman/MCL_CURRENT.c */ +#define MCL_CURRENT /* TODO */ +/* ./src/sys/mman/MCL_FUTURE.c */ +#define MCL_FUTURE /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/mman/MAP_FIXED.c */ +#define MAP_FIXED /* TODO */ +/* ./src/sys/mman/MAP_PRIVATE.c */ +#define MAP_PRIVATE /* TODO */ +/* ./src/sys/mman/MAP_SHARED.c */ +#define MAP_SHARED /* TODO */ +/* ./src/sys/mman/MS_ASYNC.c */ +#define MS_ASYNC /* TODO */ +/* ./src/sys/mman/MS_INVALIDATE.c */ +#define MS_INVALIDATE /* TODO */ +/* ./src/sys/mman/MS_SYNC.c */ +#define MS_SYNC /* TODO */ +/* ./src/sys/mman/PROT_EXEC.c */ +#define PROT_EXEC /* TODO */ +/* ./src/sys/mman/PROT_NONE.c */ +#define PROT_NONE /* TODO */ +/* ./src/sys/mman/PROT_READ.c */ +#define PROT_READ /* TODO */ +/* ./src/sys/mman/PROT_WRITE.c */ +#define PROT_WRITE /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sys/mman/mlock.c */ +int mlock(const void *__addr, size_t __len); +/* ./src/sys/mman/mlockall.c */ +int mlockall(int __flags); +/* ./src/sys/mman/munlock.c */ +int munlock(const void *__addr, size_t __len); +/* ./src/sys/mman/munlockall.c */ +int munlockall(void); +/* ./src/sys/mman/shm_open.c */ +int shm_open(const char *__name, int __oflag, mode_t __mode); +/* ./src/sys/mman/shm_unlink.c */ +int shm_unlink(const char *__name); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/mman/mmap.c */ +void *mmap(void *__addr, size_t __len, int __prot, int __flags, int __fildes, off_t __off); +/* ./src/sys/mman/mprotect.c */ +int mprotect(void *__addr, size_t __len, int __prot);; +/* ./src/sys/mman/msync.c */ +int msync(void * addr , size_t len , int flags ); +/* ./src/sys/mman/munmap.c */ +int munmap(void*__addr, size_t __len); +#endif + + +#endif diff --git a/sys/msg.h b/sys/msg.h new file mode 100644 index 0000000..79941ca --- /dev/null +++ b/sys/msg.h @@ -0,0 +1,133 @@ +#ifndef __SYS_MSG_H__ +#define __SYS_MSG_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/msg/ipc.ref */ +#include +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/msg/MSG_NOERROR.c */ +#define MSG_NOERROR 1 +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/msg/msglen_t.c */ +#ifndef __TYPE_msglen_t_DEFINED__ +#define __TYPE_msglen_t_DEFINED__ +typedef unsigned short msglen_t; +#endif + +/* ./src/sys/msg/msgqnum_t.c */ +#ifndef __TYPE_msgqnum_t_DEFINED__ +#define __TYPE_msgqnum_t_DEFINED__ +typedef unsigned short msgqnum_t; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/sys/types/key_t.c */ +#ifndef __TYPE_key_t_DEFINED__ +#define __TYPE_key_t_DEFINED__ +typedef unsigned long long int key_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/msg/struct_msqid_ds.c */ +#ifndef __TYPE_struct_msqid_ds_DEFINED__ +#define __TYPE_struct_msqid_ds_DEFINED__ +struct msqid_ds { + struct ipc_perm msg_perm; /* operation permissions */ + msgqnum_t msg_qnum; /* # messages on queue */ + msglen_t msg_qbytes; /* Max # bytes allowed on queue */ + pid_t msg_lspid; /* PID of last msgsnd() */ + pid_t msg_lrpid; /* PID of last msgrcg() */ + time_t msg_stime; /* time of last msgsnd() */ + time_t msg_rtime; /* time of last msgrcv() */ + time_t msg_ctime; /* time of last change */ +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/msg/msgctl.c */ +int msgctl(int __msqid, int __cmd, struct msqid_ds *__buf); +/* ./src/sys/msg/msgget.c */ +int msgget(key_t __key, int __msgflg); +/* ./src/sys/msg/msgrcv.c */ +ssize_t msgrcv(int __msqid, void *__msgp, size_t __msgsz, long __msgtyp, int __msgflg); +/* ./src/sys/msg/msgsnd.c */ +int msgsnd(int __msqid, const void *__msgp, size_t __msgsz, int __msgflg); +#endif + + +#endif diff --git a/sys/resource.h b/sys/resource.h new file mode 100644 index 0000000..08c39ec --- /dev/null +++ b/sys/resource.h @@ -0,0 +1,112 @@ +#ifndef __SYS_RESOURCE_H__ +#define __SYS_RESOURCE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/resource/PRIO_PGRP.c */ +#define PRIO_PGRP /* TODO */ +/* ./src/sys/resource/PRIO_PROCESS.c */ +#define PRIO_PROCESS /* TODO */ +/* ./src/sys/resource/PRIO_USER.c */ +#define PRIO_USER /* TODO */ +/* ./src/sys/resource/RLIMIT_AS.c */ +#define RLIMIT_AS /* TODO */ +/* ./src/sys/resource/RLIMIT_CORE.c */ +#define RLIMIT_CORE /* TODO */ +/* ./src/sys/resource/RLIMIT_CPU.c */ +#define RLIMIT_CPU /* TODO */ +/* ./src/sys/resource/RLIMIT_DATA.c */ +#define RLIMIT_DATA /* TODO */ +/* ./src/sys/resource/RLIMIT_FSIZE.c */ +#define RLIMIT_FSIZE /* TODO */ +/* ./src/sys/resource/RLIMIT_NOFILE.c */ +#define RLIMIT_NOFILE /* TODO */ +/* ./src/sys/resource/RLIMIT_STACK.c */ +#define RLIMIT_STACK /* TODO */ +/* ./src/sys/resource/RLIM_INFINITY.c */ +#define RLIM_INFINITY /* TODO */ +/* ./src/sys/resource/RUSAGE_CHILDREN.c */ +#define RUSAGE_CHILDREN /* TODO */ +/* ./src/sys/resource/RUSAGE_SELF.c */ +#define RUSAGE_SELF /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/resource/rlim_t.c */ +#ifndef __TYPE_rlim_t_DEFINED__ +#define __TYPE_rlim_t_DEFINED__ +typedef unsigned long long int rlim_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/resource/struct_rlimit.c */ +#ifndef __TYPE_struct_rlimit_DEFINED__ +#define __TYPE_struct_rlimit_DEFINED__ +struct rlimit { + rlim_t rlim_cur; + rlim_t rlim_max; +}; +#endif + +/* ./src/sys/resource/struct_rusage.c */ +#ifndef __TYPE_struct_rusage_DEFINED__ +#define __TYPE_struct_rusage_DEFINED__ +struct rusage { + struct timeval ru_utime; + struct timeval ru_stime; +}; +#endif + +/* src/sys/time/struct_timeval.c */ +#ifndef __TYPE_struct_timeval_DEFINED__ +#define __TYPE_struct_timeval_DEFINED__ +struct timeval { + time_t tv_sec; + suseconds_t tv_usec; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/resource/getpriority.c */ +int getpriority(int __which, id_t __who); +/* ./src/sys/resource/getrlimit.c */ +int getrlimit(int __resource, struct rlimit *__rlp); +/* ./src/sys/resource/getrusage.c */ +int getrusage(int __who, struct rusage *__r_usage); +/* ./src/sys/resource/setpriority.c */ +int setpriority(int __which, id_t __who, int __value); +/* ./src/sys/resource/setrlimit.c */ +int setrlimit(int __resource, const struct rlimit *__rlp); +#endif + + +#endif diff --git a/sys/sem.h b/sys/sem.h new file mode 100644 index 0000000..d32215a --- /dev/null +++ b/sys/sem.h @@ -0,0 +1,150 @@ +#ifndef __SYS_SEM_H__ +#define __SYS_SEM_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/sem/ipc.ref */ +#include +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/sem/GETALL.c */ +#define GETALL 4 +/* ./src/sys/sem/GETNCNT.c */ +#define GETNCNT 1 +/* ./src/sys/sem/GETPID.c */ +#define GETPID 2 +/* ./src/sys/sem/GETVAL.c */ +#define GETVAL 3 +/* ./src/sys/sem/GETZCNT.c */ +#define GETZCNT 5 +/* ./src/sys/sem/SEM_UNDO.c */ +#define SEM_UNDO 1 +/* ./src/sys/sem/SETALL.c */ +#define SETALL 12 +/* ./src/sys/sem/SETVAL.c */ +#define SETVAL 11 +#endif + +#if (defined _XOPEN_SOURCE) +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/sys/types/key_t.c */ +#ifndef __TYPE_key_t_DEFINED__ +#define __TYPE_key_t_DEFINED__ +typedef unsigned long long int key_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/sem/struct_sem_anonymous.c */ +#ifndef __TYPE_struct_sem_anonymous_DEFINED__ +#define __TYPE_struct_sem_anonymous_DEFINED__ +struct __sem_anonymous { + unsigned short semval; + pid_t sempid; + unsigned short semncnt; + unsigned short semzcnt; +}; +#endif + +/* ./src/sys/sem/struct_sembuf.c */ +#ifndef __TYPE_struct_sembuf_DEFINED__ +#define __TYPE_struct_sembuf_DEFINED__ +struct sembuf { + unsigned short sem_num; + short sem_op; + short sem_flg; +}; +#endif + +/* ./src/sys/sem/struct_semid_ds.c */ +#ifndef __TYPE_struct_semid_ds_DEFINED__ +#define __TYPE_struct_semid_ds_DEFINED__ +struct semid_ds { + struct ipc_perm sem_perm; + unsigned short sem_nsems; + time_t sem_otime; + time_t sem_ctime; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/sem/semctl.c */ +int semctl(int __semid, int __semnum, int __cmd, ...); +/* ./src/sys/sem/semget.c */ +int semget(__key_t, int __nsems, int __semflg); +/* ./src/sys/sem/semop.c */ +int semop(int __semid, struct sembuf *__sops, size_t __nsops); +#endif + + +#endif diff --git a/sys/shm.h b/sys/shm.h new file mode 100644 index 0000000..39de11b --- /dev/null +++ b/sys/shm.h @@ -0,0 +1,131 @@ +#ifndef __SYS_SHM_H__ +#define __SYS_SHM_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/shm/ipc.ref */ +#include +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/shm/SHMLBA.c */ +#define SHMLBA 3 +/* ./src/sys/shm/SHM_RDONLY.c */ +#define SHM_RDONLY 1 +/* ./src/sys/shm/SHM_RND.c */ +#define SHM_RND 2 +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/shm/shmatt_t.c */ +#ifndef __TYPE_shmatt_t_DEFINED__ +#define __TYPE_shmatt_t_DEFINED__ +typedef unsigned short shmatt_t; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/sys/types/key_t.c */ +#ifndef __TYPE_key_t_DEFINED__ +#define __TYPE_key_t_DEFINED__ +typedef unsigned long long int key_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/shm/struct_shmid_ds.c */ +#ifndef __TYPE_struct_shmid_ds_DEFINED__ +#define __TYPE_struct_shmid_ds_DEFINED__ +struct shmid_ds { + struct ipc_perm shm_perm; + size_t shm_segsz; + pid_t shm_lpid; + pid_t shm_cpid; + shmatt_t shm_nattach; + time_t shm_atime; + time_t shm_dtime; + time_t shm_ctime; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/shm/shmat.c */ +void * shmat(int __shmid, const void *__shmaddr, int __shmflg); +/* ./src/sys/shm/shmctl.c */ +int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf); +/* ./src/sys/shm/shmdt.c */ +int shmdt(const void *__shmaddr); +/* ./src/sys/shm/shmget.c */ +int shmget(key_t __key, size_t __size, int __shmflg); +#endif + + +#endif diff --git a/sys/stat.h b/sys/stat.h new file mode 100644 index 0000000..d0d6b17 --- /dev/null +++ b/sys/stat.h @@ -0,0 +1,243 @@ +#ifndef __SYS_STAT_H__ +#define __SYS_STAT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/stat/S_IRGRP.c */ +#define S_IRGRP (040) +/* ./src/sys/stat/S_IROTH.c */ +#define S_IROTH (04) +/* ./src/sys/stat/S_IRUSR.c */ +#define S_IRUSR (0400) +/* ./src/sys/stat/S_IRWXG.c */ +#define S_IRWXG (070) +/* ./src/sys/stat/S_IRWXO.c */ +#define S_IRWXO (07) +/* ./src/sys/stat/S_IRWXU.c */ +#define S_IRWXU (0700) +/* ./src/sys/stat/S_ISBLK.c */ +#define S_ISBLK(__s) /* FIXME */ +/* ./src/sys/stat/S_ISCHR.c */ +#define S_ISCHR(__s) /* fixme */ +/* ./src/sys/stat/S_ISDIR.c */ +#define S_ISDIR(__s) (__s) +/* ./src/sys/stat/S_ISFIFO.c */ +#define S_ISFIFO(__s) /* fixme */ +/* ./src/sys/stat/S_ISGID.c */ +#define S_ISGID (02000) +/* ./src/sys/stat/S_ISREG.c */ +#define S_ISREG(__s) /* fixme */ +/* ./src/sys/stat/S_ISUID.c */ +#define S_ISUID (04000) +/* ./src/sys/stat/S_IWGRP.c */ +#define S_IWGRP (020) +/* ./src/sys/stat/S_IWOTH.c */ +#define S_IWOTH (02) +/* ./src/sys/stat/S_IWUSR.c */ +#define S_IWUSR (0200) +/* ./src/sys/stat/S_IXGRP.c */ +#define S_IXGRP (010) +/* ./src/sys/stat/S_IXOTH.c */ +#define S_IXOTH (01) +/* ./src/sys/stat/S_IXUSR.c */ +#define S_IXUSR (0100) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sys/stat/S_TYPEISMQ.c */ +#define S_TYPEISMQ(__buf) /* TODO */ +/* ./src/sys/stat/S_TYPEISSEM.c */ +#define S_TYPEISSEM(__buf) /* TODO */ +/* ./src/sys/stat/S_TYPEISSHM.c */ +#define S_TYPEISSHM(__buf) /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/stat/S_ISLNK.c */ +#define S_ISLNK(__m) /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/stat/S_IFBLK.c */ +#define S_IFBLK /* TODO */ +/* ./src/sys/stat/S_IFCHR.c */ +#define S_IFCHR /* TODO */ +/* ./src/sys/stat/S_IFDIR.c */ +#define S_IFDIR /* TODO */ +/* ./src/sys/stat/S_IFIFO.c */ +#define S_IFIFO /* TODO */ +/* ./src/sys/stat/S_IFMT.c */ +#define S_IFMT /* TODO */ +/* ./src/sys/stat/S_IFREG.c */ +#define S_IFREG /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/stat/S_IFLNK.c */ +#define S_IFLNK /* TODO */ +/* ./src/sys/stat/S_ISVTX.c */ +#define S_ISVTX 01000 +#endif + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/dev_t.c */ +#ifndef __TYPE_dev_t_DEFINED__ +#define __TYPE_dev_t_DEFINED__ +typedef unsigned long int + dev_t; +#endif + +/* src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +/* src/sys/types/ino_t.c */ +#ifndef __TYPE_ino_t_DEFINED__ +#define __TYPE_ino_t_DEFINED__ +typedef unsigned long int + ino_t; +#endif + +/* src/sys/types/mode_t.c */ +#ifndef __TYPE_mode_t_DEFINED__ +#define __TYPE_mode_t_DEFINED__ +typedef unsigned long int mode_t; +#endif + +/* src/sys/types/nlink_t.c */ +#ifndef __TYPE_nlink_t_DEFINED__ +#define __TYPE_nlink_t_DEFINED__ +typedef unsigned long int + nlink_t; +#endif + +/* src/sys/types/off_t.c */ +#ifndef __TYPE_off_t_DEFINED__ +#define __TYPE_off_t_DEFINED__ +typedef long int + off_t; +#endif + +/* src/sys/types/uid_t.c */ +#ifndef __TYPE_uid_t_DEFINED__ +#define __TYPE_uid_t_DEFINED__ +typedef unsigned long int + uid_t; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/stat/struct_stat.c */ +#ifndef __TYPE_struct_stat_DEFINED__ +#define __TYPE_struct_stat_DEFINED__ +struct stat { + dev_t st_dev; + ino_t st_ino; + mode_t st_mode; + nlink_t st_nlink; + uid_t st_uid; + gid_t st_gid; + dev_t st_rdev; + off_t st_size; + #if 0 + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + blksize_t st_blksize; + blkcnt_t st_blocks; + #endif +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/stat/chmod.c */ +int chmod(const char *__path, mode_t __mode); +/* ./src/sys/stat/fstat.c */ +int fstat(int __fildes, struct stat *__buf); +/* ./src/sys/stat/mkdir.c */ +int mkdir(const char *__path, mode_t __mode); +/* ./src/sys/stat/mkfifo.c */ +int mkfifo(const char *__path, mode_t __mode); +/* ./src/sys/stat/stat.c */ +int stat(const char * restrict __path, struct stat * restrict __buf); +/* ./src/sys/stat/umask.c */ +mode_t umask(mode_t __cmask); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/sys/stat/fchmod.c */ +int fchmod(int __fildes, mode_t __mode); +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/stat/lstat.c */ +int lstat(const char * restrict __path, struct stat * restrict __buf); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/stat/mknod.c */ +int mknod(const char *__path, mode_t __mode, dev_t __dev); +#endif + + +#endif diff --git a/sys/statvfs.h b/sys/statvfs.h new file mode 100644 index 0000000..7740afb --- /dev/null +++ b/sys/statvfs.h @@ -0,0 +1,89 @@ +#ifndef __SYS_STATVFS_H__ +#define __SYS_STATVFS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/statvfs/ST_NOSUID.c */ +#define ST_NOSUID (1<<1) +/* ./src/sys/statvfs/ST_RDONLY.c */ +#define ST_RDONLY (1<<0) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/statvfs/struct_statvfs.c */ +#ifndef __TYPE_struct_statvfs_DEFINED__ +#define __TYPE_struct_statvfs_DEFINED__ +struct statvfs { + unsigned long f_bsize; + unsigned long f_frsize; + fsblkcnt_t f_blocks; + fsblkcnt_t f_bfree; + fsblkcnt_t f_bavail; + fsfilcnt_t f_files; + fsfilcnt_t f_ffree; + fsfilcnt_t f_favail; + unsigned long f_fsid; + unsigned long f_flag; + unsigned long f_namemax; +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/statvfs/fstatvfs.c */ +int fstatvfs(int __fildes, struct statvfs *__buf); +/* ./src/sys/statvfs/statvfs.c */ +int statvfs(const char * restrict __path, struct statvfs * restrict __buf); +#endif + + +#endif diff --git a/sys/time.h b/sys/time.h new file mode 100644 index 0000000..de9c69d --- /dev/null +++ b/sys/time.h @@ -0,0 +1,105 @@ +#ifndef __SYS_TIME_H__ +#define __SYS_TIME_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/time/FD_CLR.c */ +#define FD_CLR /* TODO */ +/* ./src/sys/time/FD_ISSET.c */ +#define FD_ISSET /* TODO */ +/* ./src/sys/time/FD_SET.c */ +#define FD_SET /* TODO */ +/* ./src/sys/time/FD_SETSIZE.c */ +#define FD_SETSIZE /* TODO */ +/* ./src/sys/time/FD_ZERO.c */ +#define FD_ZERO /* TIME */ +/* ./src/sys/time/ITIMER_PROF.c */ +#define ITIMER_PROF 2 +/* ./src/sys/time/ITIMER_REAL.c */ +#define ITIMER_REAL 0 +/* ./src/sys/time/ITIMER_VIRTUAL.c */ +#define ITIMER_VIRTUAL 1 +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/time/fd_set.c */ +#ifndef __TYPE_fd_set_DEFINED__ +#define __TYPE_fd_set_DEFINED__ +typedef struct { + long fds_bits[]; +} fd_set; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/time/struct_itimerval.c */ +#ifndef __TYPE_struct_itimerval_DEFINED__ +#define __TYPE_struct_itimerval_DEFINED__ +struct itimerval { + struct timeval it_interval; + struct timeval it_value; +}; +#endif + +/* ./src/sys/time/struct_timeval.c */ +#ifndef __TYPE_struct_timeval_DEFINED__ +#define __TYPE_struct_timeval_DEFINED__ +struct timeval { + time_t tv_sec; + suseconds_t tv_usec; +}; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/time/getitimer.c */ +int getitimer(int __which, struct itimerval *__value); +/* ./src/sys/time/gettimeofday.c */ +int gettimeofday(struct timeval *restrict __tp, void *restrict __tzp); +/* ./src/sys/time/select.c */ +int select(int nfds , fd_set * readfds , fd_set * writefds , fd_set * errorfds , struct timeval * timeout ); +/* ./src/sys/time/setitimer.c */ +int setitimer(int __which, const struct itimerval *restrict __value, struct itimerval *restrict __ovalue); +/* ./src/sys/time/utimes.c */ +int utimes(const char *__path, const struct timeval times[2]); +#endif + + +#endif diff --git a/sys/timeb.h b/sys/timeb.h new file mode 100644 index 0000000..52bbe13 --- /dev/null +++ b/sys/timeb.h @@ -0,0 +1,59 @@ +#ifndef __SYS_TIMEB_H__ +#define __SYS_TIMEB_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/sys/timeb/struct_timeb.c */ +#ifndef __TYPE_struct_timeb_DEFINED__ +#define __TYPE_struct_timeb_DEFINED__ +struct timeb { + time_t time; + unsigned short millitm; + short timezone; + short dstflag; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/sys/timeb/ftime.c */ +int ftime(struct timeb *__tp); +#endif + + +#endif diff --git a/sys/times.h b/sys/times.h new file mode 100644 index 0000000..4aa29fa --- /dev/null +++ b/sys/times.h @@ -0,0 +1,75 @@ +#ifndef __SYS_TIMES_H__ +#define __SYS_TIMES_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* src/time/clock_t.c */ +#ifndef __TYPE_clock_t_DEFINED__ +#define __TYPE_clock_t_DEFINED__ +typedef long int clock_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/times/struct_tms.c */ +#ifndef __TYPE_struct_tms_DEFINED__ +#define __TYPE_struct_tms_DEFINED__ +struct tms { + clock_t tms_utime; + clock_t tms_stime; + clock_t tms_cutime; + clock_t tms_cstime; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/times/times.c */ +clock_t times(struct tms *__buffer); +#endif + + +#endif diff --git a/sys/types.h b/sys/types.h new file mode 100644 index 0000000..b9976b7 --- /dev/null +++ b/sys/types.h @@ -0,0 +1,179 @@ +#ifndef __SYS_TYPES_H__ +#define __SYS_TYPES_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/types/dev_t.c */ +#ifndef __TYPE_dev_t_DEFINED__ +#define __TYPE_dev_t_DEFINED__ +typedef unsigned long int + dev_t; +#endif + +/* ./src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +/* ./src/sys/types/ino_t.c */ +#ifndef __TYPE_ino_t_DEFINED__ +#define __TYPE_ino_t_DEFINED__ +typedef unsigned long int + ino_t; +#endif + +/* ./src/sys/types/mode_t.c */ +#ifndef __TYPE_mode_t_DEFINED__ +#define __TYPE_mode_t_DEFINED__ +typedef unsigned long int mode_t; +#endif + +/* ./src/sys/types/nlink_t.c */ +#ifndef __TYPE_nlink_t_DEFINED__ +#define __TYPE_nlink_t_DEFINED__ +typedef unsigned long int + nlink_t; +#endif + +/* ./src/sys/types/off_t.c */ +#ifndef __TYPE_off_t_DEFINED__ +#define __TYPE_off_t_DEFINED__ +typedef long int + off_t; +#endif + +/* ./src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +/* ./src/sys/types/ssize_t.c */ +#ifndef __TYPE_ssize_t_DEFINED__ +#define __TYPE_ssize_t_DEFINED__ +typedef long int ssize_t; +#endif + +/* ./src/sys/types/uid_t.c */ +#ifndef __TYPE_uid_t_DEFINED__ +#define __TYPE_uid_t_DEFINED__ +typedef unsigned long int + uid_t; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/sys/types/clockid_t.c */ +#ifndef __TYPE_clockid_t_DEFINED__ +#define __TYPE_clockid_t_DEFINED__ +typedef unsigned long int clockid_t; +#endif + +/* ./src/sys/types/timer_t.c */ +#ifndef __TYPE_timer_t_DEFINED__ +#define __TYPE_timer_t_DEFINED__ +typedef unsigned long int timer_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/types/id_t.c */ +#ifndef __TYPE_id_t_DEFINED__ +#define __TYPE_id_t_DEFINED__ +typedef unsigned long long int id_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/sys/types/key_t.c */ +#ifndef __TYPE_key_t_DEFINED__ +#define __TYPE_key_t_DEFINED__ +typedef unsigned long long int key_t; +#endif + +/* src/time/clock_t.c */ +#ifndef __TYPE_clock_t_DEFINED__ +#define __TYPE_clock_t_DEFINED__ +typedef long int clock_t; +#endif + +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/sys/types/useconds_t.c */ +#ifndef __TYPE_useconds_t_DEFINED__ +#define __TYPE_useconds_t_DEFINED__ +typedef unsigned int useconds_t; +#endif + +#endif + + +#endif diff --git a/sys/uio.h b/sys/uio.h new file mode 100644 index 0000000..c511a82 --- /dev/null +++ b/sys/uio.h @@ -0,0 +1,50 @@ +#ifndef __SYS_UIO_H__ +#define __SYS_UIO_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/uio/struct_iovec.c */ +#ifndef __TYPE_struct_iovec_DEFINED__ +#define __TYPE_struct_iovec_DEFINED__ +struct iovec { + void * iov_base; + size_t iov_len; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/uio/readv.c */ +ssize_t readv(int __fildes, const struct iovec * __iov, int __iovcnt); +/* ./src/sys/uio/writev.c */ +ssize_t writev(int __fildes, const struct iovec * __iov, int __iovcnt); +#endif + + +#endif diff --git a/sys/utsname.h b/sys/utsname.h new file mode 100644 index 0000000..6a43e44 --- /dev/null +++ b/sys/utsname.h @@ -0,0 +1,67 @@ +#ifndef __SYS_UTSNAME_H__ +#define __SYS_UTSNAME_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/utsname/struct_utsname.c */ +#ifndef __TYPE_struct_utsname_DEFINED__ +#define __TYPE_struct_utsname_DEFINED__ +struct utsname { + char sysname[100]; + char nodename[100]; + char release[100]; + char version[100]; + char machine[100]; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/utsname/uname.c */ +int uname(struct utsname *__name); +#endif + + +#endif diff --git a/sys/wait.h b/sys/wait.h new file mode 100644 index 0000000..1dd2779 --- /dev/null +++ b/sys/wait.h @@ -0,0 +1,158 @@ +#ifndef __SYS_WAIT_H__ +#define __SYS_WAIT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/wait/WEXITSTATUS.c */ +#define WEXITSTATUS(__stat_val) (__stat_val & 0xff) +/* ./src/sys/wait/WIFEXITED.c */ +#define WIFEXITED(__stat_val) (__stat_val <= 255) +/* ./src/sys/wait/WIFSIGNALED.c */ +#define WIFSIGNALED(__stat_val) (__stat_val & 0x100) +/* ./src/sys/wait/WIFSTOPPED.c */ +#define WIFSTOPPED(__stat_val) (__stat_val & 0x200) +/* ./src/sys/wait/WNOHANG.c */ +#define WNOHANG (1<<0) +/* ./src/sys/wait/WSTOPSIG.c */ +#define WSTOPSIG(__stat_val) (__stat_val & 0xff) +/* ./src/sys/wait/WTERMSIG.c */ +#define WTERMSIG(__stat_val) (__stat_val & 0xff) +/* ./src/sys/wait/WUNTRACED.c */ +#define WUNTRACED (1<<1) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/wait/WEXITED.c */ +#define WEXITED (1<<3) +/* ./src/sys/wait/WNOWAIT.c */ +#define WNOWAIT (1<<4) +/* ./src/sys/wait/WSTOPPED.c */ +#define WSTOPPED (1<<5) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/wait/WCONTINUED.c */ +#define WCONTINUED (1<<2) +/* ./src/sys/wait/WIFCONTINUED.c */ +#define WIFCONTINUED(__stat_val) (__stat_val & 0x400) +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/wait/idtype_t.c */ +#ifndef __TYPE_idtype_t_DEFINED__ +#define __TYPE_idtype_t_DEFINED__ +typedef enum { + P_ALL, + P_PGID, + P_PID +} idtype_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/signal/siginfo_t.c */ +#ifndef __TYPE_siginfo_t_DEFINED__ +#define __TYPE_siginfo_t_DEFINED__ +typedef struct { + int si_signo; + int si_code; + pid_t si_pid; + uid_t si_uid; + void *si_addr; + int si_status; + long si_band; + int si_errno; + union sigval si_value; +} siginfo_t; +#endif + +/* src/sys/types/id_t.c */ +#ifndef __TYPE_id_t_DEFINED__ +#define __TYPE_id_t_DEFINED__ +typedef unsigned long long int id_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/sys/resource/struct_rusage.c */ +#ifndef __TYPE_struct_rusage_DEFINED__ +#define __TYPE_struct_rusage_DEFINED__ +struct rusage { + struct timeval ru_utime; + struct timeval ru_stime; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/sys/wait/wait.c */ +pid_t wait(int *__stat_loc); +/* ./src/sys/wait/waitpid.c */ +pid_t waitpid(pid_t __pid, int *__stat_loc, int __options); +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/sys/wait/waitid.c */ +int waitid(idtype_t __idtype, id_t __id, siginfo_t *__infop, int __options); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/sys/wait/wait3.c */ +pid_t wait3(int *__state_loc, int __options, struct rusage *__resource_usage); +#endif + + +#endif diff --git a/syslog.h b/syslog.h new file mode 100644 index 0000000..bf5b096 --- /dev/null +++ b/syslog.h @@ -0,0 +1,110 @@ +#ifndef __SYSLOG_H__ +#define __SYSLOG_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/syslog/LOG_ALERT.c */ +#define LOG_ALERT (1<<1) +/* ./src/syslog/LOG_CONS.c */ +#define LOG_CONS (1<<1) +/* ./src/syslog/LOG_CRIT.c */ +#define LOG_CRIT (1<<2) +/* ./src/syslog/LOG_CRON.c */ +#define LOG_CRON 7 +/* ./src/syslog/LOG_DAEMON.c */ +#define LOG_DAEMON 5 +/* ./src/syslog/LOG_DEBUG.c */ +#define LOG_DEBUG (1<<7) +/* ./src/syslog/LOG_EMERG.c */ +#define LOG_EMERG (1<<0) +/* ./src/syslog/LOG_ERR.c */ +#define LOG_ERR (1<<3) +/* ./src/syslog/LOG_INFO.c */ +#define LOG_INFO (1<<6) +/* ./src/syslog/LOG_KERN.c */ +#define LOG_KERN 0 +/* ./src/syslog/LOG_LOCAL0.c */ +#define LOG_LOCAL0 10 +/* ./src/syslog/LOG_LOCAL1.c */ +#define LOG_LOCAL1 11 +/* ./src/syslog/LOG_LOCAL2.c */ +#define LOG_LOCAL2 12 +/* ./src/syslog/LOG_LOCAL3.c */ +#define LOG_LOCAL3 13 +/* ./src/syslog/LOG_LOCAL4.c */ +#define LOG_LOCAL4 14 +/* ./src/syslog/LOG_LOCAL5.c */ +#define LOG_LOCAL5 15 +/* ./src/syslog/LOG_LOCAL6.c */ +#define LOG_LOCAL6 16 +/* ./src/syslog/LOG_LOCAL7.c */ +#define LOG_LOCAL7 17 +/* ./src/syslog/LOG_LPR.c */ +#define LOG_LPR 8 +/* ./src/syslog/LOG_MAIL.c */ +#define LOG_MAIL 2 +/* ./src/syslog/LOG_MASK.c */ +#define LOG_MASK(__pri) (1<<__pri) +/* ./src/syslog/LOG_NDELAY.c */ +#define LOG_NDELAY (1<<2) +/* ./src/syslog/LOG_NEWS.c */ +#define LOG_NEWS 3 +/* ./src/syslog/LOG_NOTICE.c */ +#define LOG_NOTICE (1<<5) +/* ./src/syslog/LOG_NOWAIT.c */ +#define LOG_NOWAIT (1<<4) +/* ./src/syslog/LOG_ODELAY.c */ +#define LOG_ODELAY (1<<3) +/* ./src/syslog/LOG_PID.c */ +#define LOG_PID (1<<0) +/* ./src/syslog/LOG_USER.c */ +#define LOG_USER 1 +/* ./src/syslog/LOG_UUCP.c */ +#define LOG_UUCP 4 +/* ./src/syslog/LOG_WARNING.c */ +#define LOG_WARNING (1<<4) +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 500) +/* ./src/syslog/LOG_UPTO.c */ +#define LOG_UPTO() /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/syslog/closelog.c */ +void closelog(void); +/* ./src/syslog/openlog.c */ +void openlog(const char * __ident, int __logopt, int __facility); +/* ./src/syslog/setlogmask.c */ +int setlogmask(int __maskpri); +/* ./src/syslog/syslog.c */ +void syslog(int __priority, const char * __message, ...); +#endif + + +#endif diff --git a/tar.h b/tar.h new file mode 100644 index 0000000..543a989 --- /dev/null +++ b/tar.h @@ -0,0 +1,100 @@ +#ifndef __TAR_H__ +#define __TAR_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/tar/AREGTYPE.c */ +#define AREGTYPE '\0' +/* ./src/tar/BLKTYPE.c */ +#define BLKTYPE '4' +/* ./src/tar/CHRTYPE.c */ +#define CHRTYPE '3' +/* ./src/tar/CONTTYPE.c */ +#define CONTTYPE '7' +/* ./src/tar/DIRTYPE.c */ +#define DIRTYPE '5' +/* ./src/tar/FIFOTYPE.c */ +#define FIFOTYPE '6' +/* ./src/tar/LNKTYPE.c */ +#define LNKTYPE '1' +/* ./src/tar/REGTYPE.c */ +#define REGTYPE '0' +/* ./src/tar/SYMTYPE.c */ +#define SYMTYPE '2' +/* ./src/tar/TGEXEC.c */ +#define TGEXEC 00010 +/* ./src/tar/TGREAD.c */ +#define TGREAD 00040 +/* ./src/tar/TGWRITE.c */ +#define TGWRITE 00020 +/* ./src/tar/TMAGIC.c */ +#define TMAGIC "ustar" +/* ./src/tar/TMAGLEN.c */ +#define TMAGLEN 6 +/* ./src/tar/TOEXEC.c */ +#define TOEXEC 00001 +/* ./src/tar/TOREAD.c */ +#define TOREAD 00004 +/* ./src/tar/TOWRITE.c */ +#define TOWRITE 00002 +/* ./src/tar/TSGID.c */ +#define TSGID 02000 +/* ./src/tar/TSUID.c */ +#define TSUID 04000 +/* ./src/tar/TSVTX.c */ +#define TSVTX 01000 +/* ./src/tar/TUEXEC.c */ +#define TUEXEC 00100 +/* ./src/tar/TUREAD.c */ +#define TUREAD 00400 +/* ./src/tar/TUWRITE.c */ +#define TUWRITE 00200 +/* ./src/tar/TVERSION.c */ +#define TVERSION "00" +/* ./src/tar/TVERSLEN.c */ +#define TVERSLEN 2 +#endif + + +#endif diff --git a/term.h b/term.h new file mode 100644 index 0000000..e49657a --- /dev/null +++ b/term.h @@ -0,0 +1,1020 @@ +#ifndef __TERM_H__ +#define __TERM_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/term/acs_chars.c */ +#define acs_chars tigetstr("acsc") +/* ./src/term/alt_scancode_esc.c */ +#define alt_scancode_esc tigetstr("scesa") +/* ./src/term/auto_left_margin.c */ +#define auto_left_margin tigetflag("bw") +/* ./src/term/auto_right_margin.c */ +#define auto_right_margin tigetflag("am") +/* ./src/term/back_color_erase.c */ +#define back_color_erase tigetflag("bce") +/* ./src/term/back_tab.c */ +#define back_tab tigetstr("cbt") +/* ./src/term/bell.c */ +#define bell tigetstr("bel") +/* ./src/term/bit_image_carriage_return.c */ +#define bit_image_carriage_return tigetstr("bicr") +/* ./src/term/bit_image_entwining.c */ +#define bit_image_entwining tigetnum("bitwin") +/* ./src/term/bit_image_newline.c */ +#define bit_image_newline tigetstr("binel") +/* ./src/term/bit_image_repeat.c */ +#define bit_image_repeat tigetstr("birep") +/* ./src/term/bit_image_type.c */ +#define bit_image_type tigetnum("bitype") +/* ./src/term/buffer_capacity.c */ +#define buffer_capacity tigetnum("bufsz") +/* ./src/term/buttons.c */ +#define buttons tigetnum("btns") +/* ./src/term/can_change.c */ +#define can_change tigetflag("ccc") +/* ./src/term/carriage_return.c */ +#define carriage_return tigetstr("cr") +/* ./src/term/ceol_standout_glitch.c */ +#define ceol_standout_glitch tigetflag("xhp") +/* ./src/term/change_char_pitch.c */ +#define change_char_pitch tigetstr("cpi") +/* ./src/term/change_line_pitch.c */ +#define change_line_pitch tigetstr("lpi") +/* ./src/term/change_res_horz.c */ +#define change_res_horz tigetstr("chr") +/* ./src/term/change_res_vert.c */ +#define change_res_vert tigetstr("cvr") +/* ./src/term/change_scroll_region.c */ +#define change_scroll_region tigetstr("csr") +/* ./src/term/char_padding.c */ +#define char_padding tigetstr("rmp") +/* ./src/term/char_set_names.c */ +#define char_set_names tigetstr("csnm") +/* ./src/term/clear_all_tabs.c */ +#define clear_all_tabs tigetstr("tbc") +/* ./src/term/clear_margins.c */ +#define clear_margins tigetstr("mgc") +/* ./src/term/clear_screen.c */ +#define clear_screen tigetstr("clear") +/* ./src/term/clr_bol.c */ +#define clr_bol tigetstr("el1") +/* ./src/term/clr_eol.c */ +#define clr_eol tigetstr("el") +/* ./src/term/clr_eos.c */ +#define clr_eos tigetstr("el") +/* ./src/term/code_set_init.c */ +#define code_set_init tigetstr("csin") +/* ./src/term/col_addr_glitch.c */ +#define col_addr_glitch tigetflag("xhpa") +/* ./src/term/color_names.c */ +#define color_names tigetstr("colornm") +/* ./src/term/column_address.c */ +#define column_address tigetstr("hpa") +/* ./src/term/columns.c */ +#define columns tigetnum("cols") +/* ./src/term/command_character.c */ +#define command_character tigetstr("cmdch") +/* ./src/term/cpi_change_res.c */ +#define cpi_change_res tigetflag("cpix") +/* ./src/term/cr_cancles_micro_mode.c */ +#define cr_cancles_micro_mode tigetflag("crxm") +/* ./src/term/create_window.c */ +#define create_window tigetstr("cwin") +/* ./src/term/cursor_address.c */ +#define cursor_address tigetstr("cup") +/* ./src/term/cursor_down.c */ +#define cursor_down tigetstr("cudl") +/* ./src/term/cursor_home.c */ +#define cursor_home tigetstr("home") +/* ./src/term/cursor_invisible.c */ +#define cursor_invisible tigetstr("civis") +/* ./src/term/cursor_left.c */ +#define cursor_left tigetstr("cubl") +/* ./src/term/cursor_mem_address.c */ +#define cursor_mem_address tigetstr("mrcup") +/* ./src/term/cursor_normal.c */ +#define cursor_normal tigetstr("cnorm") +/* ./src/term/cursor_right.c */ +#define cursor_right tigetstr("cufl") +/* ./src/term/cursor_to_ll.c */ +#define cursor_to_ll tigetstr("ll") +/* ./src/term/cursor_up.c */ +#define cursor_up tigetstr("cuul") +/* ./src/term/cursor_visible.c */ +#define cursor_visible tigetstr("cvvis") +/* ./src/term/define_bit_image_region.c */ +#define define_bit_image_region tigetstr("defbi") +/* ./src/term/define_char.c */ +#define define_char tigetstr("defc") +/* ./src/term/delete_character.c */ +#define delete_character tigetstr("dchl") +/* ./src/term/delete_line.c */ +#define delete_line tigetstr("dll") +/* ./src/term/dest_tabs_magic_smso.c */ +#define dest_tabs_magic_smso tigetflag("xt") +/* ./src/term/device_type.c */ +#define device_type tigetstr("devt") +/* ./src/term/dial_phone.c */ +#define dial_phone tigetstr("dial") +/* ./src/term/dis_status_line.c */ +#define dis_status_line tigetstr("dsl") +/* ./src/term/display_clock.c */ +#define display_clock tigetstr("dclk") +/* ./src/term/display_pc_char.c */ +#define display_pc_char tigetstr("dispc") +/* ./src/term/dot_horz_spacing.c */ +#define dot_horz_spacing tigetnum("spinh") +/* ./src/term/dot_vert_spacing.c */ +#define dot_vert_spacing tigetnum("spinv") +/* ./src/term/down_half_line.c */ +#define down_half_line tigetstr("hd") +/* ./src/term/eat_newline_glitch.c */ +#define eat_newline_glitch tigetflag("xenl") +/* ./src/term/ena_acs.c */ +#define ena_acs tigetstr("enacs") +/* ./src/term/end_bit_image_region.c */ +#define end_bit_image_region tigetstr("endbi") +/* ./src/term/enter_alt_charset_mode.c */ +#define enter_alt_charset_mode tigetstr("smacs") +/* ./src/term/enter_am_mode.c */ +#define enter_am_mode tigetstr("smam") +/* ./src/term/enter_blink_mode.c */ +#define enter_blink_mode tigetstr("blink") +/* ./src/term/enter_bold_mode.c */ +#define enter_bold_mode tigetstr("bold") +/* ./src/term/enter_ca_mode.c */ +#define enter_ca_mode tigetstr("smcup") +/* ./src/term/enter_delete_mode.c */ +#define enter_delete_mode tigetstr("smdc") +/* ./src/term/enter_dim_mode.c */ +#define enter_dim_mode tigetstr("dim") +/* ./src/term/enter_doublewide_mode.c */ +#define enter_doublewide_mode tigetstr("swidm") +/* ./src/term/enter_draft_quality.c */ +#define enter_draft_quality tigetstr("sdrfq") +/* ./src/term/enter_horizontal_hl_mode.c */ +#define enter_horizontal_hl_mode tigetstr("ehhlm") +/* ./src/term/enter_insert_mode.c */ +#define enter_insert_mode tigetstr("smir") +/* ./src/term/enter_italics_mode.c */ +#define enter_italics_mode tigetstr("sitm") +/* ./src/term/enter_left_hl_mode.c */ +#define enter_left_hl_mode tigetstr("elhlm") +/* ./src/term/enter_leftward_mode.c */ +#define enter_leftward_mode tigetstr("slm") +/* ./src/term/enter_low_hl_mode.c */ +#define enter_low_hl_mode tigetstr("elohlm") +/* ./src/term/enter_micro_code.c */ +#define enter_micro_code tigetstr("smicm") +/* ./src/term/enter_near_letter_quality.c */ +#define enter_near_letter_quality tigetstr("snlq") +/* ./src/term/enter_normal_quality.c */ +#define enter_normal_quality tigetstr("snrmq") +/* ./src/term/enter_pc_charset_mode.c */ +#define enter_pc_charset_mode tigetstr("smpch") +/* ./src/term/enter_protected_mode.c */ +#define enter_protected_mode tigetstr("prot") +/* ./src/term/enter_reverse_mode.c */ +#define enter_reverse_mode tigetstr("rev") +/* ./src/term/enter_right_hl_mode.c */ +#define enter_right_hl_mode tigetstr("erhlm") +/* ./src/term/enter_scancode_mode.c */ +#define enter_scancode_mode tigetstr("smsc") +/* ./src/term/enter_secure_mode.c */ +#define enter_secure_mode tigetstr("invis") +/* ./src/term/enter_shadow_mode.c */ +#define enter_shadow_mode tigetstr("sshm") +/* ./src/term/enter_standout_mode.c */ +#define enter_standout_mode tigetstr("smso") +/* ./src/term/enter_subscript_mode.c */ +#define enter_subscript_mode tigetstr("ssubm") +/* ./src/term/enter_superscript_mode.c */ +#define enter_superscript_mode tigetstr("ssupm") +/* ./src/term/enter_top_hl_mode.c */ +#define enter_top_hl_mode tigetstr("ethlm") +/* ./src/term/enter_underline_mode.c */ +#define enter_underline_mode tigetstr("smul") +/* ./src/term/enter_upward_mode.c */ +#define enter_upward_mode tigetstr("sum") +/* ./src/term/enter_vertical_hl_mode.c */ +#define enter_vertical_hl_mode tigetstr("evhlm") +/* ./src/term/enter_xon_mode.c */ +#define enter_xon_mode tigetstr("smxon") +/* ./src/term/erase_chars.c */ +#define erase_chars tigetstr("ech") +/* ./src/term/erase_overstrick.c */ +#define erase_overstrick tigetflag("eo") +/* ./src/term/exit_alt_charset_mode.c */ +#define exit_alt_charset_mode tigetstr("rmacs") +/* ./src/term/exit_am_mode.c */ +#define exit_am_mode tigetstr("rmam") +/* ./src/term/exit_attribute_mode.c */ +#define exit_attribute_mode tigetstr("sgr0") +/* ./src/term/exit_ca_mode.c */ +#define exit_ca_mode tigetstr("rmcup") +/* ./src/term/exit_delete_mode.c */ +#define exit_delete_mode tigetstr("rmdc") +/* ./src/term/exit_doublewide_mode.c */ +#define exit_doublewide_mode tigetstr("rwidm") +/* ./src/term/exit_insert_mode.c */ +#define exit_insert_mode tigetstr("rmir") +/* ./src/term/exit_italics_mode.c */ +#define exit_italics_mode tigetstr("ritm") +/* ./src/term/exit_leftword_mode.c */ +#define exit_leftword_mode tigetstr("rlim") +/* ./src/term/exit_micro_mode.c */ +#define exit_micro_mode tigetstr("rmicm") +/* ./src/term/exit_pc_charset_mode.c */ +#define exit_pc_charset_mode tigetstr("rmpch") +/* ./src/term/exit_scancode_mode.c */ +#define exit_scancode_mode tigetstr("rmcs") +/* ./src/term/exit_shadow_mode.c */ +#define exit_shadow_mode tigetstr("rshm") +/* ./src/term/exit_standout_mode.c */ +#define exit_standout_mode tigetstr("rmso") +/* ./src/term/exit_subscript_mode.c */ +#define exit_subscript_mode tigetstr("rsubm") +/* ./src/term/exit_superscript_mode.c */ +#define exit_superscript_mode tigetstr("rsupm") +/* ./src/term/exit_underline_mode.c */ +#define exit_underline_mode tigetstr("rmul") +/* ./src/term/exit_upward_mode.c */ +#define exit_upward_mode tigetstr("rum") +/* ./src/term/exit_xon_mode.c */ +#define exit_xon_mode tigetstr("rmxon") +/* ./src/term/fixed_pause.c */ +#define fixed_pause tigetstr("pause") +/* ./src/term/flash_hook.c */ +#define flash_hook tigetstr("hook") +/* ./src/term/flash_screen.c */ +#define flash_screen tigetstr("flash") +/* ./src/term/form_feed.c */ +#define form_feed tigetstr("ff") +/* ./src/term/from_status_line.c */ +#define from_status_line tigetstr("fsl") +/* ./src/term/generic_type.c */ +#define generic_type tigetflag("gn") +/* ./src/term/get_mouse.c */ +#define get_mouse tigetstr("getm") +/* ./src/term/goto_window.c */ +#define goto_window tigetstr("wingo") +/* ./src/term/hangup.c */ +#define hangup tigetstr("hup") +/* ./src/term/hard_copy.c */ +#define hard_copy tigetflag("hc") +/* ./src/term/hard_cursor.c */ +#define hard_cursor tigetflag("chts") +/* ./src/term/has_meta_key.c */ +#define has_meta_key tigetflag("km") +/* ./src/term/has_print_wheel.c */ +#define has_print_wheel tigetflag("daisy") +/* ./src/term/has_status_line.c */ +#define has_status_line tigetflag("hs") +/* ./src/term/hue_lightness_saturation.c */ +#define hue_lightness_saturation tigetflag("hls") +/* ./src/term/init_1string.c */ +#define init_1string tigetstr("is1") +/* ./src/term/init_2string.c */ +#define init_2string tigetstr("is2") +/* ./src/term/init_3string.c */ +#define init_3string tigetstr("is3") +/* ./src/term/init_file.c */ +#define init_file tigetstr("if") +/* ./src/term/init_prog.c */ +#define init_prog tigetstr("iprog") +/* ./src/term/init_tabs.c */ +#define init_tabs tigetnum("it") +/* ./src/term/initialize_color.c */ +#define initialize_color tigetstr("initc") +/* ./src/term/initialize_pair.c */ +#define initialize_pair tigetstr("initp") +/* ./src/term/insert_character.c */ +#define insert_character tigetstr("ichl") +/* ./src/term/insert_line.c */ +#define insert_line tigetstr("ill") +/* ./src/term/insert_null_glitch.c */ +#define insert_null_glitch tigetflag("in") +/* ./src/term/insert_padding.c */ +#define insert_padding tigetstr("ip") +/* ./src/term/key_a1.c */ +#define key_a1 tigetstr("ka1") +/* ./src/term/key_a3.c */ +#define key_a3 tigetstr("ka3") +/* ./src/term/key_b2.c */ +#define key_b2 tigetstr("kb2") +/* ./src/term/key_backspace.c */ +#define key_backspace tigetstr("kbs") +/* ./src/term/key_beg.c */ +#define key_beg tigetstr("kbeg") +/* ./src/term/key_btab.c */ +#define key_btab tigetstr("kcbt") +/* ./src/term/key_c1.c */ +#define key_c1 tigetstr("kc1") +/* ./src/term/key_c3.c */ +#define key_c3 tigetstr("kc3") +/* ./src/term/key_cancel.c */ +#define key_cancel tigetstr("kcan") +/* ./src/term/key_catab.c */ +#define key_catab tigetstr("ktbc") +/* ./src/term/key_clear.c */ +#define key_clear tigetstr("kclr") +/* ./src/term/key_close.c */ +#define key_close tigetstr("kclo") +/* ./src/term/key_command.c */ +#define key_command tigetstr("kcmd") +/* ./src/term/key_copy.c */ +#define key_copy tigetstr("kcpy") +/* ./src/term/key_create.c */ +#define key_create tigetstr("kcrt") +/* ./src/term/key_ctab.c */ +#define key_ctab tigetstr("kctab") +/* ./src/term/key_dc.c */ +#define key_dc tigetstr("kdchl") +/* ./src/term/key_dl.c */ +#define key_dl tigetstr("kdll") +/* ./src/term/key_down.c */ +#define key_down tigetstr("kcudl") +/* ./src/term/key_eic.c */ +#define key_eic tigetstr("krmir") +/* ./src/term/key_end.c */ +#define key_end tigetstr("kend") +/* ./src/term/key_enter.c */ +#define key_enter tigetstr("kent") +/* ./src/term/key_eol.c */ +#define key_eol tigetstr("kel") +/* ./src/term/key_eos.c */ +#define key_eos tigetstr("ked") +/* ./src/term/key_exit.c */ +#define key_exit tigetstr("kext") +/* ./src/term/key_f0.c */ +#define key_f0 tigetstr("kf0") +/* ./src/term/key_f1.c */ +#define key_f1 tigetstr("kf1") +/* ./src/term/key_f10.c */ +#define key_f10 tigetstr("kf10") +/* ./src/term/key_f11.c */ +#define key_f11 tigetstr("kf11") +/* ./src/term/key_f12.c */ +#define key_f12 tigetstr("kf12") +/* ./src/term/key_f13.c */ +#define key_f13 tigetstr("kf13") +/* ./src/term/key_f14.c */ +#define key_f14 tigetstr("kf14") +/* ./src/term/key_f15.c */ +#define key_f15 tigetstr("kf15") +/* ./src/term/key_f16.c */ +#define key_f16 tigetstr("kf16") +/* ./src/term/key_f17.c */ +#define key_f17 tigetstr("kf17") +/* ./src/term/key_f18.c */ +#define key_f18 tigetstr("kf18") +/* ./src/term/key_f19.c */ +#define key_f19 tigetstr("kf19") +/* ./src/term/key_f2.c */ +#define key_f2 tigetstr("kf2") +/* ./src/term/key_f20.c */ +#define key_f20 tigetstr("kf20") +/* ./src/term/key_f21.c */ +#define key_f21 tigetstr("kf21") +/* ./src/term/key_f22.c */ +#define key_f22 tigetstr("kf22") +/* ./src/term/key_f23.c */ +#define key_f23 tigetstr("kf23") +/* ./src/term/key_f24.c */ +#define key_f24 tigetstr("kf24") +/* ./src/term/key_f25.c */ +#define key_f25 tigetstr("kf25") +/* ./src/term/key_f26.c */ +#define key_f26 tigetstr("kf26") +/* ./src/term/key_f27.c */ +#define key_f27 tigetstr("kf27") +/* ./src/term/key_f28.c */ +#define key_f28 tigetstr("kf28") +/* ./src/term/key_f29.c */ +#define key_f29 tigetstr("kf29") +/* ./src/term/key_f3.c */ +#define key_f3 tigetstr("kf3") +/* ./src/term/key_f30.c */ +#define key_f30 tigetstr("kf30") +/* ./src/term/key_f31.c */ +#define key_f31 tigetstr("kf31") +/* ./src/term/key_f32.c */ +#define key_f32 tigetstr("kf32") +/* ./src/term/key_f33.c */ +#define key_f33 tigetstr("kf33") +/* ./src/term/key_f34.c */ +#define key_f34 tigetstr("kf34") +/* ./src/term/key_f35.c */ +#define key_f35 tigetstr("kf35") +/* ./src/term/key_f36.c */ +#define key_f36 tigetstr("kf36") +/* ./src/term/key_f37.c */ +#define key_f37 tigetstr("kf37") +/* ./src/term/key_f38.c */ +#define key_f38 tigetstr("kf38") +/* ./src/term/key_f39.c */ +#define key_f39 tigetstr("kf39") +/* ./src/term/key_f4.c */ +#define key_f4 tigetstr("kf4") +/* ./src/term/key_f40.c */ +#define key_f40 tigetstr("kf40") +/* ./src/term/key_f41.c */ +#define key_f41 tigetstr("kf41") +/* ./src/term/key_f42.c */ +#define key_f42 tigetstr("kf42") +/* ./src/term/key_f43.c */ +#define key_f43 tigetstr("kf43") +/* ./src/term/key_f44.c */ +#define key_f44 tigetstr("kf44") +/* ./src/term/key_f45.c */ +#define key_f45 tigetstr("kf45") +/* ./src/term/key_f46.c */ +#define key_f46 tigetstr("kf46") +/* ./src/term/key_f47.c */ +#define key_f47 tigetstr("kf47") +/* ./src/term/key_f48.c */ +#define key_f48 tigetstr("kf48") +/* ./src/term/key_f49.c */ +#define key_f49 tigetstr("kf49") +/* ./src/term/key_f5.c */ +#define key_f5 tigetstr("kf5") +/* ./src/term/key_f50.c */ +#define key_f50 tigetstr("kf50") +/* ./src/term/key_f51.c */ +#define key_f51 tigetstr("kf51") +/* ./src/term/key_f52.c */ +#define key_f52 tigetstr("kf52") +/* ./src/term/key_f53.c */ +#define key_f53 tigetstr("kf53") +/* ./src/term/key_f54.c */ +#define key_f54 tigetstr("kf54") +/* ./src/term/key_f55.c */ +#define key_f55 tigetstr("kf55") +/* ./src/term/key_f56.c */ +#define key_f56 tigetstr("kf56") +/* ./src/term/key_f57.c */ +#define key_f57 tigetstr("kf57") +/* ./src/term/key_f58.c */ +#define key_f58 tigetstr("kf58") +/* ./src/term/key_f59.c */ +#define key_f59 tigetstr("kf59") +/* ./src/term/key_f6.c */ +#define key_f6 tigetstr("kf6") +/* ./src/term/key_f60.c */ +#define key_f60 tigetstr("kf60") +/* ./src/term/key_f61.c */ +#define key_f61 tigetstr("kf61") +/* ./src/term/key_f62.c */ +#define key_f62 tigetstr("kf62") +/* ./src/term/key_f63.c */ +#define key_f63 tigetstr("kf63") +/* ./src/term/key_f7.c */ +#define key_f7 tigetstr("kf7") +/* ./src/term/key_f8.c */ +#define key_f8 tigetstr("kf8") +/* ./src/term/key_f9.c */ +#define key_f9 tigetstr("kf9") +/* ./src/term/key_find.c */ +#define key_find tigetstr("kfnd") +/* ./src/term/key_help.c */ +#define key_help tigetstr("khlp") +/* ./src/term/key_home.c */ +#define key_home tigetstr("khome") +/* ./src/term/key_ic.c */ +#define key_ic tigetstr("kichl") +/* ./src/term/key_il.c */ +#define key_il tigetstr("kill") +/* ./src/term/key_left.c */ +#define key_left tigetstr("kcubl") +/* ./src/term/key_ll.c */ +#define key_ll tigetstr("kll") +/* ./src/term/key_mark.c */ +#define key_mark tigetstr("kmrk") +/* ./src/term/key_message.c */ +#define key_message tigetstr("kmsg") +/* ./src/term/key_mouse.c */ +#define key_mouse tigetstr("kmous") +/* ./src/term/key_move.c */ +#define key_move tigetstr("kmov") +/* ./src/term/key_next.c */ +#define key_next tigetstr("knxt") +/* ./src/term/key_npage.c */ +#define key_npage tigetstr("knp") +/* ./src/term/key_open.c */ +#define key_open tigetstr("kopn") +/* ./src/term/key_options.c */ +#define key_options tigetstr("kopt") +/* ./src/term/key_ppage.c */ +#define key_ppage tigetstr("kpp") +/* ./src/term/key_previous.c */ +#define key_previous tigetstr("kprv") +/* ./src/term/key_print.c */ +#define key_print tigetstr("kprt") +/* ./src/term/key_redo.c */ +#define key_redo tigetstr("krdo") +/* ./src/term/key_reference.c */ +#define key_reference tigetstr("kref") +/* ./src/term/key_refresh.c */ +#define key_refresh tigetstr("krfr") +/* ./src/term/key_replace.c */ +#define key_replace tigetstr("krpl") +/* ./src/term/key_restart.c */ +#define key_restart tigetstr("krst") +/* ./src/term/key_resume.c */ +#define key_resume tigetstr("kres") +/* ./src/term/key_right.c */ +#define key_right tigetstr("kcufl") +/* ./src/term/key_save.c */ +#define key_save tigetstr("ksav") +/* ./src/term/key_sbeg.c */ +#define key_sbeg tigetstr("kBEG") +/* ./src/term/key_scancel.c */ +#define key_scancel tigetstr("kCAN") +/* ./src/term/key_scommand.c */ +#define key_scommand tigetstr("kCMD") +/* ./src/term/key_scopy.c */ +#define key_scopy tigetstr("kCPY") +/* ./src/term/key_screate.c */ +#define key_screate tigetstr("kCRT") +/* ./src/term/key_sdc.c */ +#define key_sdc tigetstr("kDC") +/* ./src/term/key_sdl.c */ +#define key_sdl tigetstr("kDL") +/* ./src/term/key_select.c */ +#define key_select tigetstr("kslt") +/* ./src/term/key_send.c */ +#define key_send tigetstr("kEND") +/* ./src/term/key_seol.c */ +#define key_seol tigetstr("kEOL") +/* ./src/term/key_sexit.c */ +#define key_sexit tigetstr("kEXT") +/* ./src/term/key_sf.c */ +#define key_sf tigetstr("kind") +/* ./src/term/key_sfind.c */ +#define key_sfind tigetstr("kFND") +/* ./src/term/key_shelp.c */ +#define key_shelp tigetstr("kHLP") +/* ./src/term/key_shome.c */ +#define key_shome tigetstr("kHOM") +/* ./src/term/key_sic.c */ +#define key_sic tigetstr("iIC") +/* ./src/term/key_sleft.c */ +#define key_sleft tigetstr("kLFT") +/* ./src/term/key_smessage.c */ +#define key_smessage tigetstr("kMSG") +/* ./src/term/key_smove.c */ +#define key_smove tigetstr("kMOV") +/* ./src/term/key_snext.c */ +#define key_snext tigetstr("kNXT") +/* ./src/term/key_soptions.c */ +#define key_soptions tigetstr("kOPT") +/* ./src/term/key_sprevious.c */ +#define key_sprevious tigetstr("kPRV") +/* ./src/term/key_sprint.c */ +#define key_sprint tigetstr("kPRT") +/* ./src/term/key_sr.c */ +#define key_sr tigetstr("kri") +/* ./src/term/key_sredo.c */ +#define key_sredo tigetstr("kRDO") +/* ./src/term/key_sreplace.c */ +#define key_sreplace tigetstr("kRPL") +/* ./src/term/key_sright.c */ +#define key_sright tigetstr("kRIT") +/* ./src/term/key_srsume.c */ +#define key_srsume tigetstr("kRES") +/* ./src/term/key_ssave.c */ +#define key_ssave tigetstr("kSAV") +/* ./src/term/key_ssuspend.c */ +#define key_ssuspend tigetstr("kSPD") +/* ./src/term/key_stab.c */ +#define key_stab tigetstr("khts") +/* ./src/term/key_sundo.c */ +#define key_sundo tigetstr("sUND") +/* ./src/term/key_suspend.c */ +#define key_suspend tigetstr("kspd") +/* ./src/term/key_undo.c */ +#define key_undo tigetstr("kund") +/* ./src/term/key_up.c */ +#define key_up tigetstr("kcuul") +/* ./src/term/keypad_local.c */ +#define keypad_local tigetstr("rmkx") +/* ./src/term/keypad_xmit.c */ +#define keypad_xmit tigetstr("smkx") +/* ./src/term/lab_f0.c */ +#define lab_f0 tigetstr("lf0") +/* ./src/term/lab_f1.c */ +#define lab_f1 tigetstr("lf1") +/* ./src/term/lab_f10.c */ +#define lab_f10 tigetstr("lf10") +/* ./src/term/lab_f2.c */ +#define lab_f2 tigetstr("lf2") +/* ./src/term/lab_f3.c */ +#define lab_f3 tigetstr("lf3") +/* ./src/term/lab_f4.c */ +#define lab_f4 tigetstr("lf4") +/* ./src/term/lab_f5.c */ +#define lab_f5 tigetstr("lf5") +/* ./src/term/lab_f6.c */ +#define lab_f6 tigetstr("lf6") +/* ./src/term/lab_f7.c */ +#define lab_f7 tigetstr("lf7") +/* ./src/term/lab_f8.c */ +#define lab_f8 tigetstr("lf8") +/* ./src/term/lab_f9.c */ +#define lab_f9 tigetstr("lf9") +/* ./src/term/label_format.c */ +#define label_format tigetstr("fln") +/* ./src/term/label_height.c */ +#define label_height tigetnum("lh") +/* ./src/term/label_off.c */ +#define label_off tigetstr("rmln") +/* ./src/term/label_on.c */ +#define label_on tigetstr("smln") +/* ./src/term/label_width.c */ +#define label_width tigetnum("lw") +/* ./src/term/lines.c */ +#define lines tigetnum("lines") +/* ./src/term/lines_of_memory.c */ +#define lines_of_memory tigetnum("lm") +/* ./src/term/lpi_changes_res.c */ +#define lpi_changes_res tigetflag("lpix") +/* ./src/term/magic_cookie_glitch.c */ +#define magic_cookie_glitch tigetnum("xmc") +/* ./src/term/max_attributes.c */ +#define max_attributes tigetnum("ma") +/* ./src/term/max_colors.c */ +#define max_colors tigetnum("colors") +/* ./src/term/max_micro_address.c */ +#define max_micro_address tigetnum("maddr") +/* ./src/term/max_micro_jump.c */ +#define max_micro_jump tigetnum("mjump") +/* ./src/term/max_pairs.c */ +#define max_pairs tigetnum("pairs") +/* ./src/term/maximum_windows.c */ +#define maximum_windows tigetnum("wnum") +/* ./src/term/memory_above.c */ +#define memory_above tigetflag("da") +/* ./src/term/memory_below.c */ +#define memory_below tigetflag("db") +/* ./src/term/meta_off.c */ +#define meta_off tigetstr("rmm") +/* ./src/term/meta_on.c */ +#define meta_on tigetstr("smm") +/* ./src/term/micro_col_size.c */ +#define micro_col_size tigetnum("mcs") +/* ./src/term/micro_colum_address.c */ +#define micro_colum_address tigetstr("mhpa") +/* ./src/term/micro_down.c */ +#define micro_down tigetstr("mcudl") +/* ./src/term/micro_left.c */ +#define micro_left tigetstr("mcubl") +/* ./src/term/micro_line_size.c */ +#define micro_line_size tigetnum("mls") +/* ./src/term/micro_right.c */ +#define micro_right tigetstr("mcufl") +/* ./src/term/micro_row_address.c */ +#define micro_row_address tigetstr("mvpa") +/* ./src/term/micro_up.c */ +#define micro_up tigetstr("mcuul") +/* ./src/term/mouse_info.c */ +#define mouse_info tigetstr("minfo") +/* ./src/term/move_insert_mode.c */ +#define move_insert_mode tigetflag("mir") +/* ./src/term/move_standout_mode.c */ +#define move_standout_mode tigetflag("msgr") +/* ./src/term/needs_xon_xoff.c */ +#define needs_xon_xoff tigetflag("nxon") +/* ./src/term/newline.c */ +#define newline tigetstr("nel") +/* ./src/term/no_color_video.c */ +#define no_color_video tigetnum("ncv") +/* ./src/term/no_esc_ctlc.c */ +#define no_esc_ctlc tigetflag("xsb") +/* ./src/term/no_pad_char.c */ +#define no_pad_char tigetflag("npc") +/* ./src/term/non_dest_scroll_region.c */ +#define non_dest_scroll_region tigetflag("ndscr") +/* ./src/term/non_rev_rmcup.c */ +#define non_rev_rmcup tigetflag("nrrmc") +/* ./src/term/num_labels.c */ +#define num_labels tigetnum("nlab") +/* ./src/term/number_of_pins.c */ +#define number_of_pins tigetnum("npins") +/* ./src/term/order_of_pins.c */ +#define order_of_pins tigetstr("porder") +/* ./src/term/orig_colors.c */ +#define orig_colors tigetstr("oc") +/* ./src/term/orig_pair.c */ +#define orig_pair tigetstr("op") +/* ./src/term/output_res_char.c */ +#define output_res_char tigetnum("orc") +/* ./src/term/output_res_horz_inch.c */ +#define output_res_horz_inch tigetnum("orhi") +/* ./src/term/output_res_line.c */ +#define output_res_line tigetnum("orl") +/* ./src/term/output_res_vert_inch.c */ +#define output_res_vert_inch tigetnum("orvi") +/* ./src/term/over_strike.c */ +#define over_strike tigetflag("os") +/* ./src/term/pad_char.c */ +#define pad_char tigetstr("pad") +/* ./src/term/padding_baud_rate.c */ +#define padding_baud_rate tigetnum("pb") +/* ./src/term/parm_dch.c */ +#define parm_dch tigetstr("dch") +/* ./src/term/parm_delete_line.c */ +#define parm_delete_line tigetstr("dl") +/* ./src/term/parm_down_cursor.c */ +#define parm_down_cursor tigetstr("cud") +/* ./src/term/parm_down_micro.c */ +#define parm_down_micro tigetstr("mcud") +/* ./src/term/parm_ich.c */ +#define parm_ich tigetstr("ich") +/* ./src/term/parm_index.c */ +#define parm_index tigetstr("indn") +/* ./src/term/parm_insert_line.c */ +#define parm_insert_line tigetstr("il") +/* ./src/term/parm_left_cursor.c */ +#define parm_left_cursor tigetstr("cub") +/* ./src/term/parm_left_micro.c */ +#define parm_left_micro tigetstr("mcub") +/* ./src/term/parm_right_cursor.c */ +#define parm_right_cursor tigetstr("cuf") +/* ./src/term/parm_right_micro.c */ +#define parm_right_micro tigetstr("mcuf") +/* ./src/term/parm_rindex.c */ +#define parm_rindex tigetstr("rin") +/* ./src/term/parm_up_cursor.c */ +#define parm_up_cursor tigetstr("cuu") +/* ./src/term/parm_up_micro.c */ +#define parm_up_micro tigetstr("mcuu") +/* ./src/term/pc_term_options.c */ +#define pc_term_options tigetstr("pctrm") +/* ./src/term/pkey_key.c */ +#define pkey_key tigetstr("pfkey") +/* ./src/term/pkey_local.c */ +#define pkey_local tigetstr("pfloc") +/* ./src/term/pkey_plab.c */ +#define pkey_plab tigetstr("pfxl") +/* ./src/term/pkey_xmit.c */ +#define pkey_xmit tigetstr("pfx") +/* ./src/term/plab_norm.c */ +#define plab_norm tigetstr("pln") +/* ./src/term/print_rate.c */ +#define print_rate tigetnum("cps") +/* ./src/term/print_screen.c */ +#define print_screen tigetstr("mc0") +/* ./src/term/prtr_non.c */ +#define prtr_non tigetstr("mc5p") +/* ./src/term/prtr_off.c */ +#define prtr_off tigetstr("mc4") +/* ./src/term/prtr_on.c */ +#define prtr_on tigetstr("mc5") +/* ./src/term/prtr_silent.c */ +#define prtr_silent tigetflag("mc5i") +/* ./src/term/pulse.c */ +#define pulse tigetstr("pulse") +/* ./src/term/quick_dial.c */ +#define quick_dial tigetstr("qdial") +/* ./src/term/remove_clock.c */ +#define remove_clock tigetstr("rmclk") +/* ./src/term/repeat_char.c */ +#define repeat_char tigetstr("rep") +/* ./src/term/req_for_input.c */ +#define req_for_input tigetstr("rfi") +/* ./src/term/req_mouse_pos.c */ +#define req_mouse_pos tigetstr("reqmp") +/* ./src/term/reset_1string.c */ +#define reset_1string tigetstr("rs1") +/* ./src/term/reset_2string.c */ +#define reset_2string tigetstr("rs2") +/* ./src/term/reset_3string.c */ +#define reset_3string tigetstr("rs3") +/* ./src/term/reset_file.c */ +#define reset_file tigetstr("rf") +/* ./src/term/restore_cursor.c */ +#define restore_cursor tigetstr("rc") +/* ./src/term/row_addr_glitch.c */ +#define row_addr_glitch tigetflag("xvpa") +/* ./src/term/row_address.c */ +#define row_address tigetstr("vpa") +/* ./src/term/save_cursor.c */ +#define save_cursor tigetstr("sc") +/* ./src/term/scancode_escape.c */ +#define scancode_escape tigetstr("scesc") +/* ./src/term/scroll_forward.c */ +#define scroll_forward tigetstr("ind") +/* ./src/term/scroll_reverse.c */ +#define scroll_reverse tigetstr("ri") +/* ./src/term/seT_top_margin.c */ +#define seT_top_margin tigetstr("smgt") +/* ./src/term/select_char_set.c */ +#define select_char_set tigetstr("scs") +/* ./src/term/semi_auto_right_margin.c */ +#define semi_auto_right_margin tigetflag("sam") +/* ./src/term/set0_des_seq.c */ +#define set0_des_seq tigetstr("s0ds") +/* ./src/term/set1_des_seq.c */ +#define set1_des_seq tigetstr("s1ds") +/* ./src/term/set2_des_seq.c */ +#define set2_des_seq tigetstr("s2ds") +/* ./src/term/set3_des_seq.c */ +#define set3_des_seq tigetstr("s3ds") +/* ./src/term/set_a_attributes.c */ +#define set_a_attributes tigetstr("sgrl") +/* ./src/term/set_a_background.c */ +#define set_a_background tigetstr("setab") +/* ./src/term/set_a_foreground.c */ +#define set_a_foreground tigetstr("setaf") +/* ./src/term/set_attributes.c */ +#define set_attributes tigetstr("sgr") +/* ./src/term/set_background.c */ +#define set_background tigetstr("setb") +/* ./src/term/set_bottom_margin.c */ +#define set_bottom_margin tigetstr("smgb") +/* ./src/term/set_bottom_margin_parm.c */ +#define set_bottom_margin_parm tigetstr("smgbp") +/* ./src/term/set_clock.c */ +#define set_clock tigetstr("sclk") +/* ./src/term/set_color_band.c */ +#define set_color_band tigetstr("setcolor") +/* ./src/term/set_color_pair.c */ +#define set_color_pair tigetstr("scp") +/* ./src/term/set_foreground.c */ +#define set_foreground tigetstr("setf") +/* ./src/term/set_left_margin.c */ +#define set_left_margin tigetstr("smgl") +/* ./src/term/set_left_margin_parm.c */ +#define set_left_margin_parm tigetstr("smglp") +/* ./src/term/set_lr_margin.c */ +#define set_lr_margin tigetstr("smglr") +/* ./src/term/set_page_length.c */ +#define set_page_length tigetstr("slines") +/* ./src/term/set_pglen_inch.c */ +#define set_pglen_inch tigetstr("slength") +/* ./src/term/set_right_margin.c */ +#define set_right_margin tigetstr("smgr") +/* ./src/term/set_right_margin_parm.c */ +#define set_right_margin_parm tigetstr("smgrp") +/* ./src/term/set_tab.c */ +#define set_tab tigetstr("hts") +/* ./src/term/set_tb_margin.c */ +#define set_tb_margin tigetstr("smgtb") +/* ./src/term/set_top_margin_parm.c */ +#define set_top_margin_parm tigetstr("smgtp") +/* ./src/term/set_window.c */ +#define set_window tigetstr("wind") +/* ./src/term/start_bit_image.c */ +#define start_bit_image tigetstr("sbim") +/* ./src/term/start_char_set_def.c */ +#define start_char_set_def tigetstr("scsd") +/* ./src/term/status_line_esc_ok.c */ +#define status_line_esc_ok tigetflag("eslok") +/* ./src/term/stop_bit_image.c */ +#define stop_bit_image tigetstr("rbim") +/* ./src/term/stop_char_set_def.c */ +#define stop_char_set_def tigetstr("rcsd") +/* ./src/term/subscript_characters.c */ +#define subscript_characters tigetstr("subcs") +/* ./src/term/superscript_characters.c */ +#define superscript_characters tigetstr("supcs") +/* ./src/term/tab.c */ +#define tab tigetstr("ht") +/* ./src/term/these_cause_cr.c */ +#define these_cause_cr tigetstr("docr") +/* ./src/term/tilde_glitch.c */ +#define tilde_glitch tigetflag("hz") +/* ./src/term/to_status_line.c */ +#define to_status_line tigetstr("tsl") +/* ./src/term/tone.c */ +#define tone tigetstr("tone") +/* ./src/term/transparent_underline.c */ +#define transparent_underline tigetflag("ul") +/* ./src/term/underline_char.c */ +#define underline_char tigetstr("uc") +/* ./src/term/up_half_line.c */ +#define up_half_line tigetstr("hu") +/* ./src/term/user0.c */ +#define user0 tigetstr("u0") +/* ./src/term/user1.c */ +#define user1 tigetstr("u1") +/* ./src/term/user2.c */ +#define user2 tigetstr("u2") +/* ./src/term/user3.c */ +#define user3 tigetstr("u3") +/* ./src/term/user4.c */ +#define user4 tigetstr("u4") +/* ./src/term/user5.c */ +#define user5 tigetstr("u5") +/* ./src/term/user6.c */ +#define user6 tigetstr("u6") +/* ./src/term/user7.c */ +#define user7 tigetstr("u7") +/* ./src/term/user8.c */ +#define user8 tigetstr("u8") +/* ./src/term/user9.c */ +#define user9 tigetstr("u9") +/* ./src/term/virtual_terminal.c */ +#define virtual_terminal tigetnum("vt") +/* ./src/term/wait_tone.c */ +#define wait_tone tigetstr("wait") +/* ./src/term/wide_char_size.c */ +#define wide_char_size tigetnum("widcs") +/* ./src/term/width_status_line.c */ +#define width_status_line tigetnum("wsl") +/* ./src/term/xoff_character.c */ +#define xoff_character tigetstr("xoffc") +/* ./src/term/xon_character.c */ +#define xon_character tigetstr("xonc") +/* ./src/term/xon_xoff.c */ +#define xon_xoff tigetflag("xon") +/* ./src/term/zero_motion.c */ +#define zero_motion tigetstr("zerom") +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/curses/bool.c */ +#ifndef __TYPE_bool_DEFINED__ +#define __TYPE_bool_DEFINED__ +#if defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ +typedef _Bool bool; +#else +typedef int bool; +#endif +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/term/TERMINAL.c */ +extern typdef struct __TERMINAL TERMINAL; +/* ./src/term/cur_term.c */ +extern TERMINAL * cur_term; +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/term/del_curterm.c */ +int del_curterm(TERMINAL * __oterm); +/* ./src/term/putp.c */ +int putp(const char * __str); +/* ./src/term/restartterm.c */ +int restartterm(const char * __term, int __fildes, int * __errret); +/* ./src/term/set_curterm.c */ +TERMINAL * set_curterm(TERMINAL * __nterm); +/* ./src/term/setupterm.c */ +int setupterm(char * __term, int __fildes, int * __erret); +/* ./src/term/tigetflag.c */ +int tigetflag(const char * __capname); +/* ./src/term/tigetnum.c */ +int tigetnum(const char * __capname); +/* ./src/term/tigetstr.c */ +char * tigetstr(const char * __capname); +/* ./src/term/tiparm.c */ +char * tiparm(const char * __cap, ...); +/* ./src/term/tparm.c */ +char * tiparm(const char * __cap, long __p1, long __p2, long __p3, long __p4, long __p5, long __p6, long __p7, long __p8, long __p9); +/* ./src/term/tputs.c */ +int tputs(const char * __str, int __affcnt, int (*__putfunc)(int)); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/term/tgetent.c */ +int tgetent(char * __bp, const char * __name); +/* ./src/term/tgetflag.c */ +int tgetflag(char id[2]); +/* ./src/term/tgetnum.c */ +int tgetnum(char id[2]); +/* ./src/term/tgetstr.c */ +char * tgetstr(char id[2], char ** __area); +/* ./src/term/tgoto.c */ +char * tgoto(char * __cap, int __col, int __row); +#endif + + +#endif diff --git a/termios.h b/termios.h new file mode 100644 index 0000000..3199f48 --- /dev/null +++ b/termios.h @@ -0,0 +1,318 @@ +#ifndef __TERMIOS_H__ +#define __TERMIOS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/termios/B0.c */ +#define B0 (0) +/* ./src/termios/B110.c */ +#define B110 (0x3) +/* ./src/termios/B1200.c */ +#define B1200 (0x9) +/* ./src/termios/B134.c */ +#define B134 (0x4) +/* ./src/termios/B150.c */ +#define B150 (0x5) +/* ./src/termios/B1800.c */ +#define B1800 (0xA) +/* ./src/termios/B19200.c */ +#define B19200 (0xE) +/* ./src/termios/B200.c */ +#define B200 (0x6) +/* ./src/termios/B2400.c */ +#define B2400 (0xB) +/* ./src/termios/B300.c */ +#define B300 (0x7) +/* ./src/termios/B38400.c */ +#define B38400 (0xF) +/* ./src/termios/B4800.c */ +#define B4800 (0xC) +/* ./src/termios/B50.c */ +#define B50 (0x1) +/* ./src/termios/B600.c */ +#define B600 (0x8) +/* ./src/termios/B75.c */ +#define B75 (0x2) +/* ./src/termios/B9600.c */ +#define B9600 (0xD) +/* ./src/termios/BRKINT.c */ +#define BRKINT (1<<4) +/* ./src/termios/CLOCAL.c */ +#define CLOCAL (1<<7) +/* ./src/termios/CREAD.c */ +#define CREAD (1<<3) +/* ./src/termios/CS5.c */ +#define CS5 (0x0) +/* ./src/termios/CS6.c */ +#define CS6 (0x1) +/* ./src/termios/CS7.c */ +#define CS7 (0x2) +/* ./src/termios/CS8.c */ +#define CS8 (0x3) +/* ./src/termios/CSIZE.c */ +#define CSIZE (0x3) +/* ./src/termios/CSTOPB.c */ +#define CSTOPB (1<<2) +/* ./src/termios/ECHO.c */ +#define ECHO (1<<0) +/* ./src/termios/ECHOE.c */ +#define ECHOE (1<<1) +/* ./src/termios/ECHOK.c */ +#define ECHOK (1<<2) +/* ./src/termios/ECHONL.c */ +#define ECHONL (1<<3) +/* ./src/termios/HUPCL.c */ +#define HUPCL (1<<6) +/* ./src/termios/ICANON.c */ +#define ICANON (1<<4) +/* ./src/termios/ICRNL.c */ +#define ICRNL (1<<5) +/* ./src/termios/IEXTEN.c */ +#define IEXTEN (1<<5) +/* ./src/termios/IGNBRK.c */ +#define IGNBRK (1<<6) +/* ./src/termios/IGNCR.c */ +#define IGNCR (1<<7) +/* ./src/termios/IGNPAR.c */ +#define IGNPAR (1<<8) +/* ./src/termios/INLCR.c */ +#define INLCR (1<<9) +/* ./src/termios/INPCK.c */ +#define INPCK (1<<10) +/* ./src/termios/ISIG.c */ +#define ISIG (1<<6) +/* ./src/termios/ISTRIP.c */ +#define ISTRIP (1<<11) +/* ./src/termios/IXOFF.c */ +#define IXOFF (1<<12) +/* ./src/termios/IXON.c */ +#define IXON (1<<13) +/* ./src/termios/NCCS.c */ +#define NCCS (11) +/* ./src/termios/NOFLSH.c */ +#define NOFLSH (1<<7) +/* ./src/termios/OPOST.c */ +#define OPOST (1<<4) +/* ./src/termios/PARENB.c */ +#define PARENB (1<<4) +/* ./src/termios/PARMRK.c */ +#define PARMRK (1<<14) +/* ./src/termios/PARODD.c */ +#define PARODD (1<<5) +/* ./src/termios/TCIFLUSH.c */ +#define TCIFLUSH (0) +/* ./src/termios/TCIOFF.c */ +#define TCIOFF (0) +/* ./src/termios/TCIOFLUSH.c */ +#define TCIOFLUSH (1) +/* ./src/termios/TCION.c */ +#define TCION (1) +/* ./src/termios/TCOFLUSH.c */ +#define TCOFLUSH /* TBD */ +/* ./src/termios/TCOOFF.c */ +#define TCOOFF (3) +/* ./src/termios/TCOON.c */ +#define TCOON (4) +/* ./src/termios/TCSADRAIN.c */ +#define TCSADRAIN (1) +/* ./src/termios/TCSAFLUSH.c */ +#define TCSAFLUSH (2) +/* ./src/termios/TCSANOW.c */ +#define TCSANOW (0) +/* ./src/termios/TOSTOP.c */ +#define TOSTOP (1<<8) +/* ./src/termios/VEOF.c */ +#define VEOF (0) +/* ./src/termios/VEOL.c */ +#define VEOL (1) +/* ./src/termios/VERASE.c */ +#define VERASE (2) +/* ./src/termios/VINTR.c */ +#define VINTR (3) +/* ./src/termios/VKILL.c */ +#define VKILL (4) +/* ./src/termios/VMIN.c */ +#define VMIN (5) +/* ./src/termios/VQUIT.c */ +#define VQUIT (6) +/* ./src/termios/VSTART.c */ +#define VSTART (7) +/* ./src/termios/VSTOP.c */ +#define VSTOP (8) +/* ./src/termios/VSUSP.c */ +#define VSUSP (9) +/* ./src/termios/VTIME.c */ +#define VTIME (10) +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/termios/BS0.c */ +#define BS0 (0) +/* ./src/termios/BS1.c */ +#define BS1 (1<<16) +/* ./src/termios/BSDLY.c */ +#define BSDLY (1<<16) +/* ./src/termios/CR0.c */ +#define CR0 (0) +/* ./src/termios/CR1.c */ +#define CR1 (1<<12) +/* ./src/termios/CR3.c */ +#define CR3 ((1<<12)|(1<<13)) +/* ./src/termios/CRDLY.c */ +#define CRDLY ((1<<12)|(1<<13)) +/* ./src/termios/FF0.c */ +#define FF0 (0) +/* ./src/termios/FF1.c */ +#define FF1 (1<<18) +/* ./src/termios/FFDLY.c */ +#define FFDLY (1<<18) +/* ./src/termios/IUCLC.c */ +#define IUCLC (1<<15) +/* ./src/termios/IXANY.c */ +#define IXANY (1<<16) +/* ./src/termios/NL0.c */ +#define NL0 (0) +/* ./src/termios/NL1.c */ +#define NL1 (1<<11) +/* ./src/termios/NLDLY.c */ +#define NLDLY (1<<11) +/* ./src/termios/OCRNL.c */ +#define OCRNL (1<<7) +/* ./src/termios/OFILL.c */ +#define OFILL (1<<10) +/* ./src/termios/OLCUC.c */ +#define OLCUC (1<<5) +/* ./src/termios/ONLCR.c */ +#define ONLCR (1<<6) +/* ./src/termios/ONLRET.c */ +#define ONLRET (1<<9) +/* ./src/termios/ONOCR.c */ +#define ONOCR (1<<8) +/* ./src/termios/TAB0.c */ +#define TAB0 (0) +/* ./src/termios/TAB1.c */ +#define TAB1 (1<<14) +/* ./src/termios/TAB2.c */ +#define TAB2 (1<<15) +/* ./src/termios/TAB3.c */ +#define TAB3 ((1<<14)|(1<<15)) +/* ./src/termios/TABDLY.c */ +#define TABDLY ((1<<14)|(1<<15)) +/* ./src/termios/VT0.c */ +#define VT0 (0) +/* ./src/termios/VT1.c */ +#define VT1 (1<<17) +/* ./src/termios/VTDLY.c */ +#define VTDLY (1<<17) +/* ./src/termios/XCASE.c */ +#define XCASE (1<<9) +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/termios/cc_t.c */ +#ifndef __TYPE_cc_t_DEFINED__ +#define __TYPE_cc_t_DEFINED__ +typedef int cc_t; +#endif + +/* ./src/termios/speed_t.c */ +#ifndef __TYPE_speed_t_DEFINED__ +#define __TYPE_speed_t_DEFINED__ +typedef int speed_t; +#endif + +/* ./src/termios/tcflag_t.c */ +#ifndef __TYPE_tcflag_t_DEFINED__ +#define __TYPE_tcflag_t_DEFINED__ +typedef unsigned int tcflag_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/termios/struct_termios.c */ +#ifndef __TYPE_struct_termios_DEFINED__ +#define __TYPE_struct_termios_DEFINED__ +struct termios { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_cc[NCCS]; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/termios/cfgetispeed.c */ +speed_t cfgetispeed(const struct termios *__termios_p); +/* ./src/termios/cfgetospeed.c */ +speed_t cfgetospeed(const struct termios *__termios_p); +/* ./src/termios/cfsetispeed.c */ +int cfsetispeed(struct termios *__termios_p, speed_t __speed); +/* ./src/termios/cfsetospeed.c */ +int cfsetospeed(struct termios *__termios_p, speed_t __speed); +/* ./src/termios/tcdrain.c */ +int tcdrain(int __fildes); +/* ./src/termios/tcflow.c */ +int tcflow(int __fildes, int __action); +/* ./src/termios/tcflush.c */ +int tcflush(int __fildes, int __queue_selector); +/* ./src/termios/tcgetattr.c */ +int tcgetattr(int __fildes, struct termios *__termios_p); +/* ./src/termios/tcsendbreak.c */ +int tcsendbreak(int __fildes, int __duration); +/* ./src/termios/tcsetattr.c */ +int tcsetattr(int __fildes, int __optional_actions, struct termios *__termios_p); +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/termios/tcgetsid.c */ +pid_t tcgetsid(int __fildes); +#endif + + +#endif diff --git a/time.h b/time.h new file mode 100644 index 0000000..5b069fd --- /dev/null +++ b/time.h @@ -0,0 +1,205 @@ +#ifndef __TIME_H__ +#define __TIME_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +/* ./src/time/CLOCKS_PER_SEC.c */ +#define CLOCKS_PER_SEC ((clock_t)1000000) +/* src/stddef/NULL.c */ +#define NULL ((void*)0) + +#if (defined _POSIX_SOURCE) +/* ./src/time/CLK_TCK.c */ +#define CLK_TCK /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/time/CLOCK_REALTIME.c */ +#define CLOCK_REALTIME (3) +/* ./src/time/TIMER_ABSTIME.c */ +#define TIMER_ABSTIME (0) +#endif + +/* ./src/time/clock_t.c */ +#ifndef __TYPE_clock_t_DEFINED__ +#define __TYPE_clock_t_DEFINED__ +typedef long int clock_t; +#endif + +/* ./src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + + +/* ./src/time/struct_tm.c */ +#ifndef __TYPE_struct_tm_DEFINED__ +#define __TYPE_struct_tm_DEFINED__ +struct tm { + int tm_sec; /* Seconds [0,60] */ + int tm_min; /* Minutes [0, 59] */ + int tm_hour; /* Hour [0,23] */ + int tm_mday; /* Day of the month [1,31] */ + int tm_mon; /* Month of the year [0,11] */ + int tm_year; /* Years since 1900 */ + int tm_wday; /* Day of the week [0,6] (Sunday = 0) */ + int tm_yday; /* Day of the year [0,365] */ + int tm_isdst; /* Daylight Saving Time flag */ +}; +#endif + + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/time/struct_itimerspec.c */ +#ifndef __TYPE_struct_itimerspec_DEFINED__ +#define __TYPE_struct_itimerspec_DEFINED__ +struct itimerspec { + struct timespec it_interval; + struct timespec it_value; +}; +#endif + +/* ./src/time/struct_timespec.c */ +#ifndef __TYPE_struct_timespec_DEFINED__ +#define __TYPE_struct_timespec_DEFINED__ +struct timespec { + time_t tv_sec; /* Seconds */ + long tv_nsec; /* Nanoseonds */ +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/time/tzname.c */ +extern char * tzname[2]; +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/time/daylight.c */ +extern int daylight; +/* ./src/time/timezone.c */ +extern long timezone; +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/time/getdate_err.c */ +extern int getdate_err; +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +/* ./src/time/asctime.c */ +char * asctime(const struct tm * __timeptr); +/* ./src/time/clock.c */ +clock_t clock(void); +/* ./src/time/ctime.c */ +char * ctime(const time_t * __timer); +/* ./src/time/difftime.c */ +double difftime(time_t __time1, time_t __time0); +/* ./src/time/gmtime.c */ +struct tm * gmtime(const time_t * __timer); +/* ./src/time/localtime.c */ +struct tm * localtime(const time_t * __timer); +/* ./src/time/mktime.c */ +time_t mktime(struct tm * __timeptr); +/* ./src/time/strftime.c */ +size_t strftime(char * restrict __s, size_t __maxsize, const char * restrict __format, const struct tm * restrict __timeptr); +/* ./src/time/time.c */ +time_t time(time_t * __timer); + +#if (defined _POSIX_SOURCE) +/* ./src/time/tzset.c */ +void tzset(void); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/time/clock_getres.c */ +int clock_getres(clockid_t __clock_id, struct timespec *__res); +/* ./src/time/clock_gettime.c */ +int clock_gettime(clockid_t __clock_id, struct timespec *__tp); +/* ./src/time/clock_settime.c */ +int clock_settime(clockid_t __clock_id, const struct timespec *__tp); +/* ./src/time/nanosleep.c */ +int nanosleep(const struct timespec *__rqtp, struct timespec *__rmtp); +/* ./src/time/timer_create.c */ +int timer_create(clockid_t __clockid, struct sigevent *restrict __evp, timer_t *restrict __timerid); +/* ./src/time/timer_delete.c */ +int timer_delete(timer_t __timerid); +/* ./src/time/timer_getoverrun.c */ +int timer_getoverrun(timer_t __timerid); +/* ./src/time/timer_gettime.c */ +int timer_gettime(timer_t __timerid, struct itimerspec *__value); +/* ./src/time/timer_settime.c */ +int timer_settime(timer_t __timerid, int __flags, const struct itimerspec * restrict __value, struct itimerspec * restrict __ovalue); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/time/strptime.c */ +char *strptime(const char *restrict __buf, const char *restrict __format, struct tm *restrict __tm); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/time/getdate.c */ +struct tm *getdate(const char *__string); +#endif + + +#endif diff --git a/ucontext.h b/ucontext.h new file mode 100644 index 0000000..515aaec --- /dev/null +++ b/ucontext.h @@ -0,0 +1,94 @@ +#ifndef __UCONTEXT_H__ +#define __UCONTEXT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/ucontext/mcontext_t.c */ +#ifndef __TYPE_mcontext_t_DEFINED__ +#define __TYPE_mcontext_t_DEFINED__ +typedef unsigned long mcontext_t; +#endif + +/* ./src/ucontext/ucontext_t.c */ +#ifndef __TYPE_ucontext_t_DEFINED__ +#define __TYPE_ucontext_t_DEFINED__ +typedef struct ucontext_t { + struct ucontext_t * uc_link; + sigset_t uc_sigmask; + stack_t uc_stack; + mcontext_t uc_mcontext; +} ucontext_t; +#endif + +/* src/signal/sigset_t.c */ +#ifndef __TYPE_sigset_t_DEFINED__ +#define __TYPE_sigset_t_DEFINED__ +typedef unsigned int sigset_t; +#endif + +/* src/signal/stack_t.c */ +#ifndef __TYPE_stack_t_DEFINED__ +#define __TYPE_stack_t_DEFINED__ +typedef struct { + void *ss_sp; /* Stack base or pointer */ + size_t ss_size; /* Stack size */ + int ss_flags; /* Flags */ +} stack_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/ucontext/getcontext.c */ +int getcontext(ucontext_t *__ucp); +/* ./src/ucontext/makecontext.c */ +void makecontext(ucontext_t *__ucp, void (*__func)(), int __argc, ...); +/* ./src/ucontext/setcontext.c */ +int setcontext(const ucontext_t *__ucp); +/* ./src/ucontext/swapcontext.c */ +void swapcontext(ucontext_t *__oucp, const ucontext_t *__ucp); +#endif + + +#endif diff --git a/ulimit.h b/ulimit.h new file mode 100644 index 0000000..3866f18 --- /dev/null +++ b/ulimit.h @@ -0,0 +1,43 @@ +#ifndef __ULIMIT_H__ +#define __ULIMIT_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* ./src/ulimit/UL_GETFSIZE.c */ +#define UL_GETFSIZE 1 +/* ./src/ulimit/UL_SETFSIZE.c */ +#define UL_SETFSIZE 2 +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/ulimit/ulimit.c */ +long ulimit(int __cmd, ...); +#endif + + +#endif diff --git a/unctrl.h b/unctrl.h new file mode 100644 index 0000000..34ddcbf --- /dev/null +++ b/unctrl.h @@ -0,0 +1,45 @@ +#ifndef __UNCTRL_H__ +#define __UNCTRL_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE) +/* src/curses/chtype.c */ +#ifndef __TYPE_chtype_DEFINED__ +#define __TYPE_chtype_DEFINED__ +typedef unsigned int chtype; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/unctrl/unctrl.c */ +char * unctrl(chtype __c); +#endif + + +#endif diff --git a/unistd.h b/unistd.h new file mode 100644 index 0000000..b0cde05 --- /dev/null +++ b/unistd.h @@ -0,0 +1,658 @@ +#ifndef __UNISTD_H__ +#define __UNISTD_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/unistd/F_OK.c */ +#define F_OK 8 +/* ./src/unistd/R_OK.c */ +#define R_OK 4 +/* ./src/unistd/STDERR_FILENO.c */ +#define STDERR_FILENO 2 +/* ./src/unistd/STDIN_FILENO.c */ +#define STDIN_FILENO 0 +/* ./src/unistd/STDOUT_FILENO.c */ +#define STDOUT_FILENO 1 +/* ./src/unistd/W_OK.c */ +#define W_OK 2 +/* ./src/unistd/X_OK.c */ +#define X_OK 1 +/* ./src/unistd/_PC_CHOWN_RESTRICTED.c */ +#define _PC_CHOWN_RESTRICTED 3 +/* ./src/unistd/_PC_LINK_MAX.c */ +#define _PC_LINK_MAX 5 +/* ./src/unistd/_PC_MAX_CANON.c */ +#define _PC_MAX_CANON 6 +/* ./src/unistd/_PC_MAX_INPUT.c */ +#define _PC_MAX_INPUT 7 +/* ./src/unistd/_PC_NAME_MAX.c */ +#define _PC_NAME_MAX 8 +/* ./src/unistd/_PC_NO_TRUNC.c */ +#define _PC_NO_TRUNC 9 +/* ./src/unistd/_PC_PATH_MAX.c */ +#define _PC_PATH_MAX 10 +/* ./src/unistd/_PC_PIPE_BUF.c */ +#define _PC_PIPE_BUF 11 +/* ./src/unistd/_PC_VDISABLE.c */ +#define _PC_VDISABLE 20 +/* ./src/unistd/_POSIX_CHOWN_RESTRICTED.c */ +#define _POSIX_CHOWN_RESTRICTED (1) +/* ./src/unistd/_POSIX_JOB_CONTROL.c */ +#define _POSIX_JOB_CONTROL (_POSIX_C_SOURCE) +/* ./src/unistd/_POSIX_NO_TRUNC.c */ +#define _POSIX_NO_TRUNC (2) +/* ./src/unistd/_POSIX_SAVED_IDS.c */ +#define _POSIX_SAVED_IDS (_POSIX_C_SOURCE) +/* ./src/unistd/_POSIX_VDISABLE.c */ +#define _POSIX_VDISABLE (3) +/* ./src/unistd/_POSIX_VERSION.c */ +#if _POSIX_C_SOURCE >= 200809L +#define _POSIX_VERISON (200809L) +#elif _POSIX_C_SOURCE >= 200112L +#define _POSIX_VERSION (200112L) +#elif _POSIX_C_SOURCE >= 199506L +#define _POSIX_VERSION (199506L) +#elif _POSIX_C_SOURCE >= 199309L +#define _POSIX_VERSION (199309L) +#elif defined _POSIX_C_SOURCE +#define _POSIX_VERSION (199009L) +#else +#define _POSIX_VERSION (198808L) +#endif +/* ./src/unistd/_SC_ARG_MAX.c */ +#define _SC_ARG_MAX 19 +/* ./src/unistd/_SC_CHILD_MAX.c */ +#define _SC_CHILD_MAX 27 +/* ./src/unistd/_SC_CLK_TCK.c */ +#define _SC_CLK_TCK 28 +/* ./src/unistd/_SC_JOB_CONTROL.c */ +#define _SC_JOB_CONTROL 40 +/* ./src/unistd/_SC_NGROUPS_MAX.c */ +#define _SC_NGROUPS_MAX 51 +/* ./src/unistd/_SC_OPEN_MAX.c */ +#define _SC_OPEN_MAX 52 +/* ./src/unistd/_SC_SAVED_IDS.c */ +#define _SC_SAVED_IDS 63 +/* ./src/unistd/_SC_STREAM_MAX.c */ +#define _SC_STREAM_MAX 74 +/* ./src/unistd/_SC_TZNAME_MAX.c */ +#define _SC_TZNAME_MAX 106 +/* ./src/unistd/_SC_VERSION.c */ +#define _SC_VERSION 115 +/* src/stddef/NULL.c */ +#define NULL ((void*)0) +/* src/stdio/SEEK_CUR.c */ +#define SEEK_CUR (1) +/* src/stdio/SEEK_END.c */ +#define SEEK_END (2) +/* src/stdio/SEEK_SET.c */ +#define SEEK_SET (3) +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/unistd/_PC_ASYNC_IO.c */ +#define _PC_ASYNC_IO 2 +/* ./src/unistd/_PC_PRIO_IO.c */ +#define _PC_PRIO_IO 12 +/* ./src/unistd/_PC_SYNC_IO.c */ +#define _PC_SYNC_IO 18 +/* ./src/unistd/_POSIX_ASYNCHRONOUS_IO.c */ +#define _POSIX_ASYNCHRONOUS_IO 200809L +/* ./src/unistd/_POSIX_ASYNC_IO.c */ +#define _POSIX_ASYNC_IO 200809L +/* ./src/unistd/_POSIX_FSYNC.c */ +#define _POSIX_FSYNC (-1) +/* ./src/unistd/_POSIX_MAPPED_FILES.c */ +#define _POSIX_MAPPED_FILES 200809L +/* ./src/unistd/_POSIX_MEMLOCK.c */ +#define _POSIX_MEMLOCK (-1) +/* ./src/unistd/_POSIX_MEMLOCK_RANGE.c */ +#define _POSIX_MEMLOCK_RANGE (-1) +/* ./src/unistd/_POSIX_MEMORY_PROTECTION.c */ +#define _POSIX_MEMORY_PROTECTION 200809L +/* ./src/unistd/_POSIX_MESSAGE_PASSING.c */ +#define _POSIX_MESSAGE_PASSING (-1) +/* ./src/unistd/_POSIX_PRIORITIZED_IO.c */ +#define _POSIX_PRIORITIZED_IO (-1) +/* ./src/unistd/_POSIX_PRIORITY_SCHEDULING.c */ +#define _POSIX_PRIORITY_SCHEDULING (-1) +/* ./src/unistd/_POSIX_PRIO_IO.c */ +#define _POSIX_PRIO_IO 200809L +/* ./src/unistd/_POSIX_REALTIME_SIGNALS.c */ +#define _POSIX_REALTIME_SIGNALS 200809L +/* ./src/unistd/_POSIX_SEMAPHORES.c */ +#define _POSIX_SEMAPHORES 200809L +/* ./src/unistd/_POSIX_SYNCHRONIZED_IO.c */ +#define _POSIX_SYNCHRONIZED_IO (-1) +/* ./src/unistd/_POSIX_SYNC_IO.c */ +#define _POSIX_SYNC_IO 200809L +/* ./src/unistd/_POSIX_TIMERS.c */ +#define _POSIX_TIMERS 200809L +/* ./src/unistd/_SC_AIO_LISTIO_MAX.c */ +#define _SC_AIO_LISTIO_MAX 16 +/* ./src/unistd/_SC_AIO_MAX.c */ +#define _SC_AIO_MAX 17 +/* ./src/unistd/_SC_AIO_PRIO_DELTA_MAX.c */ +#define _SC_AIO_PRIO_DELTA_MAX 18 +/* ./src/unistd/_SC_ASYNCHRONOUS_IO.c */ +#define _SC_ASYNCHRONOUS_IO 20 +/* ./src/unistd/_SC_DELAYTIMER_MAX.c */ +#define _SC_DELAYTIMER_MAX 32 +/* ./src/unistd/_SC_FSYNC.c */ +#define _SC_FSYNC 34 +/* ./src/unistd/_SC_MAPPED_FILES.c */ +#define _SC_MAPPED_FILES 43 +/* ./src/unistd/_SC_MEMLOCK.c */ +#define _SC_MEMLOCK 44 +/* ./src/unistd/_SC_MEMLOCK_RANGE.c */ +#define _SC_MEMLOCK_RANGE 45 +/* ./src/unistd/_SC_MEMORY_PROTECTION.c */ +#define _SC_MEMORY_PROTECTION 46 +/* ./src/unistd/_SC_MESSAGE_PASSING.c */ +#define _SC_MESSAGE_PASSING 47 +/* ./src/unistd/_SC_MQ_OPEN_MAX.c */ +#define _SC_MQ_OPEN_MAX 49 +/* ./src/unistd/_SC_MQ_PRIO_MAX.c */ +#define _SC_MQ_PRIO_MAX 50 +/* ./src/unistd/_SC_PRIORITIZED_IO.c */ +#define _SC_PRIORITIZED_IO /* TODO */ +/* ./src/unistd/_SC_PRIORITY_SCHEDULING.c */ +#define _SC_PRIORITY_SCHEDULING 56 +/* ./src/unistd/_SC_REALTIME_SIGNALS.c */ +#define _SC_REALTIME_SIGNALS 60 +/* ./src/unistd/_SC_RTSIG_MAX.c */ +#define _SC_RTSIG_MAX 62 +/* ./src/unistd/_SC_SEMAPHORES.c */ +#define _SC_SEMAPHORES 66 +/* ./src/unistd/_SC_SEM_NSEMS_MAX.c */ +#define _SC_SEM_NSEMS_MAX 64 +/* ./src/unistd/_SC_SEM_VALUE_MAX.c */ +#define _SC_SEM_VALUE_MAX 65 +/* ./src/unistd/_SC_SHARED_MEMORY_OBJECTS.c */ +#define _SC_SHARED_MEMORY_OBJECTS 67 +/* ./src/unistd/_SC_SIGQUEUE_MAX.c */ +#define _SC_SIGQUEUE_MAX 69 +/* ./src/unistd/_SC_SYNCHRONIZED_IO.c */ +#define _SC_SYNCHRONIZED_IO 76 +/* ./src/unistd/_SC_TIMERS.c */ +#define _SC_TIMERS 95 +/* ./src/unistd/_SC_TIMER_MAX.c */ +#define _SC_TIMER_MAX 94 +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/_SC_PAGESIZE.c */ +#define _SC_PAGESIZE /* TODO */ +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/unistd/_CS_PATH.c */ +#define _CS_PATH 0 +/* ./src/unistd/_POSIX2_CHAR_TERM.c */ +#define _POSIX2_CHAR_TERM (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_C_BIND.c */ +#define _POSIX2_C_BIND (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_C_DEV.c */ +#define _POSIX2_C_DEV (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_C_VERSION.c */ +#define _POSIX2_C_VERSION (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_FORT_DEV.c */ +#define _POSIX2_FORT_DEV (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_FORT_RUN.c */ +#define _POSIX2_FORT_RUN (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_SW_DEV.c */ +#define _POSIX2_SW_DEV (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_UPE.c */ +#define _POSIX2_UPE (_POSIX2_VERSION) +/* ./src/unistd/_POSIX2_VERSION.c */ +#if (defined _POSIX_C_SOURCE) +#if _POSIX_C_SOURCE >= 200809L +#define _POSIX2_VERSION (200809L) +#elif _POSIX_C_SOURCE >= 200112L +#define _POSIX2_VERSION (200112L) +#elif _POSIX_C_SOURCE >= 199506L +#define _POSIX2_VERSION (199506L) +#elif _POSIX_C_SOURCE >= 2 +#define _POSIX2_VERSION (199209L) +#else +#undef _POSIX2_VERSION +#endif +#endif +/* ./src/unistd/_SC_2_C_BIND.c */ +#define _SC_2_C_BIND 1 +/* ./src/unistd/_SC_2_C_DEV.c */ +#define _SC_2_C_DEV 1 +/* ./src/unistd/_SC_2_C_VERSION.c */ +#define _SC_2_C_VERSION 1 +/* ./src/unistd/_SC_2_FORT_DEV.c */ +#define _SC_2_FORT_DEV 3 +/* ./src/unistd/_SC_2_FORT_RUN.c */ +#define _SC_2_FORT_RUN 4 +/* ./src/unistd/_SC_2_LOCALEDEF.c */ +#define _SC_2_LOCALEDEF 5 +/* ./src/unistd/_SC_2_SW_DEV.c */ +#define _SC_2_SW_DEV 12 +/* ./src/unistd/_SC_2_UPE.c */ +#define _SC_2_UPE 13 +/* ./src/unistd/_SC_2_VERSION.c */ +#define _SC_2_VERSION 14 +/* ./src/unistd/_SC_BC_BASE_MAX.c */ +#define _SC_BC_BASE_MAX 23 +/* ./src/unistd/_SC_BC_DIM_MAX.c */ +#define _SC_BC_DIM_MAX 24 +/* ./src/unistd/_SC_BC_SCALE_MAX.c */ +#define _SC_BC_SCALE_MAX 25 +/* ./src/unistd/_SC_BC_STRING_MAX.c */ +#define _SC_BC_STRING_MAX 26 +/* ./src/unistd/_SC_COLL_WEIGHTS_MAX.c */ +#define _SC_COLL_WEIGHTS_MAX 30 +/* ./src/unistd/_SC_EXPR_NEST_MAX.c */ +#define _SC_EXPR_NEST_MAX 33 +/* ./src/unistd/_SC_LINE_MAX.c */ +#define _SC_LINE_MAX 41 +/* ./src/unistd/_SC_RE_DUP_MAX.c */ +#define _SC_RE_DUP_MAX 58 +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/unistd/_SC_XOPEN_CRYPT.c */ +#define _SC_XOPEN_CRYPT 116 +/* ./src/unistd/_SC_XOPEN_ENH_I18N.c */ +#define _SC_XOPEN_ENH_I18N 117 +/* ./src/unistd/_SC_XOPEN_SHM.c */ +#define _SC_XOPEN_SHM 120 +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/_SC_ATEXIT_MAX.c */ +#define _SC_ATEXIT_MAX 21 +/* ./src/unistd/_SC_IOV_MAX.c */ +#define _SC_IOV_MAX 38 +/* ./src/unistd/_SC_PAGE_SIZE.c */ +#define _SC_PAGE_SIZE 53 +/* ./src/unistd/_SC_XOPEN_UNIX.c */ +#define _SC_XOPEN_UNIX 122 +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && 500 <= _XOPEN_SOURCE) +/* ./src/unistd/_SC_XOPEN_VERSION.c */ +#define _SC_XOPEN_VERSION 124 +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/_POSIX2_LOCALEDEF.c */ +#define _POSIX2_LOCALEDEF (_POSIX2_VERSION) +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/unistd/_XOPEN_CRYPT.c */ +#define _XOPEN_CRYPT _XOPEN_SOURCE +/* ./src/unistd/_XOPEN_ENH_I18N.c */ +#define _XOPEN_ENH_I18N _XOPEN_SOURCE +/* ./src/unistd/_XOPEN_VERSION.c */ +#if (defined _XOPEN_SOURCE) +#if _XOPEN_SOURCE >= 700 +#define _XOPEN_VERSION (700) +#elif _XOPEN_SOURCE >= 600 +#define _XOPEN_VERSION (600) +#elif _XOPEN_SOURCE >= 500 +#define _XOPEN_VERSION (500) +#else +#define _XOPEN_VERSION (4) +#endif +#endif +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/unistd/_SC_PASS_MAX.c */ +#define _SC_PASS_MAX /* TODO */ +/* ./src/unistd/_XOPEN_XCU_VERSION.c */ +#define _XOPEN_XCU_VERSION /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/F_LOCK.c */ +#define F_LOCK 0 +/* ./src/unistd/F_TEST.c */ +#define F_TEST 1 +/* ./src/unistd/F_TLOCK.c */ +#define F_TLOCK 2 +/* ./src/unistd/F_ULOCK.c */ +#define F_ULOCK 3 +/* ./src/unistd/_XOPEN_SHM.c */ +#define _XOPEN_SHM _XOPEN_SOURCE +/* ./src/unistd/_XOPEN_UNIX.c */ +#define _XOPEN_UNIX /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && 500 <= _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/unistd/_SC_XOPEN_XCU_VERSION.c */ +#define _SC_XOPEN_XCU_VERSION /* TODO */ +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/sys/types/ssize_t.c */ +#ifndef __TYPE_ssize_t_DEFINED__ +#define __TYPE_ssize_t_DEFINED__ +typedef long int ssize_t; +#endif + + +#if (defined _XOPEN_SOURCE) +/* src/sys/types/gid_t.c */ +#ifndef __TYPE_gid_t_DEFINED__ +#define __TYPE_gid_t_DEFINED__ +typedef unsigned long int + gid_t; +#endif + +/* src/sys/types/off_t.c */ +#ifndef __TYPE_off_t_DEFINED__ +#define __TYPE_off_t_DEFINED__ +typedef long int + off_t; +#endif + +/* src/sys/types/pid_t.c */ +#ifndef __TYPE_pid_t_DEFINED__ +#define __TYPE_pid_t_DEFINED__ +typedef long int pid_t; +#endif + +/* src/sys/types/uid_t.c */ +#ifndef __TYPE_uid_t_DEFINED__ +#define __TYPE_uid_t_DEFINED__ +typedef unsigned long int + uid_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* src/sys/types/useconds_t.c */ +#ifndef __TYPE_useconds_t_DEFINED__ +#define __TYPE_useconds_t_DEFINED__ +typedef unsigned int useconds_t; +#endif + +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/unistd/optarg.c */ +extern char * optarg; +/* ./src/unistd/opterr.c */ +extern int opterr; +/* ./src/unistd/optind.c */ +extern int optind; +/* ./src/unistd/optopt.c */ +extern int optopt; +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/unistd/_exit.c */ +void _exit(int __status); +/* ./src/unistd/access.c */ +int access(const char *__path, int __amode); +/* ./src/unistd/alarm.c */ +unsigned alarm(unsigned __seconds); +/* ./src/unistd/chdir.c */ +int chdir(const char *__path); +/* ./src/unistd/chown.c */ +int chown(const char *__path, uid_t __owner, gid_t __group); +/* ./src/unistd/close.c */ +int close(int __fildes); +/* ./src/unistd/ctermid.c */ +char * ctermid(char * __s); +/* ./src/unistd/dup.c */ +int dup(int __fildes); +/* ./src/unistd/dup2.c */ +int dup2(int __fildes, int __fildes2); +/* ./src/unistd/execl.c */ +int execl(const char *__path, const char *__arg0, ... /*, (char *)0 */); +/* ./src/unistd/execle.c */ +int execle(const char *__path, const char *__arg0, ... /*, (char *)0, char *const envp[] */); +/* ./src/unistd/execlp.c */ +int execlp(const char *__file, const char *__arg0, ... /*, (char *0) */); +/* ./src/unistd/execv.c */ +int execv(const char *__path, char *const argv[]); +/* ./src/unistd/execve.c */ +int execve(const char *__path, char *const argv[], char *const envp[]); +/* ./src/unistd/execvp.c */ +int execvp(const char *__file, char *const argv[]); +/* ./src/unistd/fork.c */ +pid_t fork(void); +/* ./src/unistd/fpathconf.c */ +long fpathconf(int __fildes, int __name); +/* ./src/unistd/getcwd.c */ +char * getcwd(char *__buf, size_t __size); +/* ./src/unistd/getegid.c */ +gid_t getegid(void); +/* ./src/unistd/geteuid.c */ +uid_t geteuid(void); +/* ./src/unistd/getgid.c */ +gid_t getgid(void); +/* ./src/unistd/getgroups.c */ +int getgroups(int __gidsetsize, gid_t grouplist[]); +/* ./src/unistd/getlogin.c */ +char * getlogin(void); +/* ./src/unistd/getpgrp.c */ +pid_t getpgrp(void); +/* ./src/unistd/getpid.c */ +pid_t getpid(void); +/* ./src/unistd/getppid.c */ +pid_t getppid(void); +/* ./src/unistd/getuid.c */ +uid_t getuid(void); +/* ./src/unistd/isatty.c */ +int isatty(int __fildes); +/* ./src/unistd/link.c */ +int link(const char *__path1, const char *__path2); +/* ./src/unistd/lseek.c */ +off_t lseek(int __fildes, off_t __offset, int __whence); +/* ./src/unistd/pathconf.c */ +long pathconf(const char *__path, int __name); +/* ./src/unistd/pause.c */ +int pause(void); +/* ./src/unistd/pipe.c */ +int pipe(int fildes[2]); +/* ./src/unistd/read.c */ +ssize_t read(int __fildes, void *__buf, size_t __nbyte); +/* ./src/unistd/rmdir.c */ +int rmdir(const char *__path); +/* ./src/unistd/setgid.c */ +int setgid(gid_t __gid); +/* ./src/unistd/setpgid.c */ +int setpgid(pid_t __pid, pid_t __pgid); +/* ./src/unistd/setsid.c */ +pid_t setsid(void); +/* ./src/unistd/setuid.c */ +int setuid(uid_t __uid); +/* ./src/unistd/sleep.c */ +unsigned sleep(unsigned __seconds); +/* ./src/unistd/sysconf.c */ +long sysconf(int __name); +/* ./src/unistd/tcgetpgrp.c */ +pid_t tcgetpgrp(int __fildes); +/* ./src/unistd/tcsetpgrp.c */ +int tcsetpgrp(int __fildes, pid_t __pgid_id); +/* ./src/unistd/ttyname.c */ +char *ttyname(int __fildes); +/* ./src/unistd/unlink.c */ +int unlink(const char *__path); +/* ./src/unistd/write.c */ +ssize_t write(int __fildes, const void *__buf, size_t __nbyte); +#endif + +#if (defined _POSIX_SOURCE && (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 199506)) +/* ./src/unistd/cuserid.c */ +char *cuserid(char *__s); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) +/* ./src/unistd/fdatasync.c */ +int fdatasync(int __fildes); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* ./src/unistd/fsync.c */ +int fsync(int __fildes); +#endif + +#if (defined _POSIX_C_SOURCE && 199309 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/ftruncate.c */ +int ftruncate(int __fildes, off_t __length); +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/unistd/confstr.c */ +size_t confstr(int __name, char *__buf, size_t __len); +/* ./src/unistd/getopt.c */ +int getopt(int __argc, char * const argv[], const char *__optstring); +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/fchown.c */ +int fchown(int __fildes, uid_t __owner, gid_t __group); +/* ./src/unistd/readlink.c */ +ssize_t readlink(const char * restrict __path, char * restrict __buf, size_t __bufsize); +/* ./src/unistd/symlink.c */ +int symlink(const char*__path1, const char *__path2); +#endif + +#if (defined _POSIX_C_SOURCE && 200809 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/fchdir.c */ +int fchdir(int __fildes); +/* ./src/unistd/getpgid.c */ +pid_t getpgid(pid_t __pid); +/* ./src/unistd/getsid.c */ +pid_t getsid(pid_t __pid); +/* ./src/unistd/lchown.c */ +int lchown(const char *__path, uid_t __owner, gid_t __group); +/* ./src/unistd/truncate.c */ +int truncate(const char *__path, off_t __length); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/unistd/crypt.c */ +char * crypt( const char *__key, const char *__salt); +/* ./src/unistd/encrypt.c */ +void encrypt(char block[64], int __edflag); +/* ./src/unistd/nice.c */ +int nice(int __incr); +/* ./src/unistd/swab.c */ +void swab(const void * restrict __src, void * restrict __dest, ssize_t __nbytes); +#endif + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/unistd/getpass.c */ +char *getpass(const char *__prompt); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/unistd/gethostid.c */ +long gethostid(void); +/* ./src/unistd/lockf.c */ +int lockf(int __fildes, int __function, off_t __size); +/* ./src/unistd/setpgrp.c */ +pid_t setpgrp(void); +/* ./src/unistd/setregid.c */ +int setregid(gid_t __rgid, gid_t __egid); +/* ./src/unistd/setreuid.c */ +int setreuid(uid_t __ruid, uid_t __euid); +/* ./src/unistd/sync.c */ +void sync(void); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 600) +/* ./src/unistd/brk.c */ +int brk(void *__addr); +/* ./src/unistd/chroot.c */ +int chroot(const char *__path); +/* ./src/unistd/getdtablesize.c */ +int getdtablesize(void); +/* ./src/unistd/getpagesize.c */ +int getpagesize(void); +/* ./src/unistd/sbrk.c */ +void *sbrk(int __incr); +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE) && _XOPEN_SOURCE < 700) +/* ./src/unistd/getwd.c */ +char *getwd(char *__path_name); +/* ./src/unistd/ualarm.c */ +useconds_t ualarm(useconds_t __useconds, useconds_t __interval); +/* ./src/unistd/usleep.c */ +int usleep(useconds_t __useconds); +/* ./src/unistd/vfork.c */ +pid_t vfork(void); +#endif + + +#endif diff --git a/utime.h b/utime.h new file mode 100644 index 0000000..2e45eb8 --- /dev/null +++ b/utime.h @@ -0,0 +1,74 @@ +#ifndef __UTIME_H__ +#define __UTIME_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 200112 <= _POSIX_C_SOURCE) || \ + (defined _XOPEN_SOURCE) +/* src/time/time_t.c */ +#ifndef __TYPE_time_t_DEFINED__ +#define __TYPE_time_t_DEFINED__ +typedef long int time_t; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/utime/struct_utimbuf.c */ +#ifndef __TYPE_struct_utimbuf_DEFINED__ +#define __TYPE_struct_utimbuf_DEFINED__ +struct utimbuf { + time_t actime; + time_t modtime; +}; +#endif + +#endif + +#if (defined _POSIX_SOURCE) +/* ./src/utime/utime.c */ +int utime(const char *__path, const struct utimbuf *__times); +#endif + + +#endif diff --git a/utmpx.h b/utmpx.h new file mode 100644 index 0000000..91c8b76 --- /dev/null +++ b/utmpx.h @@ -0,0 +1,81 @@ +#ifndef __UTMPX_H__ +#define __UTMPX_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/utmpx/BOOT_TIME.c */ +#define BOOT_TIME /* TODO */ +/* ./src/utmpx/DEAD_PROCESS.c */ +#define DEAD_PROCESS /* TODO */ +/* ./src/utmpx/EMPTY.c */ +#define EMPTY /* TODO */ +/* ./src/utmpx/INIT_PROCESS.c */ +#define INIT_PROCESS /* TODO */ +/* ./src/utmpx/LOGIN_PROCESS.c */ +#define LOGIN_PROCESS /* TODO */ +/* ./src/utmpx/NEW_TIME.c */ +#define NEW_TIME /* TODO */ +/* ./src/utmpx/OLD_TIME.c */ +#define OLD_TIME /* TODO */ +/* ./src/utmpx/USER_PROCESS.c */ +#define USER_PROCESS /* TODO */ +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/utmpx/struct_utmpx.c */ +#ifndef __TYPE_struct_utmpx_DEFINED__ +#define __TYPE_struct_utmpx_DEFINED__ +struct utmpx { + char ut_user[]; + char ut_id[]; + char ut_line[]; + pid_t ut_pid; + short ut_type; + struct timeval ut_tv; +}; +#endif + +#endif + +#if (defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)) +/* ./src/utmpx/endutxent.c */ +void endutxent(void); +/* ./src/utmpx/getutxent.c */ +struct utmpx * getutxent(void); +/* ./src/utmpx/getutxid.c */ +struct utmpx * getutxid(const struct utmpx *__id); +/* ./src/utmpx/getutxline.c */ +struct utmpx * getutxline(const struct utmpx *__line); +/* ./src/utmpx/pututxline.c */ +struct utmpx * pututxline(const struct utmpx *__utmpx); +/* ./src/utmpx/setutxent.c */ +void setutxent(void); +#endif + + +#endif diff --git a/varargs.h b/varargs.h new file mode 100644 index 0000000..990e436 --- /dev/null +++ b/varargs.h @@ -0,0 +1,46 @@ +#ifndef __VARARGS_H__ +#define __VARARGS_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined _XOPEN_SOURCE && _XOPEN_SOURCE < 600) +/* ./src/varargs/va_alist.c */ +XOPEN(4,600); +/* ./src/varargs/va_arg.c */ +XOPEN(4,600); +/* ./src/varargs/va_dcl.c */ +XOPEN(4,600); +/* ./src/varargs/va_end.c */ +XOPEN(4,600); +/* ./src/varargs/va_list.c */ +XOPEN(4,600); +/* ./src/varargs/va_start.c */ +XOPEN(4,600); +#endif + + +#endif diff --git a/wchar.h b/wchar.h new file mode 100644 index 0000000..6c4d43d --- /dev/null +++ b/wchar.h @@ -0,0 +1,274 @@ +#ifndef __WCHAR_H__ +#define __WCHAR_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wchar/WCHAR_MAX.c */ +#define WCHAR_MAX (0x10FFFF) +/* ./src/wchar/WCHAR_MIN.c */ +#define WCHAR_MIN (0) +/* src/stddef/NULL.c */ +#define NULL ((void*)0) +/* src/wctype/WEOF.c */ +#define WEOF ((wint_t)(-1)) +#endif + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wchar/mbstate_t.c */ +#ifndef __TYPE_mbstate_t_DEFINED__ +#define __TYPE_mbstate_t_DEFINED__ +typedef int mbstate_t; +#endif + +/* ./src/wchar/struct_tm.c */ +#ifndef __TYPE_struct_tm_DEFINED__ +#define __TYPE_struct_tm_DEFINED__ +struct tm; +#endif + +/* src/stdarg/va_list.c */ +#ifndef __TYPE_va_list_DEFINED__ +#define __TYPE_va_list_DEFINED__ +typedef __builtin_va_list va_list; +#endif + +/* src/stddef/size_t.c */ +#ifndef __TYPE_size_t_DEFINED__ +#define __TYPE_size_t_DEFINED__ +#ifdef __LLP64__ +# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199909L +typedef unsigned __int64 size_t; +# else +typedef unsigned long long int size_t; +# endif +#else +typedef unsigned long int size_t; +#endif +#endif + +/* src/stddef/wchar_t.c */ +#ifndef __TYPE_wchar_t_DEFINED__ +#define __TYPE_wchar_t_DEFINED__ +typedef int wchar_t; +#endif + +/* src/stdio/FILE.c */ +#ifndef __TYPE_FILE_DEFINED__ +#define __TYPE_FILE_DEFINED__ +typedef struct __FILE FILE; +#endif + +/* src/wctype/wint_t.c */ +#ifndef __TYPE_wint_t_DEFINED__ +#define __TYPE_wint_t_DEFINED__ +typedef int wint_t; +#endif + +#endif + +#if (defined _XOPEN_SOURCE) +/* src/wctype/wctype_t.c */ +#ifndef __TYPE_wctype_t_DEFINED__ +#define __TYPE_wctype_t_DEFINED__ +typedef int wctype_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wchar/btowc.c */ +wint_t btowc(int __c); +/* ./src/wchar/fgetwc.c */ +wint_t fgetwc(FILE * __stream); +/* ./src/wchar/fgetws.c */ +wchar_t * fgetws(wchar_t * restrict __s, int __n, FILE * restrict __stream); +/* ./src/wchar/fputwc.c */ +wint_t fputwc(wchar_t __c, FILE * __stream); +/* ./src/wchar/fputws.c */ +int fputws(const wchar_t * restrict __s, FILE * restrict __stream); +/* ./src/wchar/fwide.c */ +int fwide(FILE * __stream, int __mode); +/* ./src/wchar/fwprintf.c */ +int fwprintf(FILE * restrict __stream, const wchar_t * restrict __format, ...); +/* ./src/wchar/fwscanf.c */ +int fwscanf(FILE * restrict __stream, const wchar_t * restrict __format, ...); +/* ./src/wchar/getwc.c */ +wint_t getwc(FILE * __stream); +/* ./src/wchar/getwchar.c */ +wint_t getwchar(void); +/* ./src/wchar/mbrlen.c */ +size_t mbrlen(const char * restrict __s, size_t __n, mbstate_t * restrict __ps); +/* ./src/wchar/mbrtowc.c */ +size_t mbrtowc(wchar_t * restrict __pwc, const char * restrict __s, size_t __n, mbstate_t * restrict __ps); +/* ./src/wchar/mbsinit.c */ +int mbsinit(const mbstate_t * __ps); +/* ./src/wchar/mbsrtowcs.c */ +size_t mbsrtowcs(wchar_t * restrict __dst, const char * restrict __src, size_t __len, mbstate_t * restrict __ps); +/* ./src/wchar/putwc.c */ +wint_t putwc(wchar_t __c, FILE * __stream); +/* ./src/wchar/putwchar.c */ +wint_t putwchar(wchar_t __c); +/* ./src/wchar/swprintf.c */ +int swprintf(wchar_t * restrict __s, size_t __n, const wchar_t * restrict __format, ...); +/* ./src/wchar/swscanf.c */ +int swscanf(const wchar_t * restrict __s, const wchar_t * restrict __format, ...); +/* ./src/wchar/ungetwc.c */ +wint_t ungetwc(wint_t __c, FILE * __stream); +/* ./src/wchar/vfwprintf.c */ +int vfwprintf(FILE * restrict __stream, const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/vswprintf.c */ +int vswprintf(wchar_t * restrict __s, size_t __n, const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/vwprintf.c */ +int vwprintf(const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/wcrtomb.c */ +size_t wcrtomb(char * restrict __s, wchar_t __wc, mbstate_t * restrict __ps); +/* ./src/wchar/wcscat.c */ +wchar_t * wcscat(wchar_t * restrict __s1, const wchar_t * restrict __s2); +/* ./src/wchar/wcschr.c */ +wchar_t * wcschr(const wchar_t * __s, wchar_t __c); +/* ./src/wchar/wcscmp.c */ +int wcscmp(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcscoll.c */ +int wcscoll(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcscpy.c */ +wchar_t * wcscpy(wchar_t * restrict __s1, const wchar_t * restrict __s2); +/* ./src/wchar/wcscspn.c */ +size_t wcscspn(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcsftime.c */ +size_t wcsftime(wchar_t * restrict __s, size_t __maxsize, const wchar_t * restrict __format, const struct tm * restrict __timeptr); +/* ./src/wchar/wcslen.c */ +size_t wcslen(const wchar_t * __s); +/* ./src/wchar/wcsncat.c */ +wchar_t * wcsncat(wchar_t * restrict __s1, const wchar_t * restrict __s2, size_t __n); +/* ./src/wchar/wcsncmp.c */ +int wcsncmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); +/* ./src/wchar/wcsncpy.c */ +wchar_t * wcsncpy(wchar_t * restrict __s1, const wchar_t * restrict __s2, size_t __n); +/* ./src/wchar/wcspbrk.c */ +wchar_t * wcspbrk(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcsrchr.c */ +wchar_t * wcsrchr(const wchar_t * __s, wchar_t __c); +/* ./src/wchar/wcsrtombs.c */ +size_t wcsrtombs(char * restrict __dst, const wchar_t ** restrict __src, size_t __len, mbstate_t * restrict __ps); +/* ./src/wchar/wcsspn.c */ +size_t wcsspn(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcsstr.c */ +wchar_t * wcsstr(const wchar_t * __s1, const wchar_t * __s2); +/* ./src/wchar/wcstod.c */ +double wcstod(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr); +/* ./src/wchar/wcstok.c */ +wchar_t * wcstok(wchar_t * restrict __s1, const wchar_t * restrict __s2, wchar_t ** restrict __ptr); +/* ./src/wchar/wcstol.c */ +long int wcstol(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +/* ./src/wchar/wcstoul.c */ +unsigned long int wcstoul(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +/* ./src/wchar/wcsxfrm.c */ +size_t wcsxfrm(wchar_t * restrict __s1, const wchar_t * restrict __s2, size_t __n); +/* ./src/wchar/wctob.c */ +int wctob(wint_t __c); +/* ./src/wchar/wmemchr.c */ +wchar_t * wmemchr(const wchar_t * __s, wchar_t __c, size_t __n); +/* ./src/wchar/wmemcmp.c */ +int wmemcmp(const wchar_t * __s1, const wchar_t * __s2, size_t __n); +/* ./src/wchar/wmemcpy.c */ +wchar_t * wmemcpy(wchar_t * restrict __s1, const wchar_t * restrict __s2, size_t __n); +/* ./src/wchar/wmemmove.c */ +wchar_t * wmemmove(wchar_t * __s1, const wchar_t * __s2, size_t __n); +/* ./src/wchar/wmemset.c */ +wchar_t * wmemset(wchar_t * __s, wchar_t __c, size_t __n); +/* ./src/wchar/wprintf.c */ +int wprintf(const wchar_t * restrict __format, ...); +/* ./src/wchar/wscanf.c */ +int wscanf(const wchar_t * restrict __format, ...); +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/wchar/vfwscanf.c */ +int vfwscanf(FILE * restrict __stream, const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/vswscanf.c */ +int vswscanf(const wchar_t * restrict __s, const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/vwscanf.c */ +int vwscanf(const wchar_t * restrict __format, va_list __arg); +/* ./src/wchar/wcstof.c */ +float wcstof(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr); +/* ./src/wchar/wcstold.c */ +long double wcstold(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr); +/* ./src/wchar/wcstoll.c */ +long long int wcstoll(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +/* ./src/wchar/wcstoull.c */ +unsigned long long int wcstoull(const wchar_t * restrict __nptr, wchar_t ** restrict __endptr, int __base); +#endif + +#if (defined _XOPEN_SOURCE) +/* ./src/wchar/wcswidth.c */ +int wcswidth(const wchar_t * __wcsptr, size_t __n); +/* ./src/wchar/wcwidth.c */ +int wcwidth(wchar_t __wc); +/* src/wctype/iswalnum.c */ +int iswalnum(wint_t __wc); +/* src/wctype/iswalpha.c */ +int iswalpha(wint_t __wc); +/* src/wctype/iswblank.c */ +int iswblank(wint_t __wc); +/* src/wctype/iswcntrl.c */ +int iswcntrl(wint_t __wc); +/* src/wctype/iswdigit.c */ +int iswdigit(wint_t __wc); +/* src/wctype/iswgraph.c */ +int iswgraph(wint_t __wc); +/* src/wctype/iswlower.c */ +int iswlower(wint_t __wc); +/* src/wctype/iswprint.c */ +int iswprint(wint_t __wc); +/* src/wctype/iswpunct.c */ +int iswpunct(wint_t __wc); +/* src/wctype/iswspace.c */ +int iswspace(wint_t __wc); +/* src/wctype/iswupper.c */ +int iswupper(wint_t __wc); +/* src/wctype/iswxdigit.c */ +int iswxdigit(wint_t __wc); +/* src/wctype/towctrans.c */ +wint_t towctrans(wint_t __wc, wctrans_t __desc); +/* src/wctype/towlower.c */ +wint_t towlower(wint_t __wc); +/* src/wctype/towupper.c */ +wint_t towupper(wint_t __wc); +/* src/wctype/wctype.c */ +wctype_t wctype(const char * __property); +#endif + +/* ./src/wchar/wcswcs.c */ +wchar_t * wcswcs(const wchar_t * __s1, const wchar_t * __s2); + + +#endif diff --git a/wctype.h b/wctype.h new file mode 100644 index 0000000..139d77a --- /dev/null +++ b/wctype.h @@ -0,0 +1,99 @@ +#ifndef __WCTYPE_H__ +#define __WCTYPE_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wctype/WEOF.c */ +#define WEOF ((wint_t)(-1)) +#endif + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wctype/wctrans_t.c */ +#ifndef __TYPE_wctrans_t_DEFINED__ +#define __TYPE_wctrans_t_DEFINED__ +typedef int wctrans_t; +#endif + +/* ./src/wctype/wctype_t.c */ +#ifndef __TYPE_wctype_t_DEFINED__ +#define __TYPE_wctype_t_DEFINED__ +typedef int wctype_t; +#endif + +/* ./src/wctype/wint_t.c */ +#ifndef __TYPE_wint_t_DEFINED__ +#define __TYPE_wint_t_DEFINED__ +typedef int wint_t; +#endif + +#endif + +#if (defined __STDC_VERSION__ && 199409 <= __STDC_VERSION__) +/* ./src/wctype/iswalnum.c */ +int iswalnum(wint_t __wc); +/* ./src/wctype/iswalpha.c */ +int iswalpha(wint_t __wc); +/* ./src/wctype/iswcntrl.c */ +int iswcntrl(wint_t __wc); +/* ./src/wctype/iswctype.c */ +int iswctype(wint_t __wc, wctype_t __desc); +/* ./src/wctype/iswdigit.c */ +int iswdigit(wint_t __wc); +/* ./src/wctype/iswgraph.c */ +int iswgraph(wint_t __wc); +/* ./src/wctype/iswlower.c */ +int iswlower(wint_t __wc); +/* ./src/wctype/iswprint.c */ +int iswprint(wint_t __wc); +/* ./src/wctype/iswpunct.c */ +int iswpunct(wint_t __wc); +/* ./src/wctype/iswspace.c */ +int iswspace(wint_t __wc); +/* ./src/wctype/iswupper.c */ +int iswupper(wint_t __wc); +/* ./src/wctype/iswxdigit.c */ +int iswxdigit(wint_t __wc); +/* ./src/wctype/towctrans.c */ +wint_t towctrans(wint_t __wc, wctrans_t __desc); +/* ./src/wctype/towlower.c */ +wint_t towlower(wint_t __wc); +/* ./src/wctype/towupper.c */ +wint_t towupper(wint_t __wc); +/* ./src/wctype/wctrans.c */ +wctrans_t wctrans(const char * __property); +/* ./src/wctype/wctype.c */ +wctype_t wctype(const char * __property); +#endif + +#if (defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__) +/* ./src/wctype/iswblank.c */ +int iswblank(wint_t __wc); +#endif + + +#endif diff --git a/wordexp.h b/wordexp.h new file mode 100644 index 0000000..ef6f48e --- /dev/null +++ b/wordexp.h @@ -0,0 +1,98 @@ +#ifndef __WORDEXP_H__ +#define __WORDEXP_H__ + +/* +UNG's Not GNU + +MIT License + +Copyright (c) 2011-2020 Jakob Kaivo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#if defined _XOPEN_SOURCE && !defined _POSIX_C_SOURCE +# if (_XOPEN_SOURCE >= 700) +# define _POSIX_C_SOURCE 200809L +# elif (_XOPEN_SOURCE >= 600) +# define _POSIX_C_SOURCE 200112L +# elif (_XOPEN_SOURCE >= 500) +# define _POSIX_C_SOURCE 199506L +# else +# define _POSIX_C_SOURCE 2 +# endif +#endif + +#if defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE +# define _POSIX_SOURCE +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/wordexp/WRDE_APPEND.c */ +#define WRDE_APPEND 1 +/* ./src/wordexp/WRDE_BADCHAR.c */ +#define WRDE_BADCHAR 1 +/* ./src/wordexp/WRDE_BADVAL.c */ +#define WRDE_BADVAL 2 +/* ./src/wordexp/WRDE_CMDSUB.c */ +#define WRDE_CMDSUB 3 +/* ./src/wordexp/WRDE_DOOFFS.c */ +#define WRDE_DOOFFS 2 +/* ./src/wordexp/WRDE_NOCMD.c */ +#define WRDE_NOCMD 3 +/* ./src/wordexp/WRDE_NOSPACE.c */ +#define WRDE_NOSPACE 4 +/* ./src/wordexp/WRDE_NOSYS.c */ +#define WRDE_NOSYS -1 +/* ./src/wordexp/WRDE_REUSE.c */ +#define WRDE_REUSE 4 +/* ./src/wordexp/WRDE_SHOWERR.c */ +#define WRDE_SHOWERR 5 +/* ./src/wordexp/WRDE_SYNTAX.c */ +#define WRDE_SYNTAX 5 +/* ./src/wordexp/WRDE_UNDEF.c */ +#define WRDE_UNDEF 6 +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/wordexp/wordexp_t.c */ +#ifndef __TYPE_wordexp_t_DEFINED__ +#define __TYPE_wordexp_t_DEFINED__ +typedef struct { + size_t we_wordc; + char ** we_wordv; + size_t we_offs; +} wordexp_t; +#endif + +#endif + +#if (!defined __STDC_VERSION__) || (__STDC_VERSION__ < 199901L) +#define restrict +#endif + +#if (defined _POSIX_C_SOURCE && 2 <= _POSIX_C_SOURCE) +/* ./src/wordexp/wordexp.c */ +int wordexp(const char *restrict __words, wordexp_t *restrict __pwordexp, int __flags); +/* ./src/wordexp/wordfree.c */ +void wordfree(wordexp_t *__pwordexp); +#endif + + +#endif -- cgit v1.2.1