mirror of
https://github.com/rhboot/gnu-efi
synced 2026-08-26 00:26:04 -04:00
Add AsciiSPrint()
AsciiSPrint() is really snprintf(), but gnu-efi has a different naming convention. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
0d74e15af1
commit
dc7fd96f23
2 changed files with 45 additions and 0 deletions
|
|
@ -596,6 +596,14 @@ AsciiVSPrint(
|
|||
__builtin_ms_va_list args
|
||||
);
|
||||
|
||||
UINTN EFIAPI
|
||||
AsciiSPrint (
|
||||
OUT CHAR8 *Str,
|
||||
IN UINTN StrSize,
|
||||
IN CONST CHAR8 *fmt,
|
||||
...
|
||||
);
|
||||
|
||||
VOID
|
||||
ValueToHex (
|
||||
IN CHAR16 *Buffer,
|
||||
|
|
|
|||
37
lib/print.c
37
lib/print.c
|
|
@ -899,6 +899,43 @@ Returns:
|
|||
return Len;
|
||||
}
|
||||
|
||||
UINTN EFIAPI
|
||||
AsciiSPrint (
|
||||
OUT CHAR8 *Str,
|
||||
IN UINTN StrSize,
|
||||
IN CONST CHAR8 *fmt,
|
||||
...
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
Prints a formatted unicode string to a buffer
|
||||
|
||||
Arguments:
|
||||
|
||||
Str - Output buffer to print the formatted string into
|
||||
|
||||
StrSize - Size of Str. String is truncated to this size.
|
||||
A size of 0 means there is no limit
|
||||
|
||||
fmt - The format string
|
||||
|
||||
Returns:
|
||||
|
||||
String length returned in buffer
|
||||
|
||||
--*/
|
||||
{
|
||||
ms_va_list args;
|
||||
UINTN len;
|
||||
|
||||
ms_va_start (args, fmt);
|
||||
len = AsciiVSPrint(Str, StrSize, fmt, args);
|
||||
ms_va_end (args);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
STATIC
|
||||
VOID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue