summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
commit5dced3d1b3deca80e01415a2e35dc7972dcbfae7 (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /include
parentInitial commit. (diff)
downloade2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.tar.xz
e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.zip
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include')
-rw-r--r--include/mingw/arpa/inet.h5
-rw-r--r--include/mingw/grp.h16
-rw-r--r--include/mingw/linux/types.h30
-rw-r--r--include/mingw/pwd.h20
-rw-r--r--include/mingw/sys/stat.h20
-rw-r--r--include/mingw/sys/sysmacros.h5
-rw-r--r--include/mingw/sys/types.h9
-rw-r--r--include/mingw/unistd.h54
-rw-r--r--include/nonunix/asm/types.h1
-rw-r--r--include/nonunix/config.h21
-rw-r--r--include/nonunix/dirent.h0
-rw-r--r--include/nonunix/getopt.h135
-rw-r--r--include/nonunix/grp.h17
-rw-r--r--include/nonunix/linux/types.h33
-rw-r--r--include/nonunix/pwd.h22
-rw-r--r--include/nonunix/sys/file.h0
-rw-r--r--include/nonunix/sys/ioctl.h0
-rw-r--r--include/nonunix/sys/param.h0
-rw-r--r--include/nonunix/sys/resource.h0
-rw-r--r--include/nonunix/sys/socket.h0
-rw-r--r--include/nonunix/sys/time.h1
-rw-r--r--include/nonunix/sys/wait.h0
-rw-r--r--include/nonunix/termios.h0
-rw-r--r--include/nonunix/unistd.h49
-rw-r--r--include/nonunix/utime.h1
25 files changed, 439 insertions, 0 deletions
diff --git a/include/mingw/arpa/inet.h b/include/mingw/arpa/inet.h
new file mode 100644
index 0000000..55dfa36
--- /dev/null
+++ b/include/mingw/arpa/inet.h
@@ -0,0 +1,5 @@
+#pragma once
+
+/* Windows is always little endian. */
+#define htonl __builtin_bswap32
+#define ntohl __builtin_bswap32
diff --git a/include/mingw/grp.h b/include/mingw/grp.h
new file mode 100644
index 0000000..67f62d9
--- /dev/null
+++ b/include/mingw/grp.h
@@ -0,0 +1,16 @@
+
+#pragma once
+
+#include <sys/types.h>
+
+__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/mingw/linux/types.h b/include/mingw/linux/types.h
new file mode 100644
index 0000000..9631456
--- /dev/null
+++ b/include/mingw/linux/types.h
@@ -0,0 +1,30 @@
+#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 __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/mingw/pwd.h b/include/mingw/pwd.h
new file mode 100644
index 0000000..d048842
--- /dev/null
+++ b/include/mingw/pwd.h
@@ -0,0 +1,20 @@
+
+#pragma once
+
+#include <sys/types.h>
+
+__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/mingw/sys/stat.h b/include/mingw/sys/stat.h
new file mode 100644
index 0000000..0ca1d1b
--- /dev/null
+++ b/include/mingw/sys/stat.h
@@ -0,0 +1,20 @@
+
+#pragma once
+
+#if HAVE_SYS_STAT_H
+#include_next <sys/stat.h>
+#endif
+
+#ifndef lstat
+#define lstat stat
+#endif
+
+#ifndef S_ISLNK
+#ifdef __S_IFLNK
+#define S_ISLNK(mode) __S_ISTYPE((mode), __S_IFLNK)
+#else
+#define S_ISLNK(mode) 0
+#endif
+#endif
+
+#define link(a, b) CreateHardLink((a), (b), NULL)
diff --git a/include/mingw/sys/sysmacros.h b/include/mingw/sys/sysmacros.h
new file mode 100644
index 0000000..a790cb2
--- /dev/null
+++ b/include/mingw/sys/sysmacros.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#ifndef makedev
+#define makedev(maj, min) (((maj) << 8) + (min))
+#endif
diff --git a/include/mingw/sys/types.h b/include/mingw/sys/types.h
new file mode 100644
index 0000000..9d048fc
--- /dev/null
+++ b/include/mingw/sys/types.h
@@ -0,0 +1,9 @@
+
+#pragma once
+
+#include_next <sys/types.h>
+
+#include <linux/types.h>
+
+typedef unsigned short __uid_t;
+typedef unsigned short __gid_t;
diff --git a/include/mingw/unistd.h b/include/mingw/unistd.h
new file mode 100644
index 0000000..b201858
--- /dev/null
+++ b/include/mingw/unistd.h
@@ -0,0 +1,54 @@
+#pragma once
+
+// Copyright transferred from Raider Solutions, Inc to
+// Kern Sibbald and John Walker by express permission.
+//
+// Copyright (C) 2004-2006 Kern Sibbald
+// Copyright (C) 2014 Adam Kropelin
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of
+// the License, or (at your option) any later version.
+//
+// This program 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
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public
+// License along with this program; if not, write to the Free
+// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+// MA 02111-1307, USA.
+
+#ifndef __COMPAT_UNISTD_H_
+#define __COMPAT_UNISTD_H_
+
+#include_next <unistd.h>
+
+#define _PC_PATH_MAX 1
+#define _PC_NAME_MAX 2
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+long pathconf(const char *, int);
+#define getpid _getpid
+#define getppid() 0
+
+unsigned int sleep(unsigned int seconds);
+
+#define getuid() 0
+#define getgid() 0
+#define geteuid() 1
+#define getegid() 0
+
+// no-oped sync
+__inline void sync(void){};
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* __COMPAT_UNISTD_H_ */ \ No newline at end of file
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>