r3/include/match_entry.h

36 lines
786 B
C
Raw Normal View History

2014-05-28 09:02:57 -04:00
/*
* 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
2014-05-28 09:08:06 -04:00
#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;
2014-05-28 09:02:57 -04:00
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 */