]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
added extern C crap
authorMoises Silva <moy@sangoma.com>
Tue, 17 Nov 2009 20:49:41 +0000 (20:49 +0000)
committerMoises Silva <moy@sangoma.com>
Tue, 17 Nov 2009 20:49:41 +0000 (20:49 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@880 a93c3328-9c30-0410-af19-c9cd2b2d52af

14 files changed:
libs/freetdm/src/include/fsk.h
libs/freetdm/src/include/hashtable.h
libs/freetdm/src/include/hashtable_itr.h
libs/freetdm/src/include/hashtable_private.h
libs/freetdm/src/include/openzap.h
libs/freetdm/src/include/uart.h
libs/freetdm/src/include/zap_buffer.h
libs/freetdm/src/include/zap_config.h
libs/freetdm/src/include/zap_dso.h
libs/freetdm/src/include/zap_m3ua.h
libs/freetdm/src/include/zap_threadmutex.h
libs/freetdm/src/include/zap_types.h
libs/freetdm/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
libs/freetdm/src/ozmod/ozmod_sangoma_boost/sangoma_boost_interface.h

index b098444d0397c3db6f32e42eec18c0d63c4c4d42..66da140df99ef286d03d872eece0ff361796cade 100644 (file)
 #define        __FSK_H__
 #include "uart.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct {
     int freq_space;            /* Frequency of the 0 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);
 
 extern fsk_modem_definition_t fsk_modem_definitions[];
 
+#ifdef __cplusplus
+} /* extern C */
+#endif
+
 #endif 
 
index 0d185bbc5beb24978e4a9b948a5d0e6d335f36a0..7a94354d5de5d7632dfb9c4fc65b23eb1481c345 100644 (file)
@@ -9,6 +9,9 @@
 #endif
 #include "openzap.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 struct hashtable;
 struct hashtable_iterator;
 
@@ -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(void) hashtable_this(struct hashtable_iterator *i, const void **key, int *klen, void **val);
 
+#ifdef __cplusplus
+} /* extern C */
+#endif
+
 #endif /* __HASHTABLE_CWC22_H__ */
 
 /*
index 6897ce949c803e98c500dff63cff15b9292eaa83..59b73a5863aa26066a2743f935a657677c50ecbc 100644 (file)
@@ -5,6 +5,9 @@
 #include "hashtable.h"
 #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
  * accessor functions. */
@@ -79,7 +82,9 @@ hashtable_iterator_search(struct hashtable_itr *itr,
                return (hashtable_iterator_search(i,h,k));                                              \
        }
 
-
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __HASHTABLE_ITR_CWC22__*/
 
index 1bb10fd016b8f3a81761b882c9e96a089d968fad..47988d8d8fd5a9fa56d4745eca1b3e38b4159222 100644 (file)
@@ -5,7 +5,9 @@
 
 #include "hashtable.h"
 
-
+#ifdef __cplusplus
+extern "C" {
+#endif
 /*****************************************************************************/
 
 struct entry
@@ -56,6 +58,9 @@ indexFor(unsigned int tablelength, unsigned int hashvalue) {
 #define freekey(X) free(X)
 /*define freekey(X) ; */
 
+#ifdef __cplusplus
+}
+#endif
 
 /*****************************************************************************/
 
index 7c5280e0ee6982978f5085814c10bebe3b91f032..4547951cd3cbb1980ecff04e53e8bb9e1955285a 100644 (file)
        } 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 ) { \
                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)) {                                     \
@@ -323,6 +317,16 @@ typedef enum {
 */
 #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 {
        zap_stream_handle_write_function_t 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)
        zap_mutex_unlock(span->mutex);
 }
 
