Simple example showing how to use the router feature.
#include <stdlib.h>
#include <stdio.h>
static void route_cb(
void *cls,
struct sg_route *route) {
fprintf(stdout,
"%s: %s\n",
sg_route_path(route), (
const char *) cls);
fflush(stdout);
}
int main(void) {
return EXIT_SUCCESS;
}
int sg_router_dispatch(struct sg_router *router, const char *path, void *user_data)
int sg_routes_cleanup(struct sg_route **routes)
const char * sg_route_path(struct sg_route *route)
struct sg_router * sg_router_new(struct sg_route *routes) __attribute__((malloc))
bool sg_routes_add(struct sg_route **routes, const char *pattern, sg_route_cb cb, void *cls)
void sg_router_free(struct sg_router *router)