1 /* $Id: os2fake.h 2243 2009-01-10 02:24:02Z bird $ 2 * 3 * Structures, defines and function prototypes for the OS/2 fake library. 4 * 5 * Copyright (c) 2001-2009 knut st. osmundsen (knut.stange.osmundsen@mynd.no) 6 * 7 * GPL 8 * 9 */ 10 11 12 #ifndef _os2fake_h_ 13 #define _os2fake_h_ 14 15 16 /******************************************************************************* 17 * Defined Constants And Macros * 18 *******************************************************************************/ 19 #ifndef OS2ENTRY 20 #define OS2ENTRY 21 #endif 22 23 #ifndef CCHMAXPATHCOMP 24 #define CCHMAXPATHCOMP 256 25 #endif 26 27 #ifndef CCHMAXPATH 28 #define CCHMAXPATH 260 29 #endif 30 31 #ifndef FIL_STANDARD 32 #define FIL_STANDARD 1 33 #define FIL_QUERYEASIZE 2 34 #define FIL_QUERYEASFROMLIST 3 35 #define FIL_QUERYFULLNAME 5 36 #endif 37 38 #define FILE_NORMAL 0x0000 39 #define FILE_READONLY 0x0001 40 #define FILE_HIDDEN 0x0002 41 #define FILE_SYSTEM 0x0004 42 #define FILE_DIRECTORY 0x0010 43 #define FILE_ARCHIVED 0x0020 44 45 #ifndef HDIR_CREATE 46 #define HDIR_CREATE (-1) 47 #endif 48 49 #ifndef TRUE 50 #define TRUE 1 51 #endif 52 #ifndef FALSE 53 #define FALSE 0 54 #endif 55 56 #ifndef NO_ERROR 57 #define NO_ERROR 0 58 #endif 59 60 61 62 /******************************************************************************* 63 * Structures and Typedefs * 64 *******************************************************************************/ 65 typedef char * PCH; 66 67 typedef char * PSZ; 68 typedef const char * PCSZ; 69 70 typedef unsigned long ULONG; 71 typedef ULONG * PULONG; 72 73 typedef unsigned short USHORT; 74 typedef USHORT * PUSHORT; 75 76 #if !defined(_WINDEF_) 77 typedef unsigned int UINT; 78 typedef UINT * PUINT; 79 80 typedef unsigned char UCHAR; 81 typedef UCHAR * PUCHAR; 82 83 #if !defined(CHAR) 84 typedef char CHAR; 85 typedef CHAR * PCHAR; 86 #endif 87 88 typedef unsigned long BOOL; 89 typedef BOOL * PBOOL; 90 #endif 91 92 #if !defined(VOID) 93 typedef void VOID; 94 #endif 95 #if !defined(_WINNT_) && !defined(PVOID) 96 typedef VOID * PVOID; 97 #endif 98 99 typedef unsigned long HDIR; 100 typedef HDIR * PHDIR; 101 102 typedef unsigned long APIRET; 103 104 105 typedef struct _FTIME /* ftime */ 106 { 107 #if defined(__IBMC__) || defined(__IBMCPP__) 108 UINT twosecs : 5; 109 UINT minutes : 6; 110 UINT hours : 5; 111 #else 112 USHORT twosecs : 5; 113 USHORT minutes : 6; 114 USHORT hours : 5; 115 #endif 116 } FTIME; 117 typedef FTIME *PFTIME; 118 119 120 typedef struct _FDATE /* fdate */ 121 { 122 #if defined(__IBMC__) || defined(__IBMCPP__) 123 UINT day : 5; 124 UINT month : 4; 125 UINT year : 7; 126 #else 127 USHORT day : 5; 128 USHORT month : 4; 129 USHORT year : 7; 130 #endif 131 } FDATE; 132 typedef FDATE *PFDATE; 133 134 135 typedef struct _FILESTATUS3 /* fsts3 */ 136 { 137 FDATE fdateCreation; 138 FTIME ftimeCreation; 139 FDATE fdateLastAccess; 140 FTIME ftimeLastAccess; 141 FDATE fdateLastWrite; 142 FTIME ftimeLastWrite; 143 ULONG cbFile; 144 ULONG cbFileAlloc; 145 ULONG attrFile; 146 } FILESTATUS3; 147 typedef FILESTATUS3 *PFILESTATUS3; 148 149 typedef struct _FILEFINDBUF3 /* findbuf3 */ 150 { 151 ULONG oNextEntryOffset; 152 FDATE fdateCreation; 153 FTIME ftimeCreation; 154 FDATE fdateLastAccess; 155 FTIME ftimeLastAccess; 156 FDATE fdateLastWrite; 157 FTIME ftimeLastWrite; 158 ULONG cbFile; 159 ULONG cbFileAlloc; 160 ULONG attrFile; 161 UCHAR cchName; 162 CHAR achName[CCHMAXPATHCOMP]; 163 } FILEFINDBUF3; 164 typedef FILEFINDBUF3 *PFILEFINDBUF3; 165 166 167 /******************************************************************************* 168 * Function Prototypes * 169 *******************************************************************************/ 170 APIRET OS2ENTRY DosQueryPathInfo( 171 PCSZ pszPathName, 172 ULONG ulInfoLevel, 173 PVOID pInfoBuf, 174 ULONG cbInfoBuf); 175 176 APIRET OS2ENTRY DosFindFirst( 177 PCSZ pszFileSpec, 178 PHDIR phdir, 179 ULONG flAttribute, 180 PVOID pFindBuf, 181 ULONG cbFindBuf, 182 PULONG pcFileNames, 183 ULONG ulInfoLevel); 184 185 APIRET OS2ENTRY DosFindNext( 186 HDIR hDir, 187 PVOID pFindBuf, 188 ULONG cbFindBuf, 189 PULONG pcFileNames); 190 191 APIRET OS2ENTRY DosFindClose( 192 HDIR hDir); 193 194 195 196 #endif 197 198