summary refs log tree commit diff stats
path: root/tinyc/win32/include/sys
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2010-08-28 22:33:07 +0200
committerAraq <rumpf_a@web.de>2010-08-28 22:33:07 +0200
commit47886978c79a3246295114a853a9cd945d368708 (patch)
treef006dc90bb9c8c166214ca751af3739b89a73621 /tinyc/win32/include/sys
parentb2075302b10b88047ea16007895bff4e46a2fa9c (diff)
downloadNim-47886978c79a3246295114a853a9cd945d368708.tar.gz
tiny C support; cosmetic improvements for the docs
Diffstat (limited to 'tinyc/win32/include/sys')
-rwxr-xr-xtinyc/win32/include/sys/fcntl.h8
-rwxr-xr-xtinyc/win32/include/sys/file.h9
-rwxr-xr-xtinyc/win32/include/sys/locking.h52
-rwxr-xr-xtinyc/win32/include/sys/stat.h190
-rwxr-xr-xtinyc/win32/include/sys/time.h3
-rwxr-xr-xtinyc/win32/include/sys/timeb.h82
-rwxr-xr-xtinyc/win32/include/sys/types.h118
-rwxr-xr-xtinyc/win32/include/sys/unistd.h9
-rwxr-xr-xtinyc/win32/include/sys/utime.h89
9 files changed, 560 insertions, 0 deletions
diff --git a/tinyc/win32/include/sys/fcntl.h b/tinyc/win32/include/sys/fcntl.h
new file mode 100755
index 000000000..b343f272f
--- /dev/null
+++ b/tinyc/win32/include/sys/fcntl.h
@@ -0,0 +1,8 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * This fcntl.h maps to the root fcntl.h
+ */
+#ifndef __STRICT_ANSI__
+#include <fcntl.h>
+#endif
diff --git a/tinyc/win32/include/sys/file.h b/tinyc/win32/include/sys/file.h
new file mode 100755
index 000000000..96c49e117
--- /dev/null
+++ b/tinyc/win32/include/sys/file.h
@@ -0,0 +1,9 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * This file.h maps to the root fcntl.h
+ * TODO?
+ */
+#ifndef __STRICT_ANSI__
+#include <fcntl.h>
+#endif
diff --git a/tinyc/win32/include/sys/locking.h b/tinyc/win32/include/sys/locking.h
new file mode 100755
index 000000000..2ecd11628
--- /dev/null
+++ b/tinyc/win32/include/sys/locking.h
@@ -0,0 +1,52 @@
+/*
+ * locking.h
+ *
+ * Constants for the mode parameter of the locking function.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.2 $
+ * $Author: bellard $
+ * $Date: 2005/04/17 13:14:29 $
+ *
+ */
+
+#ifndef	__STRICT_ANSI__
+
+#ifndef	_LOCKING_H_
+#define	_LOCKING_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#define	_LK_UNLCK	0	/* Unlock */
+#define	_LK_LOCK	1	/* Lock */
+#define	_LK_NBLCK	2	/* Non-blocking lock */
+#define	_LK_RLCK	3	/* Lock for read only */
+#define	_LK_NBRLCK	4	/* Non-blocking lock for read only */
+
+#ifndef	NO_OLDNAMES
+#define	LK_UNLCK	_LK_UNLCK
+#define	LK_LOCK		_LK_LOCK
+#define	LK_NBLCK	_LK_NBLCK
+#define	LK_RLCK		_LK_RLCK
+#define	LK_NBRLCK	_LK_NBRLCK
+#endif	/* Not NO_OLDNAMES */
+
+#endif	/* Not _LOCKING_H_ */
+
+#endif	/* Not __STRICT_ANSI__ */
+
diff --git a/tinyc/win32/include/sys/stat.h b/tinyc/win32/include/sys/stat.h
new file mode 100755
index 000000000..0e2054942
--- /dev/null
+++ b/tinyc/win32/include/sys/stat.h
@@ -0,0 +1,190 @@
+/*
+ * stat.h
+ *
+ * Symbolic constants for opening and creating files, also stat, fstat and
+ * chmod functions.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.2 $
+ * $Author: bellard $
+ * $Date: 2005/04/17 13:14:29 $
+ *
+ */
+
+#ifndef __STRICT_ANSI__
+
+#ifndef _STAT_H_
+#define _STAT_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#define __need_size_t
+#define __need_wchar_t
+#ifndef RC_INVOKED
+#include <stddef.h>
+#endif /* Not RC_INVOKED */
+
+#include <sys/types.h>
+
+/*
+ * Constants for the stat st_mode member.
+ */
+#define	_S_IFIFO	0x1000	/* FIFO */
+#define	_S_IFCHR	0x2000	/* Character */
+#define	_S_IFBLK	0x3000	/* Block: Is this ever set under w32? */
+#define	_S_IFDIR	0x4000	/* Directory */
+#define	_S_IFREG	0x8000	/* Regular */
+
+#define	_S_IFMT		0xF000	/* File type mask */
+
+#define	_S_IEXEC	0x0040
+#define	_S_IWRITE	0x0080
+#define	_S_IREAD	0x0100
+
+#define	_S_IRWXU	(_S_IREAD | _S_IWRITE | _S_IEXEC)
+#define	_S_IXUSR	_S_IEXEC
+#define	_S_IWUSR	_S_IWRITE
+#define	_S_IRUSR	_S_IREAD
+
+#define	_S_ISDIR(m)	(((m) & _S_IFMT) == _S_IFDIR)
+#define	_S_ISFIFO(m)	(((m) & _S_IFMT) == _S_IFIFO)
+#define	_S_ISCHR(m)	(((m) & _S_IFMT) == _S_IFCHR)
+#define	_S_ISBLK(m)	(((m) & _S_IFMT) == _S_IFBLK)
+#define	_S_ISREG(m)	(((m) & _S_IFMT) == _S_IFREG)
+
+#ifndef _NO_OLDNAMES
+
+#define	S_IFIFO		_S_IFIFO
+#define	S_IFCHR		_S_IFCHR
+#define	S_IFBLK		_S_IFBLK
+#define	S_IFDIR		_S_IFDIR
+#define	S_IFREG		_S_IFREG
+#define	S_IFMT		_S_IFMT
+#define	S_IEXEC		_S_IEXEC
+#define	S_IWRITE	_S_IWRITE
+#define	S_IREAD		_S_IREAD
+#define	S_IRWXU		_S_IRWXU
+#define	S_IXUSR		_S_IXUSR
+#define	S_IWUSR		_S_IWUSR
+#define	S_IRUSR		_S_IRUSR
+
+#define	S_ISDIR(m)	(((m) & S_IFMT) == S_IFDIR)
+#define	S_ISFIFO(m)	(((m) & S_IFMT) == S_IFIFO)
+#define	S_ISCHR(m)	(((m) & S_IFMT) == S_IFCHR)
+#define	S_ISBLK(m)	(((m) & S_IFMT) == S_IFBLK)
+#define	S_ISREG(m)	(((m) & S_IFMT) == S_IFREG)
+
+#endif	/* Not _NO_OLDNAMES */
+
+#ifndef RC_INVOKED
+
+#ifndef _STAT_DEFINED
+/*
+ * The structure manipulated and returned by stat and fstat.
+ *
+ * NOTE: If called on a directory the values in the time fields are not only
+ * invalid, they will cause localtime et. al. to return NULL. And calling
+ * asctime with a NULL pointer causes an Invalid Page Fault. So watch it!
+ */
+struct _stat
+{
+	_dev_t	st_dev;		/* Equivalent to drive number 0=A 1=B ... */
+	_ino_t	st_ino;		/* Always zero ? */
+	_mode_t	st_mode;	/* See above constants */
+	short	st_nlink;	/* Number of links. */
+	short	st_uid;		/* User: Maybe significant on NT ? */
+	short	st_gid;		/* Group: Ditto */
+	_dev_t	st_rdev;	/* Seems useless (not even filled in) */
+	_off_t	st_size;	/* File size in bytes */
+	time_t	st_atime;	/* Accessed date (always 00:00 hrs local
+				 * on FAT) */
+	time_t	st_mtime;	/* Modified time */
+	time_t	st_ctime;	/* Creation time */
+};
+
+struct stat
+{
+	_dev_t	st_dev;		/* Equivalent to drive number 0=A 1=B ... */
+	_ino_t	st_ino;		/* Always zero ? */
+	_mode_t	st_mode;	/* See above constants */
+	short	st_nlink;	/* Number of links. */
+	short	st_uid;		/* User: Maybe significant on NT ? */
+	short	st_gid;		/* Group: Ditto */
+	_dev_t	st_rdev;	/* Seems useless (not even filled in) */
+	_off_t	st_size;	/* File size in bytes */
+	time_t	st_atime;	/* Accessed date (always 00:00 hrs local
+				 * on FAT) */
+	time_t	st_mtime;	/* Modified time */
+	time_t	st_ctime;	/* Creation time */
+};
+#if defined (__MSVCRT__)
+struct _stati64 {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    __int64 st_size;
+    time_t st_atime;
+    time_t st_mtime;
+    time_t st_ctime;
+};
+#endif /* __MSVCRT__ */
+#define _STAT_DEFINED
+#endif /* _STAT_DEFINED */
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+int	_fstat (int, struct _stat*);
+int	_chmod (const char*, int);
+int	_stat (const char*, struct _stat*);
+
+#if defined (__MSVCRT__)
+int  _fstati64(int, struct _stati64 *);
+int  _stati64(const char *, struct _stati64 *);
+#if !defined ( _WSTAT_DEFINED) /* also declared in wchar.h */
+int	_wstat(const wchar_t*, struct _stat*);
+int	_wstati64 (const wchar_t*, struct _stati64*);
+#define _WSTAT_DEFINED
+#endif /* _WSTAT_DEFIND */
+#endif /* __MSVCRT__ */
+
+#ifndef	_NO_OLDNAMES
+
+/* These functions live in liboldnames.a. */
+int	fstat (int, struct stat*);
+int	chmod (const char*, int);
+int	stat (const char*, struct stat*);
+
+#endif	/* Not _NO_OLDNAMES */
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _STAT_H_ */
+
+#endif	/* Not __STRICT_ANSI__ */
+
diff --git a/tinyc/win32/include/sys/time.h b/tinyc/win32/include/sys/time.h
new file mode 100755
index 000000000..39d85f67b
--- /dev/null
+++ b/tinyc/win32/include/sys/time.h
@@ -0,0 +1,3 @@
+
+#include <time.h>
+
diff --git a/tinyc/win32/include/sys/timeb.h b/tinyc/win32/include/sys/timeb.h
new file mode 100755
index 000000000..b5bb0fc3d
--- /dev/null
+++ b/tinyc/win32/include/sys/timeb.h
@@ -0,0 +1,82 @@
+/*
+ * timeb.h
+ *
+ * Support for the UNIX System V ftime system call.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.2 $
+ * $Author: bellard $
+ * $Date: 2005/04/17 13:14:29 $
+ *
+ */
+
+#ifndef	__STRICT_ANSI__
+
+#ifndef	_TIMEB_H_
+#define	_TIMEB_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#ifndef	RC_INVOKED
+
+/*
+ * TODO: Structure not tested.
+ */
+struct _timeb
+{
+	long	time;
+	short	millitm;
+	short	timezone;
+	short	dstflag;
+};
+
+#ifndef	_NO_OLDNAMES
+/*
+ * TODO: Structure not tested.
+ */
+struct timeb
+{
+	long	time;
+	short	millitm;
+	short	timezone;
+	short	dstflag;
+};
+#endif
+
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+/* TODO: Not tested. */
+void	_ftime (struct _timeb*);
+
+#ifndef	_NO_OLDNAMES
+void	ftime (struct timeb*);
+#endif	/* Not _NO_OLDNAMES */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _TIMEB_H_ */
+
+#endif	/* Not __STRICT_ANSI__ */
+
diff --git a/tinyc/win32/include/sys/types.h b/tinyc/win32/include/sys/types.h
new file mode 100755
index 000000000..0679ac9b3
--- /dev/null
+++ b/tinyc/win32/include/sys/types.h
@@ -0,0 +1,118 @@
+/*
+ * types.h
+ *
+ * The definition of constants, data types and global variables.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *  Lots of types supplied by Pedro A. Aranda <paag@tid.es>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warrenties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.2 $
+ * $Author: bellard $
+ * $Date: 2005/04/17 13:14:29 $
+ *
+ */
+
+#ifndef	_TYPES_H_
+#define	_TYPES_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#define __need_wchar_t
+#define __need_size_t
+#define __need_ptrdiff_t
+#ifndef RC_INVOKED
+#include <stddef.h>
+#endif	/* Not RC_INVOKED */
+
+#ifndef RC_INVOKED
+
+#ifndef _TIME_T_DEFINED
+typedef	long	time_t;
+#define	_TIME_T_DEFINED
+#endif
+
+
+#ifndef	__STRICT_ANSI__
+
+#ifndef	_OFF_T_
+#define	_OFF_T_
+typedef long _off_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _off_t	off_t;
+#endif
+#endif	/* Not _OFF_T_ */
+
+
+#ifndef _DEV_T_
+#define	_DEV_T_
+#ifdef __MSVCRT__
+typedef unsigned int _dev_t;
+#else
+typedef short _dev_t;
+#endif
+
+#ifndef	_NO_OLDNAMES
+typedef _dev_t	dev_t;
+#endif
+#endif	/* Not _DEV_T_ */
+
+
+#ifndef _INO_T_
+#define	_INO_T_
+typedef short _ino_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _ino_t	ino_t;
+#endif
+#endif	/* Not _INO_T_ */
+
+
+#ifndef _PID_T_
+#define	_PID_T_
+typedef int	_pid_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _pid_t	pid_t;
+#endif
+#endif	/* Not _PID_T_ */
+
+
+#ifndef _MODE_T_
+#define	_MODE_T_
+typedef unsigned short _mode_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _mode_t	mode_t;
+#endif
+#endif	/* Not _MODE_T_ */
+
+
+#ifndef _SIGSET_T_
+#define	_SIGSET_T_
+typedef int	_sigset_t;
+
+#ifndef	_NO_OLDNAMES
+typedef _sigset_t	sigset_t;
+#endif
+#endif	/* Not _SIGSET_T_ */
+
+#endif	/* Not __STRICT_ANSI__ */
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _TYPES_H_ */
diff --git a/tinyc/win32/include/sys/unistd.h b/tinyc/win32/include/sys/unistd.h
new file mode 100755
index 000000000..ed122d9dd
--- /dev/null
+++ b/tinyc/win32/include/sys/unistd.h
@@ -0,0 +1,9 @@
+/*
+ * This file is part of the Mingw32 package.
+ *
+ * unistd.h maps (roughly) to io.h
+ */
+#ifndef __STRICT_ANSI__
+#include <io.h>
+#endif
+
diff --git a/tinyc/win32/include/sys/utime.h b/tinyc/win32/include/sys/utime.h
new file mode 100755
index 000000000..049524bed
--- /dev/null
+++ b/tinyc/win32/include/sys/utime.h
@@ -0,0 +1,89 @@
+/*
+ * utime.h
+ *
+ * Support for the utime function.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ *  Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision: 1.2 $
+ * $Author: bellard $
+ * $Date: 2005/04/17 13:14:29 $
+ *
+ */
+
+#ifndef	__STRICT_ANSI__
+
+#ifndef	_UTIME_H_
+#define	_UTIME_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+#define __need_wchar_t
+#define __need_size_t
+#ifndef RC_INVOKED
+#include <stddef.h>
+#endif	/* Not RC_INVOKED */
+#include <sys/types.h>
+
+#ifndef	RC_INVOKED
+
+/*
+ * Structure used by _utime function.
+ */
+struct _utimbuf
+{
+	time_t	actime;		/* Access time */
+	time_t	modtime;	/* Modification time */
+};
+
+
+#ifndef	_NO_OLDNAMES
+/* NOTE: Must be the same as _utimbuf above. */
+struct utimbuf
+{
+	time_t	actime;
+	time_t	modtime;
+};
+#endif	/* Not _NO_OLDNAMES */
+
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+int	_utime (const char*, struct _utimbuf*);
+int	_futime (int, struct _utimbuf*);
+
+/* The wide character version, only available for MSVCRT versions of the
+ * C runtime library. */
+#ifdef __MSVCRT__
+int	_wutime (const wchar_t*, struct _utimbuf*);
+#endif /* MSVCRT runtime */
+#ifndef	_NO_OLDNAMES
+int	utime (const char*, struct utimbuf*);
+#endif	/* Not _NO_OLDNAMES */
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* Not RC_INVOKED */
+
+#endif	/* Not _UTIME_H_ */
+
+#endif	/* Not __STRICT_ANSI__ */
+