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