Commit e2badeeb authored by Yakov Shalunov's avatar Yakov Shalunov
Browse files

Actually add router.c

parent 15f3929d
Showing with 40 additions and 0 deletions
+40 -0
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <stdbool.h>
#include <string.h>
#include "router.h"
typedef struct route {
char *path;
route_handler_t handler;
} route_t;
struct router {
route_handler_t fallback;
size_t max_routes;
size_t num_routes;
route_t routes[];
};
router_t *router_init(size_t max_routes, route_handler_t fallback) {
(void) max_routes;
(void) fallback;
return NULL;
}
void router_register(router_t *router, const char *path, route_handler_t handler) {
(void) router;
(void) path;
(void) handler;
}
bytes_t *router_dispatch(router_t *router, request_t *request) {
(void) router;
(void) request;
return NULL;
}
void router_free(router_t *router) {
(void) router;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment