diff options
Diffstat (limited to 'source/components/utilities/utprint.c')
-rw-r--r-- | source/components/utilities/utprint.c | 124 |
1 files changed, 14 insertions, 110 deletions
diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c index ee52453fd..5ca859ec4 100644 --- a/source/components/utilities/utprint.c +++ b/source/components/utilities/utprint.c @@ -120,8 +120,6 @@ ACPI_MODULE_NAME ("utprint") -#if defined(ACPI_USE_SYSTEM_CLIBRARY) && !defined(ACPI_USE_STANDARD_HEADERS) - #define ACPI_FORMAT_SIGN 0x01 #define ACPI_FORMAT_SIGN_PLUS 0x02 #define ACPI_FORMAT_SIGN_PLUS_SPACE 0x04 @@ -490,7 +488,7 @@ AcpiUtFormatNumber ( /******************************************************************************* * - * FUNCTION: vsnprintf + * FUNCTION: AcpiUtVsnprintf * * PARAMETERS: String - String with boundary * Size - Boundary of the string @@ -504,7 +502,7 @@ AcpiUtFormatNumber ( ******************************************************************************/ int -vsnprintf ( +AcpiUtVsnprintf ( char *String, ACPI_SIZE Size, const char *Format, @@ -787,7 +785,7 @@ vsnprintf ( /******************************************************************************* * - * FUNCTION: snprintf + * FUNCTION: AcpiUtSnprintf * * PARAMETERS: String - String with boundary * Size - Boundary of the string @@ -800,7 +798,7 @@ vsnprintf ( ******************************************************************************/ int -snprintf ( +AcpiUtSnprintf ( char *String, ACPI_SIZE Size, const char *Format, @@ -811,38 +809,7 @@ snprintf ( va_start (Args, Format); - Length = vsnprintf (String, Size, Format, Args); - va_end (Args); - - return (Length); -} - - -/******************************************************************************* - * - * FUNCTION: sprintf - * - * PARAMETERS: String - String with boundary - * Format, ... - Standard printf format - * - * RETURN: Number of bytes actually written. - * - * DESCRIPTION: Formatted output to a string. - * - ******************************************************************************/ - -int -sprintf ( - char *String, - const char *Format, - ...) -{ - va_list Args; - int Length; - - - va_start (Args, Format); - Length = vsnprintf (String, ACPI_UINT32_MAX, Format, Args); + Length = AcpiUtVsnprintf (String, Size, Format, Args); va_end (Args); return (Length); @@ -852,69 +819,7 @@ sprintf ( #ifdef ACPI_APPLICATION /******************************************************************************* * - * FUNCTION: vprintf - * - * PARAMETERS: Format - Standard printf format - * Args - Argument list - * - * RETURN: Number of bytes actually written. - * - * DESCRIPTION: Formatted output to stdout using argument list pointer. - * - ******************************************************************************/ - -int -vprintf ( - const char *Format, - va_list Args) -{ - ACPI_CPU_FLAGS Flags; - int Length; - - - Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock); - Length = vsnprintf (AcpiGbl_PrintBuffer, - sizeof (AcpiGbl_PrintBuffer), Format, Args); - - (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, ACPI_FILE_OUT); - AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags); - - return (Length); -} - - -/******************************************************************************* - * - * FUNCTION: printf - * - * PARAMETERS: Format, ... - Standard printf format - * - * RETURN: Number of bytes actually written. - * - * DESCRIPTION: Formatted output to stdout. - * - ******************************************************************************/ - -int -printf ( - const char *Format, - ...) -{ - va_list Args; - int Length; - - - va_start (Args, Format); - Length = vprintf (Format, Args); - va_end (Args); - - return (Length); -} - - -/******************************************************************************* - * - * FUNCTION: vfprintf + * FUNCTION: AcpiUtFileVprintf * * PARAMETERS: File - File descriptor * Format - Standard printf format @@ -927,8 +832,8 @@ printf ( ******************************************************************************/ int -vfprintf ( - FILE *File, +AcpiUtFileVprintf ( + ACPI_FILE File, const char *Format, va_list Args) { @@ -937,10 +842,10 @@ vfprintf ( Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock); - Length = vsnprintf (AcpiGbl_PrintBuffer, + Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer, sizeof (AcpiGbl_PrintBuffer), Format, Args); - (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File); + (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1); AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags); return (Length); @@ -949,7 +854,7 @@ vfprintf ( /******************************************************************************* * - * FUNCTION: fprintf + * FUNCTION: AcpiUtFilePrintf * * PARAMETERS: File - File descriptor * Format, ... - Standard printf format @@ -961,8 +866,8 @@ vfprintf ( ******************************************************************************/ int -fprintf ( - FILE *File, +AcpiUtFilePrintf ( + ACPI_FILE File, const char *Format, ...) { @@ -971,10 +876,9 @@ fprintf ( va_start (Args, Format); - Length = vfprintf (File, Format, Args); + Length = AcpiUtFileVprintf (File, Format, Args); va_end (Args); return (Length); } #endif -#endif /* ACPI_USE_SYSTEM_CLIBRARY && !ACPI_USE_STANDARD_HEADERS */ |