diff options
Diffstat (limited to 'include/nonunix')
-rw-r--r-- | include/nonunix/asm/types.h | 1 | ||||
-rw-r--r-- | include/nonunix/config.h | 21 | ||||
-rw-r--r-- | include/nonunix/dirent.h | 0 | ||||
-rw-r--r-- | include/nonunix/getopt.h | 135 | ||||
-rw-r--r-- | include/nonunix/grp.h | 17 | ||||
-rw-r--r-- | include/nonunix/linux/types.h | 33 | ||||
-rw-r--r-- | include/nonunix/pwd.h | 22 | ||||
-rw-r--r-- | include/nonunix/sys/file.h | 0 | ||||
-rw-r--r-- | include/nonunix/sys/ioctl.h | 0 | ||||
-rw-r--r-- | include/nonunix/sys/param.h | 0 | ||||
-rw-r--r-- | include/nonunix/sys/resource.h | 0 | ||||
-rw-r--r-- | include/nonunix/sys/socket.h | 0 | ||||
-rw-r--r-- | include/nonunix/sys/time.h | 1 | ||||
-rw-r--r-- | include/nonunix/sys/wait.h | 0 | ||||
-rw-r--r-- | include/nonunix/termios.h | 0 | ||||
-rw-r--r-- | include/nonunix/unistd.h | 49 | ||||
-rw-r--r-- | include/nonunix/utime.h | 1 |
17 files changed, 280 insertions, 0 deletions
diff --git a/include/nonunix/asm/types.h b/include/nonunix/asm/types.h new file mode 100644 index 0000000..ad1c889 --- /dev/null +++ b/include/nonunix/asm/types.h @@ -0,0 +1 @@ +#include "../linux/types.h" diff --git a/include/nonunix/config.h b/include/nonunix/config.h new file mode 100644 index 0000000..e269d20 --- /dev/null +++ b/include/nonunix/config.h @@ -0,0 +1,21 @@ + +#define _INO_T_DEFINED 1 + +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_GETOPT_H 1 +#define HAVE_ERRNO_H 1 +#define HAVE_SETJMP_H 1 + +#define HAVE_STRCASECMP 1 +#define strcasecmp _stricmp +#define strncasecmp _strnicmp + +#define HAVE_CONIO_H 1 + +#define HAVE_EXT2_INODE_VERSION 1 + +#define inline __forceinline + +#define _CTYPE_DISABLE_MACROS + diff --git a/include/nonunix/dirent.h b/include/nonunix/dirent.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/dirent.h diff --git a/include/nonunix/getopt.h b/include/nonunix/getopt.h new file mode 100644 index 0000000..88b62fd --- /dev/null +++ b/include/nonunix/getopt.h @@ -0,0 +1,135 @@ +/* Declarations for getopt. + Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 51 Franklin Street, + Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef GETOPT_VARIABLE +#define GETOPT_VARIABLE +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern GETOPT_VARIABLE char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns -1, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern GETOPT_VARIABLE int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern GETOPT_VARIABLE int opterr; + +/* Set to an option character which was unrecognized. */ + +extern GETOPT_VARIABLE int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if defined (__STDC__) && __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if defined (__STDC__) && __STDC__ +#ifdef __GNU_LIBRARY__ +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/include/nonunix/grp.h b/include/nonunix/grp.h new file mode 100644 index 0000000..ef019bd --- /dev/null +++ b/include/nonunix/grp.h @@ -0,0 +1,17 @@ + +#pragma once + +typedef unsigned short __gid_t; +__inline __gid_t getgid(void){return 0;} +__inline struct group * getgrnam(char* g){return 0;} + +struct group + { + char *gr_name; + char *gr_passwd; + __gid_t gr_gid; + char **gr_mem; + }; + +#define getgrgid(i) NULL + diff --git a/include/nonunix/linux/types.h b/include/nonunix/linux/types.h new file mode 100644 index 0000000..eb87011 --- /dev/null +++ b/include/nonunix/linux/types.h @@ -0,0 +1,33 @@ +#ifndef _LINUX_TYPES_H +#define _LINUX_TYPES_H + +//#ifndef _MSC_VER +//#error _MSC_VER not defined +//#endif + +#include <sys/types.h> + +typedef unsigned __int8 __u8; +typedef signed __int8 __s8; + +typedef signed __int64 __s64; +typedef unsigned __int64 __u64; + +typedef signed __int16 __s16; +typedef unsigned __int16 __u16; + +typedef signed __int32 __s32; +typedef unsigned __int32 __u32; + +typedef signed __int64 __s64; +typedef unsigned __int64 __u64; + + +//typedef __u32 ino_t; +typedef __u32 dev_t; +typedef __u32 uid_t; +typedef __u32 gid_t; + +#include <stdint.h> + +#endif /* LINUX_TYPES_H */ diff --git a/include/nonunix/pwd.h b/include/nonunix/pwd.h new file mode 100644 index 0000000..a724ea2 --- /dev/null +++ b/include/nonunix/pwd.h @@ -0,0 +1,22 @@ + +#pragma once + +typedef unsigned short __uid_t; +__inline __uid_t getuid(void){return 0;} +__inline int geteuid(void){return 1;} +__inline struct passwd* getpwnam (char* g){return 0;} + + +struct passwd +{ + char *pw_name; + char *pw_passwd; + __uid_t pw_uid; + __gid_t pw_gid; + char *pw_gecos; + char *pw_dir; + char *pw_shell; +}; + +#define getpwuid(i) NULL + diff --git a/include/nonunix/sys/file.h b/include/nonunix/sys/file.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/file.h diff --git a/include/nonunix/sys/ioctl.h b/include/nonunix/sys/ioctl.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/ioctl.h diff --git a/include/nonunix/sys/param.h b/include/nonunix/sys/param.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/param.h diff --git a/include/nonunix/sys/resource.h b/include/nonunix/sys/resource.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/resource.h diff --git a/include/nonunix/sys/socket.h b/include/nonunix/sys/socket.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/socket.h diff --git a/include/nonunix/sys/time.h b/include/nonunix/sys/time.h new file mode 100644 index 0000000..91fd187 --- /dev/null +++ b/include/nonunix/sys/time.h @@ -0,0 +1 @@ +#include <time.h> diff --git a/include/nonunix/sys/wait.h b/include/nonunix/sys/wait.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/sys/wait.h diff --git a/include/nonunix/termios.h b/include/nonunix/termios.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/include/nonunix/termios.h diff --git a/include/nonunix/unistd.h b/include/nonunix/unistd.h new file mode 100644 index 0000000..5053587 --- /dev/null +++ b/include/nonunix/unistd.h @@ -0,0 +1,49 @@ + + +#pragma once + +#include <stdlib.h> +#include <process.h> +#include <io.h> + +#define EOPNOTSUPP 95 + +#define O_NONBLOCK 0 +#define O_RDONLY _O_RDONLY +#define O_RDWR _O_RDWR + +#define popen _popen +#define pclose _pclose +#define sleep _sleep +#define stat _stat +#define open _open +#define close _close +#define fstat _fstat +#define read _read +#define write _write +#define off_t _off_t +#define lseek _lseek +#define putenv _putenv +#define getpid _getpid +#define utimbuf _utimbuf +#define sys_nerr _sys_nerr +#define sys_errlist _sys_errlist +#define isatty _isatty +#define getch _getch + +#include <grp.h> +#include <pwd.h> + + +// no-oped sync +__inline void sync(void){}; + + + +#define gettimeofday(p, v) ((p)->tv_sec = (p)->tv_usec = 0) + + +#define strcasecmp _stricmp + + + diff --git a/include/nonunix/utime.h b/include/nonunix/utime.h new file mode 100644 index 0000000..8285f38 --- /dev/null +++ b/include/nonunix/utime.h @@ -0,0 +1 @@ +#include <sys/utime.h> |