webc v0.0.11
Write and deploy websites using the C Programming Language.
Loading...
Searching...
No Matches
webc-server.h
Go to the documentation of this file.
1
31#ifndef WEBCSERVER_H
32#define WEBCSERVER_H
33
34#include "webc-actions.h"
35#include "webc-core.h"
36#define HTTPD_IMPLEMENTATION
37#include "extern/httpd.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43typedef union {
44 int (*serve_tree)(Cstr, int, Tree);
45 int (*serve_root)(Cstr, int, Cstr);
46} WEBCServe;
47
56WEBCAPI int WEBC_ServeExported(Cstr ip, int port, Tree tree);
57
66WEBCAPI int WEBC_ServeExportedRoot(Cstr ip, int port, Cstr root);
67
76WEBCAPI int WEBC_ServeTree(Cstr ip, int port, Tree tree);
77
81WEBCAPI void WEBC_Daemon(DaemonAction action, WEBCServe serve, Cstr ip, int port, Cstr root, Tree tree);
82
83// HTTPD Extensions
84response_t* response_tree(request_t request, Tree tree);
85int run_server_tree(server_t server, Tree tree);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif // WEBCSERVER_H
92
Definition webc-actions.h:59
Definition webc-server.h:43
WEBCAPI int WEBC_ServeTree(Cstr ip, int port, Tree tree)
WEBCAPI void WEBC_Daemon(DaemonAction action, WEBCServe serve, Cstr ip, int port, Cstr root, Tree tree)
WEBCAPI int WEBC_ServeExported(Cstr ip, int port, Tree tree)
WEBCAPI int WEBC_ServeExportedRoot(Cstr ip, int port, Cstr root)