feat: declared http functions that will be available later and fixed a header typo inside logs.c

This commit is contained in:
Gu://em_ 2025-11-21 20:10:26 +01:00
parent 5e609624a0
commit ce61a21dad
3 changed files with 41 additions and 1 deletions

View file

@ -0,0 +1,10 @@
#include "http.h"
struct http_request *parse_request(struct string *req)
{}
struct http_response *generate_response(struct http_request *req)
{}
struct string *format_response(struct http_response *resp)
{}

View file

@ -45,5 +45,35 @@ struct http_response
struct http_header *headers; // Headers linked list struct http_header *headers; // Headers linked list
}; };
// === Functions
/* @brief Parses the HTTP request and splits it into a request structure
*
* @params req
*
* @return A pointer to the structure containing the request infos on success,
* NULL otherwise
*/
struct http_request* parse_request(struct string* req);
/* @brief Generates a response to the given request
*
* @params req
*
* @return A pointer to the generated response struct on success,
* NULL otherwise
*/
struct http_response* generate_response(struct http_request* req);
/* @brief Formats the given response structure into a valid HTTP response
* string
*
* @params resp
*
* @return A pointer to the string containing the response on success,
* NULL otherwise
*/
struct string* format_response(struct http_response* resp);
#endif // ! HTTP_H #endif // ! HTTP_H

View file

@ -5,7 +5,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "../utils/fmt_time/fmt_time.h" #include "../utils/time/fmt_time.h"
// === Static variables // === Static variables