Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs3-24sp
solo04
Commits
e2badeeb
Commit
e2badeeb
authored
1 year ago
by
Yakov Shalunov
Browse files
Options
Download
Email Patches
Plain Diff
Actually add router.c
parent
15f3929d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/router.c
+40
-0
library/router.c
with
40 additions
and
0 deletions
+40
-0
library/router.c
0 → 100644
View file @
e2badeeb
#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
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment