OpenCore
1.0.4
OpenCore Bootloader
|
#include <Base.h>
#include <Library/BaseLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcFlexArrayLib.h>
#include <Library/PrintLib.h>
Go to the source code of this file.
Functions | |
OC_ASCII_STRING_BUFFER * | OcAsciiStringBufferInit (VOID) |
EFI_STATUS | OcAsciiStringBufferAppend (IN OUT OC_ASCII_STRING_BUFFER *Buffer, IN CONST CHAR8 *AppendString OPTIONAL) |
STATIC EFI_STATUS | InternalAsciiStringBufferExtendBy (IN OUT OC_ASCII_STRING_BUFFER *Buffer, IN CONST UINTN AppendLength, OUT UINTN *TargetLength) |
EFI_STATUS | OcAsciiStringBufferAppendN (IN OUT OC_ASCII_STRING_BUFFER *Buffer, IN CONST CHAR8 *AppendString, OPTIONAL IN CONST UINTN Length) |
EFI_STATUS EFIAPI | OcAsciiStringBufferSPrint (IN OUT OC_ASCII_STRING_BUFFER *Buffer, IN CONST CHAR8 *FormatString,...) |
CHAR8 * | OcAsciiStringBufferFreeContainer (IN OUT OC_ASCII_STRING_BUFFER **StringBuffer) |
VOID | OcAsciiStringBufferFree (IN OUT OC_ASCII_STRING_BUFFER **StringBuffer) |
String buffer.
Copyright (c) 2021, Mike Beaton. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
Definition in file AsciiStringBuffer.c.
STATIC EFI_STATUS InternalAsciiStringBufferExtendBy | ( | IN OUT OC_ASCII_STRING_BUFFER * | Buffer, |
IN CONST UINTN | AppendLength, | ||
OUT UINTN * | TargetLength ) |
Extend string buffer by a specified length.
[in,out] | Buffer | String buffer to be extended. |
[in] | AppendLength | Length to be appended. |
[out] | TargetLength | Target length of the extended buffer. |
EFI_SUCCESS | The buffer was extended successfully. |
EFI_OUT_OF_RESOURCES | The extension failed due to the lack of resources. |
EFI_UNSUPPORTED | The buffer has no size. |
Definition at line 50 of file AsciiStringBuffer.c.
EFI_STATUS OcAsciiStringBufferAppend | ( | IN OUT OC_ASCII_STRING_BUFFER * | Buffer, |
IN CONST CHAR8 *AppendString | OPTIONAL ) |
Append new string to buffer, resizing if necessary.
[in,out] | StringBuffer | Buffer to modify. |
[in] | AppendString | String to append. If NULL, nothing will be modified. |
EFI_SUCCESS | String was appended. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_UNSUPPORTED | Internal error. |
Definition at line 29 of file AsciiStringBuffer.c.
EFI_STATUS OcAsciiStringBufferAppendN | ( | IN OUT OC_ASCII_STRING_BUFFER * | Buffer, |
IN CONST CHAR8 * | AppendString, | ||
OPTIONAL IN CONST UINTN | Length ) |
Append new substring to buffer, resizing if necessary.
[in,out] | StringBuffer | Buffer to modify. |
[in] | AppendString | String to append. If NULL, nothing will be modified. |
[in] | Length | Maxiumum length of substring to use. 0 means use 0 characters. Use MAX_UINTN for all chars. Ignored if AppendString is NULL. |
EFI_SUCCESS | String was appended. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_UNSUPPORTED | Internal error. |
Definition at line 101 of file AsciiStringBuffer.c.
VOID OcAsciiStringBufferFree | ( | IN OUT OC_ASCII_STRING_BUFFER ** | StringBuffer | ) |
Free string buffer memory; free and discard any allocated resultant string.
[in,out] | StringBuffer | StringBuffer to free. |
Non-NULL | Pointer to pool allocated accumulated string. |
NULL | No data was ever added to the string. |
Definition at line 197 of file AsciiStringBuffer.c.
CHAR8 * OcAsciiStringBufferFreeContainer | ( | IN OUT OC_ASCII_STRING_BUFFER ** | StringBuffer | ) |
Free string buffer memory and return pointer to pool allocated resultant string. Note that if no data was ever appended to the string then the return value will be NULL, not a zero length string.
[in,out] | StringBuffer | StringBuffer to free. |
Non-NULL | Pointer to pool allocated accumulated string. |
NULL | No data was ever added to the string. |
Definition at line 178 of file AsciiStringBuffer.c.
OC_ASCII_STRING_BUFFER * OcAsciiStringBufferInit | ( | VOID | ) |
Initialize string buffer.
Non-NULL | Buffer was created. |
NULL | Out of memory. |
Definition at line 17 of file AsciiStringBuffer.c.
EFI_STATUS EFIAPI OcAsciiStringBufferSPrint | ( | IN OUT OC_ASCII_STRING_BUFFER * | Buffer, |
IN CONST CHAR8 * | FormatString, | ||
... ) |
Safely print to string buffer.
[in,out] | StringBuffer | Buffer to modify. |
[in] | FormatString | A Null-terminated ASCII format string. |
[in] | ... | Variable argument list whose contents are accessed based on the format string specified by FormatString. |
EFI_SUCCESS | When data was printed to string buffer. |
EFI_OUT_OF_RESOURCES | Out of memory increasing string buffer sufficiently to print to. |
Definition at line 140 of file AsciiStringBuffer.c.