00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _NLIBC_OS1_DEFS_OS1_H
00009 #define _NLIBC_OS1_DEFS_OS1_H
00010
00011 #include <nlibc.h>
00012
00013
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;
00028 int mode;
00029 int err;
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
00048 extern __nlcc_file_struct __std_files[3];
00049 extern int __n_files;
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