]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/DscFile.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / ProcessDsc / DscFile.h
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name: \r
13\r
14 DscFile.h\r
15 \r
16Abstract:\r
17\r
18 Defines and function prototypes for the ProcessDsc utility.\r
19 \r
20--*/\r
21\r
22#ifndef _DSC_FILE_H_\r
23#define _DSC_FILE_H_\r
24\r
25typedef struct _SECTION_LINE {\r
26 struct _SECTION_LINE *Next;\r
27 char *Line;\r
28 char *FileName;\r
29 UINT32 LineNum;\r
30} SECTION_LINE;\r
31\r
32//\r
33// Use this structure to keep track of parsed file names. Then\r
34// if we get a parse error we can figure out the file/line of\r
35// the error and print a useful message.\r
36//\r
37typedef struct _DSC_FILE_NAME {\r
38 struct _DSC_FILE_NAME *Next;\r
39 char *FileName;\r
40} DSC_FILE_NAME;\r
41\r
42//\r
43// We create a list of section names when we pre-parse a description file.\r
44// Use this structure.\r
45//\r
46typedef struct _SECTION {\r
47 struct _SECTION *Next;\r
48 char *Name;\r
49 SECTION_LINE *FirstLine;\r
50} SECTION;\r
51\r
52#define MAX_SAVES 4\r
53\r
54typedef struct {\r
55 SECTION_LINE *SavedPosition[MAX_SAVES];\r
56 int SavedPositionIndex;\r
57 SECTION *Sections;\r
58 SECTION_LINE *Lines;\r
59 SECTION *LastSection;\r
60 SECTION_LINE *LastLine;\r
61 SECTION_LINE *CurrentLine;\r
62 DSC_FILE_NAME *FileName;\r
63 DSC_FILE_NAME *LastFileName;\r
64} DSC_FILE;\r
65\r
66//\r
67// Function prototypes\r
68//\r
69int\r
70DSCFileSetFile (\r
71 DSC_FILE *DSC,\r
72 char *FileName\r
73 )\r
74;\r
75SECTION *\r
76DSCFileFindSection (\r
77 DSC_FILE *DSC,\r
78 char *Name\r
79 )\r
80;\r
81int\r
82DSCFileSavePosition (\r
83 DSC_FILE *DSC\r
84 )\r
85;\r
86int\r
87DSCFileRestorePosition (\r
88 DSC_FILE *DSC\r
89 )\r
90;\r
91char *\r
92DSCFileGetLine (\r
93 DSC_FILE *DSC,\r
94 char *Line,\r
95 int LineLen\r
96 )\r
97;\r
98int\r
99DSCFileInit (\r
100 DSC_FILE *DSC\r
101 )\r
102;\r
103int\r
104DSCFileDestroy (\r
105 DSC_FILE *DSC\r
106 )\r
107;\r
108\r
109#endif // ifndef _DSC_FILE_H_\r