]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/C/Common/CommonLib.h
3 Copyright (c) 2004 - 2008, 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 // 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
,
148 #define ASSERT(x) assert(x)
152 #include <sys/stat.h>
153 #define stricmp strcasecmp
154 #define _stricmp strcasecmp
155 #define strnicmp strncasecmp
156 #define strcmpi strcasecmp
157 size_t _filelength(int fd
);
159 char *strlwr(char *s
);
164 // On windows, mkdir only has one parameter.
165 // On unix, it has two parameters
167 #if defined(__GNUC__)
168 #define mkdir(dir, perm) mkdir(dir, perm)
170 #define mkdir(dir, perm) mkdir(dir)