Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
4b1e1121 HT |
3 | Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | Common.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Common include file for the ProcessDsc utility.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _COMMON_H_\r | |
23 | #define _COMMON_H_\r | |
24 | \r | |
25 | typedef char INT8;\r | |
26 | typedef unsigned int UINT32;\r | |
27 | \r | |
28 | #include "EfiUtilityMsgs.h"\r | |
29 | \r | |
30 | #define MAX_LINE_LEN 1024\r | |
31 | \r | |
32 | #ifdef MAX_PATH\r | |
33 | #undef MAX_PATH\r | |
34 | #define MAX_PATH 1024\r | |
35 | #endif\r | |
36 | \r | |
37 | //\r | |
38 | // Defines for how to expand symbols\r | |
39 | //\r | |
40 | #define EXPANDMODE_NO_UNDEFS 0x01\r | |
41 | #define EXPANDMODE_NO_DESTDIR 0x02\r | |
42 | #define EXPANDMODE_NO_SOURCEDIR 0x04\r | |
43 | #define EXPANDMODE_RECURSIVE 0x08\r | |
44 | \r | |
45 | //\r | |
46 | // Defines for adding symbols\r | |
47 | //\r | |
48 | #define SYM_OVERWRITE 0x01 // overwrite existing assignments\r | |
49 | #define SYM_GLOBAL 0x02 // global symbol (persistent)\r | |
50 | #define SYM_LOCAL 0x04 // symbols at component level\r | |
51 | #define SYM_FILE 0x08 // symbols at file level\r | |
52 | #define SYM_FILEPATH 0x10 // symbol is a file path\r | |
53 | #define SYM_FILENAME 0x20 // symbol is a file name\r | |
54 | #define FV_DIR "FV_DIR" // symbol for base dir where FV files are\r | |
55 | #define DSC_FILENAME "DSC_FILENAME"\r | |
56 | \r | |
57 | //\r | |
58 | // Smart file for better incremental build support.\r | |
59 | // Only re-create .pkg .inf or .apr files when it's content is changed.\r | |
60 | // \r | |
61 | //\r | |
62 | typedef struct _SMART_FILE {\r | |
63 | char *FileName;\r | |
64 | char *FileContent; // Previous file content\r | |
65 | int FileLength; // Previous file string length\r | |
66 | int FilePosition; // The offset from FileContent for next comparison\r | |
67 | FILE *FilePtr; // New file pointer if the file need to be re-created\r | |
68 | } SMART_FILE;\r | |
69 | \r | |
70 | SMART_FILE *\r | |
71 | SmartOpen (\r | |
72 | char *FileName\r | |
73 | );\r | |
74 | \r | |
75 | int\r | |
76 | SmartWrite (\r | |
77 | SMART_FILE *SmartFile,\r | |
78 | char *String\r | |
79 | );\r | |
80 | \r | |
81 | void\r | |
82 | SmartClose (\r | |
83 | SMART_FILE *SmartFile\r | |
84 | );\r | |
85 | \r | |
86 | INT8 *\r | |
87 | GetSymbolValue (\r | |
88 | INT8 *SymbolName\r | |
89 | );\r | |
90 | \r | |
91 | int\r | |
92 | AddSymbol (\r | |
93 | INT8 *Name,\r | |
94 | INT8 *Value,\r | |
95 | int Mode\r | |
96 | );\r | |
97 | \r | |
98 | int\r | |
99 | ExpandSymbols (\r | |
100 | INT8 *SourceLine,\r | |
101 | INT8 *DestLine,\r | |
102 | int LineLen,\r | |
103 | int ExpandMode\r | |
104 | );\r | |
105 | \r | |
106 | void\r | |
107 | Message (\r | |
108 | UINT32 PrintMask,\r | |
109 | INT8 *Fmt,\r | |
110 | ...\r | |
111 | );\r | |
112 | \r | |
113 | int\r | |
114 | MakeFilePath (\r | |
115 | INT8 *FileName\r | |
116 | );\r | |
117 | \r | |
118 | int\r | |
119 | IsAbsolutePath (\r | |
120 | INT8 *FileName\r | |
121 | );\r | |
122 | \r | |
123 | #endif // ifndef _COMMON_H_\r |