- Factor out .inf handling code from usetup
[reactos.git] / reactos / lib / inflib / builddep.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: .inf file parser
4 * FILE: lib/inflib/builddep.h
5 * PURPOSE: Build dependent definitions
6 * PROGRAMMER: Ge van Geldorp <gvg@reactos.org>
7 */
8
9 #ifdef INFLIB_HOST
10
11 /* Definitions native to the host on which we're building */
12
13 #include <string.h>
14 #include <errno.h>
15
16 #define FREE(Area) free(Area)
17 #define MALLOC(Size) malloc(Size)
18 #define ZEROMEMORY(Area, Size) memset((Area), '\0', (Size))
19 #define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (Size))
20
21 #define INF_STATUS_SUCCESS 0
22 #define INF_STATUS_NO_MEMORY ENOMEM
23 #define INF_STATUS_INVALID_PARAMETER EINVAL
24 #define INF_STATUS_NOT_FOUND ENOENT
25 #define INF_STATUS_BUFFER_OVERFLOW E2BIG
26 #define INF_SUCCESS(x) (0 == (x))
27
28 typedef char CHAR, *PCHAR;
29 typedef unsigned char UCHAR, *PUCHAR;
30 typedef long LONG, *PLONG;
31 typedef unsigned long ULONG, *PULONG;
32 typedef void VOID, *PVOID;
33 typedef UCHAR BOOLEAN, *PBOOLEAN;
34
35 typedef char TCHAR, *PTCHAR, *PTSTR;
36 #define _T(x) x
37 #define _tcsicmp strcasecmp
38 #define _tcslen strlen
39 #define _tcscpy strcpy
40 #define _tcstoul strtoul
41 #define _tcstol strtol
42
43 extern void DbgPrint(const char *Fmt, ...);
44
45 #else /* ! defined(INFLIB_HOST) */
46
47 /* ReactOS definitions */
48
49 #define UNICODE
50 #define _UNICODE
51 #include <tchar.h>
52 #define WIN32_NO_STATUS
53 #include <windows.h>
54 #define NTOS_MODE_USER
55 #include <ndk/ntndk.h>
56
57 extern PVOID InfpHeap;
58
59 #define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area))
60 #define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size))
61 #define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size))
62 #define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size))
63
64 #define INF_STATUS_SUCCESS STATUS_SUCCESS
65 #define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY
66 #define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
67 #define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND
68 #define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
69 #define INF_SUCCESS(x) (0 <= (x))
70
71 #endif /* INFLIB_HOST */
72
73 typedef const TCHAR *PCTSTR;
74
75 /* EOF */