diff --git a/include/match_entry.h b/include/match_entry.h index 9956dbd..bda1dd3 100644 --- a/include/match_entry.h +++ b/include/match_entry.h @@ -11,6 +11,10 @@ #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 @@ -19,7 +23,7 @@ typedef struct { void * data; // route ptr - char * host; // the request host + char * host; // the request host int host_len; 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); +#ifdef __cplusplus +} +#endif + #endif /* !MATCH_ENTRY_H */ diff --git a/include/r3.h b/include/r3.h index 9b5be9b..aad44d9 100644 --- a/include/r3.h +++ b/include/r3.h @@ -16,6 +16,10 @@ #include "str_array.h" #include "match_entry.h" +#ifdef __cplusplus +extern "C" { +#endif + struct _edge; struct _node; 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 }; - - +#ifdef __cplusplus +} +#endif #endif /* !R3_NODE_H */