]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Common/CommonLib.h
2c1db759b0db0e51f0e6ea7857a69d73c4e6626c
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4 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
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.
18 Common library assistance routines.
22 #ifndef _EFI_COMMON_LIB_H
23 #define _EFI_COMMON_LIB_H
25 #include <Common/UefiBaseTypes.h>
26 #include <Common/BuildVersion.h>
27 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
29 #define MAX_LONG_FILE_PATH 500
35 // Function declarations
76 IN CHAR8
*InputFileName
,
77 OUT CHAR8
**InputFileImage
,
84 IN CHAR8
*OutputFileName
,
85 IN CHAR8
*OutputFileImage
,
86 IN UINT32 BytesToWrite
93 This function opens a file and writes OutputFileImage into the file.
97 OutputFileName The name of the file to write.
98 OutputFileImage A pointer to the memory buffer.
99 BytesToWrite The size of the memory buffer.
103 EFI_SUCCESS The function completed successfully.
104 EFI_INVALID_PARAMETER One of the input parameters was invalid.
105 EFI_ABORTED An error occurred.
106 EFI_OUT_OF_RESOURCES No resource to complete operations.
125 CalculateChecksum16 (
144 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
148 IN OUT UINT8
*Buffer
,
161 Convert FileName to the long file path, which can support larger than 260 length.
167 LongFilePath A pointer to the converted long file path.
175 #define ASSERT(x) assert(x)
179 #include <sys/stat.h>
180 #define stricmp strcasecmp
181 #define _stricmp strcasecmp
182 #define strnicmp strncasecmp
183 #define strcmpi strcasecmp
184 size_t _filelength(int fd
);
186 char *strlwr(char *s
);
191 // On windows, mkdir only has one parameter.
192 // On unix, it has two parameters
194 #if defined(__GNUC__)
195 #define mkdir(dir, perm) mkdir(dir, perm)
197 #define mkdir(dir, perm) mkdir(dir)