+#ifdef __cplusplus
+} /* extern C */
+#endif
+
 #endif
 
 /* For Emacs:
index 89c3a13abcefe35c50ee274c9cecbb6178f9e541..b1b04c09a47cf2add388de1d256a0acbd45e0ae1 100644 (file)
 #ifndef        __UART_H__
 #define        __UART_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void (*bytehandler_func_t) (void *, int);
 typedef void (*bithandler_func_t) (void *, int);
 
@@ -72,5 +76,8 @@ void                                  dsp_uart_destroy(dsp_uart_handle_t **handle);
 
 void                                   dsp_uart_bit_handler(void *handle, int bit);
 
+#ifdef __cplusplus
+}
+#endif
 #endif
 
index 9a05420979971ca5f529f54390473cf115c980a2..03d4caae113bbe9504014f365de93d89d358827a 100644 (file)
 
 #include "openzap.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @defgroup zap_buffer Buffer Routines
  * @ingroup buffer
@@ -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);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 /* For Emacs:
  * Local Variables:
index f2f2e374bfdc23b5df2a6e3579a60377be7ffffa..d961700ea4d6024e260f54993e2efce64f286b98 100644 (file)
 #define zap_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR))
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct zap_config zap_config_t;
 
 /*! \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);
 */
 OZ_DECLARE (int) zap_config_get_cas_bits(char *strvalue, unsigned char *outbits);
 
+#ifdef __cplusplus
+}
+#endif
 
 /** @} */
 #endif
index bf51f92b184bda5e95dcd4a88b852c96ede6f89c..9cfe87e962951eeb2df22e310754dec30ab52786 100644 (file)
 #ifndef _ZAP_DSO_H
 #define _ZAP_DSO_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef void (*zap_func_ptr_t) (void);
 typedef void * zap_dso_lib_t;
 
@@ -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);
 void *zap_dso_func_sym(zap_dso_lib_t lib, const char *sym, char **err);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif
 
index 18de6db838bb3f6f58c43469a8f3b70d3f80253e..c06d112093cd1a891a35efe0c0afed62359dd263 100644 (file)
 
 //#include "m3ua_client.h"
 #include "openzap.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 enum   e_sigboost_event_id_values
 {
        SIGBOOST_EVENT_CALL_START                       = 0x80, /*128*/
@@ -113,7 +117,9 @@ zap_status_t m3ua_init(zap_io_interface_t **zint);
 zap_status_t m3ua_destroy(void);
 zap_status_t m3ua_start(zap_span_t *span);
 
-
+#ifdef __cplusplus
+}
+#endif
 
 /* For Emacs:
  * Local Variables:
index f131c48cf0fcb3de076601b276eb48e8625d584d..488dca1c4265f7cf0869706964439ad6e87403d6 100644 (file)
@@ -27,6 +27,9 @@
 
 #include "openzap.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 typedef struct zap_mutex zap_mutex_t;
 typedef struct zap_thread zap_thread_t;
 typedef struct zap_condition zap_condition_t;
@@ -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_wait(zap_condition_t *cond, int ms);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
 /* For Emacs:
index b415ecfb31899318b34a844b063fbe0266771da1..5833e6401aded20d413d356e658f7221f789e29f 100644 (file)
@@ -63,6 +63,9 @@ typedef ssize_t zap_ssize_t;
 typedef int zap_filehandle_t;
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 #define TAG_END NULL
 
 typedef size_t zap_size_t;
@@ -655,6 +658,10 @@ typedef enum {
        ZAP_CAUSE_MEDIA_TIMEOUT = 604
 } zap_call_cause_t;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 
 /* For Emacs:
index 96be901f69a427219c3ea834358128bc2b69b557..0ede9ce653324ba2d15732205940043067d5d0a1 100644 (file)
@@ -1635,7 +1635,7 @@ static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(zap_sangoma_boost_configure_span)
 
                        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);
                        snprintf(span->last_error, sizeof(span->last_error), "Failed to read Sangoma boost signaling module interface '%s': %s", path, err);
 
index 4d91f86a05e7b07445a739b76dc5c65d0bd13c31..78e1655d607f7070fa0d2a0db58cfb200567a881 100644 (file)
@@ -35,7 +35,7 @@
 #ifndef 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
@@ -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)
 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
@@ -169,7 +169,8 @@ typedef struct boost_sigmod_interface_s {
        void *pvt;
 } 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 */
 #define BOOST_INTERFACE boost_sigmod_interface_t BOOST_INTERFACE_NAME
 #endif