summaryrefslogtreecommitdiffstats
path: root/src/fastdep/os2fake.h
blob: 4036fb0e2c5c169c8c63af4a191330616cf6fd73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
/* $Id: os2fake.h 2243 2009-01-10 02:24:02Z bird $
 *
 * Structures, defines and function prototypes for the OS/2 fake library.
 *
 * Copyright (c) 2001-2009 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
 *
 * GPL
 *
 */


#ifndef _os2fake_h_
#define _os2fake_h_


/*******************************************************************************
*   Defined Constants And Macros                                               *
*******************************************************************************/
#ifndef OS2ENTRY
#define OS2ENTRY
#endif

#ifndef CCHMAXPATHCOMP
#define CCHMAXPATHCOMP          256
#endif

#ifndef CCHMAXPATH
#define CCHMAXPATH              260
#endif

#ifndef FIL_STANDARD
#define FIL_STANDARD            1
#define FIL_QUERYEASIZE         2
#define FIL_QUERYEASFROMLIST    3
#define FIL_QUERYFULLNAME       5
#endif

#define FILE_NORMAL             0x0000
#define FILE_READONLY           0x0001
#define FILE_HIDDEN             0x0002
#define FILE_SYSTEM             0x0004
#define FILE_DIRECTORY          0x0010
#define FILE_ARCHIVED           0x0020

#ifndef HDIR_CREATE
#define HDIR_CREATE             (-1)
#endif

#ifndef TRUE
#define TRUE                    1
#endif
#ifndef FALSE
#define FALSE                   0
#endif

#ifndef NO_ERROR
#define NO_ERROR                0
#endif



/*******************************************************************************
*   Structures and Typedefs                                                    *
*******************************************************************************/
typedef char *          PCH;

typedef char *          PSZ;
typedef const char *    PCSZ;

typedef unsigned long   ULONG;
typedef ULONG *         PULONG;

typedef unsigned short  USHORT;
typedef USHORT *        PUSHORT;

#if !defined(_WINDEF_)
typedef unsigned int    UINT;
typedef UINT *          PUINT;

typedef unsigned char   UCHAR;
typedef UCHAR *         PUCHAR;

#if !defined(CHAR)
typedef char            CHAR;
typedef CHAR *          PCHAR;
#endif

typedef unsigned long   BOOL;
typedef BOOL *          PBOOL;
#endif

#if !defined(VOID)
typedef void            VOID;
#endif
#if !defined(_WINNT_) && !defined(PVOID)
typedef VOID *          PVOID;
#endif

typedef unsigned long   HDIR;
typedef HDIR *          PHDIR;

typedef unsigned long   APIRET;


typedef struct _FTIME   /* ftime */
{
#if defined(__IBMC__) || defined(__IBMCPP__)
    UINT    twosecs : 5;
    UINT    minutes : 6;
    UINT    hours   : 5;
#else
    USHORT  twosecs : 5;
    USHORT  minutes : 6;
    USHORT  hours   : 5;
#endif
} FTIME;
typedef FTIME *PFTIME;


typedef struct _FDATE   /* fdate */
{
#if defined(__IBMC__) || defined(__IBMCPP__)
    UINT    day     : 5;
    UINT    month   : 4;
    UINT    year    : 7;
#else
    USHORT  day     : 5;
    USHORT  month   : 4;
    USHORT  year    : 7;
#endif
} FDATE;
typedef FDATE   *PFDATE;


typedef struct _FILESTATUS3     /* fsts3 */
{
    FDATE   fdateCreation;
    FTIME   ftimeCreation;
    FDATE   fdateLastAccess;
    FTIME   ftimeLastAccess;
    FDATE   fdateLastWrite;
    FTIME   ftimeLastWrite;
    ULONG   cbFile;
    ULONG   cbFileAlloc;
    ULONG   attrFile;
} FILESTATUS3;
typedef FILESTATUS3 *PFILESTATUS3;

typedef struct _FILEFINDBUF3    /* findbuf3 */
{
    ULONG   oNextEntryOffset;
    FDATE   fdateCreation;
    FTIME   ftimeCreation;
    FDATE   fdateLastAccess;
    FTIME   ftimeLastAccess;
    FDATE   fdateLastWrite;
    FTIME   ftimeLastWrite;
    ULONG   cbFile;
    ULONG   cbFileAlloc;
    ULONG   attrFile;
    UCHAR   cchName;
    CHAR    achName[CCHMAXPATHCOMP];
} FILEFINDBUF3;
typedef FILEFINDBUF3 *PFILEFINDBUF3;


/*******************************************************************************
*   Function Prototypes                                                        *
*******************************************************************************/
APIRET OS2ENTRY         DosQueryPathInfo(
                            PCSZ        pszPathName,
                            ULONG       ulInfoLevel,
                            PVOID       pInfoBuf,
                            ULONG       cbInfoBuf);

APIRET OS2ENTRY         DosFindFirst(
                            PCSZ        pszFileSpec,
                            PHDIR       phdir,
                            ULONG       flAttribute,
                            PVOID       pFindBuf,
                            ULONG       cbFindBuf,
                            PULONG      pcFileNames,
                            ULONG       ulInfoLevel);

APIRET OS2ENTRY         DosFindNext(
                            HDIR        hDir,
                            PVOID       pFindBuf,
                            ULONG       cbFindBuf,
                            PULONG      pcFileNames);

APIRET OS2ENTRY         DosFindClose(
                            HDIR        hDir);



#endif