r3/include/match_entry.h
2014-06-01 16:48:54 +08:00

44 lines
854 B
C

/*
* match_entry.h
* Copyright (C) 2014 c9s <c9s@c9smba.local>
*
* Distributed under terms of the MIT license.
*/
#ifndef MATCH_ENTRY_H
#define MATCH_ENTRY_H
#include "r3_define.h"
#include "str_array.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
str_array * vars;
const char * path; // current path to dispatch
int path_len; // the length of the current path
int request_method; // current request method
void * data; // route ptr
char * host; // the request host
int host_len;
char * remote_addr;
int remote_addr_len;
} match_entry;
match_entry * match_entry_createl(const char * path, int path_len);
#define match_entry_create(path) match_entry_createl(path,strlen(path))
void match_entry_free(match_entry * entry);
#ifdef __cplusplus
}
#endif
#endif /* !MATCH_ENTRY_H */