mirror of
https://github.com/sigmasternchen/Serwer
synced 2025-03-15 23:28:54 +00:00
ANY constant
This commit is contained in:
parent
e131a268ea
commit
ca6461c623
2 changed files with 6 additions and 2 deletions
|
@ -63,8 +63,8 @@ webserver_t server = ws_create("server_name", NULL, "8080", stderr, options);
|
||||||
Now you can add you handlers.
|
Now you can add you handlers.
|
||||||
```c
|
```c
|
||||||
handle_t handle = {
|
handle_t handle = {
|
||||||
.host = NULL, // the host to listen on (NULL means any)
|
.host = ANY, // the hostname to listen on (ANY can be used)
|
||||||
.path = "/*.c", // yes, you can use wildcards (NULL still means any)
|
.path = "/*.c", // yes, you can use wildcards (ANY can still be used)
|
||||||
.handler = ¬_found // function pointer of the handler
|
.handler = ¬_found // function pointer of the handler
|
||||||
};
|
};
|
||||||
ws_handle_add(&server, handle);
|
ws_handle_add(&server, handle);
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#define WS_VERSION "0.1"
|
#define WS_VERSION "0.1"
|
||||||
#define WS_NAME "SERWER"
|
#define WS_NAME "SERWER"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct header {
|
typedef struct header {
|
||||||
const char* key;
|
const char* key;
|
||||||
const char* value;
|
const char* value;
|
||||||
|
@ -29,6 +31,8 @@ typedef int loglevel_t;
|
||||||
#define LOG_WARN 2
|
#define LOG_WARN 2
|
||||||
#define LOG_ERROR 0
|
#define LOG_ERROR 0
|
||||||
|
|
||||||
|
#define ANY NULL
|
||||||
|
|
||||||
typedef enum method {
|
typedef enum method {
|
||||||
OPTIONS,
|
OPTIONS,
|
||||||
GET,
|
GET,
|
||||||
|
|
Loading…
Reference in a new issue