Add extern "C".

This commit is contained in:
whitglint 2014-06-01 16:48:54 +08:00
parent b139d8d3f2
commit 9417bc76eb
2 changed files with 16 additions and 3 deletions

View file

@ -11,6 +11,10 @@
#include "r3_define.h" #include "r3_define.h"
#include "str_array.h" #include "str_array.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { typedef struct {
str_array * vars; str_array * vars;
const char * path; // current path to dispatch const char * path; // current path to dispatch
@ -19,7 +23,7 @@ typedef struct {
void * data; // route ptr void * data; // route ptr
char * host; // the request host char * host; // the request host
int host_len; int host_len;
char * remote_addr; char * remote_addr;
@ -32,4 +36,8 @@ match_entry * match_entry_createl(const char * path, int path_len);
void match_entry_free(match_entry * entry); void match_entry_free(match_entry * entry);
#ifdef __cplusplus
}
#endif
#endif /* !MATCH_ENTRY_H */ #endif /* !MATCH_ENTRY_H */

View file

@ -16,6 +16,10 @@
#include "str_array.h" #include "str_array.h"
#include "match_entry.h" #include "match_entry.h"
#ifdef __cplusplus
extern "C" {
#endif
struct _edge; struct _edge;
struct _node; struct _node;
struct _route; struct _route;
@ -170,7 +174,8 @@ enum { NODE_COMPARE_STR, NODE_COMPARE_PCRE, NODE_COMPARE_OPCODE };
enum { OP_EXPECT_MORE_DIGITS = 1, OP_EXPECT_MORE_WORDS, OP_EXPECT_NOSLASH, OP_EXPECT_NODASH, OP_EXPECT_MORE_ALPHA }; enum { OP_EXPECT_MORE_DIGITS = 1, OP_EXPECT_MORE_WORDS, OP_EXPECT_NOSLASH, OP_EXPECT_NODASH, OP_EXPECT_MORE_ALPHA };
#ifdef __cplusplus
}
#endif
#endif /* !R3_NODE_H */ #endif /* !R3_NODE_H */