]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
4b1e1121 HT |
3 | Copyright (c) 2004, 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 | DscFile.h\r | |
15 | \r | |
16 | Abstract:\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 | |
25 | typedef 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 | |
37 | typedef 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 | |
46 | typedef 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 | |
54 | typedef 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 | |
69 | int\r | |
70 | DSCFileSetFile (\r | |
71 | DSC_FILE *DSC,\r | |
72 | char *FileName\r | |
e00e1d46 | 73 | );\r |
3eb9473e | 74 | SECTION *\r |
75 | DSCFileFindSection (\r | |
76 | DSC_FILE *DSC,\r | |
77 | char *Name\r | |
e00e1d46 | 78 | );\r |
3eb9473e | 79 | int\r |
80 | DSCFileSavePosition (\r | |
81 | DSC_FILE *DSC\r | |
e00e1d46 | 82 | );\r |
3eb9473e | 83 | int\r |
84 | DSCFileRestorePosition (\r | |
85 | DSC_FILE *DSC\r | |
e00e1d46 | 86 | );\r |
3eb9473e | 87 | char *\r |
88 | DSCFileGetLine (\r | |
89 | DSC_FILE *DSC,\r | |
90 | char *Line,\r | |
91 | int LineLen\r | |
e00e1d46 | 92 | );\r |
3eb9473e | 93 | int\r |
94 | DSCFileInit (\r | |
95 | DSC_FILE *DSC\r | |
e00e1d46 | 96 | );\r |
3eb9473e | 97 | int\r |
98 | DSCFileDestroy (\r | |
99 | DSC_FILE *DSC\r | |
e00e1d46 | 100 | );\r |
3eb9473e | 101 | \r |
102 | #endif // ifndef _DSC_FILE_H_\r |