[NEWINFLIB]
[reactos.git] / reactos / lib / newinflib / 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 <host/typedefs.h>
12
13 #include <stdarg.h>
14 #include <stdio.h>
15 #include <string.h>
16 #include <errno.h>
17
18 #define FREE(Area) free(Area)
19 #define MALLOC(Size) malloc((size_t)(Size))
20 #define ZEROMEMORY(Area, Size) memset((Area), '\0', (size_t)(Size))
21 #define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (size_t)(Size))
22
23 #define STATUS_SUCCESS 0
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 TCHAR, *PTCHAR, *PTSTR;
32 typedef const TCHAR *PCTSTR;
33 typedef WORD LCID;
34
35 #define _T(x) x
36 #define _tcsicmp strcasecmp
37 #define _tcslen strlen
38 #define _tcscpy strcpy
39 #define _tcstoul strtoul
40 #define _tcstol strtol
41 #define STRFMT "%s"
42
43 #ifdef _MSC_VER
44 #define strcasecmp _stricmp
45 #endif
46
47 #define IS_TEXT_UNICODE_ASCII16 1
48 #define IS_TEXT_UNICODE_REVERSE_ASCII16 16
49 #define IS_TEXT_UNICODE_STATISTICS 2
50 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
51 #define IS_TEXT_UNICODE_CONTROLS 4
52 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
53 #define IS_TEXT_UNICODE_SIGNATURE 8
54 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
55 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
56 #define IS_TEXT_UNICODE_ODD_LENGTH 512
57 #define IS_TEXT_UNICODE_NULL_BYTES 4096
58 #define IS_TEXT_UNICODE_UNICODE_MASK 15
59 #define IS_TEXT_UNICODE_REVERSE_MASK 240
60 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
61 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
62
63 #define SUBLANG_NEUTRAL 0
64 #define PRIMARYLANGID(lgid) ((WORD)(lgid) & 0x3ff)
65 #define MAKELANGID(p, s) ((((WORD)(s)) << 10) | (WORD)(p))
66
67
68 #else /* ! defined(INFLIB_HOST) */
69
70 /* ReactOS definitions */
71
72 #define UNICODE
73 #define _UNICODE
74 #define WIN32_NO_STATUS
75 #include <windows.h>
76 #define NTOS_MODE_USER
77 #include <ndk/ntndk.h>
78 #include <tchar.h>
79
80 extern PVOID InfpHeap;
81
82 #define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area))
83 #define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size))
84 #define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size))
85 #define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size))
86
87 #define INF_STATUS_SUCCESS STATUS_SUCCESS
88 #define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY
89 #define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
90 #define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND
91 #define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
92 #define INF_SUCCESS(x) (0 <= (x))
93
94 #define STRFMT "%S"
95
96 #endif /* INFLIB_HOST */
97
98 /* EOF */