提交 3c349c27 authored 作者: Anthony Minessale's avatar Anthony Minessale

indent pass 1

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8686 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 49ff246b
#!/bin/bash
echo -n "-brs -npsl -di0 -br -ce -d0 -cli0 -npcs -nfc1 -ut -i4 -ts4 -l155 -cs -T size_t " > ./.indent.pro
grep typedef ./src/include/*.h | grep switch_ | grep -v "\*\|{" | sed -e s/struct// | perl -ne '@l = split; $l[2] =~ s/;//g ; print "-T $l[2] "' >> ./.indent.pro
grep typedef `find ./src/include/ -name \*.h` | grep apr_ | grep -v "\*\|{" | sed -e s/struct// | perl -ne '@l = split; $l[2] =~ s/;//g ; print "-T $l[2] "' >> ./.indent.pro
grep typedef `find ./src/include/ -name \*.h` | grep switch_ | grep -v "\*\|{" | sed -e s/struct// | perl -ne '@l = split; $l[2] =~ s/;//g ; print "-T $l[2] "' >> ./.indent.pro
grep "} switch_" ./src/include/*.h | perl -ne '@l = split; $l[1] =~ s/;//g ; print " -T $l[1] "' >> ./.indent.pro
差异被折叠。
差异被折叠。
差异被折叠。
......@@ -106,7 +106,7 @@ static inline void pack_check_over(switch_bitpack_t *pack)
pack->cur++;
} else {
switch_byte_t mask = SWITCH_BITS_PER_BYTE - pack->over;
switch_assert(mask < 8); /* if pack->over this will allways be true */
switch_assert(mask < 8); /* if pack->over this will allways be true */
this_byte &= SWITCH_REVERSE_BITPACKED_MASKS[mask];
this_byte >>= mask;
......
......@@ -122,7 +122,8 @@ SWITCH_DECLARE(void) switch_buffer_set_loops(_In_ switch_buffer_t *buffer, _In_
* \param datalen amount of data to be written
* \return int amount of buffer used after the write, or 0 if no space available
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_write(_In_ switch_buffer_t *buffer, _In_bytecount_(datalen) const void *data, _In_ switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_write(_In_ switch_buffer_t *buffer, _In_bytecount_(datalen)
const void *data, _In_ switch_size_t datalen);
/*! \brief Remove data from the buffer
* \param buffer any buffer of type switch_buffer_t
......@@ -142,7 +143,8 @@ SWITCH_DECLARE(void) switch_buffer_zero(_In_ switch_buffer_t *buffer);
*/
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_zwrite(_In_ switch_buffer_t *buffer, _In_bytecount_(datalen) const void *data, _In_ switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_zwrite(_In_ switch_buffer_t *buffer, _In_bytecount_(datalen)
const void *data, _In_ switch_size_t datalen);
/** @} */
......
......@@ -140,8 +140,7 @@ struct switch_caller_extension {
\return a new extension object allocated from the session's memory pool
*/
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(_In_ switch_core_session_t *session,
_In_z_ const char *extension_name,
_In_z_ const char *extension_number);
_In_z_ const char *extension_name, _In_z_ const char *extension_number);
/*!
\brief Add an application (instruction) to the given extension
......@@ -152,8 +151,7 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(_In_ swi
*/
SWITCH_DECLARE(void) switch_caller_extension_add_application(_In_ switch_core_session_t *session,
_In_ switch_caller_extension_t *caller_extension,
_In_z_ const char *application_name,
_In_z_ const char *extra_data);
_In_z_ const char *application_name, _In_z_ const char *extra_data);
/*!
......@@ -162,8 +160,8 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(_In_ switch_core_se
\param name the name
\note this function is meant for situations where the name paramater is the contents of the variable
*/
_Check_return_ _Ret_opt_z_ SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(_In_ switch_caller_profile_t *caller_profile,
_In_z_ const char *name);
_Check_return_ _Ret_opt_z_ SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(_In_ switch_caller_profile_t *caller_profile,
_In_z_ const char *name);
/*!
\brief Create a new caller profile object
......@@ -191,8 +189,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(_In_ switch_
_In_opt_z_ const char *aniii,
_In_opt_z_ const char *rdnis,
_In_opt_z_ const char *source,
_In_opt_z_ const char *context,
_In_opt_z_ const char *destination_number);
_In_opt_z_ const char *context, _In_opt_z_ const char *destination_number);
/*!
\brief Clone an existing caller profile object
......@@ -216,8 +213,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_dup(_In_ switch_
*/
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(_In_ switch_caller_profile_t *caller_profile,
_In_opt_z_ const char *prefix,
_In_ switch_event_t *event);
_In_opt_z_ const char *prefix, _In_ switch_event_t *event);
SWITCH_END_EXTERN_C
/** @} */
......
......@@ -438,7 +438,8 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(_In_ switch_cha
*/
SWITCH_DECLARE(switch_status_t) switch_channel_dequeue_dtmf(_In_ switch_channel_t *channel, _In_ switch_dtmf_t *dtmf);
SWITCH_DECLARE(void) switch_channel_flush_dtmf(_In_ switch_channel_t *channel);
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(_In_ switch_channel_t *channel, _Out_opt_bytecapcount_(len) char *dtmf_str, _In_ switch_size_t len);
SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf_string(_In_ switch_channel_t *channel, _Out_opt_bytecapcount_(len)
char *dtmf_str, _In_ switch_size_t len);
/*!
\brief Render the name of the provided state enum
......@@ -469,7 +470,8 @@ SWITCH_DECLARE(void) switch_channel_event_set_data(_In_ switch_channel_t *channe
\note it's necessary to test if the return val is the same as the input and free the string if it is not.
*/
SWITCH_DECLARE(char *) switch_channel_expand_variables(_In_ switch_channel_t *channel, _In_ const char *in);
SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile, _In_opt_ const char *prefix);
SWITCH_DECLARE(char *) switch_channel_build_param_string(_In_ switch_channel_t *channel, _In_opt_ switch_caller_profile_t *caller_profile,
_In_opt_ const char *prefix);
SWITCH_DECLARE(switch_status_t) switch_channel_set_timestamps(_In_ switch_channel_t *channel);
#define switch_channel_stop_broadcast(_channel) if (switch_channel_test_flag(_channel, CF_BROADCAST)) switch_channel_set_flag(_channel, CF_BREAK | CF_STOP_BROADCAST)
......
......@@ -88,13 +88,13 @@ struct switch_config {
\param file_path path to the file
\return 1 (true) on success 0 (false) on failure
*/
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_path);
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_path);
/*!
\brief Close a previously opened configuration file
\param cfg (switch_config_t *) config handle to use
*/
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg);
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg);
/*!
\brief Retrieve next name/value pair from configuration file
......@@ -102,7 +102,7 @@ SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg);
\param var pointer to aim at the new variable name
\param val pointer to aim at the new value
*/
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, char **val);
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val);
SWITCH_END_EXTERN_C
/** @} */
......
......@@ -52,7 +52,6 @@ SWITCH_BEGIN_EXTERN_C
s.raw_write_function = switch_console_stream_raw_write; \
s.alloc_len = SWITCH_CMD_CHUNK_LEN; \
s.alloc_chunk = SWITCH_CMD_CHUNK_LEN
/*!
\brief A simple comand loop that reads input from the terminal
*/
......
差异被折叠。
......@@ -32,8 +32,7 @@
#define SWITCH_EVENT_HOOKS_H
#include <switch.h>
SWITCH_BEGIN_EXTERN_C
typedef struct switch_io_event_hooks switch_io_event_hooks_t;
SWITCH_BEGIN_EXTERN_C typedef struct switch_io_event_hooks switch_io_event_hooks_t;
typedef struct switch_io_event_hook_outgoing_channel switch_io_event_hook_outgoing_channel_t;
typedef struct switch_io_event_hook_receive_message switch_io_event_hook_receive_message_t;
......@@ -48,7 +47,7 @@ typedef struct switch_io_event_hook_recv_dtmf switch_io_event_hook_recv_dtmf_t;
typedef struct switch_io_event_hook_state_change switch_io_event_hook_state_change_t;
typedef struct switch_io_event_hook_resurrect_session switch_io_event_hook_resurrect_session_t;
typedef switch_status_t (*switch_outgoing_channel_hook_t)
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t *, switch_originate_flag_t);
typedef switch_status_t (*switch_receive_message_hook_t) (switch_core_session_t *, switch_core_session_message_t *);
typedef switch_status_t (*switch_receive_event_hook_t) (switch_core_session_t *, switch_event_t *);
typedef switch_status_t (*switch_read_frame_hook_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
......@@ -59,7 +58,7 @@ typedef switch_status_t (*switch_kill_channel_hook_t) (switch_core_session_t *,
typedef switch_status_t (*switch_send_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *, switch_dtmf_direction_t direction);
typedef switch_status_t (*switch_recv_dtmf_hook_t) (switch_core_session_t *, const switch_dtmf_t *, switch_dtmf_direction_t direction);
typedef switch_status_t (*switch_state_change_hook_t) (switch_core_session_t *);
typedef switch_call_cause_t (*switch_resurrect_session_hook_t)(switch_core_session_t **, switch_memory_pool_t **, void *);
typedef switch_call_cause_t (*switch_resurrect_session_hook_t) (switch_core_session_t **, switch_memory_pool_t **, void *);
/*! \brief Node in which to store custom receive message callback hooks */
struct switch_io_event_hook_outgoing_channel {
......@@ -210,7 +209,7 @@ extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_s
last = ptr; \
} \
return SWITCH_STATUS_FALSE; \
}
}
NEW_HOOK_DECL_ADD_P(outgoing_channel);
......
差异被折叠。
......@@ -156,7 +156,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event,
\param header_name the name of the header to read
\return the value of the requested header
*/
_Ret_opt_z_ SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name);
_Ret_opt_z_ SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name);
#define switch_event_get_header_nil(e, h) switch_str_nil(switch_event_get_header(e,h))
......@@ -292,7 +292,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, con
#endif
SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const char *in);
SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char *file, _In_z_ char *func, _In_ int line,
SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char *file, _In_z_ char *func, _In_ int line,
_In_z_ const char *proto, _In_z_ const char *login,
_In_z_ const char *from, _In_z_ const char *from_domain,
_In_z_ const char *status, _In_z_ const char *event_type,
......@@ -344,7 +344,7 @@ SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event);
*/
#define switch_event_fire_data(event, data) switch_event_fire_detailed(__FILE__, (char * )__SWITCH_FUNC__, __LINE__, event, data)
SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix,switch_hash_t* vars_map);
SWITCH_DECLARE(char *) switch_event_build_param_string(switch_event_t *event, const char *prefix, switch_hash_t *vars_map);
///\}
......
......@@ -40,7 +40,7 @@
SWITCH_BEGIN_EXTERN_C
/*! \brief An abstraction of a data frame */
struct switch_frame {
struct switch_frame {
/*! a pointer to the codec information */
switch_codec_t *codec;
/*! the originating source of the frame */
......
差异被折叠。
......@@ -128,9 +128,8 @@ SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialpla
SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,
switch_module_load_t switch_module_load,
switch_module_runtime_t switch_module_runtime,
switch_module_shutdown_t switch_module_shutdown,
switch_bool_t runtime);
switch_module_shutdown_t switch_module_shutdown, switch_bool_t runtime);
/*!
\brief Retrieve the timer interface by it's registered name
......@@ -259,7 +258,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir,
\param filename the path to the module's dll or so file
\return SWITCH_STATUS_SUCCESS on a successful load
*/
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load( switch_loadable_module_interface_t **module_interface, char *filename);
SWITCH_MOD_DECLARE(switch_status_t) switch_module_load(switch_loadable_module_interface_t **module_interface, char *filename);
SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void);
/*!
......@@ -317,44 +316,43 @@ SWITCH_DECLARE(uint32_t) switch_core_codec_next_id(void);
}
static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool,
switch_codec_interface_t *codec_interface,
/*! enumeration defining the type of the codec */
const switch_codec_type_t codec_type,
/*! the IANA code number */
switch_payload_t ianacode,
/*! the IANA code name */
const char *iananame,
/*! default fmtp to send (can be overridden by the init function) */
char *fmtp,
/*! samples transferred per second */
uint32_t samples_per_second,
/*! actual samples transferred per second for those who are not moron g722 RFC writers*/
uint32_t actual_samples_per_second,
/*! bits transferred per second */
int bits_per_second,
/*! number of microseconds that denote one frame */
int microseconds_per_frame,
/*! number of samples that denote one frame */
uint32_t samples_per_frame,
/*! number of bytes that denote one frame decompressed */
uint32_t bytes_per_frame,
/*! number of bytes that denote one frame compressed */
uint32_t encoded_bytes_per_frame,
/*! number of channels represented */
uint8_t number_of_channels,
/*! number of frames to send in one netowrk packet */
int pref_frames_per_packet,
/*! max number of frames to send in one network packet */
int max_frames_per_packet,
/*! function to initialize a codec handle using this implementation */
switch_core_codec_init_func_t init,
/*! function to encode raw data into encoded data */
switch_core_codec_encode_func_t encode,
/*! function to decode encoded data into raw data */
switch_core_codec_decode_func_t decode,
/*! deinitalize a codec handle using this implementation */
switch_core_codec_destroy_func_t destroy)
static inline void switch_core_codec_add_implementation(switch_memory_pool_t *pool, switch_codec_interface_t *codec_interface,
/*! enumeration defining the type of the codec */
const switch_codec_type_t codec_type,
/*! the IANA code number */
switch_payload_t ianacode,
/*! the IANA code name */
const char *iananame,
/*! default fmtp to send (can be overridden by the init function) */
char *fmtp,
/*! samples transferred per second */
uint32_t samples_per_second,
/*! actual samples transferred per second for those who are not moron g722 RFC writers */
uint32_t actual_samples_per_second,
/*! bits transferred per second */
int bits_per_second,
/*! number of microseconds that denote one frame */
int microseconds_per_frame,
/*! number of samples that denote one frame */
uint32_t samples_per_frame,
/*! number of bytes that denote one frame decompressed */
uint32_t bytes_per_frame,
/*! number of bytes that denote one frame compressed */
uint32_t encoded_bytes_per_frame,
/*! number of channels represented */
uint8_t number_of_channels,
/*! number of frames to send in one netowrk packet */
int pref_frames_per_packet,
/*! max number of frames to send in one network packet */
int max_frames_per_packet,
/*! function to initialize a codec handle using this implementation */
switch_core_codec_init_func_t init,
/*! function to encode raw data into encoded data */
switch_core_codec_encode_func_t encode,
/*! function to decode encoded data into raw data */
switch_core_codec_decode_func_t decode,
/*! deinitalize a codec handle using this implementation */
switch_core_codec_destroy_func_t destroy)
{
if (codec_type == SWITCH_CODEC_TYPE_VIDEO || SWITCH_ACCEPTABLE_INTERVAL(microseconds_per_frame / 1000)) {
switch_codec_implementation_t *impl = (switch_codec_implementation_t *) switch_core_alloc(pool, sizeof(*impl));
......
......@@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_status_t) switch_log_bind_logger(_In_ switch_log_function_
\param level the level
\return the name of the log level
*/
_Ret_z_ SWITCH_DECLARE(const char *) switch_log_level2str(_In_ switch_log_level_t level);
_Ret_z_ SWITCH_DECLARE(const char *) switch_log_level2str(_In_ switch_log_level_t level);
/*!
\brief Return the level number of the specified log level name
......
......@@ -45,8 +45,7 @@
SWITCH_BEGIN_EXTERN_C
/*! \brief A table of functions to execute at various states
*/
typedef enum {
typedef enum {
SWITCH_SHN_ON_INIT,
SWITCH_SHN_ON_ROUTING,
SWITCH_SHN_ON_EXECUTE,
......@@ -100,7 +99,31 @@ struct switch_io_event_hooks;
typedef switch_call_cause_t (*switch_io_outgoing_channel_t)
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
(switch_core_session_t *, switch_event_t *, switch_caller_profile_t *, switch_core_session_t **, switch_memory_pool_t **, switch_originate_flag_t);
typedef switch_status_t (*switch_io_read_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
typedef switch_status_t (*switch_io_write_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
typedef switch_status_t (*switch_io_kill_channel_t) (switch_core_session_t *, int);
......@@ -108,9 +131,9 @@ typedef switch_status_t (*switch_io_send_dtmf_t) (switch_core_session_t *, const
typedef switch_status_t (*switch_io_receive_message_t) (switch_core_session_t *, switch_core_session_message_t *);
typedef switch_status_t (*switch_io_receive_event_t) (switch_core_session_t *, switch_event_t *);
typedef switch_status_t (*switch_io_state_change_t) (switch_core_session_t *);
typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
typedef switch_status_t (*switch_io_read_video_frame_t) (switch_core_session_t *, switch_frame_t **, switch_io_flag_t, int);
typedef switch_status_t (*switch_io_write_video_frame_t) (switch_core_session_t *, switch_frame_t *, switch_io_flag_t, int);
typedef switch_call_cause_t (*switch_io_resurrect_session_t)(switch_core_session_t **, switch_memory_pool_t **, void *);
typedef switch_call_cause_t (*switch_io_resurrect_session_t) (switch_core_session_t **, switch_memory_pool_t **, void *);
typedef enum {
SWITCH_IO_OUTGOING_CHANNEL,
......@@ -192,7 +215,7 @@ struct switch_timer {
switch_memory_pool_t *memory_pool;
/*! private data for loadable modules to store information */
void *private_info;
/*! remaining time from last call to _check()*/
/*! remaining time from last call to _check() */
switch_size_t diff;
switch_size_t tick;
};
......@@ -346,7 +369,7 @@ struct switch_asr_handle {
/*! The Rate */
uint32_t rate;
char *grammar;
/*! module specific param*/
/*! module specific param */
char *param;
/*! the handle's memory pool */
switch_memory_pool_t *memory_pool;
......@@ -365,7 +388,7 @@ struct switch_speech_interface {
/*! function to feed audio to the ASR */
switch_status_t (*speech_feed_tts) (switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
/*! function to read audio from the TTS */
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, uint32_t * rate, switch_speech_flag_t *flags);
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags);
void (*speech_flush_tts) (switch_speech_handle_t *sh);
void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
......@@ -389,7 +412,7 @@ struct switch_speech_handle {
uint32_t samples;
char voice[80];
char *engine;
/*! module specific param*/
/*! module specific param */
char *param;
/*! the handle's memory pool */
switch_memory_pool_t *memory_pool;
......@@ -526,7 +549,7 @@ struct switch_codec_implementation {
char *fmtp;
/*! samples transferred per second */
uint32_t samples_per_second;
/*! actual samples transferred per second for those who are not moron g722 RFC writers*/
/*! actual samples transferred per second for those who are not moron g722 RFC writers */
uint32_t actual_samples_per_second;
/*! bits transferred per second */
int bits_per_second;
......@@ -545,13 +568,13 @@ struct switch_codec_implementation {
/*! max number of frames to send in one network packet */
int max_frames_per_packet;
/*! function to initialize a codec handle using this implementation */
switch_core_codec_init_func_t init;
switch_core_codec_init_func_t init;
/*! function to encode raw data into encoded data */
switch_core_codec_encode_func_t encode;
switch_core_codec_encode_func_t encode;
/*! function to decode encoded data into raw data */
switch_core_codec_decode_func_t decode;
switch_core_codec_decode_func_t decode;
/*! deinitalize a codec handle using this implementation */
switch_core_codec_destroy_func_t destroy;
switch_core_codec_destroy_func_t destroy;
uint32_t codec_id;
struct switch_codec_implementation *next;
};
......
......@@ -44,9 +44,7 @@
#endif
#include <sqltypes.h>
SWITCH_BEGIN_EXTERN_C
struct switch_odbc_handle;
SWITCH_BEGIN_EXTERN_C struct switch_odbc_handle;
typedef enum {
SWITCH_ODBC_STATE_INIT,
......@@ -70,7 +68,6 @@ SWITCH_DECLARE(switch_odbc_status_t) switch_odbc_handle_callback_exec(switch_odb
char *sql, switch_core_db_callback_func_t callback, void *pdata);
SWITCH_DECLARE(char *) switch_odbc_handle_get_error(switch_odbc_handle_t *handle, SQLHSTMT stmt);
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
* Local Variables:
......
......@@ -59,21 +59,16 @@ SWITCH_BEGIN_EXTERN_C
* C4610: struct can never be instantiated - user defined constructor required
*/
#pragma warning(disable:4100 4200 4204 4706 4819 4132 4510 4512 4610 4996)
#define SWITCH_HAVE_ODBC 1
#ifdef _MSC_VER
# pragma comment(lib, "odbc32.lib")
#endif
#pragma include_alias(<libteletone.h>, <../../libs/libteletone/src/libteletone.h>)
#pragma include_alias(<libteletone_generate.h>, <../../libs/libteletone/src/libteletone_generate.h>)
#pragma include_alias(<libteletone_detect.h>, <../../libs/libteletone/src/libteletone_detect.h>)
#if (_MSC_VER >= 1400) // VC8+
#define switch_assert(expr) assert(expr);__analysis_assume( expr )
#endif
#if (_MSC_VER >= 1400) // VC8+
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
......@@ -90,7 +85,7 @@ SWITCH_BEGIN_EXTERN_C
#undef inline
#define inline __inline
#ifndef uint32_t
typedef unsigned __int8 uint8_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
......@@ -187,9 +182,9 @@ typedef int gid_t;
#define PRINTF_FUNCTION(fmtstr,vars)
#endif
#ifdef SWITCH_INT32
typedef SWITCH_INT32 switch_int32_t;
typedef SWITCH_INT32 switch_int32_t;
#else
typedef int32_t switch_int32_t;
typedef int32_t switch_int32_t;
#endif
#ifdef SWITCH_SIZE_T
......@@ -298,10 +293,9 @@ SWITCH_END_EXTERN_C
#ifndef switch_assert
#define switch_assert(expr) assert(expr)
#endif
#ifndef __ATTR_SAL
/* used for msvc code analysis */
/* http://msdn2.microsoft.com/en-us/library/ms235402.aspx */
/* used for msvc code analysis */
/* http://msdn2.microsoft.com/en-us/library/ms235402.aspx */
#define _In_
#define _In_z_
#define _In_opt_z_
......@@ -324,8 +318,6 @@ SWITCH_END_EXTERN_C
#define _Out_ptrdiff_cap_(x)
#define _Out_opt_ptrdiff_cap_(x)
#endif
/* For Emacs:
* Local Variables:
* mode:c
......
......@@ -45,9 +45,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_RTP_KEY_LEN 30
#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
#define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80"
typedef enum {
typedef enum {
SWITCH_RTP_CRYPTO_SEND,
SWITCH_RTP_CRYPTO_RECV,
SWITCH_RTP_CRYPTO_MAX
......@@ -72,16 +70,13 @@ typedef struct switch_rtp_crypto_key switch_rtp_crypto_key_t;
SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_session,
switch_rtp_crypto_direction_t direction,
uint32_t index,
switch_rtp_crypto_key_type_t type,
unsigned char *key,
switch_size_t keylen);
uint32_t index, switch_rtp_crypto_key_type_t type, unsigned char *key, switch_size_t keylen);
///\defgroup rtp RTP (RealTime Transport Protocol)
///\ingroup core1
///\{
typedef void (*switch_rtp_invalid_handler_t) (switch_rtp_t *rtp_session,
switch_socket_t * sock, void *data, switch_size_t datalen, switch_sockaddr_t * from_addr);
typedef void (*switch_rtp_invalid_handler_t) (switch_rtp_t *rtp_session,
switch_socket_t *sock, void *data, switch_size_t datalen, switch_sockaddr_t *from_addr);
SWITCH_DECLARE(void) switch_rtp_get_random(void *buf, uint32_t len);
......@@ -130,10 +125,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **new_rtp_session
switch_payload_t payload,
uint32_t samples_per_interval,
uint32_t ms_per_packet,
switch_rtp_flag_t flags,
char *timer_name,
const char **err,
switch_memory_pool_t *pool);
switch_rtp_flag_t flags, char *timer_name, const char **err, switch_memory_pool_t *pool);
/*!
......@@ -158,10 +150,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
switch_payload_t payload,
uint32_t samples_per_interval,
uint32_t ms_per_packet,
switch_rtp_flag_t flags,
char *timer_name,
const char **err,
switch_memory_pool_t *pool);
switch_rtp_flag_t flags, char *timer_name, const char **err, switch_memory_pool_t *pool);
/*!
......@@ -296,7 +285,7 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, sw
\param io_flags i/o flags
\return the number of bytes read
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t * datalen,
SWITCH_DECLARE(switch_status_t) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen,
switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags);
/*!
......@@ -341,7 +330,8 @@ SWITCH_DECLARE(switch_size_t) switch_rtp_dequeue_dtmf(switch_rtp_t *rtp_session,
\return the number of bytes read
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session,
void **data, uint32_t * datalen, switch_payload_t *payload_type, switch_frame_flag_t *flags, switch_io_flag_t io_flags);
void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag_t *flags,
switch_io_flag_t io_flags);
/*!
\brief Read data from a given RTP session without copying
......@@ -390,9 +380,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_fra
\return the number of bytes written
*/
SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session,
void *data,
uint32_t datalen,
uint8_t m, switch_payload_t payload, uint32_t ts, switch_frame_flag_t *flags);
void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, switch_frame_flag_t *flags);
/*!
\brief Retrieve the SSRC from a given RTP session
......
......@@ -137,7 +137,7 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se
\param len the length of the data
\return a stun packet pointer to buf to use as an access point
*/
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_parse(uint8_t * buf, uint32_t len);
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_parse(uint8_t *buf, uint32_t len);
/*!
\brief Obtain a printable string form of a given value
......@@ -155,7 +155,7 @@ SWITCH_DECLARE(const char *) switch_stun_value_to_name(int32_t type, uint32_t va
\param port the port
\return true or false
*/
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_get_mapped_address(switch_stun_packet_attribute_t *attribute, char *ipstr, uint16_t * port);
SWITCH_DECLARE(uint8_t) switch_stun_packet_attribute_get_mapped_address(switch_stun_packet_attribute_t *attribute, char *ipstr, uint16_t *port);
/*!
\brief Extract a username from a packet attribute
......@@ -174,7 +174,7 @@ SWITCH_DECLARE(char *) switch_stun_packet_attribute_get_username(switch_stun_pac
\param buf a pointer to data to use for the packet
\return a pointer to a ready-to-use stun packet
*/
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_build_header(switch_stun_message_t type, char *id, uint8_t * buf);
SWITCH_DECLARE(switch_stun_packet_t *) switch_stun_packet_build_header(switch_stun_message_t type, char *id, uint8_t *buf);
/*!
\brief Add a username packet attribute
......
......@@ -91,11 +91,9 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_SEQ_CLEARLINE SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINE_CHAR_STR
#define SWITCH_SEQ_CLEARLINEEND SWITCH_SEQ_ESC SWITCH_SEQ_CLEARLINEEND_CHAR
#define SWITCH_SEQ_CLEARSCR SWITCH_SEQ_ESC SWITCH_SEQ_CLEARSCR_CHAR SWITCH_SEQ_HOME
#define SWITCH_DEFAULT_DTMF_DURATION 2000
#define SWITCH_MAX_DTMF_DURATION 192000
#define SWITCH_DEFAULT_DIR_PERMS SWITCH_FPROT_UREAD | SWITCH_FPROT_UWRITE | SWITCH_FPROT_UEXECUTE | SWITCH_FPROT_GREAD | SWITCH_FPROT_GEXECUTE
#ifdef WIN32
#define SWITCH_PATH_SEPARATOR "\\"
#else
......@@ -144,7 +142,7 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_SPEECH_KEY "speech"
#define SWITCH_UUID_BRIDGE "uuid_bridge"
#define SWITCH_BITS_PER_BYTE 8
typedef uint8_t switch_byte_t;
typedef uint8_t switch_byte_t;
typedef struct {
char digit;
......@@ -168,7 +166,7 @@ typedef enum {
typedef enum {
SOF_NONE = 0,
SOF_NOBLOCK = (1 << 0),
SOF_FORKED_DIAL = (1 << 1)
SOF_FORKED_DIAL = (1 << 1)
} switch_originate_flag_t;
typedef enum {
......@@ -185,7 +183,7 @@ typedef enum {
typedef enum {
SCF_NONE = 0,
SCF_USE_SQL = ( 1 << 0),
SCF_USE_SQL = (1 << 0),
SCF_NO_NEW_SESSIONS = (1 << 1),
SCF_SHUTTING_DOWN = (1 << 2),
SCF_CRASH_PROT = (1 << 3)
......@@ -320,10 +318,10 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs;
#define SWITCH_MAX_STACKS 32
#define SWITCH_THREAD_STACKSIZE 240 * 1024
#define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
#define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
#define SWITCH_MAX_INTERVAL 120 /* we only do up to 120ms */
#define SWITCH_INTERVAL_PAD 10 /* A little extra buffer space to be safe */
#define SWITCH_MAX_SAMPLE_LEN 32
#define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
#define SWITCH_BYTES_PER_SAMPLE 2 /* slin is 2 bytes per sample */
#define SWITCH_RECOMMENDED_BUFFER_SIZE (SWITCH_BYTES_PER_SAMPLE * SWITCH_MAX_SAMPLE_LEN * (SWITCH_MAX_INTERVAL + SWITCH_INTERVAL_PAD))
#define SWITCH_MAX_CODECS 30
#define SWITCH_MAX_STATE_HANDLERS 30
......@@ -425,29 +423,29 @@ typedef enum {
#if __BYTE_ORDER == __BIG_ENDIAN
typedef struct {
unsigned version:2; /* protocol version */
unsigned p:1; /* padding flag */
unsigned x:1; /* header extension flag */
unsigned cc:4; /* CSRC count */
unsigned m:1; /* marker bit */
unsigned pt:7; /* payload type */
unsigned seq:16; /* sequence number */
unsigned ts:32; /* timestamp */
unsigned ssrc:32; /* synchronization source */
unsigned version:2; /* protocol version */
unsigned p:1; /* padding flag */
unsigned x:1; /* header extension flag */
unsigned cc:4; /* CSRC count */
unsigned m:1; /* marker bit */
unsigned pt:7; /* payload type */
unsigned seq:16; /* sequence number */
unsigned ts:32; /* timestamp */
unsigned ssrc:32; /* synchronization source */
} switch_rtp_hdr_t;
#else /* BIG_ENDIAN */
typedef struct {
unsigned cc:4; /* CSRC count */
unsigned x:1; /* header extension flag */
unsigned p:1; /* padding flag */
unsigned version:2; /* protocol version */
unsigned pt:7; /* payload type */
unsigned m:1; /* marker bit */
unsigned seq:16; /* sequence number */
unsigned ts:32; /* timestamp */
unsigned ssrc:32; /* synchronization source */
unsigned cc:4; /* CSRC count */
unsigned x:1; /* header extension flag */
unsigned p:1; /* padding flag */
unsigned version:2; /* protocol version */
unsigned pt:7; /* payload type */
unsigned m:1; /* marker bit */
unsigned seq:16; /* sequence number */
unsigned ts:32; /* timestamp */
unsigned ssrc:32; /* synchronization source */
} switch_rtp_hdr_t;
#endif
......@@ -1210,25 +1208,19 @@ typedef switch_bool_t (*switch_media_bug_callback_t) (switch_media_bug_t *, void
typedef switch_status_t (*switch_core_codec_encode_func_t) (switch_codec_t *codec,
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
void *encoded_data,
uint32_t * encoded_data_len,
uint32_t * encoded_rate,
unsigned int *flag);
switch_codec_t *other_codec,
void *decoded_data,
uint32_t decoded_data_len,
uint32_t decoded_rate,
void *encoded_data, uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag);
typedef switch_status_t (*switch_core_codec_decode_func_t) (switch_codec_t *codec,
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
void *decoded_data,
uint32_t * decoded_data_len,
uint32_t * decoded_rate,
unsigned int *flag);
switch_codec_t *other_codec,
void *encoded_data,
uint32_t encoded_data_len,
uint32_t encoded_rate,
void *decoded_data, uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag);
typedef switch_status_t (*switch_core_codec_init_func_t) (switch_codec_t *, switch_codec_flag_t, const switch_codec_settings_t *codec_settings);
typedef switch_status_t (*switch_core_codec_destroy_func_t) (switch_codec_t *);
......@@ -1255,7 +1247,8 @@ typedef struct switch_stream_handle switch_stream_handle_t;
typedef switch_status_t (*switch_stream_handle_write_function_t) (switch_stream_handle_t *handle, const char *fmt, ...);
typedef switch_status_t (*switch_stream_handle_raw_write_function_t) (switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen);
typedef switch_status_t (*switch_api_function_t) (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream);
typedef switch_status_t (*switch_api_function_t) (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session,
_In_ switch_stream_handle_t *stream);
#define SWITCH_STANDARD_API(name) static switch_status_t name (_In_opt_z_ const char *cmd, _In_opt_ switch_core_session_t *session, _In_ switch_stream_handle_t *stream)
......@@ -1274,9 +1267,9 @@ typedef switch_status_t (*switch_say_callback_t) (switch_core_session_t *session
char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args);
typedef struct switch_xml *switch_xml_t;
typedef struct switch_core_time_duration switch_core_time_duration_t;
typedef switch_xml_t(*switch_xml_search_function_t) (const char *section,
const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
void *user_data);
typedef switch_xml_t (*switch_xml_search_function_t) (const char *section,
const char *tag_name, const char *key_name, const char *key_value, switch_event_t *params,
void *user_data);
typedef struct switch_hash switch_hash_t;
struct HashElem;
......@@ -1290,9 +1283,9 @@ typedef struct switch_network_list switch_network_list_t;
#define SWITCH_MODULE_LOAD_ARGS (switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool)
#define SWITCH_MODULE_RUNTIME_ARGS (void)
#define SWITCH_MODULE_SHUTDOWN_ARGS (void)
typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS ;
typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS ;
typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS ;
typedef switch_status_t (*switch_module_load_t) SWITCH_MODULE_LOAD_ARGS;
typedef switch_status_t (*switch_module_runtime_t) SWITCH_MODULE_RUNTIME_ARGS;
typedef switch_status_t (*switch_module_shutdown_t) SWITCH_MODULE_SHUTDOWN_ARGS;
#define SWITCH_MODULE_LOAD_FUNCTION(name) switch_status_t name SWITCH_MODULE_LOAD_ARGS
#define SWITCH_MODULE_RUNTIME_FUNCTION(name) switch_status_t name SWITCH_MODULE_RUNTIME_ARGS
#define SWITCH_MODULE_SHUTDOWN_FUNCTION(name) switch_status_t name SWITCH_MODULE_SHUTDOWN_ARGS
......
......@@ -54,15 +54,12 @@ SWITCH_BEGIN_EXTERN_C
#else
#define switch_is_file_path(file) (file && ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR)))
#endif
/*!
\brief Test for NULL or zero length string
\param s the string to test
\return true value if the string is NULL or zero length
*/
#define switch_strlen_zero(s) (!s || *s == '\0')
static inline switch_bool_t switch_is_moh(const char *s)
{
if (switch_strlen_zero(s) || !strcasecmp(s, "silence") || !strcasecmp(s, "indicate_hold")) {
......@@ -78,9 +75,10 @@ SWITCH_DECLARE(switch_status_t) switch_b64_encode(unsigned char *in, switch_size
SWITCH_DECLARE(switch_size_t) switch_b64_decode(char *in, char *out, switch_size_t olen);
SWITCH_DECLARE(char *) switch_amp_encode(char *s, char *buf, switch_size_t len);
static inline switch_bool_t switch_is_digit_string(const char *s) {
static inline switch_bool_t switch_is_digit_string(const char *s)
{
while(s && *s) {
while (s && *s) {
if (*s < 48 || *s > 57) {
return SWITCH_FALSE;
}
......@@ -113,7 +111,8 @@ atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
\param family the address family to return (AF_INET or AF_INET6)
\return SWITCH_STATUS_SUCCESSS for success, otherwise failure
*/
SWITCH_DECLARE(switch_status_t) switch_find_local_ip(_Out_opt_bytecapcount_(len) char *buf, _In_ int len, _In_ int family);
SWITCH_DECLARE(switch_status_t) switch_find_local_ip(_Out_opt_bytecapcount_(len)
char *buf, _In_ int len, _In_ int family);
/*!
\brief find the char representation of an ip adress
......@@ -205,7 +204,7 @@ switch_mutex_unlock(obj->flag_mutex);
#define switch_set_string(_dst, _src) switch_copy_string(_dst, _src, sizeof(_dst))
static inline char *switch_clean_string(char *s)
static inline char *switch_clean_string(char *s)
{
char *p;
for (p = s; p && *p; p++) {
......@@ -247,11 +246,11 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
}
S = strdup(s);
assert(S != NULL);
for (p = S; p && *p; p++) {
*p = (char)toupper(*p);
*p = (char) toupper(*p);
}
if (strstr(S, q)) {
......@@ -263,9 +262,9 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
assert(Q != NULL);
for (p = Q; p && *p; p++) {
*p = (char)toupper(*p);
*p = (char) toupper(*p);
}
if (strstr(s, Q)) {
tf = SWITCH_TRUE;
goto done;
......@@ -275,8 +274,8 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
tf = SWITCH_TRUE;
goto done;
}
done:
done:
switch_safe_free(S);
switch_safe_free(Q);
......@@ -345,7 +344,7 @@ SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in,
\param ms the number of milliseconds to wait
\return the requested condition
*/
SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t * poll, int ms);
SWITCH_DECLARE(int) switch_socket_waitfor(switch_pollfd_t *poll, int ms);
/*!
\brief Create a pointer to the file name in a given file path eliminating the directory name
......@@ -369,7 +368,7 @@ SWITCH_DECLARE(switch_status_t) switch_network_list_add_host_mask(switch_network
SWITCH_DECLARE(switch_bool_t) switch_network_list_validate_ip(switch_network_list_t *list, uint32_t ip);
#define switch_test_subnet(_ip, _net, _mask) (_mask ? ((_net & _mask) == (_ip & _mask)) : _net ? _net == _ip : 1)
int switch_inet_pton(int af, const char *src, void *dst);
int switch_inet_pton(int af, const char *src, void *dst);
/* malloc or DIE macros */
#ifdef NDEBUG
......
......@@ -184,7 +184,7 @@ SWITCH_DECLARE(const char *) switch_xml_attr_soft(switch_xml_t xml, const char *
///\ Returns NULL if not found.
///\param xml the xml node
///\return an xml node or NULL
SWITCH_DECLARE(switch_xml_t) switch_xml_get(switch_xml_t xml,...);
SWITCH_DECLARE(switch_xml_t) switch_xml_get(switch_xml_t xml, ...);
///\brief Converts an switch_xml structure back to xml. Returns a string of xml data that
///\ must be freed.
......@@ -234,7 +234,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_new(const char *name);
///\param name the name of the tag
///\param off the offset
///\return an xml node or NULL
SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(switch_xml_t xml, const char *name, switch_size_t off);
SWITCH_DECLARE(switch_xml_t) switch_xml_add_child(switch_xml_t xml, const char *name, switch_size_t off);
///\brief wrapper for switch_xml_add_child() that strdup()s name
///\param xml the xml node
......@@ -247,7 +247,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_new(const char *name);
///\param xml the xml node
///\param txt the text
///\return an xml node or NULL
SWITCH_DECLARE(switch_xml_t) switch_xml_set_txt(switch_xml_t xml, const char *txt);
SWITCH_DECLARE(switch_xml_t) switch_xml_set_txt(switch_xml_t xml, const char *txt);
///\brief wrapper for switch_xml_set_txt() that strdup()s txt
///\ sets the character content for the given tag and returns the tag
......@@ -324,25 +324,22 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_root(void);
///\return SWITCH_STATUS_SUCCESS if successful root and node will be assigned
SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
const char *tag_name,
const char *key_name, const char *key_value, switch_xml_t * root, switch_xml_t * node,
const char *key_name, const char *key_value, switch_xml_t *root, switch_xml_t *node,
switch_event_t *params);
SWITCH_DECLARE(switch_status_t) switch_xml_locate_domain(const char *domain_name, switch_event_t *params, switch_xml_t *root, switch_xml_t *domain);
SWITCH_DECLARE(switch_status_t) switch_xml_locate_user(const char *key,
const char *user_name,
const char *domain_name,
const char *ip,
switch_xml_t *root,
switch_xml_t *domain,
switch_xml_t *user,
switch_event_t *params);
const char *user_name,
const char *domain_name,
const char *ip,
switch_xml_t *root, switch_xml_t *domain, switch_xml_t *user, switch_event_t *params);
///\brief open a config in the core registry
///\param file_path the name of the config section e.g. modules.conf
///\param node a pointer to point to the node if it is found
///\param params optional URL formatted params to pass to external gateways
///\return the root xml node associated with the current request or NULL
SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t * node, switch_event_t *params);
SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t *node, switch_event_t *params);
///\brief bind a search function to an external gateway
///\param function the search function to bind
......
差异被折叠。
......@@ -280,7 +280,7 @@ SWITCH_DECLARE(switch_size_t) switch_buffer_zwrite(switch_buffer_t *buffer, cons
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
{
if (buffer && *buffer) {
if (buffer && *buffer) {
if ((switch_test_flag((*buffer), SWITCH_BUFFER_FLAG_DYNAMIC))) {
switch_safe_free((*buffer)->data);
free(*buffer);
......
......@@ -44,16 +44,14 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_new(switch_memor
const char *network_addr,
const char *ani,
const char *aniii,
const char *rdnis,
const char *source,
const char *context,
const char *destination_number)
const char *rdnis,
const char *source, const char *context, const char *destination_number)
{
switch_caller_profile_t *profile = NULL;
profile = switch_core_alloc(pool, sizeof(*profile));
switch_assert(profile != NULL);
if (!context) {
context = "default";
}
......@@ -276,7 +274,8 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
switch_event_add_header(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
}
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, const char *extension_name, const char *extension_number)
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, const char *extension_name,
const char *extension_number)
{
switch_caller_extension_t *caller_extension = NULL;
......@@ -290,7 +289,8 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_c
}
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
switch_caller_extension_t *caller_extension, const char *application_name, const char *application_data)
switch_caller_extension_t *caller_extension, const char *application_name,
const char *application_data)
{
switch_caller_application_t *caller_application = NULL;
......
差异被折叠。
......@@ -33,7 +33,7 @@
#include <switch.h>
#include <switch_config.h>
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_path)
SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_path)
{
FILE *f;
char *path = NULL;
......@@ -88,7 +88,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa
}
}
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg)
SWITCH_DECLARE(void) switch_config_close_file(switch_config_t *cfg)
{
if (cfg->file) {
......@@ -98,7 +98,7 @@ SWITCH_DECLARE(void) switch_config_close_file(switch_config_t * cfg)
memset(cfg, 0, sizeof(*cfg));
}
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t * cfg, char **var, char **val)
SWITCH_DECLARE(int) switch_config_next_pair(switch_config_t *cfg, char **var, char **val)
{
int ret = 0;
char *p, *end;
......
差异被折叠。
差异被折叠。
......@@ -37,11 +37,7 @@
SWITCH_DECLARE(switch_status_t) switch_core_asr_open(switch_asr_handle_t *ah,
const char *module_name,
const char *codec,
int rate,
const char *dest,
switch_asr_flag_t *flags,
switch_memory_pool_t *pool)
const char *codec, int rate, const char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool)
{
switch_status_t status;
char buf[256] = "";
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
......@@ -35,7 +35,8 @@
#include <switch.h>
#include "private/switch_core_pvt.h"
SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples, switch_memory_pool_t *pool)
SWITCH_DECLARE(switch_status_t) switch_core_timer_init(switch_timer_t *timer, const char *timer_name, int interval, int samples,
switch_memory_pool_t *pool)
{
switch_timer_interface_t *timer_interface;
switch_status_t status;
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论