[ADD/WIP] Routerwerk!

This commit is contained in:
LDA 2024-06-12 23:27:36 +02:00
commit 47c98cbbe3
8 changed files with 280 additions and 1 deletions

20
src/include/Routes.h Normal file
View file

@ -0,0 +1,20 @@
#ifndef PARSEE_ROUTES_H
#define PARSEE_ROUTES_H
#include <Parsee.h>
typedef struct ParseeHttpArg {
ParseeData *data;
HttpServerContext *ctx;
Stream *stream;
} ParseeHttpArg;
/* A list of all routes. */
#define ROUTES X_ROUTE("/", RouteRoot)
#define X_ROUTE(path, name) extern void * name(Array *, void *);
ROUTES
#undef X_ROUTE
#define RouteHead(name, pathargs, argp) void * \
name(Array * pathargs, void *argp)
#endif