mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
API visibility support (GCC/SUNCC) (FSCORE-264)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12061 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -110,6 +110,12 @@ typedef __int16 int16_t;
|
||||
#define teletone_assert(expr) assert(expr)
|
||||
#endif
|
||||
|
||||
#if (defined(__GNUC__) || defined(__SUNCC__)) && defined(HAVE_VISIBILITY)
|
||||
#define TELETONE_API __attribute__((visibility("default")))
|
||||
#else
|
||||
#define TELETONE_API
|
||||
#endif
|
||||
|
||||
#include <libteletone_generate.h>
|
||||
#include <libteletone_detect.h>
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ static void goertzel_init(teletone_goertzel_state_t *goertzel_state, teletone_de
|
||||
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)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
|
||||
|
||||
#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;
|
||||
@@ -169,7 +169,7 @@ void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state,
|
||||
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;
|
||||
@@ -209,7 +209,7 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -299,7 +299,7 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -430,7 +430,7 @@ int teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ int16_t TELETONE_SINES[SINE_TABLE_MAX] = {
|
||||
};
|
||||
|
||||
|
||||
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;
|
||||
@@ -115,7 +115,7 @@ int teletone_set_tone(teletone_generation_session_t *ts, int index, ...)
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -131,7 +131,7 @@ int teletone_set_map(teletone_tone_map_t *map, ...)
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -174,7 +174,7 @@ int teletone_init_session(teletone_generation_session_t *ts, int buflen, tone_ha
|
||||
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);
|
||||
@@ -203,7 +203,7 @@ static int ensure_buffer(teletone_generation_session_t *ts, int need)
|
||||
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;
|
||||
@@ -318,7 +318,7 @@ static char *my_strdup (const char *s)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user