/*******************************************************************************
*
- * FUNCTION: AcpiUtVsnprintf
+ * FUNCTION: vsnprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
******************************************************************************/
int
-AcpiUtVsnprintf (
+vsnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
/*******************************************************************************
*
- * FUNCTION: AcpiUtSnprintf
+ * FUNCTION: snprintf
*
* PARAMETERS: String - String with boundary
* Size - Boundary of the string
******************************************************************************/
int
-AcpiUtSnprintf (
+snprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
va_start (Args, Format);
- Length = AcpiUtVsnprintf (String, Size, Format, Args);
+ 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);
va_end (Args);
return (Length);
#ifdef ACPI_APPLICATION
/*******************************************************************************
*
- * FUNCTION: AcpiUtFileVprintf
+ * 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
*
* PARAMETERS: File - File descriptor
* Format - Standard printf format
******************************************************************************/
int
-AcpiUtFileVprintf (
- ACPI_FILE File,
+vfprintf (
+ FILE *File,
const char *Format,
va_list Args)
{
Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
- Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
+ Length = vsnprintf (AcpiGbl_PrintBuffer,
sizeof (AcpiGbl_PrintBuffer), Format, Args);
- (void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
+ (void) fwrite (AcpiGbl_PrintBuffer, Length, 1, File);
AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
return (Length);
/*******************************************************************************
*
- * FUNCTION: AcpiUtFilePrintf
+ * FUNCTION: fprintf
*
* PARAMETERS: File - File descriptor
* Format, ... - Standard printf format
******************************************************************************/
int
-AcpiUtFilePrintf (
- ACPI_FILE File,
+fprintf (
+ FILE *File,
const char *Format,
...)
{
va_start (Args, Format);
- Length = AcpiUtFileVprintf (File, Format, Args);
+ Length = vfprintf (File, Format, Args);
va_end (Args);
return (Length);