]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/Common/MemoryFile.h
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / C / Common / MemoryFile.h
CommitLineData
30fdf114
LG
1/** @file\r
2\r
1be2ed90 3Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
40d841f6 4This program and the accompanying materials \r
30fdf114
LG
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 MemoryFile.h\r
15\r
16Abstract:\r
17\r
18 Header file for helper functions useful for accessing files.\r
19\r
20**/\r
21\r
22#ifndef _EFI_MEMORY_FILE_H\r
23#define _EFI_MEMORY_FILE_H\r
24\r
25#include <stdio.h>\r
26#include <stdlib.h>\r
27#include <Common/UefiBaseTypes.h>\r
28\r
30fdf114
LG
29//\r
30// Common data structures\r
31//\r
32typedef struct {\r
33 CHAR8 *FileImage;\r
34 CHAR8 *Eof;\r
35 CHAR8 *CurrentFilePointer;\r
36} MEMORY_FILE;\r
37\r
38\r
39//\r
40// Functions declarations\r
41//\r
42\r
43EFI_STATUS\r
44GetMemoryFile (\r
45 IN CHAR8 *InputFileName,\r
46 OUT EFI_HANDLE *OutputMemoryFile\r
47 )\r
48;\r
49/**\r
50\r
51Routine Description:\r
52\r
53 This opens a file, reads it into memory and returns a memory file\r
54 object.\r
55\r
56Arguments:\r
57\r
58 InputFile Memory file image.\r
59 OutputMemoryFile Handle to memory file\r
60\r
61Returns:\r
62\r
63 EFI_STATUS\r
64 OutputMemoryFile is valid if !EFI_ERROR\r
65\r
66**/\r
67\r
68\r
69EFI_STATUS\r
70FreeMemoryFile (\r
71 IN EFI_HANDLE InputMemoryFile\r
72 )\r
73;\r
74/**\r
75\r
76Routine Description:\r
77\r
78 Frees all memory associated with the input memory file.\r
79\r
80Arguments:\r
81\r
82 InputMemoryFile Handle to memory file\r
83\r
84Returns:\r
85\r
86 EFI_STATUS\r
87\r
88**/\r
89\r
90\r
91CHAR8 *\r
92ReadMemoryFileLine (\r
93 IN EFI_HANDLE InputMemoryFile\r
94 )\r
95;\r
96/**\r
97\r
98Routine Description:\r
99\r
100 This function reads a line from the memory file. The newline characters\r
101 are stripped and a null terminated string is returned.\r
102\r
103 If the string pointer returned is non-NULL, then the caller must free the\r
104 memory associated with this string.\r
105\r
106Arguments:\r
107\r
108 InputMemoryFile Handle to memory file\r
109\r
110Returns:\r
111\r
112 NULL if error or EOF\r
113 NULL character termincated string otherwise (MUST BE FREED BY CALLER)\r
114\r
115**/\r
116\r
117\r
118#endif\r