]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/DscFile.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Sample / Tools / Source / ProcessDsc / DscFile.h
diff --git a/EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/DscFile.h b/EdkCompatibilityPkg/Sample/Tools/Source/ProcessDsc/DscFile.h
new file mode 100644 (file)
index 0000000..4dcad54
--- /dev/null
@@ -0,0 +1,109 @@
+/*++\r
+\r
+Copyright (c) 2004, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:  \r
+\r
+  DscFile.h\r
+  \r
+Abstract:\r
+\r
+  Defines and function prototypes for the ProcessDsc utility.\r
+  \r
+--*/\r
+\r
+#ifndef _DSC_FILE_H_\r
+#define _DSC_FILE_H_\r
+\r
+typedef struct _SECTION_LINE {\r
+  struct _SECTION_LINE  *Next;\r
+  char                  *Line;\r
+  char                  *FileName;\r
+  UINT32                LineNum;\r
+} SECTION_LINE;\r
+\r
+//\r
+// Use this structure to keep track of parsed file names. Then\r
+// if we get a parse error we can figure out the file/line of\r
+// the error and print a useful message.\r
+//\r
+typedef struct _DSC_FILE_NAME {\r
+  struct _DSC_FILE_NAME *Next;\r
+  char                  *FileName;\r
+} DSC_FILE_NAME;\r
+\r
+//\r
+// We create a list of section names when we pre-parse a description file.\r
+// Use this structure.\r
+//\r
+typedef struct _SECTION {\r
+  struct _SECTION *Next;\r
+  char            *Name;\r
+  SECTION_LINE    *FirstLine;\r
+} SECTION;\r
+\r
+#define MAX_SAVES 4\r
+\r
+typedef struct {\r
+  SECTION_LINE  *SavedPosition[MAX_SAVES];\r
+  int           SavedPositionIndex;\r
+  SECTION       *Sections;\r
+  SECTION_LINE  *Lines;\r
+  SECTION       *LastSection;\r
+  SECTION_LINE  *LastLine;\r
+  SECTION_LINE  *CurrentLine;\r
+  DSC_FILE_NAME *FileName;\r
+  DSC_FILE_NAME *LastFileName;\r
+} DSC_FILE;\r
+\r
+//\r
+// Function prototypes\r
+//\r
+int\r
+DSCFileSetFile (\r
+  DSC_FILE *DSC,\r
+  char     *FileName\r
+  )\r
+;\r
+SECTION *\r
+DSCFileFindSection (\r
+  DSC_FILE *DSC,\r
+  char     *Name\r
+  )\r
+;\r
+int\r
+DSCFileSavePosition (\r
+  DSC_FILE *DSC\r
+  )\r
+;\r
+int\r
+DSCFileRestorePosition (\r
+  DSC_FILE *DSC\r
+  )\r
+;\r
+char    *\r
+DSCFileGetLine (\r
+  DSC_FILE *DSC,\r
+  char     *Line,\r
+  int      LineLen\r
+  )\r
+;\r
+int\r
+DSCFileInit (\r
+  DSC_FILE *DSC\r
+  )\r
+;\r
+int\r
+DSCFileDestroy (\r
+  DSC_FILE *DSC\r
+  )\r
+;\r
+\r
+#endif // ifndef _DSC_FILE_H_\r