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