ANY constant

This commit is contained in:
overflowerror 2017-01-02 00:43:53 +01:00
parent e131a268ea
commit ca6461c623
2 changed files with 6 additions and 2 deletions

View file

@ -63,8 +63,8 @@ webserver_t server = ws_create("server_name", NULL, "8080", stderr, options);
Now you can add you handlers.
```c
handle_t handle = {
.host = NULL, // the host to listen on (NULL means any)
.path = "/*.c", // yes, you can use wildcards (NULL still means any)
.host = ANY, // the hostname to listen on (ANY can be used)
.path = "/*.c", // yes, you can use wildcards (ANY can still be used)
.handler = &not_found // function pointer of the handler
};
ws_handle_add(&server, handle);

View file

@ -9,6 +9,8 @@
#define WS_VERSION "0.1"
#define WS_NAME "SERWER"
typedef struct header {
const char* key;
const char* value;
@ -29,6 +31,8 @@ typedef int loglevel_t;
#define LOG_WARN 2
#define LOG_ERROR 0
#define ANY NULL
typedef enum method {
OPTIONS,
GET,