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.8 2005/10/27 20:04:57 morinl 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
00014 #include <nsys.h>
00015 #include <os1_const.h>
00016 
00018 #define __NLCC_OS1_MAX_FILES__ 10
00019 
00021 #define __NLCC_BASE_FD         40
00022 
00023 #ifndef __NLCC_FILE_STRUCT
00024 #define __NLCC_FILE_STRUCT
00025 
00026 typedef struct {
00027    int fd;      // file descriptor
00028    int mode;    // open mode;
00029    int err;     // error indicator;
00030 } __nlcc_file_struct;
00031 #endif // __NLCC_FILE_STRUCT
00032 
00034 #define _SYS_IOMODE_CLOSED -1
00035 
00036 #ifdef __HAS_MAIN
00037 
00039 static __nlcc_file_struct __files[__NLCC_OS1_MAX_FILES__] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
00040 static int  __n_files = 0;
00041 
00043 __nlcc_file_struct __std_files[3] = {{0,_SYS_IOMODE_R},{1,_SYS_IOMODE_W},{2,_SYS_IOMODE_W}};
00044 
00045 #else
00046 
00047 // external definition
00048 extern __nlcc_file_struct __std_files[3];
00049 extern int  __n_files;                          // LM Added, 01/09/05
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 Tue Jan 10 12:43:38 2006 for nlibc by doxygen 1.3.5