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
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;
00027 int mode;
00028 int err;
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
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