Changeset 732 for trunk/src/emx/include
- Timestamp:
- Sep 26, 2003, 4:41:32 AM (22 years ago)
- Location:
- trunk/src/emx/include
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/386/_limits.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r731 r732 90 90 91 91 /* bird: our off_t is 32 bit signed at the moment. */ 92 #if 092 #if 1 93 93 #define __OFF_MAX __LLONG_MAX /* max value for an off_t */ 94 94 #define __OFF_MIN __LLONG_MIN /* min value for an off_t */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/386/ansi.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r731 r732 75 75 */ 76 76 #define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ 77 #if 077 #if 1 78 78 #define _BSD_OFF_T_ __int64_t /* file offset */ 79 79 #else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/dirent.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r731 r732 1 /* dirent.h (emx+gcc) */ 1 /*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)dirent.h 8.2 (Berkeley) 7/28/94 34 * $FreeBSD: src/include/dirent.h,v 1.13 2002/09/10 18:12:16 mike Exp $ 35 */ 2 36 3 #ifndef _DIRENT_H 4 #define _DIRENT_H 37 /** @file 38 * FreeBSD 5.1 39 * @changes bird: Merged in EMX stuff and internal LIBC stuff. 40 */ 5 41 6 #if !defined (_SYS_TYPES_H) 7 #warning <dirent.h> requires <sys/types.h> 8 #include <sys/types.h> 42 #ifndef _DIRENT_H_ 43 #define _DIRENT_H_ 44 45 /* 46 * The kernel defines the format of directory entries returned by 47 * the getdirentries(2) system call. 48 */ 49 #include <sys/cdefs.h> 50 #include <sys/dirent.h> 51 52 #if __BSD_VISIBLE || __XSI_VISIBLE 53 /* 54 * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer 55 * to the specification. 56 */ 57 #define d_ino d_fileno /* backward and XSI compatibility */ 9 58 #endif 10 59 11 #i nclude <sys/dirent.h>60 #if __BSD_VISIBLE 12 61 13 #if defined (__cplusplus) 14 extern "C" { 62 /* definitions for library routines operating on directories. */ 63 #define DIRBLKSIZ 1024 64 65 struct _telldir; /* see telldir.h */ 66 67 /* bird: EMX internal structure. */ 68 struct _dircontents 69 { 70 struct _dircontents * _d_next; 71 char * _d_entry; 72 __off_t _d_size; 73 unsigned short _d_time; 74 unsigned short _d_date; 75 unsigned short _d_attr; 76 unsigned char _d_type; 77 }; 78 79 /* structure describing an open directory. */ 80 typedef struct _dirdesc { 81 #if 0 82 int dd_fd; /* file descriptor associated with directory */ 83 long dd_loc; /* offset in current buffer */ 84 long dd_size; /* amount of data returned by getdirentries */ 85 char *dd_buf; /* data buffer */ 86 int dd_len; /* size of data buffer */ 87 long dd_seek; /* magic cookie returned by getdirentries */ 88 long dd_rewind; /* magic cookie for rewinding */ 89 int dd_flags; /* flags for readdir */ 90 void *dd_lock; /* hack to avoid including <pthread.h> */ 91 struct _telldir *dd_td; /* telldir position recording */ 92 #else 93 int dd_id; 94 long dd_loc; 95 struct _dircontents * dd_contents; 96 struct _dircontents * dd_cp; 97 struct dirent dd_dirent; 98 #endif 99 } DIR; 100 101 #define dirfd(dirp) ((dirp)->dd_fd) 102 103 /* flags for opendir2 */ 104 #define DTF_HIDEW 0x0001 /* hide whiteout entries */ 105 #define DTF_NODUP 0x0002 /* don't return duplicate names */ 106 #define DTF_REWIND 0x0004 /* rewind after reading union stack */ 107 #define __DTF_READALL 0x0008 /* everything has been read */ 108 109 #ifndef NULL 110 #define NULL 0 15 111 #endif 16 112 17 struct _dirdesc; 113 #else /* !__BSD_VISIBLE */ 18 114 19 typedef struct _dirdescDIR;115 typedef void * DIR; 20 116 21 DIR *opendir (__const__ char *); 22 struct dirent *readdir (DIR *); 23 int closedir (DIR *); 24 void rewinddir (DIR *); 117 #endif /* __BSD_VISIBLE */ 25 118 26 #if !defined (_POSIX_SOURCE) 27 void seekdir (DIR *, long); 28 long telldir (DIR *); 119 #ifndef _KERNEL 120 121 __BEGIN_DECLS 122 #if __BSD_VISIBLE 123 /** @todo DIR *__opendir2(const char *, int); */ 124 /** @todo int alphasort(const void *, const void *); */ 125 /** @todo int getdents(int, char *, int); */ 126 /** @todo int getdirentries(int, char *, int, long *); */ 29 127 #endif 128 DIR *opendir(const char *); 129 struct dirent * 130 readdir(DIR *); 131 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500 132 int readdir_r(DIR *, struct dirent *, struct dirent **); 133 #endif 134 void rewinddir(DIR *); 135 #if __BSD_VISIBLE 136 int scandir(const char *, struct dirent ***, 137 int (*)(struct dirent *), int (*)(const void *, const void *)); 138 #endif 139 #if __XSI_VISIBLE 140 void seekdir(DIR *, long); 141 long telldir(DIR *); 142 #endif 143 int closedir(DIR *); 30 144 145 146 /* bird: EMX extra - start */ 31 147 DIR *_opendir (__const__ char *); 32 148 struct dirent *_readdir (DIR *); … … 35 151 int _closedir (DIR *); 36 152 void _rewinddir (DIR *); 153 /* bird: EMX extra - end */ 37 154 38 #if defined (__cplusplus) 39 } 40 #endif 155 __END_DECLS 41 156 42 #endif /* not _DIRENT_H */ 157 #endif /* !_KERNEL */ 158 159 #endif /* !_DIRENT_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/io.h
-
Property cvs2svn:cvs-rev
changed from
1.3
to1.4
r731 r732 7 7 extern "C" { 8 8 #endif 9 10 #include <sys/types.h> 9 11 10 12 #if !defined (NULL) … … 14 16 #define NULL ((void *)0) 15 17 #endif 16 #endif17 18 #if !defined (_SIZE_T)19 #define _SIZE_T20 typedef unsigned long size_t;21 18 #endif 22 19 … … 217 214 void _closestream (struct _FILE *); 218 215 int _fflush_nolock (struct _FILE *); 219 int _fseek_nolock (struct _FILE *, long, int);220 long_ftell_nolock (struct _FILE *);216 int _fseek_nolock (struct _FILE *, off_t, int); 217 off_t _ftell_nolock (struct _FILE *); 221 218 size_t _fwrite_nolock (const void *, size_t, size_t, struct _FILE *); 222 219 int _input (struct _FILE *, __const__ char *, char *); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/emx/syscalls.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r731 r732 3 3 #ifndef _EMX_SYSCALLS_H 4 4 #define _EMX_SYSCALLS_H 5 6 #include <sys/types.h> 5 7 6 8 #if defined (__cplusplus) … … 37 39 typedef unsigned long sigset_t; 38 40 #endif 39 40 #if !defined (_SIZE_T)41 #define _SIZE_T42 typedef unsigned long size_t;43 #endif44 45 41 46 42 struct hostent; … … 54 50 struct timeval; 55 51 52 #pragma pack(1) 56 53 struct _find 57 54 { 58 char reserved[21]; 59 unsigned char attr; 60 unsigned short time; 61 unsigned short date; 62 unsigned short size_lo; /* split due to alignment problems */ 63 unsigned short size_hi; 64 char name[257]; /* Big buffer for OS/2 */ 65 }; 55 /** Size of file, in number of bytes. */ 56 off_t cbFile; 57 /** Last written (OS/2 & DOS time). */ 58 unsigned short time; 59 /** Last written (OS/2 & DOS date). */ 60 unsigned short date; 61 /** File attributes. */ 62 unsigned char attr; 63 /** File name */ 64 char szName[257]; 65 }; 66 #pragma pack() 66 67 67 68 struct _new_proc … … 128 129 int __chmod (__const__ char *name, int flag, int attr); 129 130 int __chdrive (char drive); 130 int __chsize (int handle, longlength);131 int __chsize (int handle, off_t length); 131 132 long long __clock (void); 132 133 int __close (int handle); … … 146 147 int __fsync (int handle); 147 148 void __ftime (struct timeb *ptr); 148 int __ftruncate (int handle, longlength);149 int __ftruncate (int handle, off_t length); 149 150 int __getcwd (char *buffer, char drive); 150 151 char __getdrive (void); … … 175 176 int __kill (int pid, int sig); 176 177 int __listen (int handle, int backlog); 177 int __lseek (int handle, longoffset, int origin);178 off_t __lseek (int handle, off_t offset, int origin); 178 179 int __memavail (void); 179 180 int __mkdir (__const__ char *name); 180 181 int __newthread (int tid); 181 int __open (__const__ char *name, int flags, unsigned longsize);182 int __open (__const__ char *name, int flags, off_t size); 182 183 int __pause (void); 183 184 int __pipe (int *two_handles, int pipe_size); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/io.h
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r731 r732 49 49 int access (__const__ char *, int); 50 50 int chmod (__const__ char *, int); 51 int chsize (int, long);51 int chsize (int, off_t); 52 52 int close (int); 53 53 int creat (const char *, mode_t); … … 55 55 int dup2 (int, int); 56 56 int eof (int); 57 longfilelength (int);57 off_t filelength (int); 58 58 int fstat (int, struct stat *); 59 59 int fsync (int); … … 77 77 int sopen (__const__ char *, int, int, ...); 78 78 int stat (__const__ char *, struct stat *); 79 longtell (int);79 off_t tell (int); 80 80 #ifndef _TRUNCATE_DECLARED 81 81 #define _TRUNCATE_DECLARED … … 91 91 int _access (__const__ char *, int); 92 92 int _chmod (__const__ char *, int); 93 int _chsize (int, long);93 int _chsize (int, off_t); 94 94 int _close (int); 95 95 int _creat (__const__ char *, int); … … 98 98 int _dup2 (int, int); 99 99 int _eof (int); 100 long_filelength (int);100 off_t _filelength (int); 101 101 int _fstat (int, struct stat *); 102 102 int _fsync (int); … … 123 123 int _sopen (__const__ char *, int, int, ...); 124 124 int _stat (__const__ char *, struct stat *); 125 long_tell (int);126 int _truncate (char *, long);125 off_t _tell (int); 126 int _truncate (char *, off_t); 127 127 int _umask (int); 128 128 int _unlink (__const__ char *); -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/os2emx.h
-
Property cvs2svn:cvs-rev
changed from
1.6
to1.7
r731 r732 1268 1268 #define FIL_QUERYEASIZEL 12 1269 1269 #define FIL_QUERYEASFROMLISTL 13 1270 #define FIL_QUERYFULLNAME 5 /* DosQueryPathInfo */1270 #define FIL_QUERYFULLNAME 5 1271 1271 1272 1272 #define FILE_BEGIN 0 … … 1589 1589 typedef FILEFINDBUF4 *PFILEFINDBUF4; 1590 1590 1591 typedef struct _FILEFINDBUF3L 1592 { 1593 ULONG oNextEntryOffset; 1594 FDATE fdateCreation; 1595 FTIME ftimeCreation; 1596 FDATE fdateLastAccess; 1597 FTIME ftimeLastAccess; 1598 FDATE fdateLastWrite; 1599 FTIME ftimeLastWrite; 1600 LONGLONG cbFile; 1601 LONGLONG cbFileAlloc; 1602 ULONG attrFile; 1603 UCHAR cchName; 1604 CHAR achName[CCHMAXPATHCOMP]; 1605 } FILEFINDBUF3L; 1606 typedef FILEFINDBUF3L *PFILEFINDBUF3L; 1607 1608 typedef struct _FILEFINDBUF4L 1609 { 1610 ULONG oNextEntryOffset; 1611 FDATE fdateCreation; 1612 FTIME ftimeCreation; 1613 FDATE fdateLastAccess; 1614 FTIME ftimeLastAccess; 1615 FDATE fdateLastWrite; 1616 FTIME ftimeLastWrite; 1617 LONGLONG cbFile; 1618 LONGLONG cbFileAlloc; 1619 ULONG attrFile; 1620 ULONG cbList; 1621 UCHAR cchName; 1622 CHAR achName[CCHMAXPATHCOMP]; 1623 } FILEFINDBUF4L; 1624 typedef FILEFINDBUF4L *PFILEFINDBUF4L; 1625 1591 1626 typedef struct _FILELOCK 1592 1627 { … … 1596 1631 typedef FILELOCK *PFILELOCK; 1597 1632 1598 typedef struct _FILELOCKL /* flock */1633 typedef struct _FILELOCKL 1599 1634 { 1600 1635 LONGLONG lOffset; -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdio.h
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r731 r732 1 /* stdio.h (emx+gcc) */ 2 3 #ifndef _STDIO_H 4 #define _STDIO_H 5 6 #if defined (__cplusplus) 7 extern "C" { 8 #endif 1 /*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 3. All advertising materials mentioning features or use of this software 17 * must display the following acknowledgement: 18 * This product includes software developed by the University of 19 * California, Berkeley and its contributors. 20 * 4. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)stdio.h 8.5 (Berkeley) 4/29/95 37 * $FreeBSD: src/include/stdio.h,v 1.51 2003/01/13 08:41:47 tjr Exp $ 38 */ 39 40 /** @file 41 * FreeBSD 5.1 42 * @changed bird: EMX isms + LIBC implementation specifics. 43 * @chagned bird: Made quite a few @todos on function which aren't implemented. 44 */ 45 46 #ifndef _STDIO_H_ 47 #define _STDIO_H_ 9 48 10 49 #include <sys/cdefs.h> 11 50 #include <sys/_types.h> 12 51 13 #if !defined(_VA_LIST_DECLARED) && !defined(_VA_LIST) /* bird: emx */ 52 typedef __off_t fpos_t; 53 54 #ifndef _SIZE_T_DECLARED 55 typedef __size_t size_t; 56 #define _SIZE_T_DECLARED 57 #define _SIZE_T /* bird: emx */ 58 #endif 59 60 #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 61 #ifndef _VA_LIST_DECLARED 62 typedef __va_list va_list; 14 63 #define _VA_LIST_DECLARED 15 64 #define _VA_LIST /* bird: emx */ 16 typedef __va_list va_list; 17 #endif 18 19 #if !defined (_SIZE_T) 20 #define _SIZE_T 21 typedef unsigned long size_t; 22 #endif 23 24 #if !defined (NULL) 25 #if defined (__cplusplus) 26 #define NULL 0 27 #else 28 #define NULL ((void *)0) 29 #endif 30 #endif 31 32 #if !defined (BUFSIZ) 33 #define BUFSIZ 5120 34 #endif 35 36 #if !defined (_FILE_T) 65 #endif 66 #endif 67 68 #ifndef NULL 69 #define NULL 0 70 #endif 71 72 #define _FSTDIO /* Define for new stdio with functions. */ 73 74 #if 0 /* bird: emx */ 75 76 /* 77 * NB: to fit things in six character monocase externals, the stdio 78 * code uses the prefix `__s' for stdio objects, typically followed 79 * by a three-character attempt at a mnemonic. 80 */ 81 82 /* stdio buffers */ 83 struct __sbuf { 84 unsigned char *_base; 85 int _size; 86 }; 87 88 /* hold a buncha junk that would grow the ABI */ 89 struct __sFILEX; 90 91 /* 92 * stdio state variables. 93 * 94 * The following always hold: 95 * 96 * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), 97 * _lbfsize is -_bf._size, else _lbfsize is 0 98 * if _flags&__SRD, _w is 0 99 * if _flags&__SWR, _r is 0 100 * 101 * This ensures that the getc and putc macros (or inline functions) never 102 * try to write or read from a file that is in `read' or `write' mode. 103 * (Moreover, they can, and do, automatically switch from read mode to 104 * write mode, and back, on "r+" and "w+" files.) 105 * 106 * _lbfsize is used only to make the inline line-buffered output stream 107 * code as compact as possible. 108 * 109 * _ub, _up, and _ur are used when ungetc() pushes back more characters 110 * than fit in the current _bf, or when ungetc() pushes back a character 111 * that does not match the previous one in _bf. When this happens, 112 * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff 113 * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. 114 * 115 * NB: see WARNING above before changing the layout of this structure! 116 */ 117 typedef struct __sFILE { 118 unsigned char *_p; /* current position in (some) buffer */ 119 int _r; /* read space left for getc() */ 120 int _w; /* write space left for putc() */ 121 short _flags; /* flags, below; this FILE is free if 0 */ 122 short _file; /* fileno, if Unix descriptor, else -1 */ 123 struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ 124 int _lbfsize; /* 0 or -_bf._size, for inline putc */ 125 126 /* operations */ 127 void *_cookie; /* cookie passed to io functions */ 128 int (*_close)(void *); 129 int (*_read)(void *, char *, int); 130 fpos_t (*_seek)(void *, fpos_t, int); 131 int (*_write)(void *, const char *, int); 132 133 /* separate buffer for long sequences of ungetc() */ 134 struct __sbuf _ub; /* ungetc buffer */ 135 struct __sFILEX *_extra; /* additions to FILE to not break ABI */ 136 int _ur; /* saved _r when _r is counting ungetc data */ 137 138 /* tricks to meet minimum requirements even when malloc() fails */ 139 unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ 140 unsigned char _nbuf[1]; /* guarantee a getc() buffer */ 141 142 /* separate buffer for fgetln() when line crosses buffer boundary */ 143 struct __sbuf _lb; /* buffer for fgetln() */ 144 145 /* Unix stdio files get aligned to block boundaries on fseek() */ 146 int _blksize; /* stat.st_blksize (may be != _bf._size) */ 147 fpos_t _offset; /* current lseek offset (see WARNING) */ 148 } FILE; 149 150 __BEGIN_DECLS 151 extern FILE *__stdinp; 152 extern FILE *__stdoutp; 153 extern FILE *__stderrp; 154 __END_DECLS 155 156 #define __SLBF 0x0001 /* line buffered */ 157 #define __SNBF 0x0002 /* unbuffered */ 158 #define __SRD 0x0004 /* OK to read */ 159 #define __SWR 0x0008 /* OK to write */ 160 /* RD and WR are never simultaneously asserted */ 161 #define __SRW 0x0010 /* open for reading & writing */ 162 #define __SEOF 0x0020 /* found EOF */ 163 #define __SERR 0x0040 /* found error */ 164 #define __SMBF 0x0080 /* _buf is from malloc */ 165 #define __SAPP 0x0100 /* fdopen()ed in append mode */ 166 #define __SSTR 0x0200 /* this is an sprintf/snprintf string */ 167 #define __SOPT 0x0400 /* do fseek() optimization */ 168 #define __SNPT 0x0800 /* do not do fseek() optimization */ 169 #define __SOFF 0x1000 /* set iff _offset is in fact correct */ 170 #define __SMOD 0x2000 /* true => fgetln modified _p text */ 171 #define __SALC 0x4000 /* allocate string space dynamically */ 172 #define __SIGN 0x8000 /* ignore this file in _fwalk */ 173 174 #else /* bird: EMX specific FILE stuff starts. */ 175 37 176 #define _FILE_T 38 177 #define _FILE_MEMBERS_HAVE_UNDERSCORE 39 178 struct _file2; 40 struct _FILE179 typedef struct _FILE 41 180 { 42 181 char * _ptr; … … 54 193 int (*_flush)(struct _FILE *, int); 55 194 struct _file2 *_more; 56 }; 57 58 typedef struct _FILE FILE; 59 195 } FILE; 196 197 __BEGIN_DECLS 60 198 extern FILE _streamv[]; 61 62 #define stdin (&_streamv[0]) 63 #define stdout (&_streamv[1]) 64 #define stderr (&_streamv[2]) 65 66 #endif 67 68 #if !defined (SEEK_SET) 69 #define SEEK_SET 0 70 #define SEEK_CUR 1 71 #define SEEK_END 2 72 #endif 73 74 #if !defined (EOF) 75 #define EOF (-1) 76 #endif 199 __END_DECLS 200 201 #define __stdinp (&_streamv[0]) 202 #define __stdoutp (&_streamv[1]) 203 #define __stderrp (&_streamv[2]) 204 205 #endif /* bird: EMX specific FILE stuff ends. */ 206 207 208 /* 209 * The following three definitions are for ANSI C, which took them 210 * from System V, which brilliantly took internal interface macros and 211 * made them official arguments to setvbuf(), without renaming them. 212 * Hence, these ugly _IOxxx names are *supposed* to appear in user code. 213 * 214 * Although numbered as their counterparts above, the implementation 215 * does not rely on this. 216 */ 217 #define _IOFBF 0 /* setvbuf should set fully buffered */ 218 #define _IOLBF 0x20 /* bird: emx, was 1 */ /* setvbuf should set line buffered */ 219 #define _IONBF 0x40 /* bird: emx, was 2 */ /* setvbuf should set unbuffered */ 220 221 #define BUFSIZ 5120 /* bird: emx, was 1024 */ /* size of buffer used by setbuf */ 222 #define EOF (-1) 223 224 /* 225 * FOPEN_MAX is a minimum maximum, and is the number of streams that 226 * stdio can provide without attempting to allocate further resources 227 * (which could fail). Do not use this for anything. 228 */ 229 /* must be == _POSIX_STREAM_MAX <limits.h> */ 230 #define FOPEN_MAX 14 /* bird: emx, was 20 */ /* must be <= OPEN_MAX <sys/syslimits.h> */ 231 #define FILENAME_MAX 260 /* bird: emx, was 1024 */ /* must be <= PATH_MAX <sys/syslimits.h> */ 232 233 /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ 234 #if __XSI_VISIBLE 235 #define P_tmpdir "." /* bird: emx, was "/var/tmp/" */ 236 #endif 237 #define L_tmpnam 260 /* bird: emx, was 1024 */ /* XXX must be == PATH_MAX */ 238 #define TMP_MAX 1000 /* bird: emx, was 308915776 */ 239 240 #ifndef SEEK_SET 241 #define SEEK_SET 0 /* set file offset to offset */ 242 #endif 243 #ifndef SEEK_CUR 244 #define SEEK_CUR 1 /* set file offset to current plus offset */ 245 #endif 246 #ifndef SEEK_END 247 #define SEEK_END 2 /* set file offset to EOF plus offset */ 248 #endif 249 250 #define stdin __stdinp 251 #define stdout __stdoutp 252 #define stderr __stderrp 253 254 __BEGIN_DECLS 255 /* 256 * Functions defined in ANSI C standard. 257 */ 258 void clearerr(FILE *); 259 int fclose(FILE *); 260 int feof(FILE *); 261 int ferror(FILE *); 262 int fflush(FILE *); 263 int fgetc(FILE *); 264 int fgetpos(FILE * __restrict, fpos_t * __restrict); 265 char *fgets(char * __restrict, int, FILE * __restrict); 266 FILE *fopen(const char * __restrict, const char * __restrict); 267 int fprintf(FILE * __restrict, const char * __restrict, ...); 268 int fputc(int, FILE *); 269 int fputs(const char * __restrict, FILE * __restrict); 270 size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); 271 FILE *freopen(const char * __restrict, const char * __restrict, FILE * __restrict); 272 int fscanf(FILE * __restrict, const char * __restrict, ...); 273 int fseek(FILE *, long, int); 274 int fsetpos(FILE *, const fpos_t *); 275 long ftell(FILE *); 276 size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict); 277 #if 0 /* bird: emx */ 278 int getc(FILE *); 279 #else /* bird: emx */ 280 /** @todo: Check the standard, if this is correct or not. declaration might be required. */ 281 #define getc(s) fgetc(s) /* bird: emx */ 282 #endif /* bird: emx */ 283 int getchar(void); 284 char *gets(char *); 285 void perror(const char *); 286 int printf(const char * __restrict, ...); 287 #if 0 /* bird: emx */ 288 int putc(int, FILE *); 289 #else /* bird: emx */ 290 /** @todo: Check the standard, if this is correct or not. declaration might be required. */ 291 #define putc(c,s) fputc(c,s) /* bird: emx */ 292 #endif /* bird: emx */ 293 int putchar(int); 294 int puts(const char *); 295 int remove(const char *); 296 int rename(const char *, const char *); 297 void rewind(FILE *); 298 int scanf(const char * __restrict, ...); 299 void setbuf(FILE * __restrict, char * __restrict); 300 int setvbuf(FILE * __restrict, char * __restrict, int, size_t); 301 int sprintf(char * __restrict, const char * __restrict, ...); 302 int sscanf(const char * __restrict, const char * __restrict, ...); 303 FILE *tmpfile(void); 304 char *tmpnam(char *); 305 int ungetc(int, FILE *); 306 int vfprintf(FILE * __restrict, const char * __restrict, 307 __va_list); 308 int vprintf(const char * __restrict, __va_list); 309 int vsprintf(char * __restrict, const char * __restrict, 310 __va_list); 311 312 #if __ISO_C_VISIBLE >= 1999 313 int snprintf(char * __restrict, size_t, const char * __restrict, 314 ...) __printflike(3, 4); 315 int vfscanf(FILE * __restrict, const char * __restrict, __va_list) 316 __scanflike(2, 0); 317 int vscanf(const char * __restrict, __va_list) __scanflike(1, 0); 318 int vsnprintf(char * __restrict, size_t, const char * __restrict, 319 __va_list) __printflike(3, 0); 320 int vsscanf(const char * __restrict, const char * __restrict, __va_list) 321 __scanflike(2, 0); 322 #endif 323 324 /* 325 * Functions defined in all versions of POSIX 1003.1. 326 */ 327 #if __BSD_VISIBLE || __POSIX_VISIBLE <= 199506 328 /* size for cuserid(3); UT_NAMESIZE + 1, see <utmp.h> */ 329 #define L_cuserid 9 /* bird: emx, was 17 */ /* legacy */ 330 #endif 331 332 #if __POSIX_VISIBLE 333 #define L_ctermid 260 /* bird: emx, was 1024 */ /* size for ctermid(3); PATH_MAX */ 334 335 /** @todo char *ctermid(char *); */ 336 FILE *fdopen(int, const char *); 337 int fileno(FILE *); 338 #endif /* __POSIX_VISIBLE */ 339 340 #if __POSIX_VISIBLE >= 199209 341 int pclose(FILE *); 342 FILE *popen(const char *, const char *); 343 #endif 344 345 #if __POSIX_VISIBLE >= 199506 346 /** @todo int ftrylockfile(FILE *); */ 347 /** @todo void flockfile(FILE *); */ 348 /** @todo void funlockfile(FILE *); */ 349 350 /* 351 * These are normally used through macros as defined below, but POSIX 352 * requires functions as well. 353 */ 354 /** @todo int getc_unlocked(FILE *); */ 355 /** @todo int getchar_unlocked(void); */ 356 /** @todo int putc_unlocked(int, FILE *); */ 357 /** @todo int putchar_unlocked(int); */ 358 #endif 359 #if __BSD_VISIBLE 360 /** @todo void clearerr_unlocked(FILE *); */ 361 /** @todo int feof_unlocked(FILE *); */ 362 /** @todo int ferror_unlocked(FILE *); */ 363 /** @todo int fileno_unlocked(FILE *); */ 364 #endif 365 366 #if __POSIX_VISIBLE >= 200112 367 int fseeko(FILE *, __off_t, int); 368 __off_t ftello(FILE *); 369 #endif 370 371 #if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 372 int getw(FILE *); 373 int putw(int, FILE *); 374 #endif /* BSD or X/Open before issue 6 */ 375 376 #if __XSI_VISIBLE 377 char *tempnam(const char *, const char *); 378 #endif 379 380 /* 381 * Routines that are purely local. 382 */ 383 #if __BSD_VISIBLE 384 /** @todo int asprintf(char **, const char *, ...) __printflike(2, 3); */ 385 /** @todo char *ctermid_r(char *); */ 386 /** @todo char *fgetln(FILE *, size_t *); */ 387 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3 388 #define __ATTR_FORMAT_ARG __attribute__((__format_arg__(2))) 389 #else 390 #define __ATTR_FORMAT_ARG 391 #endif 392 /** @todo __const char *fmtcheck(const char *, const char *) __ATTR_FORMAT_ARG; */ 393 /** @todo int fpurge(FILE *); */ 394 void setbuffer(FILE *, char *, int); 395 /** @todo int setlinebuf(FILE *); */ 396 /** @todo int vasprintf(char **, const char *, __va_list) 397 __printflike(2, 0); */ 398 399 /* 400 * The system error table contains messages for the first sys_nerr 401 * positive errno values. Use strerror() or strerror_r() from <string.h> 402 * instead. 403 */ 404 extern __const int sys_nerr; 405 extern __const char *__const sys_errlist[]; 406 407 /* 408 * Stdio function-access interface. 409 */ 410 /** @todo FILE *funopen(const void *, 411 int (*)(void *, char *, int), 412 int (*)(void *, const char *, int), 413 fpos_t (*)(void *, fpos_t, int), 414 int (*)(void *)); */ 415 /** @todo #define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0) */ 416 /** @todo #define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0) */ 417 418 /* 419 * Portability hacks. See <sys/types.h>. 420 */ 421 #ifndef _FTRUNCATE_DECLARED 422 #define _FTRUNCATE_DECLARED 423 int ftruncate(int, __off_t); 424 #endif 425 #ifndef _LSEEK_DECLARED 426 #define _LSEEK_DECLARED 427 __off_t lseek(int, __off_t, int); 428 #endif 429 #ifndef _MMAP_DECLARED 430 #define _MMAP_DECLARED 431 void *mmap(void *, size_t, int, int, int, __off_t); 432 #endif 433 #ifndef _TRUNCATE_DECLARED 434 #define _TRUNCATE_DECLARED 435 int truncate(const char *, __off_t); 436 #endif 437 #endif /* __BSD_VISIBLE */ 438 439 #if 0 /* bird: Skip FreeBSD sepcific LIBC stuff. */ 440 /* 441 * Functions internal to the implementation. 442 */ 443 int __srget(FILE *); 444 int __swbuf(int, FILE *); 445 446 /* 447 * The __sfoo macros are here so that we can 448 * define function versions in the C library. 449 */ 450 #define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) 451 #if defined(__GNUC__) && defined(__STDC__) 452 static __inline int __sputc(int _c, FILE *_p) { 453 if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) 454 return (*_p->_p++ = _c); 455 else 456 return (__swbuf(_c, _p)); 457 } 458 #else 459 /* 460 * This has been tuned to generate reasonable code on the vax using pcc. 461 */ 462 #define __sputc(c, p) \ 463 (--(p)->_w < 0 ? \ 464 (p)->_w >= (p)->_lbfsize ? \ 465 (*(p)->_p = (c)), *(p)->_p != '\n' ? \ 466 (int)*(p)->_p++ : \ 467 __swbuf('\n', p) : \ 468 __swbuf((int)(c), p) : \ 469 (*(p)->_p = (c), (int)*(p)->_p++)) 470 #endif 471 472 #define __sfeof(p) (((p)->_flags & __SEOF) != 0) 473 #define __sferror(p) (((p)->_flags & __SERR) != 0) 474 #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) 475 #define __sfileno(p) ((p)->_file) 476 477 #if __BSD_VISIBLE 478 /* 479 * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12 480 * B.8.2.7 for the rationale behind the *_unlocked() macros. 481 */ 482 #define feof_unlocked(p) __sfeof(p) 483 #define ferror_unlocked(p) __sferror(p) 484 #define clearerr_unlocked(p) __sclearerr(p) 485 #define fileno_unlocked(p) __sfileno(p) 486 #endif 487 #if __POSIX_VISIBLE >= 199506 488 #define getc_unlocked(fp) __sgetc(fp) 489 #define putc_unlocked(x, fp) __sputc(x, fp) 490 491 #define getchar_unlocked() getc_unlocked(stdin) 492 #define putchar_unlocked(x) putc_unlocked(x, stdout) 493 #endif 494 495 #endif /* bird: Skip FreeBSD sepcific LIBC stuff. */ 496 497 498 /* bird: start of EMX isms. */ 77 499 78 500 #if !defined (_IOREAD) 501 /** @todo change to double underscore prefix to prevent confusion with 502 * setvbuf() constants. See the short rant about it above. */ 79 503 #define _IOREAD 0x01 80 504 #define _IOWRT 0x02 … … 82 506 #define _IOEOF 0x08 83 507 #define _IOERR 0x10 84 #define _IOFBF 0x00 85 #define _IOLBF 0x20 86 #define _IONBF 0x40 87 #endif 88 89 #if !defined (FOPEN_MAX) 90 #define FOPEN_MAX 14 91 #endif 92 93 #if !defined (FILENAME_MAX) 94 #define FILENAME_MAX 260 95 #endif 96 97 #if !defined (TMP_MAX) 98 #define TMP_MAX 1000 99 #endif 100 101 #if !defined (P_tmpdir) 102 #define P_tmpdir "." 103 #define L_tmpnam (sizeof (P_tmpdir) + 13) 104 #endif 105 106 #if !defined (L_cuserid) 107 #define L_cuserid 9 108 #endif 109 110 #if !defined (_FPOS_T) 111 #define _FPOS_T 112 typedef struct 113 { 114 long _pos; 115 long _reserved1; 116 short _mbstate; 117 short _reserved2; 118 } fpos_t; 119 #endif 120 121 122 void clearerr (FILE *); 123 int fclose (FILE *); 124 int feof (FILE *); 125 int ferror (FILE *); 126 int fflush (FILE *); 127 int fgetc (FILE *); 128 int fgetpos (FILE *, fpos_t *); 129 char *fgets (char *, int, FILE *); 130 FILE *fopen (__const__ char *, __const__ char *); 131 int fprintf (FILE *, __const__ char *, ...); 132 int fputc (int, FILE *); 133 int fputs (__const__ char *, FILE *); 134 size_t fread (void *, size_t, size_t, FILE *); 135 FILE *freopen (__const__ char *, __const__ char *, FILE *); 136 int fscanf (FILE *, __const__ char *, ...); 137 int fseek (FILE *, long, int); 138 int fsetpos (FILE *, __const__ fpos_t *); 139 long ftell (FILE *); 140 size_t fwrite (__const__ void *, size_t, size_t, FILE *); 141 int getchar (void); 142 char *gets (char *); 143 void perror (__const__ char *); 144 int printf (__const__ char *, ...); 145 int putchar (int); 146 int puts (__const__ char *); 147 int remove (__const__ char *); 148 int rename (__const__ char *, __const__ char *); 149 void rewind (FILE *); 150 int scanf (__const__ char *, ...); 151 int setbuf (FILE *, char *); 152 int setvbuf (FILE *, char *, int, size_t); 153 int sprintf (char *, __const__ char *, ...); 154 int sscanf (__const__ char *, __const__ char *, ...); 155 FILE *tmpfile (void); 156 char *tmpnam (char *); 157 int ungetc (int, FILE *); 158 int vfprintf (FILE *, __const__ char *, va_list); 159 int vprintf (__const__ char *, va_list); 160 int vsprintf (char *, __const__ char *, va_list); 508 #endif 161 509 162 510 int _fill (FILE *); … … 174 522 } 175 523 176 #define getc(s) fgetc(s)177 #define putc(c,s) fputc(c,s)178 179 524 extern __inline__ int getchar (void) { return getc (stdin); } 180 525 extern __inline__ int putchar (int _c) { return putc (_c, stdout); } 181 526 182 183 #if !defined (__STRICT_ANSI__)184 185 /* POSIX.1 */186 187 /* ctermid() */188 FILE *fdopen (int, __const__ char *);189 int fileno (FILE *);190 191 extern __inline__ int fileno (FILE *_s) { return _s->_handle; }192 193 #endif194 195 196 527 #if !defined (__STRICT_ANSI__) && !defined (_POSIX_SOURCE) 197 528 198 529 char *cuserid (char *); 199 int getw (FILE *);200 530 int fcloseall (void); 201 531 int fgetchar (void); 202 532 int flushall (void); 203 533 int fputchar (int); 204 int pclose (FILE *);205 FILE *popen (__const__ char *, __const__ char *);206 int putw (int, FILE *);207 int setbuffer (FILE *, char *, size_t);208 int snprintf (char *, size_t, __const__ char *, ...);209 char *tempnam (__const__ char *, __const__ char *);210 int vfscanf (FILE *, __const__ char *, va_list);211 int vscanf (__const__ char *, va_list);212 int vsnprintf (char *, size_t, __const__ char *, va_list);213 int vsscanf (__const__ char *, __const__ char *, va_list);214 534 215 535 #endif … … 234 554 FILE *_popen (__const__ char *, __const__ char *); 235 555 int _putw (int, FILE *); 236 int _setbuffer (FILE *, char *, size_t);556 void _setbuffer (FILE *, char *, int); 237 557 int _snprintf (char *, size_t, __const__ char *, ...); 238 558 char *_tempnam (__const__ char *, __const__ char *); … … 240 560 241 561 #endif 242 243 244 #if defined (__cplusplus) 245 } 246 #endif 247 248 #endif /* not _STDIO_H */ 562 /* bird: end of EMX isms. */ 563 564 __END_DECLS 565 #endif /* !_STDIO_H_ */ 566 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/_types.h
-
Property cvs2svn:cvs-rev
changed from
1.4
to1.5
r731 r732 57 57 typedef int __nl_item; 58 58 typedef __uint16_t __nlink_t; /* link count */ 59 #if 1/* bird: emx */59 #if 0 /* bird: emx */ 60 60 typedef __int32_t __off_t; /* file offset */ 61 61 #else -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/dir.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r731 r732 1 /* sys/dir.h (emx+gcc) */ 1 /* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)dir.h 8.2 (Berkeley) 1/4/94 34 * $FreeBSD: src/sys/sys/dir.h,v 1.6 1999/08/28 00:51:39 peter Exp $ 35 */ 2 36 3 #ifndef _SYS_DIR_H 4 #define _SYS_DIR_H 37 /** @file 38 * FreeBSD 5.1 39 */ 5 40 6 #if !defined (_SYS_TYPES_H) 7 #warning <sys/dir.h> requires <sys/types.h> 8 #include <sys/types.h> 41 #ifndef _SYS_DIR_H_ 42 #define _SYS_DIR_H_ 43 44 #if __GNUC__ 45 #warning "The information in this file should be obtained from <dirent.h>" 46 #warning "and is provided solely (and temporarily) for backward compatibility." 9 47 #endif 10 48 11 #if defined (__cplusplus) 12 extern "C" { 13 #endif 49 #include <dirent.h> 14 50 15 #if !defined (MAXNAMLEN) 16 #define MAXNAMLEN 260 17 #endif 51 /* 52 * Backwards compatibility. 53 */ 54 #define direct dirent 55 #define DIRSIZ(dp) _GENERIC_DIRSIZ(dp) 18 56 19 #if !defined (MAXPATHLEN) 20 #define MAXPATHLEN 260 21 #endif 22 23 #if !defined (A_RONLY) 24 #define A_RONLY 0x01 25 #define A_HIDDEN 0x02 26 #define A_SYSTEM 0x04 27 #define A_LABEL 0x08 28 #define A_DIR 0x10 29 #define A_ARCHIVE 0x20 30 #endif 31 32 #define _DIRECT_D_MODE_RENAMED_D_ATTR 33 34 struct direct 35 { 36 ino_t d_ino; /* Almost not used */ 37 int d_reclen; /* Almost not used */ 38 int d_namlen; /* Length of d_name */ 39 char d_name[MAXNAMLEN + 1]; /* File name, 0 terminated */ 40 long d_size; /* File size (bytes) */ 41 unsigned short d_attr; /* OS file attributes */ 42 unsigned short d_time; /* OS file modification time */ 43 unsigned short d_date; /* OS file modification date */ 44 }; 45 46 struct _dircontents 47 { 48 char * _d_entry; 49 long _d_size; 50 unsigned short _d_attr; 51 unsigned short _d_time; 52 unsigned short _d_date; 53 struct _dircontents * _d_next; 54 }; 55 56 struct _dirdesc 57 { 58 int dd_id; 59 long dd_loc; 60 struct _dircontents * dd_contents; 61 struct _dircontents * dd_cp; 62 }; 63 64 typedef struct _dirdesc DIR; 65 66 DIR *opendir (__const__ char *name); 67 struct direct *readdir (DIR *dirp); 68 void seekdir (DIR *dirp, long off); 69 long telldir (DIR *dirp); 70 int closedir (DIR *dirp); 71 void rewinddir (DIR *dirp); 72 73 #if defined (__cplusplus) 74 } 75 #endif 76 77 #endif /* not SYS_DIR_H */ 57 #endif /* !_SYS_DIR_H_ */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/dirent.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r731 r732 1 /* sys/dirent.h (emx+gcc) */ 1 /*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)dirent.h 8.3 (Berkeley) 8/10/94 34 * $FreeBSD: src/sys/sys/dirent.h,v 1.13 2002/09/10 18:12:16 mike Exp $ 35 */ 2 36 3 #ifndef _SYS_DIRENT_H 4 #define _SYS_DIRENT_H 37 /** @file 38 * FreeBSD 5.1 39 * @changed bird: Merged in all the EMX stuff. 40 */ 5 41 6 #if !defined (_SYS_TYPES_H) 7 #warning <sys/dirent.h> requires <sys/types.h> 8 #include <sys/types.h> 42 #ifndef _SYS_DIRENT_H_ 43 #define _SYS_DIRENT_H_ 44 45 #include <sys/cdefs.h> 46 #include <sys/_types.h> 47 48 /* 49 * The dirent structure defines the format of directory entries returned by 50 * the getdirentries(2) system call. 51 * 52 * A directory entry has a struct dirent at the front of it, containing its 53 * inode number, the length of the entry, and the length of the name 54 * contained in the entry. These are followed by the name padded to a 4 55 * byte boundary with null bytes. All names are guaranteed null terminated. 56 * The maximum length of a name in a directory is MAXNAMLEN. 57 */ 58 59 struct dirent { 60 __uint32_t d_fileno; /* file number of entry */ 61 __uint16_t d_reclen; /* length of this record */ 62 __uint8_t d_type; /* file type, see below */ 63 __uint8_t d_namlen; /* length of string in d_name */ 64 #if __BSD_VISIBLE 65 #ifndef MAXNAMLEN /* bird: emx */ 66 #define MAXNAMLEN 260 /* bird: changed from 255. */ 67 #endif /* bird: emx */ 68 char d_name[MAXNAMLEN + 1]; /* name must be no longer than this */ 69 #else 70 char d_name[260 + 1]; /* bird: changed from 255. */ /* name must be no longer than this */ 71 #endif 72 /* bird: Extra EMX fields - start */ 73 __uint8_t d_attr; /* OS file attributes */ 74 __uint16_t d_time; /* OS file modification time */ 75 __uint16_t d_date; /* OS file modification date */ 76 __off_t d_size; /* File size (bytes) */ 77 /* bird: Extra EMX fields - end */ 78 }; 79 80 #if __BSD_VISIBLE 81 /* 82 * File types 83 */ 84 #define DT_UNKNOWN 0 85 #define DT_FIFO 1 86 #define DT_CHR 2 87 #define DT_DIR 4 88 #define DT_BLK 6 89 #define DT_REG 8 90 #define DT_LNK 10 91 #define DT_SOCK 12 92 #define DT_WHT 14 93 94 /* 95 * Convert between stat structure types and directory types. 96 */ 97 #define IFTODT(mode) (((mode) & 0170000) >> 12) 98 #define DTTOIF(dirtype) ((dirtype) << 12) 99 100 /* 101 * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold 102 * the directory entry. This requires the amount of space in struct direct 103 * without the d_name field, plus enough space for the name with a terminating 104 * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. 105 * 106 * XXX although this macro is in the implementation namespace, it requires 107 * a manifest constant that is not. 108 */ 109 #define _GENERIC_DIRSIZ(dp) \ 110 ((sizeof (struct dirent) - (MAXNAMLEN+1)) + (((dp)->d_namlen+1 + 3) &~ 3)) 111 #endif /* __BSD_VISIBLE */ 112 113 #ifdef _KERNEL 114 #define GENERIC_DIRSIZ(dp) _GENERIC_DIRSIZ(dp) 9 115 #endif 10 116 11 #if !defined (MAXNAMLEN) 12 #define MAXNAMLEN 260 13 # endif117 118 /* bird: EMX stuff */ 119 #define _DIRENT_D_MODE_RENAMED_D_ATTR 14 120 15 121 #if !defined (MAXPATHLEN) … … 26 132 #endif 27 133 28 #define _DIRENT_D_MODE_RENAMED_D_ATTR29 30 struct dirent31 {32 ino_t d_ino; /* Almost not used */33 int d_reclen; /* Almost not used */34 int d_namlen; /* Length of d_name */35 char d_name[MAXNAMLEN + 1]; /* File name, 0 terminated */36 long d_size; /* File size (bytes) */37 unsigned short d_attr; /* OS file attributes */38 unsigned short d_time; /* OS file modification time */39 unsigned short d_date; /* OS file modification date */40 };41 42 134 #endif /* not SYS_DIRENT_H */ -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/dirtree.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r731 r732 4 4 #define _SYS_DIRTREE_H 5 5 6 #if defined (__cplusplus) 7 extern "C" { 6 #include <sys/cdefs.h> 7 #include <sys/_types.h> 8 9 #if !defined(_TIME_T_DECLARED) && !defined(_TIME_T) 10 typedef __time_t time_t; 11 #define _TIME_T_DECLARED 12 #define _TIME_T 8 13 #endif 9 14 10 #if !defined (_TIME_T) 11 #define _TIME_T 12 typedef unsigned long time_t; 15 #if !defined(_OFF_T_DECLARED) && !defined(_OFF_T) 16 typedef __off_t off_t; /* file offset */ 17 #define _OFF_T_DECLARED 18 #define _OFF_T 13 19 #endif 14 20 … … 18 24 struct _dt_node *sub; /* Pointer to next level (child) */ 19 25 char *name; /* Name */ 20 long size;/* File size */26 off_t size; /* File size */ 21 27 long user; /* Available for user */ 22 28 time_t mtime; /* Timestamp for last update */ 23 29 unsigned char attr; /* Attributes */ 24 30 }; 25 26 31 27 32 struct _dt_tree … … 34 39 #define _DT_NOCPDIR 0x8000 35 40 36 void _dt_free (struct _dt_tree *dt); 41 __BEGIN_DECLS 42 void _dt_free (struct _dt_tree *dt); 37 43 struct _dt_tree *_dt_read (__const__ char *dir, __const__ char *mask, 38 44 unsigned flags); 39 void _dt_sort (struct _dt_tree *dt, __const__ char *spec); 40 int _dt_split (__const__ char *src, char *dir, char *mask); 45 void _dt_sort (struct _dt_tree *dt, __const__ char *spec); 46 int _dt_split (__const__ char *src, char *dir, char *mask); 47 __END_DECLS 41 48 42 #if defined (__cplusplus) 43 } 44 #endif 45 46 #endif /* not _SYS_DIRTREE_H */ 49 #endif /* !_SYS_DIRTREE_H */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.