From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/civetweb/docs/api/mg_printf.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/civetweb/docs/api/mg_printf.md (limited to 'src/civetweb/docs/api/mg_printf.md') diff --git a/src/civetweb/docs/api/mg_printf.md b/src/civetweb/docs/api/mg_printf.md new file mode 100644 index 00000000..8beb9c07 --- /dev/null +++ b/src/civetweb/docs/api/mg_printf.md @@ -0,0 +1,27 @@ +# Civetweb API Reference + +### `mg_printf( conn, fmt, ... );` + +### Parameters + +| Parameter | Type | Description | +| :--- | :--- | :--- | +|**`conn`**|`struct mg_connection *`|The connection over which the data must be sent| +|**`fmt`**|`const char *`|Format string| +|**`...`**|*various*|Parameters as specified in the format string| + +### Return Value + +| Type | Description | +| :--- | :--- | +|`int`|Number of bytes written or an error code| + +### Description + +The function `mg_printf()` can be used to send formatted strings over a connection. The functionality is comparable to the `printf()` family of functions in the standard C library. The function returns **0** when the connection has been closed, **-1** if an error occurred and otherwise the number of bytes written over the connection. Except for the formatting part, the `mg_printf()` function is identical to the function [`mg_write()`](mg_write.md). + +### See Also + +* [`mg_websocket_client_write();`](mg_websocket_client_write.md) +* [`mg_websocket_write();`](mg_websocket_write.md) +* [`mg_write();`](mg_write.md) -- cgit v1.2.3