home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / OSLib / Win32.h < prev   
Encoding:
C/C++ Source or Header  |  2006-10-19  |  2.5 KB  |  119 lines

  1.  
  2. /*
  3.  *    WIN32 types
  4.  */
  5.  
  6. #include <x86_prefix.h>
  7. #include <windef.h>
  8. #include <winerror.h>
  9. #include <time.h>
  10.  
  11. #define OS_MAXPATHLEN     (MAX_PATH-1)
  12. #define OS_MAXNAMELEN    63
  13. #define OS_MAXVOLLEN    63        /* why this long?  for network names */
  14.  
  15. #define OS_VOLSIZE        64
  16. #define OS_NAMESIZE        64
  17. #define OS_PATHSIZE        MAX_PATH
  18.  
  19. #define OS_PATHSEP        '\\'
  20. #define OS_PDSTR        "..\\"
  21. #define OS_CWDSTR        "."
  22.  
  23. #define OS_ENVSEP        ';'
  24. #define OS_ENVSEPLIST    ";,"
  25.  
  26. #define    OS_IS_CASE_INSENSITIVE 1
  27. #undef    OS_REL_PATH_HAS_SEP
  28.  
  29. /*    As used by CreateFile() */
  30. typedef    
  31. HANDLE                    OSRef;        /*    file ref */
  32.  
  33. /*    C string ending in '\\' */
  34. typedef
  35. struct                OSPathSpec
  36. {
  37.     char            s[OS_PATHSIZE];
  38. }                    OSPathSpec;            /*  OS specifier for a path */
  39.  
  40. typedef
  41. struct                OSNameSpec
  42. {
  43.     char            s[OS_NAMESIZE];
  44. }                    OSNameSpec;            /*  OS specifier for a name */
  45.  
  46. /*    As used by FindFirstFile()/FindNextFile() */
  47. typedef
  48. struct
  49. {
  50.     struct
  51.     {
  52.         HANDLE        handle;
  53.         void        *ffd;            /* really WIN32_FIND_DATA* */
  54.     }                dir;
  55.     OSPathSpec        path;            /* original path */
  56. }                    OSDirRef;        /*    directory scan ref */
  57.  
  58. /*    As used by GlobalAlloc(), etc.  */
  59. typedef
  60. struct    OSHandle
  61. {
  62.     void    *glob;
  63.     size_t    used;
  64. }        OSHandle;                        /*  memory handle */
  65.  
  66. /*    As used by GetLastError() */
  67. typedef 
  68. DWORD                    OSError;        /*    error type */
  69.  
  70. /*    No-error code */
  71. #define    OS_NOERR        NO_ERROR
  72.  
  73. /*    Does OSError report error? */
  74. #define OS_ISERR(x)        ((x)!=NO_ERROR)
  75.  
  76. /*    OSError representing 'file not found' */
  77. #define OS_FNFERR        ERROR_FILE_NOT_FOUND
  78.  
  79. /*    OSError representing 'directory not found' */
  80. #define OS_DNFERR        ERROR_PATH_NOT_FOUND
  81.  
  82. /*    OSError representing 'file is a directory' */
  83. #define OS_FIDERR        ERROR_ACCESS_DENIED
  84.  
  85. /*    OSError representing 'file is not a directory' */
  86. #define OS_FNIDERR        ERROR_DIRECTORY
  87.  
  88. /*    OSError representing 'filename too long' */
  89. #define OS_FNTLERR        ERROR_BUFFER_OVERFLOW
  90.  
  91. /*    OSError representing 'out of memory' */
  92. #define OS_MEMERR        ERROR_NOT_ENOUGH_MEMORY
  93.  
  94. /*    OSError representing 'permission denied' */
  95. #define OS_PERMERR        ERROR_INVALID_ACCESS
  96.  
  97. /*    OSError representing 'busy' (as for handles) */
  98. #define OS_BUSYERR        ERROR_SHARING_VIOLATION
  99.  
  100. /*    Meaningless. */
  101. typedef    
  102. int                    OSFileType;        /*    way to identify a file's type */
  103.  
  104. extern                OSFileType OS_TEXTTYPE;            /* text file */
  105.  
  106. /*    Time; a replica of FILETIME, in Win32, 
  107.     a 64-bit value counting nanoseconds since 1/1/1601 (obviously) */
  108. typedef
  109. struct
  110. {
  111.     DWORD            dwLowDateTime;
  112.     DWORD            dwHighDateTime;
  113. }                    OSTime;
  114.  
  115. /*    As used by LoadLibrary, etc */
  116. typedef
  117. HINSTANCE                OSLibrary;        /*  library handle */
  118.  
  119.