]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/docs/api/mg_printf.md
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / civetweb / docs / api / mg_printf.md
1 # Civetweb API Reference
2
3 ### `mg_printf( conn, fmt, ... );`
4
5 ### Parameters
6
7 | Parameter | Type | Description |
8 | :--- | :--- | :--- |
9 |**`conn`**|`struct mg_connection *`|The connection over which the data must be sent|
10 |**`fmt`**|`const char *`|Format string|
11 |**`...`**|*various*|Parameters as specified in the format string|
12
13 ### Return Value
14
15 | Type | Description |
16 | :--- | :--- |
17 |`int`|Number of bytes written or an error code|
18
19 ### Description
20
21 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).
22
23 ### See Also
24
25 * [`mg_websocket_client_write();`](mg_websocket_client_write.md)
26 * [`mg_websocket_write();`](mg_websocket_write.md)
27 * [`mg_write();`](mg_write.md)