webc v0.0.11
Write and deploy websites using the C Programming Language.
Loading...
Searching...
No Matches
webc-actions.h
Go to the documentation of this file.
1
31#ifndef WEBCACTIONS_H
32#define WEBCACTIONS_H
33
34#include "extern/httpd.h"
35#define CLIB_IMPLEMENTATION
36#include "extern/clib.h"
37#include "webc-core.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
43typedef struct {
44 Bool export;
45 Bool serve_static;
46 Bool serve_dynamic;
47 Bool serve_exported_static;
48 int daemon_action;
49 int port;
50 char* root;
51 char* ip;
53
54typedef struct {
55 char* path;
56 char* buffer;
57} Route;
58
59typedef struct {
60 Cstr root;
61 Route** routes;
62 size_t count;
63 size_t capacity;
64} Tree;
65
74WEBCAPI Route* WEBC_MakeRoute(Cstr path, char* buffer);
75
85WEBCAPI Tree WEBC_MakeTree(Cstr root, Route* first, ...);
86
95WEBCAPI Tree WEBC_AllocTree(Cstr root, size_t capacity);
96
103WEBCAPI void WEBC_AddRoute(Tree* tree, Route* route);
104
110WEBCAPI void WEBC_CleanRoute(Route* route);
111
117WEBCAPI void WEBC_CleanTree(Tree tree);
118
127WEBCAPI WebcAction WEBC_ParseCliArgs(int argc, char** argv);
128
135WEBCAPI void WEBC_HandleAction(WebcAction action, Tree tree);
136
143WEBCAPI void WEBC_Export(char* buffer, Cstr path);
144
150WEBCAPI void WEBC_ExportRoute(Route route);
151
157WEBCAPI void WEBC_ExportTree(Tree tree);
158
159#ifdef __cplusplus
160}
161#endif
162
163#endif // WEBCACTIONS_H
Definition webc-actions.h:54
Definition webc-actions.h:59
Definition webc-actions.h:43
WEBCAPI void WEBC_CleanTree(Tree tree)
WEBCAPI void WEBC_AddRoute(Tree *tree, Route *route)
WEBCAPI Tree WEBC_AllocTree(Cstr root, size_t capacity)
WEBCAPI void WEBC_CleanRoute(Route *route)
WEBCAPI Route * WEBC_MakeRoute(Cstr path, char *buffer)
WEBCAPI WebcAction WEBC_ParseCliArgs(int argc, char **argv)
WEBCAPI void WEBC_Export(char *buffer, Cstr path)
WEBCAPI void WEBC_ExportTree(Tree tree)
WEBCAPI Tree WEBC_MakeTree(Cstr root, Route *first,...)
WEBCAPI void WEBC_ExportRoute(Route route)
WEBCAPI void WEBC_HandleAction(WebcAction action, Tree tree)