]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/CCode/Source/Common/CommonLib.h
46f0cbace5645a9771ac4f818658c7975332cb8a
[mirror_edk2.git] / Tools / CCode / Source / Common / CommonLib.h
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. 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
8
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.
11
12 Module Name:
13
14 CommonLib.h
15
16 Abstract:
17
18 Common library assistance routines.
19
20 --*/
21
22 #ifndef _EFI_COMMON_LIB_H
23 #define _EFI_COMMON_LIB_H
24
25 #include <Common/UefiBaseTypes.h>
26
27 #ifndef _MAX_PATH
28 #define _MAX_PATH 500
29 #endif
30
31 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
32 //
33 // Function declarations
34 //
35 VOID
36 PeiZeroMem (
37 IN VOID *Buffer,
38 IN UINTN Size
39 )
40 ;
41
42 VOID
43 PeiCopyMem (
44 IN VOID *Destination,
45 IN VOID *Source,
46 IN UINTN Length
47 )
48 ;
49
50 VOID
51 ZeroMem (
52 IN VOID *Buffer,
53 IN UINTN Size
54 )
55 ;
56
57 VOID
58 CopyMem (
59 IN VOID *Destination,
60 IN VOID *Source,
61 IN UINTN Length
62 )
63 ;
64
65 INTN
66 CompareGuid (
67 IN EFI_GUID *Guid1,
68 IN EFI_GUID *Guid2
69 )
70 ;
71
72 EFI_STATUS
73 GetFileImage (
74 IN CHAR8 *InputFileName,
75 OUT CHAR8 **InputFileImage,
76 OUT UINT32 *BytesRead
77 )
78 ;
79
80 UINT8
81 CalculateChecksum8 (
82 IN UINT8 *Buffer,
83 IN UINTN Size
84 )
85 ;
86
87 UINT8
88 CalculateSum8 (
89 IN UINT8 *Buffer,
90 IN UINTN Size
91 )
92 ;
93
94 UINT16
95 CalculateChecksum16 (
96 IN UINT16 *Buffer,
97 IN UINTN Size
98 )
99 ;
100
101 UINT16
102 CalculateSum16 (
103 IN UINT16 *Buffer,
104 IN UINTN Size
105 )
106 ;
107
108 EFI_STATUS
109 PrintGuid (
110 IN EFI_GUID *Guid
111 )
112 ;
113
114 #define PRINTED_GUID_BUFFER_SIZE 37 // including null-termination
115 EFI_STATUS
116 PrintGuidToBuffer (
117 IN EFI_GUID *Guid,
118 IN OUT UINT8 *Buffer,
119 IN UINT32 BufferLen,
120 IN BOOLEAN Uppercase
121 )
122 ;
123
124 #define ASSERT(x) assert(x)
125
126 #ifdef __GNUC__
127 #define stricmp strcasecmp
128 #define strnicmp strncasecmp
129 #define strcmpi strcasecmp
130 #ifndef __CYGWIN__
131 char *strlwr(char *s);
132 #endif
133 #endif
134
135 #endif