c7fecfd34c5644b980057cd6b680e85cb97cf816
[mirror_edk2.git] / MdePkg / Library / BasePrintLib / PrintLibInternal.h
1 /** @file
2 Print Library.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. 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
9
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.
12
13 Module Name: PrintLibInternal.h
14
15 **/
16
17
18
19 //
20 // Print primitives
21 //
22 //#define LEFT_JUSTIFY 0x01
23 #define PREFIX_SIGN 0x02
24 #define PREFIX_BLANK 0x04
25 //#define COMMA_TYPE 0x08
26 #define LONG_TYPE 0x10
27 //#define PREFIX_ZERO 0x20
28 #define OUTPUT_UNICODE 0x40
29 #define RADIX_HEX 0x80
30 #define FORMAT_UNICODE 0x100
31 #define PAD_TO_WIDTH 0x200
32 #define ARGUMENT_UNICODE 0x400
33 #define PRECISION 0x800
34 #define ARGUMENT_REVERSED 0x1000
35
36 ///
37 /// Define the maximum number of characters that are required to encode
38 /// a decimal, hexidecimal, GUID, or TIME value with a Nll terminator.
39 /// Maximum Length Decimal String = 28 "-9,223,372,036,854,775,808"
40 /// Maximum Length Hexidecimal String = 17 "FFFFFFFFFFFFFFFF"
41 /// Maximum Length GUID = 37 "00000000-0000-0000-0000-000000000000"
42 /// Maximum Length TIME = 18 "12/12/2006 12:12"
43 ///
44 #define MAXIMUM_VALUE_CHARACTERS 38
45
46 //
47 //
48 //
49 typedef struct {
50 UINT16 Year;
51 UINT8 Month;
52 UINT8 Day;
53 UINT8 Hour;
54 UINT8 Minute;
55 UINT8 Second;
56 UINT8 Pad1;
57 UINT32 Nanosecond;
58 INT16 TimeZone;
59 UINT8 Daylight;
60 UINT8 Pad2;
61 } TIME;
62
63 UINTN
64 BasePrintLibSPrint (
65 OUT CHAR8 *Buffer,
66 IN UINTN BufferSize,
67 IN UINTN Flags,
68 IN CONST CHAR8 *FormatString,
69 ...
70 );
71
72 CHAR8 *
73 BasePrintLibFillBuffer (
74 CHAR8 *Buffer,
75 INTN Length,
76 UINTN Character,
77 INTN Increment
78 );
79
80 UINTN
81 EFIAPI
82 BasePrintLibValueToString (
83 IN OUT CHAR8 *Buffer,
84 IN INT64 Value,
85 IN UINTN Radix
86 );
87
88 UINTN
89 BasePrintLibConvertValueToString (
90 IN OUT CHAR8 *Buffer,
91 IN UINTN Flags,
92 IN INT64 Value,
93 IN UINTN Width,
94 IN UINTN Increment
95 );