diff --git a/include/sntl/connection.h b/include/sntl/connection.h index efb576e..c203dda 100644 --- a/include/sntl/connection.h +++ b/include/sntl/connection.h @@ -41,9 +41,14 @@ #define SEXP_ITERATE_LIST(lst, iter, ind) \ for((ind) = 0, (iter) = (lst)->list; (ind) < sexp_list_length(lst); \ (ind)++, (iter) = (iter)->next) - +#ifdef __cplusplus +extern "C" { +#endif int sexp_list_cdr(sexp_t *expr, sexp_t **sx); int sexp_list_car(sexp_t *expr, sexp_t **sx); +#ifdef __cplusplus +} +#endif #define VERIFY_DEPTH 1 /* FIXME: */ @@ -214,6 +219,9 @@ extern conn_sys_t *conn_sys; /* subsystem */ extern conn_sys_t *conn_sys; +#ifdef __cplusplus +extern "C" { +#endif int connections_subsystem_init(void); @@ -222,17 +230,25 @@ int connections_subsystem_setsslserts(const char *rootca, const char *certpem, int connections_subsystem_setrpclist_function(usrtc_t* (*get_rpc_typed_list_tree)(conn_t *)); +#ifdef __cplusplus +} +#endif + #define connections_subsystem_set_securecheck(c, fuu) (c)->secure_check = fuu #define connections_subsystem_set_sslvalidator(c, fuu) (c)->validate_sslpem = fuu #define connections_subsystem_set_rpctlist_call(c, fuu) (c)->set_typed_list_callback = fuu #define connections_subsystem_set_on_destroy(c, fuu) (c)->on_destroy = fuu /* connection */ +#define connection_create(c, s) connection_create_fapi((c), (s), NULL) +#ifdef __cplusplus +extern "C" { +#endif + int connection_initiate (conn_t *co, const char *host, int port, const char *SSL_cert, perm_ctx_t *pctx); int connection_create_fapi(conn_t *co, int sck, struct in_addr *addr); -#define connection_create(c, s) connection_create_fapi((c), (s), NULL) int connection_close(conn_t *co); @@ -267,6 +283,10 @@ int msg_send_pulse_timed(chnl_t *ch, sexp_t *sx, struct timespec *tio); int msg_send_pulse_nowait(chnl_t *ch, sexp_t *sx); +#ifdef __cplusplus +} +#endif + /* additional functions */ #define sntl_msg_get_secctx(m) (m)->pch->connection->pctx @@ -275,6 +295,10 @@ int msg_send_pulse_nowait(chnl_t *ch, sexp_t *sx); #define SNTL_FILTER_EXC 0xb #define SNTL_FILTER_END -1 +#ifdef __cplusplus +extern "C" { +#endif + int sntl_rpclist_init(usrtc_t *tree); int sntl_rpclist_add(usrtc_t *tree, int type, const char *description, @@ -285,6 +309,10 @@ int sntl_rpclist_add_function(usrtc_t *tree, int type, const char *fu_name, int sntl_rpclist_filter(usrtc_t *source, usrtc_t **dest, int flag, int *filter); +#ifdef __cplusplus +} +#endif + /* for DEBUG purposes */ #define __DBGLINE fprintf(stderr, "%s:%d at %s\n", __FILE__, __LINE__, __FUNCTION__)