Pharos
0.7.23
Modern Web Framework & Web App Hosting Service.
Toggle main menu visibility
Loading...
Searching...
No Matches
native_http_response.h
Go to the documentation of this file.
1
/**
2
* @file
3
* @brief Declares native HTTP response writing helpers.
4
*/
5
6
#ifndef PHAROS_NATIVE_HTTP_RESPONSE_H
7
#define PHAROS_NATIVE_HTTP_RESPONSE_H
8
9
#include "
native_connection.h
"
10
11
/** @name HTTP response helpers
12
* @{
13
*/
14
/**
15
* @brief Writes formatted bytes to a native connection.
16
* @param connection Connection to write to.
17
* @param format printf-style format string.
18
* @param ... Format arguments.
19
* @return Result of the underlying connection write, or -1 on formatting or allocation failure.
20
*/
21
int
native_connection_printf
(
NativeConnection
*connection,
const
char
*format, ...);
22
/**
23
* @brief Sends a plain-text HTTP response with explicit content length.
24
* @param connection Connection to write to.
25
* @param status Numeric HTTP status code.
26
* @param status_text HTTP reason phrase.
27
* @param body Plain-text response body.
28
*/
29
void
native_send_text_response
(
NativeConnection
*connection,
int
status,
const
char
*status_text,
const
char
*body);
30
31
/** @} */
32
#endif
native_connection.h
Declares the native connection abstraction and transport metadata helpers.
native_send_text_response
void native_send_text_response(NativeConnection *connection, int status, const char *status_text, const char *body)
Sends a plain-text HTTP response with explicit content length.
Definition
native_http_response.c:40
native_connection_printf
int native_connection_printf(NativeConnection *connection, const char *format,...)
Writes formatted bytes to a native connection.
Definition
native_http_response.c:13
NativeConnection
Accepted client connection and its resolved transport metadata.
Definition
native_connection.h:24
src
native_runtime
c
native_http_response.h
Generated by
1.17.0