Merge pull request #4921 from cornishon/fmt_allocator_docs

Update `fmt` docs for procedures with a default allocator parameter
This commit is contained in:
Jeroen van Rijn
2025-03-09 14:14:18 +01:00
committed by GitHub
+14 -7
View File
@@ -116,11 +116,12 @@ register_user_formatter :: proc(id: typeid, formatter: User_Formatter) -> Regist
} }
// Creates a formatted string // Creates a formatted string
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - args: A variadic list of arguments to be formatted. // - args: A variadic list of arguments to be formatted.
// - sep: An optional separator string (default is a single space). // - sep: An optional separator string (default is a single space).
// - allocator: (default: context.allocator)
// //
// Returns: A formatted string. // Returns: A formatted string.
// //
@@ -132,11 +133,12 @@ aprint :: proc(args: ..any, sep := " ", allocator := context.allocator) -> strin
} }
// Creates a formatted string with a newline character at the end // Creates a formatted string with a newline character at the end
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - args: A variadic list of arguments to be formatted. // - args: A variadic list of arguments to be formatted.
// - sep: An optional separator string (default is a single space). // - sep: An optional separator string (default is a single space).
// - allocator: (default: context.allocator)
// //
// Returns: A formatted string with a newline character at the end. // Returns: A formatted string with a newline character at the end.
// //
@@ -148,11 +150,12 @@ aprintln :: proc(args: ..any, sep := " ", allocator := context.allocator) -> str
} }
// Creates a formatted string using a format string and arguments // Creates a formatted string using a format string and arguments
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - fmt: A format string with placeholders for the provided arguments. // - fmt: A format string with placeholders for the provided arguments.
// - args: A variadic list of arguments to be formatted. // - args: A variadic list of arguments to be formatted.
// - allocator: (default: context.allocator)
// - newline: Whether the string should end with a newline. (See `aprintfln`.) // - newline: Whether the string should end with a newline. (See `aprintfln`.)
// //
// Returns: A formatted string. The returned string must be freed accordingly. // Returns: A formatted string. The returned string must be freed accordingly.
@@ -165,11 +168,12 @@ aprintf :: proc(fmt: string, args: ..any, allocator := context.allocator, newlin
} }
// Creates a formatted string using a format string and arguments, followed by a newline. // Creates a formatted string using a format string and arguments, followed by a newline.
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - fmt: A format string with placeholders for the provided arguments. // - fmt: A format string with placeholders for the provided arguments.
// - args: A variadic list of arguments to be formatted. // - args: A variadic list of arguments to be formatted.
// - allocator: (default: context.allocator)
// //
// Returns: A formatted string. The returned string must be freed accordingly. // Returns: A formatted string. The returned string must be freed accordingly.
// //
@@ -359,11 +363,12 @@ panicf :: proc(fmt: string, args: ..any, loc := #caller_location) -> ! {
// Creates a formatted C string // Creates a formatted C string
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - args: A variadic list of arguments to be formatted. // - args: A variadic list of arguments to be formatted.
// - sep: An optional separator string (default is a single space). // - sep: An optional separator string (default is a single space).
// - allocator: (default: context.allocator)
// //
// Returns: A formatted C string. // Returns: A formatted C string.
// //
@@ -379,11 +384,12 @@ caprint :: proc(args: ..any, sep := " ", allocator := context.allocator) -> cstr
// Creates a formatted C string // Creates a formatted C string
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - format: A format string with placeholders for the provided arguments // - format: A format string with placeholders for the provided arguments
// - args: A variadic list of arguments to be formatted // - args: A variadic list of arguments to be formatted
// - allocator: (default: context.allocator)
// - newline: Whether the string should end with a newline. (See `caprintfln`.) // - newline: Whether the string should end with a newline. (See `caprintfln`.)
// //
// Returns: A formatted C string // Returns: A formatted C string
@@ -399,11 +405,12 @@ caprintf :: proc(format: string, args: ..any, allocator := context.allocator, ne
} }
// Creates a formatted C string, followed by a newline. // Creates a formatted C string, followed by a newline.
// //
// *Allocates Using Context's Allocator* // *Allocates Using Provided Allocator*
// //
// Inputs: // Inputs:
// - format: A format string with placeholders for the provided arguments // - format: A format string with placeholders for the provided arguments
// - args: A variadic list of arguments to be formatted // - args: A variadic list of arguments to be formatted
// - allocator: (default: context.allocator)
// //
// Returns: A formatted C string // Returns: A formatted C string
// //