提交 5a2bb60b authored 作者: Moises Silva's avatar Moises Silva

added extern C crap

git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@880 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 c1ee86a0
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#define __FSK_H__ #define __FSK_H__
#include "uart.h" #include "uart.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct { typedef struct {
int freq_space; /* Frequency of the 0 bit */ int freq_space; /* Frequency of the 0 bit */
int freq_mark; /* Frequency of the 1 bit */ int freq_mark; /* Frequency of the 1 bit */
...@@ -109,5 +113,9 @@ void dsp_fsk_sample(dsp_fsk_handle_t *handle, double normalized_sample); ...@@ -109,5 +113,9 @@ void dsp_fsk_sample(dsp_fsk_handle_t *handle, double normalized_sample);
extern fsk_modem_definition_t fsk_modem_definitions[]; extern fsk_modem_definition_t fsk_modem_definitions[];
#ifdef __cplusplus
} /* extern C */
#endif
#endif #endif
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#endif #endif
#include "openzap.h" #include "openzap.h"
#ifdef __cplusplus
extern "C" {
#endif
struct hashtable; struct hashtable;
struct hashtable_iterator; struct hashtable_iterator;
...@@ -181,6 +184,10 @@ OZ_DECLARE(struct hashtable_iterator*) hashtable_first(struct hashtable *h); ...@@ -181,6 +184,10 @@ OZ_DECLARE(struct hashtable_iterator*) hashtable_first(struct hashtable *h);
OZ_DECLARE(struct hashtable_iterator*) hashtable_next(struct hashtable_iterator *i); OZ_DECLARE(struct hashtable_iterator*) hashtable_next(struct hashtable_iterator *i);
OZ_DECLARE(void) hashtable_this(struct hashtable_iterator *i, const void **key, int *klen, void **val); OZ_DECLARE(void) hashtable_this(struct hashtable_iterator *i, const void **key, int *klen, void **val);
#ifdef __cplusplus
} /* extern C */
#endif
#endif /* __HASHTABLE_CWC22_H__ */ #endif /* __HASHTABLE_CWC22_H__ */
/* /*
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
#include "hashtable.h" #include "hashtable.h"
#include "hashtable_private.h" /* needed to enable inlining */ #include "hashtable_private.h" /* needed to enable inlining */
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************/ /*****************************************************************************/
/* This struct is only concrete here to allow the inlining of two of the /* This struct is only concrete here to allow the inlining of two of the
* accessor functions. */ * accessor functions. */
...@@ -79,7 +82,9 @@ hashtable_iterator_search(struct hashtable_itr *itr, ...@@ -79,7 +82,9 @@ hashtable_iterator_search(struct hashtable_itr *itr,
return (hashtable_iterator_search(i,h,k)); \ return (hashtable_iterator_search(i,h,k)); \
} }
#ifdef __cplusplus
}
#endif
#endif /* __HASHTABLE_ITR_CWC22__*/ #endif /* __HASHTABLE_ITR_CWC22__*/
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
#include "hashtable.h" #include "hashtable.h"
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************/ /*****************************************************************************/
struct entry struct entry
...@@ -56,6 +58,9 @@ indexFor(unsigned int tablelength, unsigned int hashvalue) { ...@@ -56,6 +58,9 @@ indexFor(unsigned int tablelength, unsigned int hashvalue) {
#define freekey(X) free(X) #define freekey(X) free(X)
/*define freekey(X) ; */ /*define freekey(X) ; */
#ifdef __cplusplus
}
#endif
/*****************************************************************************/ /*****************************************************************************/
......
...@@ -297,12 +297,6 @@ ...@@ -297,12 +297,6 @@
} while(0); } while(0);
typedef enum {
ZAP_STATE_CHANGE_FAIL,
ZAP_STATE_CHANGE_SUCCESS,
ZAP_STATE_CHANGE_SAME,
} zap_state_change_result_t;
#define zap_set_state_r(obj, s, l, r) if ( obj->state == s ) { \ #define zap_set_state_r(obj, s, l, r) if ( obj->state == s ) { \
zap_log(ZAP_LOG_WARNING, "Why bother changing state on %d:%d from %s to %s\n", obj->span_id, obj->chan_id, zap_channel_state2str(obj->state), zap_channel_state2str(s)); r = ZAP_STATE_CHANGE_SAME; \ zap_log(ZAP_LOG_WARNING, "Why bother changing state on %d:%d from %s to %s\n", obj->span_id, obj->chan_id, zap_channel_state2str(obj->state), zap_channel_state2str(s)); r = ZAP_STATE_CHANGE_SAME; \
} else if (zap_test_flag(obj, ZAP_CHANNEL_READY)) { \ } else if (zap_test_flag(obj, ZAP_CHANNEL_READY)) { \
...@@ -323,6 +317,16 @@ typedef enum { ...@@ -323,6 +317,16 @@ typedef enum {
*/ */
#define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags)) #define zap_copy_flags(dest, src, flags) (dest)->flags &= ~(flags); (dest)->flags |= ((src)->flags & (flags))
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ZAP_STATE_CHANGE_FAIL,
ZAP_STATE_CHANGE_SUCCESS,
ZAP_STATE_CHANGE_SAME,
} zap_state_change_result_t;
struct zap_stream_handle { struct zap_stream_handle {
zap_stream_handle_write_function_t write_function; zap_stream_handle_write_function_t write_function;
zap_stream_handle_raw_write_function_t raw_write_function; zap_stream_handle_raw_write_function_t raw_write_function;
...@@ -851,6 +855,10 @@ static __inline__ void zap_clear_flag_all(zap_span_t *span, uint32_t flag) ...@@ -851,6 +855,10 @@ static __inline__ void zap_clear_flag_all(zap_span_t *span, uint32_t flag)
zap_mutex_unlock(span->mutex); zap_mutex_unlock(span->mutex);
} }
#ifdef __cplusplus
} /* extern C */
#endif
#endif #endif
/* For Emacs: /* For Emacs:
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
#ifndef __UART_H__ #ifndef __UART_H__
#define __UART_H__ #define __UART_H__
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*bytehandler_func_t) (void *, int); typedef void (*bytehandler_func_t) (void *, int);
typedef void (*bithandler_func_t) (void *, int); typedef void (*bithandler_func_t) (void *, int);
...@@ -72,5 +76,8 @@ void dsp_uart_destroy(dsp_uart_handle_t **handle); ...@@ -72,5 +76,8 @@ void dsp_uart_destroy(dsp_uart_handle_t **handle);
void dsp_uart_bit_handler(void *handle, int bit); void dsp_uart_bit_handler(void *handle, int bit);
#ifdef __cplusplus
}
#endif
#endif #endif
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
#include "openzap.h" #include "openzap.h"
#ifdef __cplusplus
extern "C" {
#endif
/** /**
* @defgroup zap_buffer Buffer Routines * @defgroup zap_buffer Buffer Routines
* @ingroup buffer * @ingroup buffer
...@@ -133,6 +137,10 @@ OZ_DECLARE(zap_size_t) zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen) ...@@ -133,6 +137,10 @@ OZ_DECLARE(zap_size_t) zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen)
OZ_DECLARE(zap_size_t) zap_buffer_zwrite(zap_buffer_t *buffer, const void *data, zap_size_t datalen); OZ_DECLARE(zap_size_t) zap_buffer_zwrite(zap_buffer_t *buffer, const void *data, zap_size_t datalen);
#ifdef __cplusplus
}
#endif
#endif #endif
/* For Emacs: /* For Emacs:
* Local Variables: * Local Variables:
......
...@@ -70,6 +70,10 @@ ...@@ -70,6 +70,10 @@
#define zap_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR)) #define zap_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR))
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct zap_config zap_config_t; typedef struct zap_config zap_config_t;
/*! \brief A simple file handle representing an open configuration file **/ /*! \brief A simple file handle representing an open configuration file **/
...@@ -123,6 +127,9 @@ int zap_config_next_pair(zap_config_t * cfg, char **var, char **val); ...@@ -123,6 +127,9 @@ int zap_config_next_pair(zap_config_t * cfg, char **var, char **val);
*/ */
OZ_DECLARE (int) zap_config_get_cas_bits(char *strvalue, unsigned char *outbits); OZ_DECLARE (int) zap_config_get_cas_bits(char *strvalue, unsigned char *outbits);
#ifdef __cplusplus
}
#endif
/** @} */ /** @} */
#endif #endif
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#ifndef _ZAP_DSO_H #ifndef _ZAP_DSO_H
#define _ZAP_DSO_H #define _ZAP_DSO_H
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*zap_func_ptr_t) (void); typedef void (*zap_func_ptr_t) (void);
typedef void * zap_dso_lib_t; typedef void * zap_dso_lib_t;
...@@ -28,6 +32,9 @@ void zap_dso_destroy(zap_dso_lib_t *lib); ...@@ -28,6 +32,9 @@ void zap_dso_destroy(zap_dso_lib_t *lib);
zap_dso_lib_t zap_dso_open(const char *path, char **err); zap_dso_lib_t zap_dso_open(const char *path, char **err);
void *zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err); void *zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err);
#ifdef __cplusplus
}
#endif
#endif #endif
......
...@@ -39,6 +39,10 @@ ...@@ -39,6 +39,10 @@
//#include "m3ua_client.h" //#include "m3ua_client.h"
#include "openzap.h" #include "openzap.h"
#ifdef __cplusplus
extern "C" {
#endif
enum e_sigboost_event_id_values enum e_sigboost_event_id_values
{ {
SIGBOOST_EVENT_CALL_START = 0x80, /*128*/ SIGBOOST_EVENT_CALL_START = 0x80, /*128*/
...@@ -113,7 +117,9 @@ zap_status_t m3ua_init(zap_io_interface_t **zint); ...@@ -113,7 +117,9 @@ zap_status_t m3ua_init(zap_io_interface_t **zint);
zap_status_t m3ua_destroy(void); zap_status_t m3ua_destroy(void);
zap_status_t m3ua_start(zap_span_t *span); zap_status_t m3ua_start(zap_span_t *span);
#ifdef __cplusplus
}
#endif
/* For Emacs: /* For Emacs:
* Local Variables: * Local Variables:
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#include "openzap.h" #include "openzap.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct zap_mutex zap_mutex_t; typedef struct zap_mutex zap_mutex_t;
typedef struct zap_thread zap_thread_t; typedef struct zap_thread zap_thread_t;
typedef struct zap_condition zap_condition_t; typedef struct zap_condition zap_condition_t;
...@@ -45,6 +48,10 @@ OZ_DECLARE(zap_status_t) zap_condition_destroy(zap_condition_t **cond); ...@@ -45,6 +48,10 @@ OZ_DECLARE(zap_status_t) zap_condition_destroy(zap_condition_t **cond);
OZ_DECLARE(zap_status_t) zap_condition_signal(zap_condition_t *cond); OZ_DECLARE(zap_status_t) zap_condition_signal(zap_condition_t *cond);
OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *cond, int ms); OZ_DECLARE(zap_status_t) zap_condition_wait(zap_condition_t *cond, int ms);
#ifdef __cplusplus
}
#endif
#endif #endif
/* For Emacs: /* For Emacs:
......
...@@ -63,6 +63,9 @@ typedef ssize_t zap_ssize_t; ...@@ -63,6 +63,9 @@ typedef ssize_t zap_ssize_t;
typedef int zap_filehandle_t; typedef int zap_filehandle_t;
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#define TAG_END NULL #define TAG_END NULL
typedef size_t zap_size_t; typedef size_t zap_size_t;
...@@ -655,6 +658,10 @@ typedef enum { ...@@ -655,6 +658,10 @@ typedef enum {
ZAP_CAUSE_MEDIA_TIMEOUT = 604 ZAP_CAUSE_MEDIA_TIMEOUT = 604
} zap_call_cause_t; } zap_call_cause_t;
#ifdef __cplusplus
}
#endif
#endif #endif
/* For Emacs: /* For Emacs:
......
...@@ -1635,7 +1635,7 @@ static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(zap_sangoma_boost_configure_span) ...@@ -1635,7 +1635,7 @@ static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(zap_sangoma_boost_configure_span)
FAIL_CONFIG_RETURN(ZAP_FAIL); FAIL_CONFIG_RETURN(ZAP_FAIL);
} }
if (!(sigmod_iface = (boost_sigmod_interface_t *)zap_dso_func_sym(lib, BOOST_INTERFACE_NAME, &err))) { if (!(sigmod_iface = (boost_sigmod_interface_t *)zap_dso_func_sym(lib, BOOST_INTERFACE_NAME_STR, &err))) {
zap_log(ZAP_LOG_ERROR, "Failed to read Sangoma boost signaling module interface '%s': %s\n", path, err); zap_log(ZAP_LOG_ERROR, "Failed to read Sangoma boost signaling module interface '%s': %s\n", path, err);
snprintf(span->last_error, sizeof(span->last_error), "Failed to read Sangoma boost signaling module interface '%s': %s", path, err); snprintf(span->last_error, sizeof(span->last_error), "Failed to read Sangoma boost signaling module interface '%s': %s", path, err);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#ifndef SANGOMA_BOOST_INTERFACE_H #ifndef SANGOMA_BOOST_INTERFACE_H
#define SANGOMA_BOOST_INTERFACE_H #define SANGOMA_BOOST_INTERFACE_H
#include "zap_types.h" #include "openzap.h"
/*! /*!
\brief Callback used to notify signaling status changes on a channel \brief Callback used to notify signaling status changes on a channel
...@@ -111,7 +111,7 @@ typedef void (*boost_on_hw_link_status_change_t) BOOST_ON_HW_LINK_STATUS_CHANGE_ ...@@ -111,7 +111,7 @@ typedef void (*boost_on_hw_link_status_change_t) BOOST_ON_HW_LINK_STATUS_CHANGE_
*/ */
#define BOOST_SET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t status) #define BOOST_SET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t status)
typedef zap_status_t (*boost_set_sig_status_func_t) BOOST_SET_SIG_STATUS_ARGS; typedef zap_status_t (*boost_set_sig_status_func_t) BOOST_SET_SIG_STATUS_ARGS;
#define BOOST_SET_SIG_STATUS_FUNCTION(name) zap_status_t BOOST_SET_SIG_STATUS_ARGS #define BOOST_SET_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_SET_SIG_STATUS_ARGS
/*! /*!
\brief Configure the given span signaling \brief Configure the given span signaling
...@@ -169,7 +169,8 @@ typedef struct boost_sigmod_interface_s { ...@@ -169,7 +169,8 @@ typedef struct boost_sigmod_interface_s {
void *pvt; void *pvt;
} boost_sigmod_interface_t; } boost_sigmod_interface_t;
#define BOOST_INTERFACE_NAME "boost_sigmod_interface" #define BOOST_INTERFACE_NAME boost_sigmod_interface
#define BOOST_INTERFACE_NAME_STR "boost_sigmod_interface"
/* use this in your sig boost module to declare your interface */ /* use this in your sig boost module to declare your interface */
#define BOOST_INTERFACE boost_sigmod_interface_t BOOST_INTERFACE_NAME #define BOOST_INTERFACE boost_sigmod_interface_t BOOST_INTERFACE_NAME
#endif #endif
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论