Name="Debug|Win32"\r
OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="4"\r
+ ConfigurationType="2"\r
CharacterSet="2"\r
BuildLogFile="$(IntDir)\BuildLog-openzap.htm"\r
>\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
AdditionalIncludeDirectories="../src/include;../src/isdn/include"\r
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;OPENZAP_EXPORTS;TELETONE_EXPORTS"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="3"\r
WarningLevel="4"\r
WarnAsError="true"\r
Detect64BitPortabilityProblems="true"\r
- DebugInformationFormat="4"\r
+ DebugInformationFormat="3"\r
CompileAs="1"\r
/>\r
<Tool\r
Name="VCPreLinkEventTool"\r
/>\r
<Tool\r
- Name="VCLibrarianTool"\r
+ Name="VCLinkerTool"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
<Tool\r
Name="VCXDCMakeTool"\r
/>\r
<Tool\r
Name="VCFxCopTool"\r
/>\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
<Tool\r
Name="VCPostBuildEventTool"\r
/>\r
Name="Release|Win32"\r
OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="4"\r
+ ConfigurationType="2"\r
CharacterSet="2"\r
WholeProgramOptimization="1"\r
BuildLogFile="$(IntDir)\BuildLog-openzap.htm"\r
<Tool\r
Name="VCCLCompilerTool"\r
AdditionalIncludeDirectories="../src/include;../src/isdn/include"\r
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;OPENZAP_EXPORTS;TELETONE_EXPORTS"\r
RuntimeLibrary="2"\r
DisableLanguageExtensions="false"\r
RuntimeTypeInfo="false"\r
Name="VCPreLinkEventTool"\r
/>\r
<Tool\r
- Name="VCLibrarianTool"\r
+ Name="VCLinkerTool"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
<Tool\r
Name="VCXDCMakeTool"\r
/>\r
<Tool\r
Name="VCFxCopTool"\r
/>\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebDeploymentTool"\r
+ />\r
<Tool\r
Name="VCPostBuildEventTool"\r
/>\r
Name="Debug|Win32"\r
OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="4"\r
+ ConfigurationType="2"\r
CharacterSet="2"\r
BuildLogFile="$(IntDir)\BuildLog-openzap.htm"\r
>\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
AdditionalIncludeDirectories="../src/include;../src/isdn/include"\r
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;OPENZAP_EXPORTS;TELETONE_EXPORTS"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="3"\r
WarningLevel="4"\r
WarnAsError="true"\r
Detect64BitPortabilityProblems="false"\r
- DebugInformationFormat="4"\r
+ DebugInformationFormat="3"\r
CompileAs="1"\r
/>\r
<Tool\r
Name="VCPreLinkEventTool"\r
/>\r
<Tool\r
- Name="VCLibrarianTool"\r
+ Name="VCLinkerTool"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
<Tool\r
Name="VCXDCMakeTool"\r
/>\r
<Tool\r
Name="VCFxCopTool"\r
/>\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
<Tool\r
Name="VCPostBuildEventTool"\r
/>\r
Name="Release|Win32"\r
OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
IntermediateDirectory="$(ConfigurationName)"\r
- ConfigurationType="4"\r
+ ConfigurationType="2"\r
CharacterSet="2"\r
WholeProgramOptimization="1"\r
BuildLogFile="$(IntDir)\BuildLog-openzap.htm"\r
<Tool\r
Name="VCCLCompilerTool"\r
AdditionalIncludeDirectories="../src/include;../src/isdn/include"\r
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"\r
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;OPENZAP_EXPORTS;TELETONE_EXPORTS"\r
RuntimeLibrary="2"\r
DisableLanguageExtensions="false"\r
RuntimeTypeInfo="false"\r
Name="VCPreLinkEventTool"\r
/>\r
<Tool\r
- Name="VCLibrarianTool"\r
+ Name="VCLinkerTool"\r
/>\r
<Tool\r
Name="VCALinkTool"\r
/>\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
<Tool\r
Name="VCXDCMakeTool"\r
/>\r
<Tool\r
Name="VCFxCopTool"\r
/>\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
<Tool\r
Name="VCPostBuildEventTool"\r
/>\r
#define teletone_assert(expr) assert(expr)
#endif
+#ifdef _MSC_VER
+#if defined(TT_DECLARE_STATIC)
+#define TELETONE_API(type) type __stdcall
+#define TELETONE_API_NONSTD(type) type __cdecl
+#define TELETONE_API_DATA
+#elif defined(TELETONE_EXPORTS)
+#define TELETONE_API(type) __declspec(dllexport) type __stdcall
+#define TELETONE_API_NONSTD(type) __declspec(dllexport) type __cdecl
+#define TELETONE_API_DATA __declspec(dllexport)
+#else
+#define TELETONE_API(type) __declspec(dllimport) type __stdcall
+#define TELETONE_API_NONSTD(type) __declspec(dllimport) type __cdecl
+#define TELETONE_API_DATA __declspec(dllimport)
+#endif
+#else
+#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(HAVE_VISIBILITY)
+#define TELETONE_API(type) __attribute__((visibility("default"))) type
+#define TELETONE_API_NONSTD(type) __attribute__((visibility("default"))) type
+#define TELETONE_API_DATA __attribute__((visibility("default")))
+#else
+#define TELETONE_API(type) type
+#define TELETONE_API_NONSTD(type) type
+#define TELETONE_API_DATA
+#endif
+#endif
+
#include <libteletone_generate.h>
#include <libteletone_detect.h>
* c-basic-offset:4
* End:
* For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
\param mt the multi-frequency tone descriptor
\param map a representation of the multi-frequency tone
*/
- void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *map);
+TELETONE_API(void) teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *map);
/*!
\brief Check a sample buffer for the presence of the mulit-frequency tone described by mt
\param samples the number of samples present in sample_buffer
\return true when the tone was detected or false when it is not
*/
- int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
+TELETONE_API(int) teletone_multi_tone_detect (teletone_multi_tone_t *mt,
int16_t sample_buffer[],
int samples);
\param dtmf_detect_state the DTMF detection state to initilize
\param sample_rate the desired sample rate
*/
- void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate);
+TELETONE_API(void) teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate);
/*!
\brief Check a sample buffer for the presence of DTMF digits
\param samples the number of samples present in sample_buffer
\return true when DTMF was detected or false when it is not
*/
- int teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
+TELETONE_API(int) teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
int16_t sample_buffer[],
int samples);
/*!
\param max the maximum length of buf
\return the number of characters written to buf
*/
- int teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state,
+TELETONE_API(int) teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state,
char *buf,
int max);
\param sample_buffer an array aof 16 bit signed linear samples
\param samples the number of samples present in sample_buffer
*/
- void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
+TELETONE_API(void) teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
int16_t sample_buffer[],
int samples);
* c-basic-offset:4
* End:
* For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
#include <sys/stat.h>
#include <fcntl.h>
#include <math.h>
-#if !defined(powf)
+#if !defined(powf) && !defined(_WIN64)
extern float powf (float, float);
#endif
#include <string.h>
/* 3.02 represents twice the power */
#define DBM0_MAX_POWER (3.14f + 3.02f)
-extern int16_t TELETONE_SINES[SINE_TABLE_MAX];
+TELETONE_API_DATA extern int16_t TELETONE_SINES[SINE_TABLE_MAX];
static __inline__ int32_t teletone_dds_phase_rate(teletone_process_t tone, uint32_t rate)
{
\param ... up to TELETONE_MAX_TONES frequencies terminated by 0.0
\return 0
*/
-int teletone_set_tone(teletone_generation_session_t *ts, int index, ...);
+TELETONE_API(int) teletone_set_tone(teletone_generation_session_t *ts, int index, ...);
/*!
\brief Assign a set of tones to a single tone map
\param ... up to TELETONE_MAX_TONES frequencies terminated by 0.0
\return 0
*/
-int teletone_set_map(teletone_tone_map_t *map, ...);
+TELETONE_API(int) teletone_set_map(teletone_tone_map_t *map, ...);
/*!
\brief Initilize a tone generation session
\param user_data optional user data to send
\return 0
*/
-int teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_handler handler, void *user_data);
+TELETONE_API(int) teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_handler handler, void *user_data);
/*!
\brief Free the buffer allocated by a tone generation session
\param ts the tone generation session to destroy
\return 0
*/
-int teletone_destroy_session(teletone_generation_session_t *ts);
+TELETONE_API(int) teletone_destroy_session(teletone_generation_session_t *ts);
/*!
\brief Execute a single tone generation instruction
\param map the tone mapping to use for the frequencies
\return 0
*/
-int teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *map);
+TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *map);
/*!
\brief Execute a tone generation script and call callbacks after each instruction
\param cmd the script to execute
\return 0
*/
-int teletone_run(teletone_generation_session_t *ts, const char *cmd);
+TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd);
#ifdef __cplusplus
}
* c-basic-offset:4
* End:
* For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
#endif
#ifndef __WINDOWS__
-#if defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)
+#if defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32) || defined(_WIN64)
#define __WINDOWS__
#endif
#endif
+#ifdef _MSC_VER
+#if defined(OZ_DECLARE_STATIC)
+#define OZ_DECLARE(type) type __stdcall
+#define OZ_DECLARE_NONSTD(type) type __cdecl
+#define OZ_DECLARE_DATA
+#elif defined(OPENZAP_EXPORTS)
+#define OZ_DECLARE(type) __declspec(dllexport) type __stdcall
+#define OZ_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
+#define OZ_DECLARE_DATA __declspec(dllexport)
+#else
+#define OZ_DECLARE(type) __declspec(dllimport) type __stdcall
+#define OZ_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
+#define OZ_DECLARE_DATA __declspec(dllimport)
+#endif
+#else
+#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(HAVE_VISIBILITY)
+#define OZ_DECLARE(type) __attribute__((visibility("default"))) type
+#define OZ_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
+#define OZ_DECLARE_DATA __attribute__((visibility("default")))
+#else
+#define OZ_DECLARE(type) type
+#define OZ_DECLARE_NONSTD(type) type
+#define OZ_DECLARE_DATA
+#endif
+#endif
+
#ifdef _MSC_VER
#ifndef __inline__
#define __inline__ __inline
#define ZAP_THREAD_STACKSIZE 240 * 1024
#define ZAP_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL };
-#define ZAP_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type);
+#define ZAP_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) OZ_DECLARE(_TYPE) _FUNC1 (const char *name); OZ_DECLARE(const char *) _FUNC2 (_TYPE type);
#define ZAP_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX) \
- _TYPE _FUNC1 (const char *name) \
+ OZ_DECLARE(_TYPE) _FUNC1 (const char *name) \
{ \
int i; \
_TYPE t = _MAX ; \
\
return t; \
} \
- const char * _FUNC2 (_TYPE type) \
+ OZ_DECLARE(const char *) _FUNC2 (_TYPE type) \
{ \
if (type > _MAX) { \
type = _MAX; \
#include <time.h>
-#ifndef WIN32
+#ifndef __WINDOWS__
#include <sys/time.h>
#endif
#define XX if (0)
-#ifdef WIN32
+#ifdef __WINDOWS__
#define zap_sleep(x) Sleep(x)
#else
#define zap_sleep(x) usleep(x * 1000)
};
-zap_status_t zap_console_stream_raw_write(zap_stream_handle_t *handle, uint8_t *data, zap_size_t datalen);
-zap_status_t zap_console_stream_write(zap_stream_handle_t *handle, const char *fmt, ...);
+OZ_DECLARE_NONSTD(zap_status_t) zap_console_stream_raw_write(zap_stream_handle_t *handle, uint8_t *data, zap_size_t datalen);
+OZ_DECLARE_NONSTD(zap_status_t) zap_console_stream_write(zap_stream_handle_t *handle, const char *fmt, ...);
#define ZAP_CMD_CHUNK_LEN 1024
#define ZAP_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); s.data = malloc(ZAP_CMD_CHUNK_LEN); \
};
-extern zap_logger_t zap_log;
+OZ_DECLARE_DATA extern zap_logger_t zap_log;
struct zap_io_interface {
const char *name;
};
-zap_size_t zap_fsk_modulator_generate_bit(zap_fsk_modulator_t *fsk_trans, int8_t bit, int16_t *buf, zap_size_t buflen);
-int32_t zap_fsk_modulator_generate_carrier_bits(zap_fsk_modulator_t *fsk_trans, uint32_t bits);
-void zap_fsk_modulator_generate_chan_sieze(zap_fsk_modulator_t *fsk_trans);
-void zap_fsk_modulator_send_data(zap_fsk_modulator_t *fsk_trans);
+OZ_DECLARE(zap_size_t) zap_fsk_modulator_generate_bit(zap_fsk_modulator_t *fsk_trans, int8_t bit, int16_t *buf, zap_size_t buflen);
+OZ_DECLARE(int32_t) zap_fsk_modulator_generate_carrier_bits(zap_fsk_modulator_t *fsk_trans, uint32_t bits);
+OZ_DECLARE(void) zap_fsk_modulator_generate_chan_sieze(zap_fsk_modulator_t *fsk_trans);
+OZ_DECLARE(void) zap_fsk_modulator_send_data(zap_fsk_modulator_t *fsk_trans);
#define zap_fsk_modulator_send_all(_it) zap_fsk_modulator_generate_chan_sieze(_it); \
zap_fsk_modulator_generate_carrier_bits(_it, _it->carrier_bits_start); \
zap_fsk_modulator_send_data(_it); \
zap_fsk_modulator_generate_carrier_bits(_it, _it->carrier_bits_stop)
-zap_status_t zap_fsk_modulator_init(zap_fsk_modulator_t *fsk_trans,
+OZ_DECLARE(zap_status_t) zap_fsk_modulator_init(zap_fsk_modulator_t *fsk_trans,
fsk_modem_types_t modem_type,
uint32_t sample_rate,
zap_fsk_data_state_t *fsk_data,
uint32_t chan_sieze_bits,
zap_fsk_write_sample_t write_sample_callback,
void *user_data);
-int8_t zap_bitstream_get_bit(zap_bitstream_t *bsp);
-void zap_bitstream_init(zap_bitstream_t *bsp, uint8_t *data, uint32_t datalen, zap_endian_t endian, uint8_t ss);
-zap_status_t zap_fsk_data_parse(zap_fsk_data_state_t *state, zap_size_t *type, char **data, zap_size_t *len);
-zap_status_t zap_fsk_demod_feed(zap_fsk_data_state_t *state, int16_t *data, size_t samples);
-zap_status_t zap_fsk_demod_destroy(zap_fsk_data_state_t *state);
-int zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, size_t bufsize);
-zap_status_t zap_fsk_data_init(zap_fsk_data_state_t *state, uint8_t *data, uint32_t datalen);
-zap_status_t zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_mdmf_type_t type, const uint8_t *data, uint32_t datalen);
-zap_status_t zap_fsk_data_add_checksum(zap_fsk_data_state_t *state);
-zap_status_t zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number);
-zap_status_t zap_channel_outgoing_call(zap_channel_t *zchan);
-void zap_channel_rotate_tokens(zap_channel_t *zchan);
-void zap_channel_clear_detected_tones(zap_channel_t *zchan);
-void zap_channel_clear_needed_tones(zap_channel_t *zchan);
-zap_status_t zap_channel_get_alarms(zap_channel_t *zchan);
-zap_status_t zap_channel_send_fsk_data(zap_channel_t *zchan, zap_fsk_data_state_t *fsk_data, float db_level);
-zap_status_t zap_channel_clear_token(zap_channel_t *zchan, const char *token);
-zap_status_t zap_channel_add_token(zap_channel_t *zchan, char *token, int end);
-zap_status_t zap_channel_set_state(zap_channel_t *zchan, zap_channel_state_t state, int lock);
-zap_status_t zap_span_load_tones(zap_span_t *span, const char *mapname);
-zap_size_t zap_channel_dequeue_dtmf(zap_channel_t *zchan, char *dtmf, zap_size_t len);
-zap_status_t zap_channel_queue_dtmf(zap_channel_t *zchan, const char *dtmf);
-void zap_channel_flush_dtmf(zap_channel_t *zchan);
-zap_time_t zap_current_time_in_ms(void);
-zap_status_t zap_span_poll_event(zap_span_t *span, uint32_t ms);
-zap_status_t zap_span_next_event(zap_span_t *span, zap_event_t **event);
-zap_status_t zap_span_find(uint32_t id, zap_span_t **span);
-zap_status_t zap_span_create(zap_io_interface_t *zio, zap_span_t **span);
-zap_status_t zap_span_close_all(void);
-zap_status_t zap_span_add_channel(zap_span_t *span, zap_socket_t sockfd, zap_chan_type_t type, zap_channel_t **chan);
-zap_status_t zap_span_set_event_callback(zap_span_t *span, zio_event_cb_t event_callback);
-zap_status_t zap_channel_set_event_callback(zap_channel_t *zchan, zio_event_cb_t event_callback);
-zap_status_t zap_channel_open(uint32_t span_id, uint32_t chan_id, zap_channel_t **zchan);
-zap_status_t zap_channel_open_chan(zap_channel_t *zchan);
-zap_status_t zap_channel_open_any(uint32_t span_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan);
-zap_status_t zap_channel_close(zap_channel_t **zchan);
-zap_status_t zap_channel_done(zap_channel_t *zchan);
-zap_status_t zap_channel_use(zap_channel_t *zchan);
-zap_status_t zap_channel_command(zap_channel_t *zchan, zap_command_t command, void *obj);
-zap_status_t zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t *flags, int32_t to);
-zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *datalen);
-zap_status_t zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t datasize, zap_size_t *datalen);
-zap_status_t zap_channel_add_var(zap_channel_t *zchan, const char *var_name, const char *value);
-const char * zap_channel_get_var(zap_channel_t *zchan, const char *var_name);
-zap_status_t zap_channel_clear_vars(zap_channel_t *zchan);
-zap_status_t zap_global_init(void);
-zap_status_t zap_global_destroy(void);
-void zap_global_set_logger(zap_logger_t logger);
-void zap_global_set_default_logger(int level);
-uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen);
-void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss);
-void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen);
-int zap_hash_equalkeys(void *k1, void *k2);
-uint32_t zap_hash_hashfromstring(void *ky);
-uint32_t zap_running(void);
-zap_status_t zap_channel_complete_state(zap_channel_t *zchan);
-zap_status_t zap_channel_init(zap_channel_t *zchan);
-int zap_load_modules(void);
-zap_status_t zap_unload_modules(void);
-zap_status_t zap_configure_span(const char *type, zap_span_t *span, zio_signal_cb_t sig_cb, ...);
-zap_status_t zap_span_start(zap_span_t *span);
-int zap_load_module(const char *name);
-int zap_load_module_assume(const char *name);
-zap_status_t zap_span_find_by_name(const char *name, zap_span_t **span);
-char *zap_api_execute(const char *type, const char *cmd);
-int zap_vasprintf(char **ret, const char *fmt, va_list ap);
+OZ_DECLARE(int8_t) zap_bitstream_get_bit(zap_bitstream_t *bsp);
+OZ_DECLARE(void) zap_bitstream_init(zap_bitstream_t *bsp, uint8_t *data, uint32_t datalen, zap_endian_t endian, uint8_t ss);
+OZ_DECLARE(zap_status_t) zap_fsk_data_parse(zap_fsk_data_state_t *state, zap_size_t *type, char **data, zap_size_t *len);
+OZ_DECLARE(zap_status_t) zap_fsk_demod_feed(zap_fsk_data_state_t *state, int16_t *data, size_t samples);
+OZ_DECLARE(zap_status_t) zap_fsk_demod_destroy(zap_fsk_data_state_t *state);
+OZ_DECLARE(int) zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, size_t bufsize);
+OZ_DECLARE(zap_status_t) zap_fsk_data_init(zap_fsk_data_state_t *state, uint8_t *data, uint32_t datalen);
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_mdmf_type_t type, const uint8_t *data, uint32_t datalen);
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_checksum(zap_fsk_data_state_t *state);
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number);
+OZ_DECLARE(zap_status_t) zap_channel_outgoing_call(zap_channel_t *zchan);
+OZ_DECLARE(void) zap_channel_rotate_tokens(zap_channel_t *zchan);
+OZ_DECLARE(void) zap_channel_clear_detected_tones(zap_channel_t *zchan);
+OZ_DECLARE(void) zap_channel_clear_needed_tones(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_get_alarms(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_send_fsk_data(zap_channel_t *zchan, zap_fsk_data_state_t *fsk_data, float db_level);
+OZ_DECLARE(zap_status_t) zap_channel_clear_token(zap_channel_t *zchan, const char *token);
+OZ_DECLARE(zap_status_t) zap_channel_add_token(zap_channel_t *zchan, char *token, int end);
+OZ_DECLARE(zap_status_t) zap_channel_set_state(zap_channel_t *zchan, zap_channel_state_t state, int lock);
+OZ_DECLARE(zap_status_t) zap_span_load_tones(zap_span_t *span, const char *mapname);
+OZ_DECLARE(zap_size_t) zap_channel_dequeue_dtmf(zap_channel_t *zchan, char *dtmf, zap_size_t len);
+OZ_DECLARE(zap_status_t) zap_channel_queue_dtmf(zap_channel_t *zchan, const char *dtmf);
+OZ_DECLARE(void) zap_channel_flush_dtmf(zap_channel_t *zchan);
+OZ_DECLARE(zap_time_t) zap_current_time_in_ms(void);
+OZ_DECLARE(zap_status_t) zap_span_poll_event(zap_span_t *span, uint32_t ms);
+OZ_DECLARE(zap_status_t) zap_span_next_event(zap_span_t *span, zap_event_t **event);
+OZ_DECLARE(zap_status_t) zap_span_find(uint32_t id, zap_span_t **span);
+OZ_DECLARE(zap_status_t) zap_span_create(zap_io_interface_t *zio, zap_span_t **span);
+OZ_DECLARE(zap_status_t) zap_span_close_all(void);
+OZ_DECLARE(zap_status_t) zap_span_add_channel(zap_span_t *span, zap_socket_t sockfd, zap_chan_type_t type, zap_channel_t **chan);
+OZ_DECLARE(zap_status_t) zap_span_set_event_callback(zap_span_t *span, zio_event_cb_t event_callback);
+OZ_DECLARE(zap_status_t) zap_channel_set_event_callback(zap_channel_t *zchan, zio_event_cb_t event_callback);
+OZ_DECLARE(zap_status_t) zap_channel_open(uint32_t span_id, uint32_t chan_id, zap_channel_t **zchan);
+OZ_DECLARE(zap_status_t) zap_channel_open_chan(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan);
+OZ_DECLARE(zap_status_t) zap_channel_close(zap_channel_t **zchan);
+OZ_DECLARE(zap_status_t) zap_channel_done(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_use(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_command(zap_channel_t *zchan, zap_command_t command, void *obj);
+OZ_DECLARE(zap_status_t) zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t *flags, int32_t to);
+OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *datalen);
+OZ_DECLARE(zap_status_t) zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t datasize, zap_size_t *datalen);
+OZ_DECLARE(zap_status_t) zap_channel_add_var(zap_channel_t *zchan, const char *var_name, const char *value);
+OZ_DECLARE(const char *) zap_channel_get_var(zap_channel_t *zchan, const char *var_name);
+OZ_DECLARE(zap_status_t) zap_channel_clear_vars(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_global_init(void);
+OZ_DECLARE(zap_status_t) zap_global_destroy(void);
+OZ_DECLARE(void) zap_global_set_logger(zap_logger_t logger);
+OZ_DECLARE(void) zap_global_set_default_logger(int level);
+OZ_DECLARE(uint32_t) zap_separate_string(char *buf, char delim, char **array, int arraylen);
+OZ_DECLARE(void) print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss);
+OZ_DECLARE(void) print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen);
+OZ_DECLARE_NONSTD(int) zap_hash_equalkeys(void *k1, void *k2);
+OZ_DECLARE_NONSTD(uint32_t) zap_hash_hashfromstring(void *ky);
+OZ_DECLARE(uint32_t) zap_running(void);
+OZ_DECLARE(zap_status_t) zap_channel_complete_state(zap_channel_t *zchan);
+OZ_DECLARE(zap_status_t) zap_channel_init(zap_channel_t *zchan);
+OZ_DECLARE(int) zap_load_modules(void);
+OZ_DECLARE(zap_status_t) zap_unload_modules(void);
+OZ_DECLARE(zap_status_t) zap_configure_span(const char *type, zap_span_t *span, zio_signal_cb_t sig_cb, ...);
+OZ_DECLARE(zap_status_t) zap_span_start(zap_span_t *span);
+OZ_DECLARE(int) zap_load_module(const char *name);
+OZ_DECLARE(int) zap_load_module_assume(const char *name);
+OZ_DECLARE(zap_status_t) zap_span_find_by_name(const char *name, zap_span_t **span);
+OZ_DECLARE(char *) zap_api_execute(const char *type, const char *cmd);
+OZ_DECLARE(int) zap_vasprintf(char **ret, const char *fmt, va_list ap);
ZIO_CODEC_FUNCTION(zio_slin2ulaw);
ZIO_CODEC_FUNCTION(zio_ulaw2slin);
* \param max_len length the buffer is allowed to grow to
* \return status
*/
-zap_status_t zap_buffer_create(zap_buffer_t **buffer, zap_size_t blocksize, zap_size_t start_len, zap_size_t max_len);
+OZ_DECLARE(zap_status_t) zap_buffer_create(zap_buffer_t **buffer, zap_size_t blocksize, zap_size_t start_len, zap_size_t max_len);
/*! \brief Get the length of a zap_buffer_t
* \param buffer any buffer of type zap_buffer_t
* \return int size of the buffer.
*/
-zap_size_t zap_buffer_len(zap_buffer_t *buffer);
+OZ_DECLARE(zap_size_t) zap_buffer_len(zap_buffer_t *buffer);
/*! \brief Get the freespace of a zap_buffer_t
* \param buffer any buffer of type zap_buffer_t
* \return int freespace in the buffer.
*/
-zap_size_t zap_buffer_freespace(zap_buffer_t *buffer);
+OZ_DECLARE(zap_size_t) zap_buffer_freespace(zap_buffer_t *buffer);
/*! \brief Get the in use amount of a zap_buffer_t
* \param buffer any buffer of type zap_buffer_t
* \return int ammount of buffer curently in use
*/
-zap_size_t zap_buffer_inuse(zap_buffer_t *buffer);
+OZ_DECLARE(zap_size_t) zap_buffer_inuse(zap_buffer_t *buffer);
/*! \brief Read data from a zap_buffer_t up to the ammount of datalen if it is available. Remove read data from buffer.
* \param buffer any buffer of type zap_buffer_t
* \param datalen amount of data to be returned
* \return int ammount of data actually read
*/
-zap_size_t zap_buffer_read(zap_buffer_t *buffer, void *data, zap_size_t datalen);
+OZ_DECLARE(zap_size_t) zap_buffer_read(zap_buffer_t *buffer, void *data, zap_size_t datalen);
/*! \brief Read data endlessly from a zap_buffer_t
* \param buffer any buffer of type zap_buffer_t
* \return int ammount of data actually read
* \note Once you have read all the data from the buffer it will loop around.
*/
-zap_size_t zap_buffer_read_loop(zap_buffer_t *buffer, void *data, zap_size_t datalen);
+OZ_DECLARE(zap_size_t) zap_buffer_read_loop(zap_buffer_t *buffer, void *data, zap_size_t datalen);
/*! \brief Assign a number of loops to read
* \param buffer any buffer of type zap_buffer_t
* \param loops the number of loops (-1 for infinite)
*/
-void zap_buffer_set_loops(zap_buffer_t *buffer, int32_t loops);
+OZ_DECLARE(void) zap_buffer_set_loops(zap_buffer_t *buffer, int32_t loops);
/*! \brief Write data into a zap_buffer_t up to the length of datalen
* \param buffer any buffer of type zap_buffer_t
* \param datalen amount of data to be written
* \return int amount of buffer used after the write, or 0 if no space available
*/
-zap_size_t zap_buffer_write(zap_buffer_t *buffer, const void *data, zap_size_t datalen);
+OZ_DECLARE(zap_size_t) zap_buffer_write(zap_buffer_t *buffer, const void *data, zap_size_t datalen);
/*! \brief Remove data from the buffer
* \param buffer any buffer of type zap_buffer_t
* \param datalen amount of data to be removed
* \return int size of buffer, or 0 if unable to toss that much data
*/
-zap_size_t zap_buffer_toss(zap_buffer_t *buffer, zap_size_t datalen);
+OZ_DECLARE(zap_size_t) zap_buffer_toss(zap_buffer_t *buffer, zap_size_t datalen);
/*! \brief Remove all data from the buffer
* \param buffer any buffer of type zap_buffer_t
*/
-void zap_buffer_zero(zap_buffer_t *buffer);
+OZ_DECLARE(void) zap_buffer_zero(zap_buffer_t *buffer);
/*! \brief Destroy the buffer
* \param buffer buffer to destroy
* \note only neccessary on dynamic buffers (noop on pooled ones)
*/
-void zap_buffer_destroy(zap_buffer_t **buffer);
+OZ_DECLARE(void) zap_buffer_destroy(zap_buffer_t **buffer);
/*! \brief Seek to offset from the beginning of the buffer
* \param buffer buffer to seek
* \param datalen offset in bytes
* \return new position
*/
-zap_size_t zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen);
+OZ_DECLARE(zap_size_t) zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen);
/** @} */
-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);
#endif
/* For Emacs:
typedef struct zap_thread zap_thread_t;
typedef void *(*zap_thread_function_t) (zap_thread_t *, void *);
-zap_status_t zap_thread_create_detached(zap_thread_function_t func, void *data);
-zap_status_t zap_thread_create_detached_ex(zap_thread_function_t func, void *data, zap_size_t stack_size);
-void zap_thread_override_default_stacksize(zap_size_t size);
-zap_status_t zap_mutex_create(zap_mutex_t **mutex);
-zap_status_t zap_mutex_destroy(zap_mutex_t **mutex);
-zap_status_t _zap_mutex_lock(zap_mutex_t *mutex);
-zap_status_t _zap_mutex_trylock(zap_mutex_t *mutex);
-zap_status_t _zap_mutex_unlock(zap_mutex_t *mutex);
+OZ_DECLARE(zap_status_t) zap_thread_create_detached(zap_thread_function_t func, void *data);
+OZ_DECLARE(zap_status_t) zap_thread_create_detached_ex(zap_thread_function_t func, void *data, zap_size_t stack_size);
+OZ_DECLARE(void) zap_thread_override_default_stacksize(zap_size_t size);
+OZ_DECLARE(zap_status_t) zap_mutex_create(zap_mutex_t **mutex);
+OZ_DECLARE(zap_status_t) zap_mutex_destroy(zap_mutex_t **mutex);
+OZ_DECLARE(zap_status_t) _zap_mutex_lock(zap_mutex_t *mutex);
+OZ_DECLARE(zap_status_t) _zap_mutex_trylock(zap_mutex_t *mutex);
+OZ_DECLARE(zap_status_t) _zap_mutex_unlock(zap_mutex_t *mutex);
#endif
#define ZIO_SPAN_NEXT_EVENT_FUNCTION(name) zap_status_t name ZIO_SPAN_NEXT_EVENT_ARGS
#define ZIO_SIGNAL_CB_FUNCTION(name) zap_status_t name ZIO_SIGNAL_CB_ARGS
#define ZIO_EVENT_CB_FUNCTION(name) zap_status_t name ZIO_EVENT_CB_ARGS
-#define ZIO_CODEC_FUNCTION(name) zap_status_t name ZIO_CODEC_ARGS
+#define ZIO_CODEC_FUNCTION(name) OZ_DECLARE_NONSTD(zap_status_t) name ZIO_CODEC_ARGS
#define ZIO_CONFIGURE_SPAN_FUNCTION(name) zap_status_t name ZIO_CONFIGURE_SPAN_ARGS
#define ZIO_CONFIGURE_FUNCTION(name) zap_status_t name ZIO_CONFIGURE_ARGS
#define ZIO_OPEN_FUNCTION(name) zap_status_t name ZIO_OPEN_ARGS
goertzel_state->fac = tdesc->fac;
}
-void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
+TELETONE_API(void) teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
int16_t sample_buffer[],
int samples)
{
#define teletone_goertzel_result(gs) (double)(((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac))
-void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate)
+TELETONE_API(void) teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate)
{
int i;
float theta;
dtmf_detect_state->mhit = 0;
}
-void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *map)
+TELETONE_API(void) teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *map)
{
float theta = 0;
int x = 0;
mt->sample_rate = 8000;
}
- if(!mt->min_samples) {
+ if (!mt->min_samples) {
mt->min_samples = 102;
}
}
-int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
+TELETONE_API(int) teletone_multi_tone_detect (teletone_multi_tone_t *mt,
int16_t sample_buffer[],
int samples)
{
}
-int teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
+TELETONE_API(int) teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
int16_t sample_buffer[],
int samples)
{
}
-int teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state,
+TELETONE_API(int) teletone_dtmf_get (teletone_dtmf_detect_state_t *dtmf_detect_state,
char *buf,
int max)
{
* c-basic-offset:4
* End:
* For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
#pragma warning(disable:4706)
#endif
-int16_t TELETONE_SINES[SINE_TABLE_MAX] = {
+TELETONE_API_DATA int16_t TELETONE_SINES[SINE_TABLE_MAX] = {
0x00c9, 0x025b, 0x03ed, 0x057f, 0x0711, 0x08a2, 0x0a33, 0x0bc4,
0x0d54, 0x0ee4, 0x1073, 0x1201, 0x138f, 0x151c, 0x16a8, 0x1833,
0x19be, 0x1b47, 0x1cd0, 0x1e57, 0x1fdd, 0x2162, 0x22e5, 0x2467,
};
-int teletone_set_tone(teletone_generation_session_t *ts, int index, ...)
+TELETONE_API(int) teletone_set_tone(teletone_generation_session_t *ts, int index, ...)
{
va_list ap;
int i = 0;
}
-int teletone_set_map(teletone_tone_map_t *map, ...)
+TELETONE_API(int) teletone_set_map(teletone_tone_map_t *map, ...)
{
va_list ap;
int i = 0;
}
-int teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_handler handler, void *user_data)
+TELETONE_API(int) teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_handler handler, void *user_data)
{
memset(ts, 0, sizeof(*ts));
ts->rate = 8000;
return 0;
}
-int teletone_destroy_session(teletone_generation_session_t *ts)
+TELETONE_API(int) teletone_destroy_session(teletone_generation_session_t *ts)
{
if (ts->buffer) {
free(ts->buffer);
return 0;
}
-int teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *map)
+TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone_tone_map_t *map)
{
/*teletone_process_t period = (1.0 / ts->rate) / ts->channels;*/
int i, c;
wait = (ts->tmp_wait > -1) ? ts->tmp_wait : ts->wait;
if (map->freqs[0] > 0) {
- for (freqlen = 0; map->freqs[freqlen] && freqlen < TELETONE_MAX_TONES; freqlen++) {
+ for (freqlen = 0; freqlen < TELETONE_MAX_TONES && map->freqs[freqlen]; freqlen++) {
teletone_dds_state_set_tone(&tones[freqlen], map->freqs[freqlen], ts->rate, 0);
teletone_dds_state_set_tx_level(&tones[freqlen], vol);
}
if (nvol <= TELETONE_VOL_DB_MAX && nvol >= TELETONE_VOL_DB_MIN) {
vol = nvol;
- for (j = 0; map->freqs[j] && j < TELETONE_MAX_TONES; j++) {
+ for (j = 0; j < TELETONE_MAX_TONES && map->freqs[j]; j++) {
teletone_dds_state_set_tx_level(&tones[j], vol);
}
dc = 0;
return (char *) memcpy (new, s, len);
}
-int teletone_run(teletone_generation_session_t *ts, const char *cmd)
+TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd)
{
char *data = NULL, *cur = NULL, *end = NULL;
int var = 0, LOOPING = 0;
* c-basic-offset:4
* End:
* For VIM:
- * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/
};
-zap_status_t zap_buffer_create(zap_buffer_t **buffer, zap_size_t blocksize, zap_size_t start_len, zap_size_t max_len)
+OZ_DECLARE(zap_status_t) zap_buffer_create(zap_buffer_t **buffer, zap_size_t blocksize, zap_size_t start_len, zap_size_t max_len)
{
zap_buffer_t *new_buffer;
return ZAP_MEMERR;
}
-zap_size_t zap_buffer_len(zap_buffer_t *buffer)
+OZ_DECLARE(zap_size_t) zap_buffer_len(zap_buffer_t *buffer)
{
assert(buffer != NULL);
}
-zap_size_t zap_buffer_freespace(zap_buffer_t *buffer)
+OZ_DECLARE(zap_size_t) zap_buffer_freespace(zap_buffer_t *buffer)
{
assert(buffer != NULL);
}
-zap_size_t zap_buffer_inuse(zap_buffer_t *buffer)
+OZ_DECLARE(zap_size_t) zap_buffer_inuse(zap_buffer_t *buffer)
{
assert(buffer != NULL);
return buffer->used;
}
-zap_size_t zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen)
+OZ_DECLARE(zap_size_t) zap_buffer_seek(zap_buffer_t *buffer, zap_size_t datalen)
{
zap_size_t reading = 0;
return reading;
}
-zap_size_t zap_buffer_toss(zap_buffer_t *buffer, zap_size_t datalen)
+OZ_DECLARE(zap_size_t) zap_buffer_toss(zap_buffer_t *buffer, zap_size_t datalen)
{
zap_size_t reading = 0;
return buffer->used;
}
-void zap_buffer_set_loops(zap_buffer_t *buffer, int loops)
+OZ_DECLARE(void) zap_buffer_set_loops(zap_buffer_t *buffer, int loops)
{
buffer->loops = loops;
}
-zap_size_t zap_buffer_read_loop(zap_buffer_t *buffer, void *data, zap_size_t datalen)
+OZ_DECLARE(zap_size_t) zap_buffer_read_loop(zap_buffer_t *buffer, void *data, zap_size_t datalen)
{
zap_size_t len;
if ((len = zap_buffer_read(buffer, data, datalen)) < datalen) {
return len;
}
-zap_size_t zap_buffer_read(zap_buffer_t *buffer, void *data, zap_size_t datalen)
+OZ_DECLARE(zap_size_t) zap_buffer_read(zap_buffer_t *buffer, void *data, zap_size_t datalen)
{
zap_size_t reading = 0;
return reading;
}
-zap_size_t zap_buffer_write(zap_buffer_t *buffer, const void *data, zap_size_t datalen)
+OZ_DECLARE(zap_size_t) zap_buffer_write(zap_buffer_t *buffer, const void *data, zap_size_t datalen)
{
zap_size_t freespace, actual_freespace;
return buffer->used;
}
-void zap_buffer_zero(zap_buffer_t *buffer)
+OZ_DECLARE(void) zap_buffer_zero(zap_buffer_t *buffer)
{
assert(buffer != NULL);
assert(buffer->data != NULL);
buffer->head = buffer->data;
}
-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)
{
zap_size_t w;
return w;
}
-void zap_buffer_destroy(zap_buffer_t **buffer)
+OZ_DECLARE(void) zap_buffer_destroy(zap_buffer_t **buffer)
{
if (*buffer) {
free((*buffer)->data);
}
}
-zap_status_t zap_fsk_data_init(zap_fsk_data_state_t *state, uint8_t *data, uint32_t datalen)
+OZ_DECLARE(zap_status_t) zap_fsk_data_init(zap_fsk_data_state_t *state, uint8_t *data, uint32_t datalen)
{
memset(state, 0, sizeof(*state));
state->buf = data;
return ZAP_SUCCESS;
}
-zap_status_t zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number)
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number)
{
size_t dlen = strlen(date);
size_t nlen = strlen(number);
return ZAP_SUCCESS;
}
-zap_status_t zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_mdmf_type_t type, const uint8_t *data, uint32_t datalen)
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_mdmf_type_t type, const uint8_t *data, uint32_t datalen)
{
state->buf[0] = ZAP_CID_TYPE_MDMF;
state->buf[state->bpos++] = type;
}
-zap_status_t zap_fsk_data_add_checksum(zap_fsk_data_state_t *state)
+OZ_DECLARE(zap_status_t) zap_fsk_data_add_checksum(zap_fsk_data_state_t *state)
{
uint32_t i;
uint8_t check = 0;
}
-zap_status_t zap_fsk_data_parse(zap_fsk_data_state_t *state, zap_size_t *type, char **data, zap_size_t *len)
+OZ_DECLARE(zap_status_t) zap_fsk_data_parse(zap_fsk_data_state_t *state, zap_size_t *type, char **data, zap_size_t *len)
{
zap_size_t i;
return ZAP_FAIL;
}
-zap_status_t zap_fsk_demod_feed(zap_fsk_data_state_t *state, int16_t *data, zap_size_t samples)
+OZ_DECLARE(zap_status_t) zap_fsk_demod_feed(zap_fsk_data_state_t *state, int16_t *data, zap_size_t samples)
{
uint32_t x;
int16_t *sp = data;
return ZAP_SUCCESS;
}
-zap_status_t zap_fsk_demod_destroy(zap_fsk_data_state_t *state)
+OZ_DECLARE(zap_status_t) zap_fsk_demod_destroy(zap_fsk_data_state_t *state)
{
dsp_fsk_destroy(&state->fsk1200_handle);
memset(state, 0, sizeof(*state));
return ZAP_SUCCESS;
}
-int zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, zap_size_t bufsize)
+OZ_DECLARE(int) zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, zap_size_t bufsize)
{
dsp_fsk_attr_t fsk1200_attr;
return ZAP_SUCCESS;
}
-zap_size_t zap_fsk_modulator_generate_bit(zap_fsk_modulator_t *fsk_trans, int8_t bit, int16_t *buf, zap_size_t buflen)
+OZ_DECLARE(zap_size_t) zap_fsk_modulator_generate_bit(zap_fsk_modulator_t *fsk_trans, int8_t bit, int16_t *buf, zap_size_t buflen)
{
zap_size_t i;
}
-int32_t zap_fsk_modulator_generate_carrier_bits(zap_fsk_modulator_t *fsk_trans, uint32_t bits)
+OZ_DECLARE(int32_t) zap_fsk_modulator_generate_carrier_bits(zap_fsk_modulator_t *fsk_trans, uint32_t bits)
{
uint32_t i = 0;
zap_size_t r = 0;
}
-void zap_fsk_modulator_generate_chan_sieze(zap_fsk_modulator_t *fsk_trans)
+OZ_DECLARE(void) zap_fsk_modulator_generate_chan_sieze(zap_fsk_modulator_t *fsk_trans)
{
uint32_t i = 0;
zap_size_t r = 0;
}
-void zap_fsk_modulator_send_data(zap_fsk_modulator_t *fsk_trans)
+OZ_DECLARE(void) zap_fsk_modulator_send_data(zap_fsk_modulator_t *fsk_trans)
{
zap_size_t r = 0;
int8_t bit = 0;
}
-zap_status_t zap_fsk_modulator_init(zap_fsk_modulator_t *fsk_trans,
+OZ_DECLARE(zap_status_t) zap_fsk_modulator_init(zap_fsk_modulator_t *fsk_trans,
fsk_modem_types_t modem_type,
uint32_t sample_rate,
zap_fsk_data_state_t *fsk_data,
time_is_init = 0;
}
-zap_time_t zap_current_time_in_ms(void)
+OZ_DECLARE(zap_time_t) zap_current_time_in_ms(void)
{
#ifdef WIN32
return timeGetTime();
}
-zap_logger_t zap_log = null_logger;
+OZ_DECLARE_DATA zap_logger_t zap_log = null_logger;
-void zap_global_set_logger(zap_logger_t logger)
+OZ_DECLARE(void) zap_global_set_logger(zap_logger_t logger)
{
if (logger) {
zap_log = logger;
}
}
-void zap_global_set_default_logger(int level)
+OZ_DECLARE(void) zap_global_set_default_logger(int level)
{
if (level < 0 || level > 7) {
level = 7;
zap_log_level = level;
}
-int zap_hash_equalkeys(void *k1, void *k2)
+OZ_DECLARE_NONSTD(int) zap_hash_equalkeys(void *k1, void *k2)
{
return strcmp((char *) k1, (char *) k2) ? 0 : 1;
}
-uint32_t zap_hash_hashfromstring(void *ky)
+OZ_DECLARE_NONSTD(uint32_t) zap_hash_hashfromstring(void *ky)
{
unsigned char *str = (unsigned char *) ky;
uint32_t hash = 0;
-zap_status_t zap_channel_get_alarms(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_get_alarms(zap_channel_t *zchan)
{
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_span_create(zap_io_interface_t *zio, zap_span_t **span)
+OZ_DECLARE(zap_status_t) zap_span_create(zap_io_interface_t *zio, zap_span_t **span)
{
zap_span_t *new_span = NULL;
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_span_close_all(void)
+OZ_DECLARE(zap_status_t) zap_span_close_all(void)
{
zap_span_t *span;
uint32_t i, j;
return i ? ZAP_SUCCESS : ZAP_FAIL;
}
-zap_status_t zap_span_load_tones(zap_span_t *span, const char *mapname)
+OZ_DECLARE(zap_status_t) zap_span_load_tones(zap_span_t *span, const char *mapname)
{
zap_config_t cfg;
char *var, *val;
}
-zap_status_t zap_span_add_channel(zap_span_t *span, zap_socket_t sockfd, zap_chan_type_t type, zap_channel_t **chan)
+OZ_DECLARE(zap_status_t) zap_span_add_channel(zap_span_t *span, zap_socket_t sockfd, zap_chan_type_t type, zap_channel_t **chan)
{
if (span->chan_count < ZAP_MAX_CHANNELS_SPAN) {
zap_channel_t *new_chan = span->channels[++span->chan_count];
return ZAP_FAIL;
}
-zap_status_t zap_span_find_by_name(const char *name, zap_span_t **span)
+OZ_DECLARE(zap_status_t) zap_span_find_by_name(const char *name, zap_span_t **span)
{
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_span_find(uint32_t id, zap_span_t **span)
+OZ_DECLARE(zap_status_t) zap_span_find(uint32_t id, zap_span_t **span)
{
zap_span_t *fspan;
}
-zap_status_t zap_span_set_event_callback(zap_span_t *span, zio_event_cb_t event_callback)
+OZ_DECLARE(zap_status_t) zap_span_set_event_callback(zap_span_t *span, zio_event_cb_t event_callback)
{
zap_mutex_lock(span->mutex);
span->event_callback = event_callback;
}
-zap_status_t zap_span_poll_event(zap_span_t *span, uint32_t ms)
+OZ_DECLARE(zap_status_t) zap_span_poll_event(zap_span_t *span, uint32_t ms)
{
assert(span->zio != NULL);
return ZAP_NOTIMPL;
}
-zap_status_t zap_span_next_event(zap_span_t *span, zap_event_t **event)
+OZ_DECLARE(zap_status_t) zap_span_next_event(zap_span_t *span, zap_event_t **event)
{
assert(span->zio != NULL);
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_send_fsk_data(zap_channel_t *zchan, zap_fsk_data_state_t *fsk_data, float db_level)
+OZ_DECLARE(zap_status_t) zap_channel_send_fsk_data(zap_channel_t *zchan, zap_fsk_data_state_t *fsk_data, float db_level)
{
struct zap_fsk_modulator fsk_trans;
}
-zap_status_t zap_channel_set_event_callback(zap_channel_t *zchan, zio_event_cb_t event_callback)
+OZ_DECLARE(zap_status_t) zap_channel_set_event_callback(zap_channel_t *zchan, zio_event_cb_t event_callback)
{
zap_mutex_lock(zchan->mutex);
zchan->event_callback = event_callback;
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_clear_token(zap_channel_t *zchan, const char *token)
+OZ_DECLARE(zap_status_t) zap_channel_clear_token(zap_channel_t *zchan, const char *token)
{
zap_status_t status = ZAP_FAIL;
return status;
}
-void zap_channel_rotate_tokens(zap_channel_t *zchan)
+OZ_DECLARE(void) zap_channel_rotate_tokens(zap_channel_t *zchan)
{
if (zchan->token_count) {
memmove(zchan->tokens[1], zchan->tokens[0], zchan->token_count * ZAP_TOKEN_STRLEN);
}
}
-zap_status_t zap_channel_add_token(zap_channel_t *zchan, char *token, int end)
+OZ_DECLARE(zap_status_t) zap_channel_add_token(zap_channel_t *zchan, char *token, int end)
{
zap_status_t status = ZAP_FAIL;
}
-zap_status_t zap_channel_complete_state(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_complete_state(zap_channel_t *zchan)
{
zap_channel_state_t state = zchan->state;
return ok;
}
-zap_status_t zap_channel_set_state(zap_channel_t *zchan, zap_channel_state_t state, int lock)
+OZ_DECLARE(zap_status_t) zap_channel_set_state(zap_channel_t *zchan, zap_channel_state_t state, int lock)
{
int ok = 1;
return ok ? ZAP_SUCCESS : ZAP_FAIL;
}
-zap_status_t zap_channel_open_any(uint32_t span_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan)
+OZ_DECLARE(zap_status_t) zap_channel_open_any(uint32_t span_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan)
{
zap_status_t status = ZAP_FAIL;
zap_channel_t *check;
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_init(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_init(zap_channel_t *zchan)
{
if (zchan->init_state != ZAP_CHANNEL_STATE_DOWN) {
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_open_chan(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_open_chan(zap_channel_t *zchan)
{
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_channel_open(uint32_t span_id, uint32_t chan_id, zap_channel_t **zchan)
+OZ_DECLARE(zap_status_t) zap_channel_open(uint32_t span_id, uint32_t chan_id, zap_channel_t **zchan)
{
zap_channel_t *check;
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_channel_outgoing_call(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_outgoing_call(zap_channel_t *zchan)
{
zap_status_t status;
return ZAP_FAIL;
}
-zap_status_t zap_channel_done(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_done(zap_channel_t *zchan)
{
assert(zchan != NULL);
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_use(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_use(zap_channel_t *zchan)
{
assert(zchan != NULL);
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_close(zap_channel_t **zchan)
+OZ_DECLARE(zap_status_t) zap_channel_close(zap_channel_t **zchan)
{
zap_channel_t *check;
zap_status_t status = ZAP_FAIL;
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_command(zap_channel_t *zchan, zap_command_t command, void *obj)
+OZ_DECLARE(zap_status_t) zap_channel_command(zap_channel_t *zchan, zap_command_t command, void *obj)
{
zap_status_t status = ZAP_FAIL;
}
-zap_status_t zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t *flags, int32_t to)
+OZ_DECLARE(zap_status_t) zap_channel_wait(zap_channel_t *zchan, zap_wait_flag_t *flags, int32_t to)
{
assert(zchan != NULL);
assert(zchan->zio != NULL);
/******************************/
-void zap_channel_clear_detected_tones(zap_channel_t *zchan)
+OZ_DECLARE(void) zap_channel_clear_detected_tones(zap_channel_t *zchan)
{
memset(zchan->detected_tones, 0, sizeof(zchan->detected_tones[0]) * ZAP_TONEMAP_INVALID);
}
-void zap_channel_clear_needed_tones(zap_channel_t *zchan)
+OZ_DECLARE(void) zap_channel_clear_needed_tones(zap_channel_t *zchan)
{
memset(zchan->needed_tones, 0, sizeof(zchan->needed_tones[0]) * ZAP_TONEMAP_INVALID);
}
-zap_size_t zap_channel_dequeue_dtmf(zap_channel_t *zchan, char *dtmf, zap_size_t len)
+OZ_DECLARE(zap_size_t) zap_channel_dequeue_dtmf(zap_channel_t *zchan, char *dtmf, zap_size_t len)
{
zap_size_t bytes = 0;
return bytes;
}
-void zap_channel_flush_dtmf(zap_channel_t *zchan)
+OZ_DECLARE(void) zap_channel_flush_dtmf(zap_channel_t *zchan)
{
if (zchan->digit_buffer && zap_buffer_inuse(zchan->digit_buffer)) {
zap_mutex_lock(zchan->mutex);
}
}
-zap_status_t zap_channel_queue_dtmf(zap_channel_t *zchan, const char *dtmf)
+OZ_DECLARE(zap_status_t) zap_channel_queue_dtmf(zap_channel_t *zchan, const char *dtmf)
{
zap_status_t status;
register zap_size_t len, inuse;
-zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *datalen)
+OZ_DECLARE(zap_status_t) zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *datalen)
{
zap_status_t status = ZAP_FAIL;
zio_codec_t codec_func = NULL;
}
-zap_status_t zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t datasize, zap_size_t *datalen)
+OZ_DECLARE(zap_status_t) zap_channel_write(zap_channel_t *zchan, void *data, zap_size_t datasize, zap_size_t *datalen)
{
zap_status_t status = ZAP_FAIL;
zio_codec_t codec_func = NULL;
return status;
}
-zap_status_t zap_channel_clear_vars(zap_channel_t *zchan)
+OZ_DECLARE(zap_status_t) zap_channel_clear_vars(zap_channel_t *zchan)
{
if(zchan->variable_hash) {
hashtable_destroy(zchan->variable_hash);
return ZAP_SUCCESS;
}
-zap_status_t zap_channel_add_var(zap_channel_t *zchan, const char *var_name, const char *value)
+OZ_DECLARE(zap_status_t) zap_channel_add_var(zap_channel_t *zchan, const char *var_name, const char *value)
{
char *t_name = 0, *t_val = 0;
return ZAP_FAIL;
}
-const char * zap_channel_get_var(zap_channel_t *zchan, const char *var_name)
+OZ_DECLARE(const char *) zap_channel_get_var(zap_channel_t *zchan, const char *var_name)
{
if(!zchan->variable_hash || !var_name)
{
} interfaces;
-char *zap_api_execute(const char *type, const char *cmd)
+OZ_DECLARE(char *) zap_api_execute(const char *type, const char *cmd)
{
zap_io_interface_t *zio = NULL;
char *dup = NULL, *p;
return ZAP_SUCCESS;
}
-int zap_load_module(const char *name)
+OZ_DECLARE(int) zap_load_module(const char *name)
{
zap_dso_lib_t lib;
int count = 0, x = 0;
return count;
}
-int zap_load_module_assume(const char *name)
+OZ_DECLARE(int) zap_load_module_assume(const char *name)
{
char buf[256] = "";
return zap_load_module(buf);
}
-int zap_load_modules(void)
+OZ_DECLARE(int) zap_load_modules(void)
{
char cfg_name[] = "modules.conf";
zap_config_t cfg;
return count;
}
-zap_status_t zap_unload_modules(void)
+OZ_DECLARE(zap_status_t) zap_unload_modules(void)
{
zap_hash_iterator_t *i;
zap_dso_lib_t lib;
return ZAP_SUCCESS;
}
-zap_status_t zap_configure_span(const char *type, zap_span_t *span, zio_signal_cb_t sig_cb, ...)
+OZ_DECLARE(zap_status_t) zap_configure_span(const char *type, zap_span_t *span, zio_signal_cb_t sig_cb, ...)
{
zap_module_t *mod = (zap_module_t *) hashtable_search(globals.module_hash, (void *)type);
zap_status_t status = ZAP_FAIL;
return status;
}
-zap_status_t zap_span_start(zap_span_t *span)
+OZ_DECLARE(zap_status_t) zap_span_start(zap_span_t *span)
{
if (span->start) {
return span->start(span);
}
-zap_status_t zap_global_init(void)
+OZ_DECLARE(zap_status_t) zap_global_init(void)
{
int modcount;
return ZAP_FAIL;
}
-uint32_t zap_running(void)
+OZ_DECLARE(uint32_t) zap_running(void)
{
return globals.running;
}
-zap_status_t zap_global_destroy(void)
+OZ_DECLARE(zap_status_t) zap_global_destroy(void)
{
unsigned int i,j;
time_end();
}
-uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen)
+OZ_DECLARE(uint32_t) zap_separate_string(char *buf, char delim, char **array, int arraylen)
{
int argc;
char *ptr;
return argc;
}
-void zap_bitstream_init(zap_bitstream_t *bsp, uint8_t *data, uint32_t datalen, zap_endian_t endian, uint8_t ss)
+OZ_DECLARE(void) zap_bitstream_init(zap_bitstream_t *bsp, uint8_t *data, uint32_t datalen, zap_endian_t endian, uint8_t ss)
{
memset(bsp, 0, sizeof(*bsp));
bsp->data = data;
}
-int8_t zap_bitstream_get_bit(zap_bitstream_t *bsp)
+OZ_DECLARE(int8_t) zap_bitstream_get_bit(zap_bitstream_t *bsp)
{
int8_t bit = -1;
return bit;
}
-void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen)
+OZ_DECLARE(void) print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen)
{
char *bp = buf;
uint8_t *byte = data;
}
-void print_bits(uint8_t *b, int bl, char *buf, int blen, zap_endian_t e, uint8_t ss)
+OZ_DECLARE(void) print_bits(uint8_t *b, int bl, char *buf, int blen, zap_endian_t e, uint8_t ss)
{
zap_bitstream_t bs;
int j = 0, c = 0;
-zap_status_t zap_console_stream_raw_write(zap_stream_handle_t *handle, uint8_t *data, zap_size_t datalen)
+OZ_DECLARE_NONSTD(zap_status_t) zap_console_stream_raw_write(zap_stream_handle_t *handle, uint8_t *data, zap_size_t datalen)
{
zap_size_t need = handle->data_len + datalen;
return ZAP_SUCCESS;
}
-int zap_vasprintf(char **ret, const char *fmt, va_list ap) /* code from switch_apr.c */
+OZ_DECLARE(int) zap_vasprintf(char **ret, const char *fmt, va_list ap) /* code from switch_apr.c */
{
#ifdef HAVE_VASPRINTF
return vasprintf(ret, fmt, ap);
#endif
}
-zap_status_t zap_console_stream_write(zap_stream_handle_t *handle, const char *fmt, ...)
+OZ_DECLARE_NONSTD(zap_status_t) zap_console_stream_write(zap_stream_handle_t *handle, const char *fmt, ...)
{
va_list ap;
char *buf = handle->data;
zap_size_t thread_default_stacksize = 0;
-void zap_thread_override_default_stacksize(zap_size_t size)
+OZ_DECLARE(void) zap_thread_override_default_stacksize(zap_size_t size)
{
thread_default_stacksize = size;
}
return exit_val;
}
-zap_status_t zap_thread_create_detached(zap_thread_function_t func, void *data)
+OZ_DECLARE(zap_status_t) zap_thread_create_detached(zap_thread_function_t func, void *data)
{
return zap_thread_create_detached_ex(func, data, thread_default_stacksize);
}
-zap_status_t zap_thread_create_detached_ex(zap_thread_function_t func, void *data, zap_size_t stack_size)
+OZ_DECLARE(zap_status_t) zap_thread_create_detached_ex(zap_thread_function_t func, void *data, zap_size_t stack_size)
{
zap_thread_t *thread = NULL;
zap_status_t status = ZAP_FAIL;
}
-zap_status_t zap_mutex_create(zap_mutex_t **mutex)
+OZ_DECLARE(zap_status_t) zap_mutex_create(zap_mutex_t **mutex)
{
zap_status_t status = ZAP_FAIL;
#ifndef WIN32
return status;
}
-zap_status_t zap_mutex_destroy(zap_mutex_t **mutex)
+OZ_DECLARE(zap_status_t) zap_mutex_destroy(zap_mutex_t **mutex)
{
zap_mutex_t *mp = *mutex;
*mutex = NULL;
return ZAP_SUCCESS;
}
-zap_status_t _zap_mutex_lock(zap_mutex_t *mutex)
+OZ_DECLARE(zap_status_t) _zap_mutex_lock(zap_mutex_t *mutex)
{
#ifdef WIN32
EnterCriticalSection(&mutex->mutex);
return ZAP_SUCCESS;
}
-zap_status_t _zap_mutex_trylock(zap_mutex_t *mutex)
+OZ_DECLARE(zap_status_t) _zap_mutex_trylock(zap_mutex_t *mutex)
{
#ifdef WIN32
if (!TryEnterCriticalSection(&mutex->mutex))
return ZAP_SUCCESS;
}
-zap_status_t _zap_mutex_unlock(zap_mutex_t *mutex)
+OZ_DECLARE(zap_status_t) _zap_mutex_unlock(zap_mutex_t *mutex)
{
#ifdef WIN32
LeaveCriticalSection(&mutex->mutex);