r3/include/match_entry.h
2014-05-28 21:08:06 +08:00

35 lines
786 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"
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);
#endif /* !MATCH_ENTRY_H */