1 /** @file 2 Header file for helper functions for parsing GuidedSectionTools.txt 3 4 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR> 5 This program and the accompanying materials 6 are licensed and made available under the terms and conditions of the BSD License 7 which accompanies this distribution. The full text of the license may be found at 8 http://opensource.org/licenses/bsd-license.php 9 10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 13 **/ 14 15 #ifndef _EFI_PARSE_GUIDED_SECTION_TOOLS_H 16 #define _EFI_PARSE_GUIDED_SECTION_TOOLS_H 17 18 #include <Common/UefiBaseTypes.h> 19 20 // 21 // Functions declarations 22 // 23 24 EFI_HANDLE 25 ParseGuidedSectionToolsFile ( 26 IN CHAR8 *InputFile 27 ) 28 ; 29 /** 30 31 Routine Description: 32 33 This function parses the tools_def.txt file. It returns a 34 EFI_HANDLE object which can be used for the other library 35 functions and should be passed to FreeParsedToolsDefHandle 36 to free resources when the tools_def.txt information is no 37 longer needed. 38 39 Arguments: 40 41 InputFile Path name of file to read 42 43 Returns: 44 45 NULL if error parsing 46 A non-NULL EFI_HANDLE otherwise 47 48 **/ 49 50 51 EFI_HANDLE 52 ParseGuidedSectionToolsMemoryFile ( 53 IN EFI_HANDLE InputFile 54 ) 55 ; 56 /** 57 58 Routine Description: 59 60 This function parses the tools_def.txt file. It returns a 61 EFI_HANDLE object which can be used for the other library 62 functions and should be passed to FreeParsedToolsDefHandle 63 to free resources when the tools_def.txt information is no 64 longer needed. 65 66 Arguments: 67 68 InputFile Memory file image. 69 70 Returns: 71 72 NULL if error parsing 73 A non-NULL EFI_HANDLE otherwise 74 75 **/ 76 77 CHAR8* 78 LookupGuidedSectionToolPath ( 79 IN EFI_HANDLE ParsedGuidedSectionToolsHandle, 80 IN EFI_GUID *SectionGuid 81 ) 82 ; 83 /** 84 85 Routine Description: 86 87 This function looks up the appropriate tool to use for extracting 88 a GUID defined FV section. 89 90 Arguments: 91 92 ParsedGuidedSectionToolsHandle A parsed GUID section tools handle. 93 SectionGuid The GUID for the section. 94 95 Returns: 96 97 NULL - if no tool is found or there is another error 98 Non-NULL - The tool to use to access the section contents. (The caller 99 must free the memory associated with this string.) 100 101 **/ 102 103 EFI_STATUS 104 FreeParsedGuidedSectionToolsHandle ( 105 IN EFI_HANDLE ParsedGuidedSectionToolsHandle 106 ) 107 ; 108 /** 109 110 Routine Description: 111 112 Frees resources that were allocated by ParseGuidedSectionToolsFile. 113 After freeing these resources, the information that was parsed 114 is no longer accessible. 115 116 Arguments: 117 118 ParsedToolDefHandle Handle returned from ParseGuidedSectionToolsFile 119 120 Returns: 121 122 EFI_STATUS 123 124 **/ 125 126 #endif 127