Main Page | Alphabetical List | Class List | File List | Class Members | File Members

defs_os1.h

Go to the documentation of this file.
00001 /* =============
00002  * apeNEXT/nlibc
00003  * =============
00004  *
00005  * $Id: defs_os1.h,v 1.9 2006/03/22 17:19:51 pleiter Exp $
00006  * -------------------------------------------------------------------------- */
00007 
00008 #ifndef _NLIBC_OS1_DEFS_OS1_H
00009 #define _NLIBC_OS1_DEFS_OS1_H
00010 
00011 #include <nlibc.h>
00012 
00013 // include main definition file from  OS1/OS7
00014 #include <nsys.h>
00015 
00017 #define __NLCC_OS1_MAX_FILES__ 10
00018 
00020 #define __NLCC_BASE_FD         40
00021 
00022 #ifndef __NLCC_FILE_STRUCT
00023 #define __NLCC_FILE_STRUCT
00024 
00025 typedef struct {
00026    int fd;      // file descriptor
00027    int mode;    // open mode;
00028    int err;     // error indicator;
00029 } __nlcc_file_struct;
00030 #endif // __NLCC_FILE_STRUCT
00031 
00033 #define _SYS_IOMODE_CLOSED -1
00034 
00035 #ifdef __HAS_MAIN
00036 
00038 static __nlcc_file_struct __files[__NLCC_OS1_MAX_FILES__] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
00039 static int  __n_files = 0;
00040 
00042 __nlcc_file_struct __std_files[3] = {{0,_SYS_IOMODE_R},{1,_SYS_IOMODE_W},{2,_SYS_IOMODE_W}};
00043 
00044 #else
00045 
00046 // external definition
00047 extern __nlcc_file_struct __files[__NLCC_OS1_MAX_FILES__];
00048 extern int  __n_files;
00049 extern __nlcc_file_struct __std_files[3];
00050 
00051 #endif // __HAS_MAIN
00052 
00053 #define stdin  (&(__std_files[0]))
00054 #define stdout (&(__std_files[1]))
00055 #define stderr (&(__std_files[2]))
00056 
00057 #endif /* _NLIBC_OS1_DEFS_OS1 */

Generated on Fri Jul 14 10:51:31 2006 for nlibc by doxygen 1.3.5