]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Common/CommonLib.h
2 Common library assistance routines.
4 Copyright (c) 2004 - 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
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.
15 #ifndef _EFI_COMMON_LIB_H
16 #define _EFI_COMMON_LIB_H
18 #include <Common/UefiBaseTypes.h>
19 #include <Common/BuildVersion.h>
20 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
22 #define MAX_LONG_FILE_PATH 500
29 // Function declarations
70 IN CHAR8
*InputFileName
,
71 OUT CHAR8
**InputFileImage
,
78 IN CHAR8
*OutputFileName
,
79 IN CHAR8
*OutputFileImage
,
80 IN UINT32 BytesToWrite
87 This function opens a file and writes OutputFileImage into the file.
91 OutputFileName The name of the file to write.
92 OutputFileImage A pointer to the memory buffer.
93 BytesToWrite The size of the memory buffer.
97 EFI_SUCCESS The function completed successfully.
98 EFI_INVALID_PARAMETER One of the input parameters was invalid.
99 EFI_ABORTED An error occurred.
100 EFI_OUT_OF_RESOURCES No resource to complete operations.
119 CalculateChecksum16 (
138 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
142 IN OUT UINT8
*Buffer
,
155 Convert FileName to the long file path, which can support larger than 260 length.
161 LongFilePath A pointer to the converted long file path.
169 #define ASSERT(x) assert(x)
173 #include <sys/stat.h>
174 #define stricmp strcasecmp
175 #define _stricmp strcasecmp
176 #define strnicmp strncasecmp
177 #define strcmpi strcasecmp
178 size_t _filelength(int fd
);
180 char *strlwr(char *s
);
185 // On windows, mkdir only has one parameter.
186 // On unix, it has two parameters
188 #if defined(__GNUC__)
189 #define mkdir(dir, perm) mkdir(dir, perm)
191 #define mkdir(dir, perm) mkdir(dir)