diff --git a/src/include/switch.h b/src/include/switch.h index 67a04db7ec..e7badb4d61 100644 --- a/src/include/switch.h +++ b/src/include/switch.h @@ -35,13 +35,13 @@ #ifndef SWITCH_H #define SWITCH_H -#ifdef __cplusplus -#define BEGIN_EXTERN_C extern "C" { -#define END_EXTERN_C } -#else -#define BEGIN_EXTERN_C -#define END_EXTERN_C -#endif +#ifdef __cplusplus +#define BEGIN_EXTERN_C extern "C" { +#define END_EXTERN_C } +#else +#define BEGIN_EXTERN_C +#define END_EXTERN_C +#endif BEGIN_EXTERN_C diff --git a/src/include/switch_apr.h b/src/include/switch_apr.h index 29d9e38d78..f2036d7905 100644 --- a/src/include/switch_apr.h +++ b/src/include/switch_apr.h @@ -256,7 +256,7 @@ typedef apr_thread_cond_t switch_thread_cond_t; DoxyDefine(apr_status_t switch_thread_cond_create(switch_thread_cond_t **cond, switch_pool_t *pool);) #define switch_thread_cond_create apr_thread_cond_create -typedef apr_os_thread_t switch_thread_id; +typedef apr_os_thread_t switch_thread_id_t; #define switch_thread_data_set apr_thread_data_set #define switch_thread_data_get apr_thread_data_get @@ -331,7 +331,7 @@ DoxyDefine(apr_status_t switch_thread_cond_destroy(switch_thread_cond_t *cond);) */ /** Opaque Thread structure. */ -typedef apr_thread_t switch_thread; +typedef apr_thread_t switch_thread_t; /** Opaque Thread attributes structure. */ typedef apr_threadattr_t switch_threadattr_t; @@ -947,7 +947,7 @@ DoxyDefine(apr_status_t switch_mcast_interface(switch_socket_t *sock, * @{ */ /** The fundamental pool type */ -typedef apr_pool_t switch_memory_pool; +typedef apr_pool_t switch_memory_pool_t; /** @@ -958,7 +958,7 @@ typedef apr_pool_t switch_memory_pool; * to re-use this memory for the next allocation. * @see apr_pool_destroy() */ -DoxyDefine(void switch_pool_clear(switch_memory_pool *p);) +DoxyDefine(void switch_pool_clear(switch_memory_pool_t *p);) #define switch_pool_clear apr_pool_clear /** @} */ @@ -1135,7 +1135,7 @@ DoxyDefine(void switch_sleep(apr_interval_time_t t);) */ /** Abstract type for hash tables. */ -typedef apr_hash_t switch_hash; +typedef apr_hash_t switch_hash_t; /** Abstract type for scanning hash tables. */ typedef apr_hash_index_t switch_hash_index_t; @@ -1392,7 +1392,7 @@ typedef apr_thread_mutex_t switch_mutex_t; * SWITCH_DECLARE(switch_status) switch_mutex_init(switch_mutex_t **lock, switch_lock_flag flags, - switch_memory_pool *pool); + switch_memory_pool_t *pool); */ #define switch_mutex_init apr_thread_mutex_create /** diff --git a/src/include/switch_buffer.h b/src/include/switch_buffer.h index 582fbc0f40..4429a01e4e 100644 --- a/src/include/switch_buffer.h +++ b/src/include/switch_buffer.h @@ -60,7 +60,7 @@ struct switch_buffer; * \param max_len length required by the buffer * \return status */ -SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool *pool, switch_buffer **buffer, switch_size_t max_len); +SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len); /*! \brief Get the length of a switch_buffer * \param buffer any buffer of type switch_buffer diff --git a/src/include/switch_caller.h b/src/include/switch_caller.h index c2aeac4e22..c3ebec4def 100644 --- a/src/include/switch_caller.h +++ b/src/include/switch_caller.h @@ -151,7 +151,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session \param destination_number destination number \return a new profile object allocated from the session's memory pool */ -SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, +SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool, char *dialplan, char *caller_id_name, char *caller_id_number, @@ -179,7 +179,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_ \param event the event to add the information to */ -SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event *event); +SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, switch_event_t *event); END_EXTERN_C diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h index ba6487b1d2..b49c5169b0 100644 --- a/src/include/switch_channel.h +++ b/src/include/switch_channel.h @@ -122,7 +122,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch \param pool memory_pool to use for allocation \return SWITCH_STATUS_SUCCESS if successful */ -SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool); /*! \brief Connect a newly allocated channel to a session object and setup it's initial state @@ -367,7 +367,7 @@ SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state stat \param channel channel to add information about \param event event to add information to */ -SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event *event); +SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event); // These may go away diff --git a/src/include/switch_core.h b/src/include/switch_core.h index a9fb053895..5ea70f4d65 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -82,7 +82,7 @@ struct switch_core_thread_session { /*! array of void pointers to pass mutiple data objects */ void *objs[SWITCH_MAX_CORE_THREAD_SESSION_OBJS]; /*! a pointer to a memory pool if the thread has it's own pool */ - switch_memory_pool *pool; + switch_memory_pool_t *pool; }; struct switch_core_session; @@ -162,13 +162,13 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_core_get_state_handler \brief Create a new sub memory pool from the core's master pool \return SWITCH_STATUS_SUCCESS on success */ -SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **pool); +SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool_t **pool); /*! \brief Returns a subpool back to the main pool \return SWITCH_STATUS_SUCCESS on success */ -SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool **pool); +SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool_t **pool); /*! \brief Start the session's state machine @@ -196,7 +196,7 @@ SWITCH_DECLARE(void *) switch_core_permenant_alloc(switch_size_t memory); \param memory the number of bytes to allocate \return a void pointer to the allocated memory */ -SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t memory); +SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory); /*! \brief Allocate memory from a session's pool @@ -228,7 +228,7 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session, \param todup the string to duplicate \return a pointer to the newly duplicated string */ -SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup); +SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todup); /*! \brief Retrieve the memory pool from a session @@ -236,7 +236,7 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup) \return the session's pool \note to be used sparingly */ -SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_session *session); +SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session); ///\} ///\defgroup sessm Session Creation / Management @@ -248,7 +248,7 @@ SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_se \param pool the pool to use for the allocation (a new one will be used if NULL) \return the newly created session */ -SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, switch_memory_pool *pool); +SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, switch_memory_pool_t *pool); /*! \brief Destroy a session and return the memory pool to the core @@ -263,7 +263,7 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session); \param pool the pool to use \return the newly created session */ -SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool *pool); +SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool); /*! \brief Launch the session thread (state machine) on a given session @@ -312,7 +312,7 @@ SWITCH_DECLARE (switch_status) switch_core_session_message_send(char *uuid_str, \param event the event to send \return the status returned by the message handler */ -SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event *event); +SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event_t *event); /*! \brief Retrieve private user data from a session @@ -358,7 +358,7 @@ SWITCH_DECLARE(int) switch_core_session_get_stream_count(switch_core_session *se \param func a function to execute in the thread \param obj an arguement */ -SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, void *(*func)(switch_thread *, void *), void *obj); +SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, void *(*func)(switch_thread_t *, void *), void *obj); /*! \brief Signal a thread using a thread session to terminate @@ -387,7 +387,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s char *endpoint_name, switch_caller_profile *caller_profile, switch_core_session **new_session, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! \brief Answer the channel of a given session @@ -410,7 +410,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se \param event the event to queue \return the status returned by the message handler */ -SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event *event); +SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event); /*! \brief Read a frame from a session @@ -563,14 +563,14 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switc \param pool the pool to use for the new hash \return SWITCH_STATUS_SUCCESS if the hash is created */ -SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash_t **hash, switch_memory_pool_t *pool); /*! \brief Destroy an existing hash table \param hash the hash to destroy \return SWITCH_STATUS_SUCCESS if the hash is destroyed */ -SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash); +SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash_t *hash); /*! \brief Insert data into a hash @@ -580,7 +580,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash); \return SWITCH_STATUS_SUCCESS if the data is added \note the string key must be a constant or a dynamic string */ -SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *key, void *data); +SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash_t *hash, char *key, void *data); /*! \brief Insert data into a hash with dynamicly allocated key name @@ -589,7 +589,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *k \param data the data to add \return SWITCH_STATUS_SUCCESS if the data is added */ -SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, char *key, void *data); +SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash_t *hash, char *key, void *data); /*! \brief Delete data from a hash based on desired key @@ -597,7 +597,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, cha \param key the key from which to delete the data \return SWITCH_STATUS_SUCCESS if the data is deleted */ -SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *key); +SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash_t *hash, char *key); /*! \brief Retrieve data from a given hash @@ -605,7 +605,7 @@ SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *k \param key the key to retrieve \return a pointer to the data held in the key */ -SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key); +SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, char *key); ///\} ///\defgroup timer Timer Functions @@ -620,7 +620,7 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key); \param pool the memory pool to use for allocation \return */ -SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, switch_memory_pool_t *pool); /*! \brief Wait for one cycle on an existing timer @@ -659,7 +659,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, int channels, uint32_t flags, const switch_codec_settings *codec_settings, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! \brief Encode data using a codec handle @@ -777,7 +777,7 @@ SWITCH_DECLARE(switch_core_db *) switch_core_db_open_file(char *filename); \return SWITCH_STATUS_SUCCESS if the file is opened \note the loadable module used is chosen based on the file extension */ -SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, switch_memory_pool_t *pool); /*! \brief Read media from a file handle @@ -833,7 +833,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh, char *voice_name, unsigned int rate, switch_speech_flag *flags, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! \brief Feed data to the ASR module @@ -907,7 +907,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle char *source, char *dsn, char *passwd, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! \brief Query a directory handle @@ -967,7 +967,7 @@ SWITCH_DECLARE(FILE *) switch_core_get_console(void); /*! \brief Launch a thread */ -SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func)(switch_thread *, void*), void *obj, switch_memory_pool *pool); +SWITCH_DECLARE(void) switch_core_launch_thread(void *(*func)(switch_thread_t *, void*), void *obj, switch_memory_pool_t *pool); /*! \brief Initiate Globals diff --git a/src/include/switch_event.h b/src/include/switch_event.h index 8abdddb270..2ffc7a22bc 100644 --- a/src/include/switch_event.h +++ b/src/include/switch_event.h @@ -63,7 +63,7 @@ BEGIN_EXTERN_C /*! \brief An event Header */ -struct switch_event_header { +struct switch_event_header{ /*! the header name */ char *name; /*! the header value */ @@ -82,7 +82,7 @@ struct switch_event_subclass { /*! \brief Representation of an event */ struct switch_event { /*! the event id (descriptor) */ - switch_event_t event_id; + switch_event_types_t event_id; /*! the priority of the event */ switch_priority_t priority; /*! the owner of the event */ @@ -90,7 +90,7 @@ struct switch_event { /*! the subclass of the event */ switch_event_subclass *subclass; /*! the event headers */ - struct switch_event_header *headers; + switch_event_header_t *headers; /*! the body of the event */ char *body; /*! user data from the subclass provider */ @@ -105,7 +105,7 @@ struct switch_event_node { /*! the id of the node */ char *id; /*! the event id enumeration to bind to */ - switch_event_t event_id; + switch_event_types_t event_id; /*! the event subclass to bind to for custom events */ switch_event_subclass *subclass; /*! a callback function to execute when the event is triggered */ @@ -122,7 +122,7 @@ struct switch_event_node { \param pool the memory pool to use for the event system (creates a new one if NULL) \return SWITCH_STATUS_SUCCESS when complete */ -SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool_t *pool); /*! \brief Stop the eventing system @@ -137,7 +137,7 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void); \param subclass_name the subclass name for custom event (only valid when event_id is SWITCH_EVENT_CUSTOM) \return SWITCH_STATUS_SUCCESS on success */ -SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, switch_event_t event_id, char *subclass_name); +SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event_t **event, switch_event_types_t event_id, char *subclass_name); /*! \brief Set the priority of an event @@ -145,7 +145,7 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, \param priority the event priority \return SWITCH_STATUS_SUCCESS */ -SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority); +SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event_t *event, switch_priority_t priority); /*! \brief Retrieve a header value from an event @@ -153,7 +153,7 @@ SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, swi \param header_name the name of the header to read \return the value of the requested header */ -SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header_name); +SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name); /*! \brief Add a header to an event @@ -163,13 +163,13 @@ SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header \param fmt the value of the header (varargs see standard sprintf family) \return SWITCH_STATUS_SUCCESS if the header was added */ -SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switch_stack_t stack, char *header_name, char *fmt, ...); +SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...); /*! \brief Destroy an event \param event pointer to the pointer to event to destroy */ -SWITCH_DECLARE(void) switch_event_destroy(switch_event **event); +SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event); /*! \brief Duplicate an event @@ -177,7 +177,7 @@ SWITCH_DECLARE(void) switch_event_destroy(switch_event **event); \param todup an event to duplicate \return SWITCH_STATUS_SUCCESS if the event was duplicated */ -SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_event *todup); +SWITCH_DECLARE(switch_status) switch_event_dup(switch_event_t **event, switch_event_t *todup); /*! \brief Fire an event with full arguement list @@ -188,7 +188,7 @@ SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_even \param user_data optional private data to pass to the event handlers \return */ -SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event **event, void *user_data); +SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event, void *user_data); /*! \brief Bind an event callback to a specific event @@ -199,14 +199,14 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, \param user_data optional user specific data to pass whenever the callback is invoked \return SWITCH_STATUS_SUCCESS if the event was binded */ -SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, char *subclass_name, switch_event_callback_t callback, void *user_data); +SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback, void *user_data); /*! \brief Render the name of an event id enumeration \param event the event id to render the name of \return the rendered name */ -SWITCH_DECLARE(char *) switch_event_name(switch_event_t event); +SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event); /*! \brief Reserve a subclass name for private use with a custom event @@ -227,7 +227,7 @@ SWITCH_DECLARE(switch_status) switch_event_reserve_subclass_detailed(char *owner \return SWITCH_STATUS_SUCCESS if the operation was successful \note the body supplied by this function will supersede an existing body the event may have */ -SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char *buf, switch_size_t buflen, char *fmt, ...); +SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event_t *event, char *buf, switch_size_t buflen, char *fmt, ...); /*! \brief Determine if the event system has been initilized @@ -242,7 +242,7 @@ SWITCH_DECLARE(switch_status) switch_event_running(void); \return SWITCH_STATUS_SUCCESS if the body was added to the event \note the body parameter can be shadowed by the switch_event_reserve_subclass_detailed function */ -SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *fmt, ...); +SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event_t *event, char *fmt, ...); /*! @@ -266,7 +266,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f \param event the event to send (will be nulled) \note normaly use switch_event_fire for delivering events (only use this when you wish to deliver the event blocking on your thread) */ -SWITCH_DECLARE(void) switch_event_deliver(switch_event **event); +SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event); /*! \brief Fire an event filling in most of the arguements with obvious values diff --git a/src/include/switch_loadable_module.h b/src/include/switch_loadable_module.h index 42e38e4993..1e941cf76c 100644 --- a/src/include/switch_loadable_module.h +++ b/src/include/switch_loadable_module.h @@ -178,7 +178,7 @@ SWITCH_DECLARE(switch_directory_interface *) switch_loadable_module_get_director \param arraylen the max size in elements of the array \return the number of elements added to the array */ -SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool *pool, +SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface **array, int arraylen); diff --git a/src/include/switch_log.h b/src/include/switch_log.h index a5a3f76398..de42418b60 100644 --- a/src/include/switch_log.h +++ b/src/include/switch_log.h @@ -74,7 +74,7 @@ typedef switch_status (*switch_log_function)(const switch_log_node *node, switch \param pool the memory pool to use \note to be called at application startup by the core */ -SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool_t *pool); /*! \brief Shut down the logging engine diff --git a/src/include/switch_module_interfaces.h b/src/include/switch_module_interfaces.h index e3ab2b911d..c627a22662 100644 --- a/src/include/switch_module_interfaces.h +++ b/src/include/switch_module_interfaces.h @@ -159,7 +159,7 @@ struct switch_io_event_hooks { /*! \brief A table of i/o routines that an endpoint interface can implement */ struct switch_io_routines { /*! creates an outgoing session from given session, caller profile */ - switch_status (*outgoing_channel)(switch_core_session *, switch_caller_profile *, switch_core_session **, switch_memory_pool *); + switch_status (*outgoing_channel)(switch_core_session *, switch_caller_profile *, switch_core_session **, switch_memory_pool_t *); /*! answers the given session's channel */ switch_status (*answer_channel)(switch_core_session *); /*! read a frame from a session */ @@ -177,7 +177,7 @@ struct switch_io_routines { /*! receive a message from another session*/ switch_status (*receive_message)(switch_core_session *, switch_core_session_message *); /*! queue a message for another session*/ - switch_status (*queue_event)(switch_core_session *, switch_event *); + switch_status (*queue_event)(switch_core_session *, switch_event_t *); }; /*! \brief Abstraction of an module endpoint interface @@ -216,7 +216,7 @@ struct switch_timer { /*! the timer interface provided from a loadable module */ struct switch_timer_interface *timer_interface; /*! the timer's memory pool */ - switch_memory_pool *memory_pool; + switch_memory_pool_t *memory_pool; /*! private data for loadable modules to store information */ void *private_info; }; @@ -287,7 +287,7 @@ struct switch_file_handle { /*! the speed of the file playback*/ int speed; /*! the handle's memory pool */ - switch_memory_pool *memory_pool; + switch_memory_pool_t *memory_pool; /*! private data for the format module to store handle specific info */ void *private_info; int64_t pos; @@ -331,7 +331,7 @@ struct switch_speech_handle { uint32_t flags; /*! the handle's memory pool */ - switch_memory_pool *memory_pool; + switch_memory_pool_t *memory_pool; /*! private data for the format module to store handle specific info */ void *private_info; }; @@ -364,7 +364,7 @@ struct switch_directory_handle { uint32_t flags; /*! the handle's memory pool */ - switch_memory_pool *memory_pool; + switch_memory_pool_t *memory_pool; /*! private data for the format module to store handle specific info */ void *private_info; }; @@ -418,7 +418,7 @@ struct switch_codec { /*! flags to modify behaviour */ uint32_t flags; /*! the handle's memory pool*/ - switch_memory_pool *memory_pool; + switch_memory_pool_t *memory_pool; /*! private data for the codec module to store handle specific info */ void *private_info; }; diff --git a/src/include/switch_resample.h b/src/include/switch_resample.h index d2737b8270..7321c83390 100644 --- a/src/include/switch_resample.h +++ b/src/include/switch_resample.h @@ -53,7 +53,7 @@ BEGIN_EXTERN_C */ /*! \brief An audio resampling handle */ -struct switch_audio_resampler { +typedef struct { /*! a pointer to store the resampler object */ void *resampler; /*! the rate to resample from in hz */ @@ -74,7 +74,7 @@ struct switch_audio_resampler { uint32_t to_len; /*! the total size of the to buffer */ uint32_t to_size; -}; +} switch_audio_resampler_t; /*! \brief Prepare a new resampler handle @@ -86,18 +86,18 @@ struct switch_audio_resampler { \param pool the memory pool to use for buffer allocation \return SWITCH_STATUS_SUCCESS if the handle was created */ -SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **new_resampler, +SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler_t **new_resampler, int from_rate, switch_size_t from_size, int to_rate, uint32_t to_size, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! \brief Destroy an existing resampler handle \param resampler the resampler handle to destroy */ -SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler); +SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler_t *resampler); /*! \brief Resample one float buffer into another using specifications of a given handle @@ -109,7 +109,7 @@ SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler); \param last parameter denoting the last sample is being resampled \return the used size of dst */ -SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last); +SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last); /*! \brief Convert an array of floats to an array of shorts diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index 1a336f14f3..86646aab39 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -45,7 +45,7 @@ BEGIN_EXTERN_C ///\defgroup rtp RTP (RealTime Transport Protocol) ///\ingroup core1 ///\{ -typedef void (*switch_rtp_invalid_handler)(switch_rtp *rtp_session, +typedef void (*switch_rtp_invalid_handler)(switch_rtp_t *rtp_session, switch_socket_t *sock, void *data, switch_size_t datalen, @@ -56,7 +56,7 @@ typedef void (*switch_rtp_invalid_handler)(switch_rtp *rtp_session, \param pool the memory pool to use for long term allocations \note Generally called by the core_init */ -SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool *pool); +SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool); /*! \brief Request a new port to be used for media @@ -76,14 +76,14 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void); \param pool a memory pool to use for the session \return the new RTP session or NULL on failure */ -SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session, +SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp_t **new_rtp_session, switch_payload_t payload, uint32_t packet_size, uint32_t ms_per_packet, switch_rtp_flag_t flags, char *crypto_key, const char **err, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! @@ -101,7 +101,7 @@ SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session, \param pool a memory pool to use for the session \return the new RTP session or NULL on failure */ -SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, +SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host, switch_port_t rx_port, char *tx_host, switch_port_t tx_port, @@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, switch_rtp_flag_t flags, char *crypto_key, const char **err, - switch_memory_pool *pool); + switch_memory_pool_t *pool); /*! @@ -121,7 +121,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, \param port the remote port \param err pointer for error messages */ -SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err); +SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err); /*! \brief Assign a local address to the RTP session @@ -131,32 +131,32 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_sess \param err pointer for error messages \note this call also binds the RTP session's socket to the new address */ -SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err); +SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err); /*! \brief Kill the socket on an existing RTP session \param rtp_session an RTP session to kill the socket of */ -SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp *rtp_session); +SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session); /*! \brief Destroy an RTP session \param rtp_session an RTP session to destroy */ -SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session); +SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session); /*! \brief Acvite ICE on an RTP session \return SWITCH_STATUS_SUCCESS */ -SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, char *login, char *rlogin); +SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin); /*! \brief Set an RTP Flag \param rtp_session the RTP session \param flags the flags to set */ -SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); +SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags); /*! \brief Test an RTP Flag @@ -164,49 +164,49 @@ SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_fla \param flags the flags to test \return TRUE or FALSE */ -SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); +SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags); /*! \brief Clear an RTP Flag \param rtp_session the RTP session \param flags the flags to clear */ -SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags); +SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags); /*! \brief Retrieve the socket from an existing RTP session \param rtp_session the RTP session to retrieve the socket from \return the socket from the RTP session */ -SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session); +SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session); /*! \brief Set the default packet size for a given RTP session \param rtp_session the RTP session to set the packet size on \param packet_size the new default packet size */ -SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint16_t packet_size); +SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp_t *rtp_session, uint16_t packet_size); /*! \brief Get the default packet size for a given RTP session \param rtp_session the RTP session to get the packet size from \return the default packet_size of the RTP session */ -SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session); +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp_t *rtp_session); /*! \brief Set the default payload number for a given RTP session \param rtp_session the RTP session to set the payload number on \param payload the new default payload number */ -SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp *rtp_session, switch_payload_t payload); +SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp_t *rtp_session, switch_payload_t payload); /*! \brief Get the default payload number for a given RTP session \param rtp_session the RTP session to get the payload number from \return the default payload of the RTP session */ -SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session); +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp_t *rtp_session); /*! @@ -215,7 +215,7 @@ SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session) \param on_invalid the function to set \return */ -SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, switch_rtp_invalid_handler on_invalid); +SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, switch_rtp_invalid_handler on_invalid); /*! \brief Read data from a given RTP session @@ -226,7 +226,7 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, swit \param flags flags \return the number of bytes read */ -SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); +SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); /*! \brief Read data from a given RTP session without copying @@ -237,7 +237,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *dat \param flags flags \return the number of bytes read */ -SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); +SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags); /*! \brief Read data from a given RTP session without copying @@ -245,7 +245,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, \param frame a frame to populate with information \return the number of bytes read */ -SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_session, switch_frame *frame); +SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame); /*! \brief Write data to a given RTP session @@ -256,7 +256,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_ses \param flags frame flags \return the number of bytes written */ -SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags); +SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags); /*! \brief Enable VAD on an RTP Session @@ -266,14 +266,14 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32 \param flags flags for control \return SWITCH_STAUTS_SUCCESS on success */ -SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags); +SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags); /*! \brief Disable VAD on an RTP Session \param rtp_session the RTP session \return SWITCH_STAUTS_SUCCESS on success */ -SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session); +SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session); /*! \brief Write data to a given RTP session @@ -282,7 +282,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session); \param ts then number of bytes to increment the timestamp by \return the number of bytes written */ -SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame *frame, uint32_t ts); +SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts); /*! \brief Write data with a specified payload and sequence number to a given RTP session @@ -296,28 +296,28 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame \param flags frame flags \return the number of bytes written */ -SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags); +SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *data, uint16_t datalen, uint8_t m, switch_payload_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags); /*! \brief Retrieve the SSRC from a given RTP session \param rtp_session the RTP session to retrieve from \return the SSRC */ -SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp *rtp_session); +SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp_t *rtp_session); /*! \brief Associate an arbitrary data pointer with and RTP session \param rtp_session the RTP session to assign the pointer to \param private_data the private data to assign */ -SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp *rtp_session, void *private_data); +SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp_t *rtp_session, void *private_data); /*! \brief Retrieve the private data from a given RTP session \param rtp_session the RTP session to retrieve the data from \return the pointer to the private data */ -SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp *rtp_session); +SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp_t *rtp_session); /*! \} diff --git a/src/include/switch_stun.h b/src/include/switch_stun.h index c9af3bc6d7..6c33eea02a 100644 --- a/src/include/switch_stun.h +++ b/src/include/switch_stun.h @@ -214,7 +214,7 @@ SWITCH_DECLARE(switch_status) switch_stun_lookup (char **ip, char *stunip, switch_port_t stunport, char **err, - switch_memory_pool *pool); + switch_memory_pool_t *pool); diff --git a/src/include/switch_types.h b/src/include/switch_types.h index b0726fb697..d0504e04c1 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -491,7 +491,7 @@ typedef enum { also never put any new ones before EVENT_ALL */ /*! - \enum switch_event_t + \enum switch_event_type_t \brief Built-in Events
@@ -541,7 +541,7 @@ typedef enum { SWITCH_EVENT_NOTALK, SWITCH_EVENT_SESSION_CRASH, SWITCH_EVENT_ALL -} switch_event_t; +} switch_event_types_t; typedef enum { @@ -594,11 +594,10 @@ typedef enum { typedef uint8_t switch_payload_t; -typedef struct switch_rtp switch_rtp; +typedef struct switch_rtp switch_rtp_t; typedef struct switch_core_session_message switch_core_session_message; -typedef struct switch_audio_resampler switch_audio_resampler; -typedef struct switch_event_header switch_event_header; -typedef struct switch_event switch_event; +typedef struct switch_event_header switch_event_header_t; +typedef struct switch_event switch_event_t; typedef struct switch_event_subclass switch_event_subclass; typedef struct switch_event_node switch_event_node; typedef struct switch_loadable_module switch_loadable_module; @@ -643,13 +642,13 @@ typedef struct switch_speech_interface switch_speech_interface; typedef struct switch_directory_handle switch_directory_handle; typedef struct switch_directory_interface switch_directory_interface; typedef void (*switch_application_function)(switch_core_session *, char *); -typedef void (*switch_event_callback_t)(switch_event *); +typedef void (*switch_event_callback_t)(switch_event_t *); typedef switch_caller_extension *(*switch_dialplan_hunt_function)(switch_core_session *); typedef switch_status (*switch_state_handler)(switch_core_session *); typedef switch_status (*switch_outgoing_channel_hook)(switch_core_session *, switch_caller_profile *, switch_core_session *); typedef switch_status (*switch_answer_channel_hook)(switch_core_session *); typedef switch_status (*switch_receive_message_hook)(switch_core_session *, switch_core_session_message *); -typedef switch_status (*switch_queue_event_hook)(switch_core_session *, switch_event *); +typedef switch_status (*switch_queue_event_hook)(switch_core_session *, switch_event_t *); typedef switch_status (*switch_read_frame_hook)(switch_core_session *, switch_frame **, int, switch_io_flag, int); typedef switch_status (*switch_write_frame_hook)(switch_core_session *, switch_frame *, int, switch_io_flag, int); typedef switch_status (*switch_kill_channel_hook)(switch_core_session *, int); diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 681ba1db85..ce600e0b42 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -157,7 +157,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char \param pool the memory pool to use \return SWITCH_STATUS_SUCCESS when successful */ -SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, switch_int16_t flags, switch_memory_pool *pool); +SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, switch_int16_t flags, switch_memory_pool_t *pool); /*! \brief Wait for a socket diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index edfc951607..322a28bbfd 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -37,7 +37,7 @@ static const char modname[] = "mod_dingaling"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; typedef enum { TFLAG_IO = (1 << 0), @@ -74,7 +74,7 @@ static struct { int codec_rates_last; unsigned int flags; unsigned int init; - switch_hash *profile_hash; + switch_hash_t *profile_hash; int running; int handles; } globals; @@ -107,7 +107,7 @@ struct private_object { switch_codec_interface *codecs[SWITCH_MAX_CODECS]; unsigned int num_codecs; int codec_index; - struct switch_rtp *rtp_session; + switch_rtp_t *rtp_session; ldl_session_t *dlsession; char *remote_ip; switch_port_t local_port; @@ -155,7 +155,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan) static switch_status channel_on_loopback(switch_core_session *session); static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool); + switch_core_session **new_session, switch_memory_pool_t *pool); static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, switch_io_flag flags, int stream_id); static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, @@ -200,7 +200,7 @@ static void get_codecs(struct private_object *tech_pvt) -static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread_t *thread, void *obj) { ldl_handle_t *handle = obj; struct mdl_profile *profile = NULL; @@ -217,7 +217,7 @@ static void *SWITCH_THREAD_FUNC handle_thread_run(switch_thread *thread, void *o static void handle_thread_launch(ldl_handle_t *handle) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_threadattr_create(&thd_attr, module_pool); @@ -449,7 +449,7 @@ static int do_describe(struct private_object *tech_pvt, int force) return 0; } -static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, void *obj) { switch_core_session *session = obj; @@ -532,7 +532,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread *thread, void static void negotiate_thread_launch(switch_core_session *session) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_threadattr_create(&thd_attr, switch_core_session_get_pool(session)); @@ -1009,7 +1009,7 @@ static const switch_loadable_module_interface channel_module_interface = { that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool) + switch_core_session **new_session, switch_memory_pool_t *pool) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { struct private_object *tech_pvt; diff --git a/src/mod/endpoints/mod_exosip/mod_exosip.c b/src/mod/endpoints/mod_exosip/mod_exosip.c index 9394849247..d9fcb7435a 100644 --- a/src/mod/endpoints/mod_exosip/mod_exosip.c +++ b/src/mod/endpoints/mod_exosip/mod_exosip.c @@ -41,7 +41,7 @@ static const char modname[] = "mod_exosip"; #define STRLEN 15 -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; @@ -88,8 +88,8 @@ static struct { char *codec_string; char *codec_order[SWITCH_MAX_CODECS]; int codec_order_last; - switch_hash *call_hash; - switch_hash *srtp_hash; + switch_hash_t *call_hash; + switch_hash_t *srtp_hash; int running; int codec_ms; int dtmf_duration; @@ -110,7 +110,7 @@ struct private_object { int32_t timestamp_recv; int32_t timestamp_dtmf; int payload_num; - struct switch_rtp *rtp_session; + switch_rtp_t *rtp_session; struct osip_rfc3264 *sdp_config; sdp_message_t *remote_sdp; sdp_message_t *local_sdp; @@ -150,7 +150,7 @@ static switch_status exosip_on_hangup(switch_core_session *session); static switch_status exosip_on_loopback(switch_core_session *session); static switch_status exosip_on_transmit(switch_core_session *session); static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool); + switch_core_session **new_session, switch_memory_pool_t *pool); static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout, switch_io_flag flags, int stream_id); static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout, @@ -996,7 +996,7 @@ static const switch_loadable_module_interface exosip_module_interface = { }; static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool) + switch_core_session **new_session, switch_memory_pool_t *pool) { if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) { struct private_object *tech_pvt; @@ -1808,7 +1808,7 @@ static int config_exosip(int reload) SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void) { eXosip_event_t *event = NULL; - switch_event *s_event; + switch_event_t *s_event; config_exosip(0); diff --git a/src/mod/endpoints/mod_iax/mod_iax.c b/src/mod/endpoints/mod_iax/mod_iax.c index a34e7a1100..e1f39603ad 100644 --- a/src/mod/endpoints/mod_iax/mod_iax.c +++ b/src/mod/endpoints/mod_iax/mod_iax.c @@ -44,7 +44,7 @@ static const char modname[] = "mod_iax"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; static int running = 1; @@ -396,7 +396,7 @@ static switch_status channel_on_ring(switch_core_session *session); static switch_status channel_on_loopback(switch_core_session *session); static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool); + switch_core_session **new_session, switch_memory_pool_t *pool); static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, switch_io_flag flags, int stream_id); static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, @@ -724,7 +724,7 @@ static const switch_loadable_module_interface channel_module_interface = { that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool) + switch_core_session **new_session, switch_memory_pool_t *pool) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { struct private_object *tech_pvt; @@ -871,7 +871,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void) { //int refresh; struct iax_event *iaxevent = NULL; - switch_event *s_event; + switch_event_t *s_event; if (load_config() != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_TERM; } diff --git a/src/mod/endpoints/mod_portaudio/mod_portaudio.c b/src/mod/endpoints/mod_portaudio/mod_portaudio.c index da348c1d6b..ea9525e3b9 100644 --- a/src/mod/endpoints/mod_portaudio/mod_portaudio.c +++ b/src/mod/endpoints/mod_portaudio/mod_portaudio.c @@ -41,7 +41,7 @@ static const char modname[] = "mod_portaudio"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; //static int running = 1; #define SAMPLE_TYPE paInt16 @@ -73,7 +73,7 @@ static struct { int indev; int outdev; int call_id; - switch_hash *call_hash; + switch_hash_t *call_hash; switch_mutex_t *device_lock; int sample_rate; } globals; @@ -105,7 +105,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan) static switch_status channel_on_transmit(switch_core_session *session); static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool); + switch_core_session **new_session, switch_memory_pool_t *pool); static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout, switch_io_flag flags, int stream_id); static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout, @@ -268,7 +268,7 @@ static switch_status channel_on_transmit(switch_core_session *session) while (switch_channel_get_state(channel) == CS_TRANSMIT && !switch_test_flag(tech_pvt, TFLAG_ANSWER)) { if (switch_time_now() - last >= waitsec) { char buf[512]; - switch_event *event; + switch_event_t *event; snprintf(buf, sizeof(buf), "BRRRRING! BRRRRING! call %s\n", tech_pvt->call_id); @@ -476,7 +476,7 @@ static const switch_loadable_module_interface channel_module_interface = { that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool) + switch_core_session **new_session, switch_memory_pool_t *pool) { if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) { struct private_object *tech_pvt; diff --git a/src/mod/endpoints/mod_woomera/mod_woomera.c b/src/mod/endpoints/mod_woomera/mod_woomera.c index c95731a5a2..525568a8ce 100644 --- a/src/mod/endpoints/mod_woomera/mod_woomera.c +++ b/src/mod/endpoints/mod_woomera/mod_woomera.c @@ -50,7 +50,7 @@ static const char modname[] = "mod_woomera"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; #define STRLEN 15 #define FRAME_LEN 480 @@ -169,7 +169,7 @@ static switch_status woomerachan_on_ring(switch_core_session *session); static switch_status woomerachan_on_loopback(switch_core_session *session); static switch_status woomerachan_on_transmit(switch_core_session *session); static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool); + switch_core_session **new_session, switch_memory_pool_t *pool); static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout, switch_io_flag flags, int stream_id); static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout, @@ -186,7 +186,7 @@ static int connect_woomera(switch_socket_t **new_sock, woomera_profile * profile static int woomera_profile_thread_running(woomera_profile * profile, int set, int new); static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **woomera_socket); static int tech_create_read_socket(private_object * tech_pvt); -static void *woomera_channel_thread_run(switch_thread *thread, void *obj); +static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj); static void *woomera_thread_run(void *obj); static int tech_activate(private_object * tech_pvt); @@ -473,7 +473,7 @@ static const switch_loadable_module_interface woomerachan_module_interface = { that allocate memory or you will have 1 channel with memory allocated from another channel's pool! */ static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile, - switch_core_session **new_session, switch_memory_pool *pool) + switch_core_session **new_session, switch_memory_pool_t *pool) { if ((*new_session = switch_core_session_request(&woomerachan_endpoint_interface, pool)) != 0) { struct private_object *tech_pvt; @@ -858,7 +858,7 @@ static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **wo static int tech_create_read_socket(private_object * tech_pvt) { - switch_memory_pool *pool = switch_core_session_get_pool(tech_pvt->session); + switch_memory_pool_t *pool = switch_core_session_get_pool(tech_pvt->session); if ((tech_pvt->port = globals.next_woomera_port++) >= WOOMERA_MAX_PORT) { tech_pvt->port = globals.next_woomera_port = WOOMERA_MIN_PORT; @@ -926,7 +926,7 @@ static int tech_activate(private_object * tech_pvt) -static void *woomera_channel_thread_run(switch_thread *thread, void *obj) +static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj) { switch_core_session *session = obj; switch_channel *channel = NULL; diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index aa3aafead9..93e3d45229 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -33,7 +33,7 @@ static const char modname[] = "mod_event_multicast"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; static struct { char *address; @@ -81,7 +81,7 @@ static switch_status load_config(void) } -static void event_handler(switch_event *event) +static void event_handler(switch_event_t *event) { char buf[1024]; size_t len; @@ -189,7 +189,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void) SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void) { - switch_event *local_event; + switch_event_t *local_event; char buf[1024]; globals.running = 1; diff --git a/src/mod/event_handlers/mod_event_test/mod_event_test.c b/src/mod/event_handlers/mod_event_test/mod_event_test.c index 62646ed425..c1832d4217 100644 --- a/src/mod/event_handlers/mod_event_test/mod_event_test.c +++ b/src/mod/event_handlers/mod_event_test/mod_event_test.c @@ -36,7 +36,7 @@ static const char modname[] = "mod_event_test"; //#define TORTURE_ME -static void event_handler(switch_event *event) +static void event_handler(switch_event_t *event) { char buf[1024]; @@ -68,12 +68,12 @@ static switch_loadable_module_interface event_test_module_interface = { #define TTHREADS 500 static int THREADS = 0; -static void *torture_thread(switch_thread *thread, void *obj) +static void *torture_thread(switch_thread_t *thread, void *obj) { int y = 0; int z = 0; switch_core_thread_session *ts = obj; - switch_event *event; + switch_event_t *event; z = THREADS++; @@ -89,7 +89,7 @@ static void *torture_thread(switch_thread *thread, void *obj) } if (ts->pool) { - switch_memory_pool *pool = ts->pool; + switch_memory_pool_t *pool = ts->pool; switch_core_destroy_memory_pool(&pool); } diff --git a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c index a3b9542281..a833781458 100644 --- a/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c +++ b/src/mod/event_handlers/mod_xmpp_event/mod_xmpp_event.c @@ -58,7 +58,7 @@ static struct { struct session session; } globals; -static void event_handler(switch_event *event) +static void event_handler(switch_event_t *event) { char buf[1024]; iks *msg; diff --git a/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c b/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c index 134307d20a..43d83a7967 100644 --- a/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c +++ b/src/mod/event_handlers/mod_zeroconf/mod_zeroconf.c @@ -34,7 +34,7 @@ static const char modname[] = "mod_zeroconf"; -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; static struct { sw_discovery discovery; @@ -121,7 +121,7 @@ static sw_result HOWL_API my_service_reply(sw_discovery discovery, } -static void event_handler(switch_event *event) +static void event_handler(switch_event_t *event) { sw_text_record text_record; sw_result result; @@ -132,7 +132,7 @@ static void event_handler(switch_event *event) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "sw_text_record_init() failed\n"); return; } else { - switch_event_header *hp; + switch_event_header_t *hp; char *service = switch_event_get_header(event, "service"); char *port = switch_event_get_header(event, "port"); sw_port porti = 0; diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index 4cc582cf18..226fa51d13 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -120,7 +120,7 @@ struct teletone_obj { switch_codec codec; switch_buffer *audio_buffer; switch_buffer *loop_buffer; - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_timer *timer; switch_timer timer_base; char code_buffer[1024]; @@ -132,14 +132,14 @@ struct fileio_obj { char *path; unsigned int flags; switch_file_t *fd; - switch_memory_pool *pool; + switch_memory_pool_t *pool; char *buf; switch_size_t buflen; int32 bufsize; }; struct db_obj { - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_core_db *db; switch_core_db_stmt *stmt; char *dbname; @@ -965,7 +965,7 @@ static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map /*********************************************************************************/ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - switch_memory_pool *pool = NULL; + switch_memory_pool_t *pool = NULL; if (argc > 2) { struct js_session *jss = NULL; JSObject *session_obj; @@ -1070,7 +1070,7 @@ static void session_destroy(JSContext *cx, JSObject *obj) /*********************************************************************************/ static JSBool fileio_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_file_t *fd; char *path, *flags_str; unsigned int flags = 0; @@ -1120,7 +1120,7 @@ static void fileio_destroy(JSContext *cx, JSObject *obj) struct fileio_obj *fio = JS_GetPrivate(cx, obj); if (fio) { - switch_memory_pool *pool = fio->pool; + switch_memory_pool_t *pool = fio->pool; switch_core_destroy_memory_pool(&pool); pool = NULL; } @@ -1241,7 +1241,7 @@ JSClass fileio_class = { /*********************************************************************************/ static JSBool db_construct(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) { - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_core_db *db; struct db_obj *dbo; @@ -1271,7 +1271,7 @@ static void db_destroy(JSContext *cx, JSObject *obj) struct db_obj *dbo = JS_GetPrivate(cx, obj); if (dbo) { - switch_memory_pool *pool = dbo->pool; + switch_memory_pool_t *pool = dbo->pool; if (dbo->stmt) { switch_core_db_finalize(dbo->stmt); dbo->stmt = NULL; @@ -1472,7 +1472,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval struct teletone_obj *tto = NULL; struct js_session *jss = NULL; switch_codec *read_codec; - switch_memory_pool *pool; + switch_memory_pool_t *pool; char *timer_name = NULL; if (argc > 0) { @@ -1549,7 +1549,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval static void teletone_destroy(JSContext *cx, JSObject *obj) { struct teletone_obj *tto = JS_GetPrivate(cx, obj); - switch_memory_pool *pool; + switch_memory_pool_t *pool; if (tto) { if (tto->timer) { switch_core_timer_destroy(tto->timer); @@ -2114,7 +2114,7 @@ static void js_parse_and_execute(switch_core_session *session, char *input_code) -static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread_t *thread, void *obj) { char *input_code = obj; @@ -2128,11 +2128,11 @@ static void *SWITCH_THREAD_FUNC js_thread_run(switch_thread *thread, void *obj) } -static switch_memory_pool *module_pool = NULL; +static switch_memory_pool_t *module_pool = NULL; static void js_thread_launch(char *text) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; if (!module_pool) { diff --git a/src/mod/loggers/mod_console/mod_console.c b/src/mod/loggers/mod_console/mod_console.c index a4229c0f9a..438543419f 100644 --- a/src/mod/loggers/mod_console/mod_console.c +++ b/src/mod/loggers/mod_console/mod_console.c @@ -47,9 +47,9 @@ static switch_loadable_module_interface console_module_interface = { /*.directory_interface */ NULL }; -static switch_memory_pool *module_pool = NULL; -static switch_hash *log_hash = NULL; -static switch_hash *name_hash = NULL; +static switch_memory_pool_t *module_pool = NULL; +static switch_hash_t *log_hash = NULL; +static switch_hash_t *name_hash = NULL; static int8_t all_level = -1; static void del_mapping(char *var) { diff --git a/src/switch.c b/src/switch.c index 156f2e369b..32991512a6 100644 --- a/src/switch.c +++ b/src/switch.c @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) char path[256] = ""; char *ppath = NULL; char *err = NULL; - switch_event *event; + switch_event_t *event; int bg = 0; FILE *f; #ifdef WIN32 diff --git a/src/switch_buffer.c b/src/switch_buffer.c index 6882b1f957..04235606b8 100644 --- a/src/switch_buffer.c +++ b/src/switch_buffer.c @@ -30,6 +30,7 @@ * */ #include+#include static uint32_t buffer_id = 0; @@ -40,7 +41,7 @@ struct switch_buffer { uint32_t id; }; -SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool *pool, switch_buffer **buffer, switch_size_t max_len) +SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool_t *pool, switch_buffer **buffer, switch_size_t max_len) { switch_buffer *new_buffer; diff --git a/src/switch_caller.c b/src/switch_caller.c index c1ffd1b5c2..fe85789258 100644 --- a/src/switch_caller.c +++ b/src/switch_caller.c @@ -30,8 +30,9 @@ * */ #include +#include -SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool *pool, +SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_new(switch_memory_pool_t *pool, char *dialplan, char *caller_id_name, char *caller_id_number, @@ -90,7 +91,7 @@ SWITCH_DECLARE(switch_caller_profile *) switch_caller_profile_clone(switch_core_ } SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile *caller_profile, char *prefix, - switch_event *event) + switch_event_t *event) { char header_name[1024]; diff --git a/src/switch_channel.c b/src/switch_channel.c index 48460d1d9c..816bf609f8 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -30,6 +30,7 @@ * */ #include +#include struct switch_cause_table { const char *name; @@ -99,7 +100,7 @@ struct switch_channel { switch_caller_extension *caller_extension; const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS]; int state_handler_index; - switch_hash *variables; + switch_hash_t *variables; switch_channel_timetable_t *times; void *private_info; switch_call_cause_t hangup_cause; @@ -148,7 +149,7 @@ SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch return channel->times; } -SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool *pool) +SWITCH_DECLARE(switch_status) switch_channel_alloc(switch_channel **channel, switch_memory_pool_t *pool) { assert(pool != NULL); @@ -243,7 +244,7 @@ SWITCH_DECLARE(switch_status) switch_channel_queue_dtmf(switch_channel *channel, SWITCH_DECLARE(switch_size_t) switch_channel_dequeue_dtmf(switch_channel *channel, char *dtmf, switch_size_t len) { switch_size_t bytes; - switch_event *event; + switch_event_t *event; assert(channel != NULL); @@ -516,7 +517,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_cha channel->hangup_cause = SWITCH_CAUSE_NORMAL_CLEARING; } if (state < CS_HANGUP) { - switch_event *event; + switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_STATE) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event); switch_event_fire(&event); @@ -541,7 +542,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_set_state(switch_cha return channel->state; } -SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event *event) +SWITCH_DECLARE(void) switch_channel_event_set_data(switch_channel *channel, switch_event_t *event) { switch_caller_profile *caller_profile, *originator_caller_profile, *originatee_caller_profile; switch_hash_index_t *hi; @@ -605,7 +606,7 @@ SWITCH_DECLARE(void) switch_channel_set_caller_profile(switch_channel *channel, } if (!channel->caller_profile) { - switch_event *event; + switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_CREATE) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(channel, event); @@ -766,7 +767,7 @@ SWITCH_DECLARE(switch_channel_state) switch_channel_perform_hangup(switch_channe } if (channel->state < CS_HANGUP) { - switch_event *event; + switch_event_t *event; switch_channel_state last_state = channel->state; channel->state = CS_HANGUP; @@ -824,7 +825,7 @@ SWITCH_DECLARE(switch_status) switch_channel_perform_answer(switch_channel *chan } if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) { - switch_event *event; + switch_event_t *event; channel->times->answered = switch_time_now(); switch_channel_set_flag(channel, CF_ANSWERED); diff --git a/src/switch_config.c b/src/switch_config.c index cbca4c008e..ae8b2e29ee 100644 --- a/src/switch_config.c +++ b/src/switch_config.c @@ -30,6 +30,7 @@ * */ #include +#include SWITCH_DECLARE(int) switch_config_open_file(switch_config *cfg, char *file_path) { diff --git a/src/switch_console.c b/src/switch_console.c index 15f73dd114..a98c27f11d 100644 --- a/src/switch_console.c +++ b/src/switch_console.c @@ -99,7 +99,7 @@ SWITCH_DECLARE(void) switch_console_printf(switch_text_channel channel, char *fi } else { switch_size_t retsize; switch_time_exp_t tm; - switch_event *event; + switch_event_t *event; switch_time_exp_lt(&tm, switch_time_now()); switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm); diff --git a/src/switch_core.c b/src/switch_core.c index 480194b0b6..7fe6da287c 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -42,9 +42,9 @@ struct switch_core_session { uint32_t id; char name[80]; int thread_running; - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_channel *channel; - switch_thread *thread; + switch_thread_t *thread; const switch_endpoint_interface *endpoint_interface; struct switch_io_event_hooks event_hooks; switch_codec *read_codec; @@ -63,8 +63,8 @@ struct switch_core_session { uint8_t enc_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE]; - switch_audio_resampler *read_resampler; - switch_audio_resampler *write_resampler; + switch_audio_resampler_t *read_resampler; + switch_audio_resampler_t *write_resampler; switch_mutex_t *mutex; switch_thread_cond_t *cond; @@ -85,8 +85,8 @@ struct switch_core_runtime { time_t initiated; uint32_t session_id; apr_pool_t *memory_pool; - switch_hash *session_table; - switch_hash *stack_table; + switch_hash_t *session_table; + switch_hash_t *stack_table; switch_core_db *db; switch_core_db *event_db; const struct switch_state_handler_table *state_handlers[SWITCH_MAX_STATE_HANDLERS]; @@ -96,7 +96,7 @@ struct switch_core_runtime { }; /* Prototypes */ -static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread, void *obj); +static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thread, void *obj); static void switch_core_standard_on_init(switch_core_session *session); static void switch_core_standard_on_hangup(switch_core_session *session); static void switch_core_standard_on_ring(switch_core_session *session); @@ -274,7 +274,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_message_send(char *uuid_str, s return status; } -SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event *event) +SWITCH_DECLARE(switch_status) switch_core_session_event_send(char *uuid_str, switch_event_t *event) { switch_core_session *session = NULL; switch_status status = SWITCH_STATUS_FALSE; @@ -326,7 +326,7 @@ SWITCH_DECLARE(switch_codec *) switch_core_session_get_write_codec(switch_core_s SWITCH_DECLARE(switch_status) switch_core_codec_init(switch_codec *codec, char *codec_name, uint32_t rate, int ms, int channels, uint32_t flags, const switch_codec_settings *codec_settings, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { const switch_codec_interface *codec_interface; const switch_codec_implementation *iptr, *implementation = NULL; @@ -462,7 +462,7 @@ SWITCH_DECLARE(switch_status) switch_core_codec_destroy(switch_codec *codec) } SWITCH_DECLARE(switch_status) switch_core_file_open(switch_file_handle *fh, char *file_path, unsigned int flags, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { char *ext; switch_status status; @@ -521,7 +521,7 @@ SWITCH_DECLARE(switch_status) switch_core_directory_open(switch_directory_handle char *source, char *dsn, char *passwd, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { switch_status status; @@ -567,7 +567,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_open(switch_speech_handle *sh, char *voice_name, unsigned int rate, switch_speech_flag *flags, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { switch_status status; @@ -628,7 +628,7 @@ SWITCH_DECLARE(switch_status) switch_core_speech_close(switch_speech_handle *sh, } SWITCH_DECLARE(switch_status) switch_core_timer_init(switch_timer *timer, char *timer_name, int interval, int samples, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { switch_timer_interface *timer_interface; switch_status status; @@ -689,7 +689,7 @@ SWITCH_DECLARE(switch_status) switch_core_timer_destroy(switch_timer *timer) return SWITCH_STATUS_SUCCESS; } -static void *switch_core_service_thread(switch_thread *thread, void *obj) +static void *switch_core_service_thread(switch_thread_t *thread, void *obj) { switch_core_thread_session *data = obj; switch_core_session *session = data->objs[0]; @@ -742,7 +742,7 @@ SWITCH_DECLARE(void) switch_core_service_session(switch_core_session *session, switch_core_session_launch_thread(session, switch_core_service_thread, thread_session); } -SWITCH_DECLARE(switch_memory_pool *) switch_core_session_get_pool(switch_core_session *session) +SWITCH_DECLARE(switch_memory_pool_t *) switch_core_session_get_pool(switch_core_session *session) { return session->pool; } @@ -830,7 +830,7 @@ SWITCH_DECLARE(char *) switch_core_session_strdup(switch_core_session *session, } -SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup) +SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool_t *pool, char *todup) { char *duped = NULL; switch_size_t len; @@ -887,7 +887,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_outgoing_channel(switch_core_s char *endpoint_name, switch_caller_profile *caller_profile, switch_core_session **new_session, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { struct switch_io_event_hook_outgoing_channel *ptr; switch_status status = SWITCH_STATUS_FALSE; @@ -984,7 +984,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_receive_message(switch_core_se return status; } -SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event *event) +SWITCH_DECLARE(switch_status) switch_core_session_queue_event(switch_core_session *session, switch_event_t *event) { struct switch_io_event_hook_queue_event *ptr; @@ -1711,7 +1711,7 @@ SWITCH_DECLARE(switch_status) switch_core_session_add_event_hook_send_dtmf(switc } -SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **pool) +SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool_t **pool) { assert(runtime.memory_pool != NULL); @@ -1723,7 +1723,7 @@ SWITCH_DECLARE(switch_status) switch_core_new_memory_pool(switch_memory_pool **p return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool **pool) +SWITCH_DECLARE(switch_status) switch_core_destroy_memory_pool(switch_memory_pool_t **pool) { apr_pool_destroy(*pool); return SWITCH_STATUS_SUCCESS; @@ -1779,7 +1779,7 @@ static void switch_core_standard_on_ring(switch_core_session *session) static void switch_core_standard_on_execute(switch_core_session *session) { switch_caller_extension *extension; - switch_event *event; + switch_event_t *event; const switch_application_interface *application_interface; @@ -1898,7 +1898,7 @@ static void print_trace (void) static int handle_fatality(int sig) { - switch_thread_id thread_id; + switch_thread_id_t thread_id; jmp_buf *env; if (sig && (thread_id = switch_thread_self()) && (env = (jmp_buf *) apr_hash_get(runtime.stack_table, &thread_id, sizeof(thread_id)))) { @@ -1919,7 +1919,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) const switch_endpoint_interface *endpoint_interface; const switch_state_handler_table *driver_state_handler = NULL; const switch_state_handler_table *application_state_handler = NULL; - switch_thread_id thread_id = switch_thread_self(); + switch_thread_id_t thread_id = switch_thread_self(); jmp_buf env; int sig; @@ -1930,7 +1930,7 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) #endif if ((sig = setjmp(env)) != 0) { - switch_event *event; + switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_SESSION_CRASH) == SWITCH_STATUS_SUCCESS) { switch_channel_event_set_data(session->channel, event); @@ -2258,8 +2258,8 @@ SWITCH_DECLARE(void) switch_core_session_run(switch_core_session *session) SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session) { - switch_memory_pool *pool; - switch_event *event; + switch_memory_pool_t *pool; + switch_event_t *event; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Close Channel %s\n", switch_channel_get_name((*session)->channel)); @@ -2275,7 +2275,7 @@ SWITCH_DECLARE(void) switch_core_session_destroy(switch_core_session **session) } -SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_memory_pool *pool) +SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash_t **hash, switch_memory_pool_t *pool) { assert(pool != NULL); @@ -2286,31 +2286,31 @@ SWITCH_DECLARE(switch_status) switch_core_hash_init(switch_hash **hash, switch_m return SWITCH_STATUS_GENERR; } -SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash *hash) +SWITCH_DECLARE(switch_status) switch_core_hash_destroy(switch_hash_t *hash) { assert(hash != NULL); return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash *hash, char *key, void *data) +SWITCH_DECLARE(switch_status) switch_core_hash_insert_dup(switch_hash_t *hash, char *key, void *data) { apr_hash_set(hash, switch_core_strdup(apr_hash_pool_get(hash), key), APR_HASH_KEY_STRING, data); return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash *hash, char *key, void *data) +SWITCH_DECLARE(switch_status) switch_core_hash_insert(switch_hash_t *hash, char *key, void *data) { apr_hash_set(hash, key, APR_HASH_KEY_STRING, data); return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash *hash, char *key) +SWITCH_DECLARE(switch_status) switch_core_hash_delete(switch_hash_t *hash, char *key) { apr_hash_set(hash, key, APR_HASH_KEY_STRING, NULL); return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key) +SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t *hash, char *key) { return apr_hash_get(hash, key, APR_HASH_KEY_STRING); } @@ -2329,9 +2329,9 @@ SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash *hash, char *key) */ -SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool *pool) +SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void *obj, switch_memory_pool_t *pool) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_core_thread_session *ts; int mypool; @@ -2359,7 +2359,7 @@ SWITCH_DECLARE(void) switch_core_launch_thread(switch_thread_start_t func, void } -static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread_t *thread, void *obj) { switch_core_session *session = obj; session->thread = thread; @@ -2383,7 +2383,7 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread(switch_thread *thread SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *session) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr;; switch_threadattr_create(&thd_attr, session->pool); switch_threadattr_detach_set(thd_attr, 1); @@ -2399,7 +2399,7 @@ SWITCH_DECLARE(void) switch_core_session_thread_launch(switch_core_session *sess SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *session, switch_thread_start_t func, void *obj) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr = NULL; switch_threadattr_create(&thd_attr, session->pool); switch_threadattr_detach_set(thd_attr, 1); @@ -2410,7 +2410,7 @@ SWITCH_DECLARE(void) switch_core_session_launch_thread(switch_core_session *sess } -SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t memory) +SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool_t *pool, switch_size_t memory) { void *ptr = NULL; assert(pool != NULL); @@ -2427,9 +2427,9 @@ SWITCH_DECLARE(void *) switch_core_alloc(switch_memory_pool *pool, switch_size_t } SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_endpoint_interface *endpoint_interface, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { - switch_memory_pool *usepool; + switch_memory_pool_t *usepool; switch_core_session *session; switch_uuid_t uuid; @@ -2483,7 +2483,7 @@ SWITCH_DECLARE(switch_core_session *) switch_core_session_request(const switch_e return session; } -SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool *pool) +SWITCH_DECLARE(switch_core_session *) switch_core_session_request_by_name(char *endpoint_name, switch_memory_pool_t *pool) { const switch_endpoint_interface *endpoint_interface; @@ -2522,7 +2522,7 @@ static switch_status switch_core_sql_persistant_execute(switch_core_db *db, char return status; } -static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread, void *obj) { void *pop; uint32_t itterations = 0; @@ -2587,7 +2587,7 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, vo static void switch_core_sql_thread_launch(void) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr;; assert(runtime.memory_pool != NULL); @@ -2600,7 +2600,7 @@ static void switch_core_sql_thread_launch(void) } -static void core_event_handler(switch_event *event) +static void core_event_handler(switch_event_t *event) { char buf[1024]; char *sql = NULL; diff --git a/src/switch_event.c b/src/switch_event.c index b5e45485ab..081a5fdfc4 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -30,18 +30,19 @@ * */ #include +#include static switch_event_node *EVENT_NODES[SWITCH_EVENT_ALL + 1] = { NULL }; static switch_mutex_t *BLOCK = NULL; static switch_mutex_t *POOL_LOCK = NULL; -static switch_memory_pool *RUNTIME_POOL = NULL; -//static switch_memory_pool *APOOL = NULL; -//static switch_memory_pool *BPOOL = NULL; -static switch_memory_pool *THRUNTIME_POOL = NULL; +static switch_memory_pool_t *RUNTIME_POOL = NULL; +//static switch_memory_pool_t *APOOL = NULL; +//static switch_memory_pool_t *BPOOL = NULL; +static switch_memory_pool_t *THRUNTIME_POOL = NULL; static switch_queue_t *EVENT_QUEUE[3] = {0,0,0}; static int POOL_COUNT_MAX = 2000; -static switch_hash *CUSTOM_HASH = NULL; +static switch_hash_t *CUSTOM_HASH = NULL; static int THREAD_RUNNING = 0; #if 0 @@ -75,11 +76,17 @@ static void *locked_dup(char *str) #define DUP(str) locked_dup(str) #endif +#ifndef ALLOC #define ALLOC(size) malloc(size) +#endif +#ifndef DUP #define DUP(str) strdup(str) +#endif +#ifndef FREE #define FREE(ptr) if (ptr) free(ptr) +#endif -/* make sure this is synced with the switch_event_t enum in switch_types.h +/* make sure this is synced with the switch_event_types_t enum in switch_types.h also never put any new ones before EVENT_ALL */ static char *EVENT_NAMES[] = { @@ -107,7 +114,7 @@ static char *EVENT_NAMES[] = { }; -static int switch_events_match(switch_event *event, switch_event_node *node) +static int switch_events_match(switch_event_t *event, switch_event_node *node) { int match = 0; @@ -146,9 +153,9 @@ static int switch_events_match(switch_event *event, switch_event_node *node) return match; } -static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread_t *thread, void *obj) { - switch_event *out_event = NULL; + switch_event_t *out_event = NULL; switch_queue_t *queue = NULL; switch_queue_t *queues[3] = {0,0,0}; void *pop; @@ -204,9 +211,9 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void return NULL; } -SWITCH_DECLARE(void) switch_event_deliver(switch_event **event) +SWITCH_DECLARE(void) switch_event_deliver(switch_event_t **event) { - switch_event_t e; + switch_event_types_t e; switch_event_node *node; for (e = (*event)->event_id;; e = SWITCH_EVENT_ALL) { @@ -231,7 +238,7 @@ SWITCH_DECLARE(switch_status) switch_event_running(void) return THREAD_RUNNING ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE; } -SWITCH_DECLARE(char *) switch_event_name(switch_event_t event) +SWITCH_DECLARE(char *) switch_event_name(switch_event_types_t event) { assert(BLOCK != NULL); assert(RUNTIME_POOL != NULL); @@ -282,9 +289,9 @@ SWITCH_DECLARE(switch_status) switch_event_shutdown(void) return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool) +SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool_t *pool) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr;; switch_threadattr_create(&thd_attr, pool); switch_threadattr_detach_set(thd_attr, 1); @@ -322,8 +329,8 @@ SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool) } -SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, - switch_event_t event_id, +SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event_t **event, + switch_event_types_t event_id, char *subclass_name) { @@ -331,10 +338,10 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, return SWITCH_STATUS_GENERR; } - if ((*event = ALLOC(sizeof(switch_event))) == 0) { + if ((*event = ALLOC(sizeof(switch_event_t))) == 0) { return SWITCH_STATUS_MEMERR; } - memset(*event, 0, sizeof(switch_event)); + memset(*event, 0, sizeof(switch_event_t)); (*event)->event_id = event_id; @@ -345,16 +352,16 @@ SWITCH_DECLARE(switch_status) switch_event_create_subclass(switch_event **event, return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event *event, switch_priority_t priority) +SWITCH_DECLARE(switch_status) switch_event_set_priority(switch_event_t *event, switch_priority_t priority) { event->priority = priority; switch_event_add_header(event, SWITCH_STACK_TOP, "priority", switch_priority_name(priority)); return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header_name) +SWITCH_DECLARE(char *) switch_event_get_header(switch_event_t *event, char *header_name) { - switch_event_header *hp; + switch_event_header_t *hp; if (header_name) { for (hp = event->headers; hp; hp = hp->next) { if (!strcasecmp(hp->name, header_name)) { @@ -365,7 +372,7 @@ SWITCH_DECLARE(char *) switch_event_get_header(switch_event *event, char *header return NULL; } -SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switch_stack_t stack, char *header_name, +SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event_t *event, switch_stack_t stack, char *header_name, char *fmt, ...) { int ret = 0; @@ -379,7 +386,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switc if (ret == -1) { return SWITCH_STATUS_MEMERR; } else { - switch_event_header *header, *hp; + switch_event_header_t *header, *hp; if ((header = ALLOC(sizeof(*header))) == 0) { return SWITCH_STATUS_MEMERR; @@ -407,7 +414,7 @@ SWITCH_DECLARE(switch_status) switch_event_add_header(switch_event *event, switc } -SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *fmt, ...) +SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event_t *event, char *fmt, ...) { int ret = 0; char data[2048]; @@ -425,10 +432,10 @@ SWITCH_DECLARE(switch_status) switch_event_add_body(switch_event *event, char *f } } -SWITCH_DECLARE(void) switch_event_destroy(switch_event **event) +SWITCH_DECLARE(void) switch_event_destroy(switch_event_t **event) { - switch_event *ep = *event; - switch_event_header *hp, *this; + switch_event_t *ep = *event; + switch_event_header_t *hp, *this; for (hp = ep->headers; hp;) { this = hp; @@ -442,9 +449,9 @@ SWITCH_DECLARE(void) switch_event_destroy(switch_event **event) *event = NULL; } -SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_event *todup) +SWITCH_DECLARE(switch_status) switch_event_dup(switch_event_t **event, switch_event_t *todup) { - switch_event_header *header, *hp, *hp2; + switch_event_header_t *header, *hp, *hp2; if (switch_event_create_subclass(event, todup->event_id, todup->subclass->name) != SWITCH_STATUS_SUCCESS) { return SWITCH_STATUS_GENERR; @@ -476,10 +483,10 @@ SWITCH_DECLARE(switch_status) switch_event_dup(switch_event **event, switch_even return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char *buf, switch_size_t buflen, char *fmt, ...) +SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event_t *event, char *buf, switch_size_t buflen, char *fmt, ...) { switch_size_t len = 0; - switch_event_header *hp; + switch_event_header_t *hp; char *data = NULL, *body = NULL; int ret = 0; va_list ap; @@ -529,7 +536,7 @@ SWITCH_DECLARE(switch_status) switch_event_serialize(switch_event *event, char * } -SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event **event, +SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, int line, switch_event_t **event, void *user_data) { @@ -572,7 +579,7 @@ SWITCH_DECLARE(switch_status) switch_event_fire_detailed(char *file, char *func, return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, char *subclass_name, +SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_types_t event, char *subclass_name, switch_event_callback_t callback, void *user_data) { switch_event_node *event_node; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 97051c1f6b..3a84e46073 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -268,7 +268,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_play_file(switch_core_session *session, switch_timer timer; switch_core_thread_session thread_session; switch_codec codec; - switch_memory_pool *pool = switch_core_session_get_pool(session); + switch_memory_pool_t *pool = switch_core_session_get_pool(session); char *codec_name; int stream_id; switch_status status = SWITCH_STATUS_SUCCESS; @@ -502,7 +502,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_speak_text(switch_core_session *session switch_timer timer; switch_core_thread_session thread_session; switch_codec codec; - switch_memory_pool *pool = switch_core_session_get_pool(session); + switch_memory_pool_t *pool = switch_core_session_get_pool(session); char *codec_name; int x; int stream_id; @@ -700,7 +700,7 @@ struct audio_bridge_data { int running; }; -static void *audio_bridge_thread(switch_thread *thread, void *obj) +static void *audio_bridge_thread(switch_thread_t *thread, void *obj) { struct switch_core_thread_session *his_thread, *data = obj; int *stream_id_p; @@ -988,7 +988,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi } if (switch_channel_test_flag(peer_channel, CF_ANSWERED) || switch_channel_test_flag(peer_channel, CF_EARLY_MEDIA)) { - switch_event *event; + switch_event_t *event; switch_core_session_message msg = {0}; switch_channel_set_state(peer_channel, CS_HOLD); diff --git a/src/switch_loadable_module.c b/src/switch_loadable_module.c index 40b413e734..4f0ceb365a 100644 --- a/src/switch_loadable_module.c +++ b/src/switch_loadable_module.c @@ -42,22 +42,22 @@ struct switch_loadable_module { }; struct switch_loadable_module_container { - switch_hash *module_hash; - switch_hash *endpoint_hash; - switch_hash *codec_hash; - switch_hash *dialplan_hash; - switch_hash *timer_hash; - switch_hash *application_hash; - switch_hash *api_hash; - switch_hash *file_hash; - switch_hash *speech_hash; - switch_hash *directory_hash; - switch_memory_pool *pool; + switch_hash_t *module_hash; + switch_hash_t *endpoint_hash; + switch_hash_t *codec_hash; + switch_hash_t *dialplan_hash; + switch_hash_t *timer_hash; + switch_hash_t *application_hash; + switch_hash_t *api_hash; + switch_hash_t *file_hash; + switch_hash_t *speech_hash; + switch_hash_t *directory_hash; + switch_memory_pool_t *pool; }; static struct switch_loadable_module_container loadable_modules; -static void *switch_loadable_module_exec(switch_thread *thread, void *obj) +static void *switch_loadable_module_exec(switch_thread_t *thread, void *obj) { @@ -75,7 +75,7 @@ static void *switch_loadable_module_exec(switch_thread *thread, void *obj) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Thread ended for %s\n", module->interface->module_name); if (ts->pool) { - switch_memory_pool *pool = ts->pool; + switch_memory_pool_t *pool = ts->pool; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Destroying Pool for %s\n", module->interface->module_name); switch_core_destroy_memory_pool(&pool); } @@ -567,7 +567,7 @@ SWITCH_DECLARE(switch_directory_interface *) switch_loadable_module_get_director return switch_core_hash_find(loadable_modules.directory_hash, name); } -SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool *pool, switch_codec_interface **array, +SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface **array, int arraylen) { switch_hash_index_t *hi; @@ -608,7 +608,7 @@ SWITCH_DECLARE(switch_status) switch_api_execute(char *cmd, char *arg, char *ret { switch_api_interface *api; switch_status status; - switch_event *event; + switch_event_t *event; if ((api = switch_loadable_module_get_api_interface(cmd)) != 0) { status = api->function(arg, retbuf, len); diff --git a/src/switch_log.c b/src/switch_log.c index daed611ea5..999f4d2c33 100644 --- a/src/switch_log.c +++ b/src/switch_log.c @@ -53,7 +53,7 @@ struct switch_log_binding { typedef struct switch_log_binding switch_log_binding; -static switch_memory_pool *LOG_POOL = NULL; +static switch_memory_pool_t *LOG_POOL = NULL; static switch_log_binding *BINDINGS = NULL; static switch_mutex_t *BINDLOCK = NULL; static switch_queue_t *LOG_QUEUE = NULL; @@ -111,7 +111,7 @@ SWITCH_DECLARE(switch_status) switch_log_bind_logger(switch_log_function functio return SWITCH_STATUS_SUCCESS; } -static void *SWITCH_THREAD_FUNC log_thread(switch_thread *thread, void *obj) +static void *SWITCH_THREAD_FUNC log_thread(switch_thread_t *thread, void *obj) { /* To Be or Not To Be */ @@ -212,7 +212,7 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file, } if (channel == SWITCH_CHANNEL_ID_EVENT) { - switch_event *event; + switch_event_t *event; if (switch_event_running() == SWITCH_STATUS_SUCCESS && switch_event_create(&event, SWITCH_EVENT_LOG) == SWITCH_STATUS_SUCCESS) { switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-Data", "%s", data); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Log-File", "%s", filep); @@ -250,9 +250,9 @@ SWITCH_DECLARE(void) switch_log_printf(switch_text_channel channel, char *file, } -SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool *pool) +SWITCH_DECLARE(switch_status) switch_log_init(switch_memory_pool_t *pool) { - switch_thread *thread; + switch_thread_t *thread; switch_threadattr_t *thd_attr;; assert(pool != NULL); diff --git a/src/switch_resample.c b/src/switch_resample.c index e3a15242e7..39bbb28af1 100644 --- a/src/switch_resample.c +++ b/src/switch_resample.c @@ -30,6 +30,7 @@ * */ #include +#include #include #define NORMFACT (float)0x8000 #define MAXSAMPLE (float)0x7FFF @@ -46,12 +47,12 @@ -SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **new_resampler, +SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler_t **new_resampler, int from_rate, switch_size_t from_size, - int to_rate, uint32_t to_size, switch_memory_pool *pool) + int to_rate, uint32_t to_size, switch_memory_pool_t *pool) { - switch_audio_resampler *resampler; + switch_audio_resampler_t *resampler; double lto_rate, lfrom_rate; if ((resampler = switch_core_alloc(pool, sizeof(*resampler))) == 0) { @@ -77,7 +78,7 @@ SWITCH_DECLARE(switch_status) switch_resample_create(switch_audio_resampler **ne } -SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampler, float *src, int srclen, float *dst, +SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler_t *resampler, float *src, int srclen, float *dst, uint32_t dstlen, int last) { int o = 0, srcused = 0, srcpos = 0, out = 0; @@ -100,7 +101,7 @@ SWITCH_DECLARE(uint32_t) switch_resample_process(switch_audio_resampler *resampl return out; } -SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler *resampler) +SWITCH_DECLARE(void) switch_resample_destroy(switch_audio_resampler_t *resampler) { resample_close(resampler->resampler); } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 501e444b92..5045da9ba7 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -99,7 +99,7 @@ struct switch_rtp { uint32_t ts; uint32_t flags; - switch_memory_pool *pool; + switch_memory_pool_t *pool; switch_sockaddr_t *from_addr; char *ice_user; @@ -117,7 +117,7 @@ struct switch_rtp { static int global_init = 0; -static switch_status ice_out(switch_rtp *rtp_session) +static switch_status ice_out(switch_rtp_t *rtp_session) { assert(rtp_session != NULL); @@ -149,7 +149,7 @@ static switch_status ice_out(switch_rtp *rtp_session) return SWITCH_STATUS_SUCCESS; } -static void handle_ice(switch_rtp *rtp_session, void *data, switch_size_t len) +static void handle_ice(switch_rtp_t *rtp_session, void *data, switch_size_t len) { switch_stun_packet_t *packet; switch_stun_packet_attribute_t *attr; @@ -199,7 +199,7 @@ static void handle_ice(switch_rtp *rtp_session, void *data, switch_size_t len) } -SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool *pool) +SWITCH_DECLARE(void) switch_rtp_init(switch_memory_pool_t *pool) { if (global_init) { return; @@ -225,7 +225,7 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void) } -SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err) +SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err) { *err = "Success"; @@ -256,7 +256,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_sessi return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_session, char *host, switch_port_t port, const char **err) +SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err) { *err = "Success"; @@ -270,16 +270,16 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_sess return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, +SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp_t **new_rtp_session, switch_payload_t payload, uint32_t packet_size, uint32_t ms_per_packet, switch_rtp_flag_t flags, char *crypto_key, const char **err, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { - switch_rtp *rtp_session = NULL; + switch_rtp_t *rtp_session = NULL; srtp_policy_t policy; char key[MAX_KEY_LEN]; uint32_t ssrc = rand() & 0xffff; @@ -390,7 +390,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, +SWITCH_DECLARE(switch_rtp_t *)switch_rtp_new(char *rx_host, switch_port_t rx_port, char *tx_host, switch_port_t tx_port, @@ -400,9 +400,9 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, switch_rtp_flag_t flags, char *crypto_key, const char **err, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { - switch_rtp *rtp_session; + switch_rtp_t *rtp_session; if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, crypto_key, err, pool) != SWITCH_STATUS_SUCCESS) { return NULL; @@ -420,7 +420,7 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, } -SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, char *login, char *rlogin) +SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp_t *rtp_session, char *login, char *rlogin) { char ice_user[80]; char user_ice[80]; @@ -439,14 +439,14 @@ SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, c return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp *rtp_session) +SWITCH_DECLARE(void) switch_rtp_kill_socket(switch_rtp_t *rtp_session) { apr_socket_shutdown(rtp_session->sock, APR_SHUTDOWN_READWRITE); switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_IO); } -SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session) +SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp_t **rtp_session) { switch_rtp_kill_socket(*rtp_session); switch_socket_close((*rtp_session)->sock); @@ -463,58 +463,58 @@ SWITCH_DECLARE(void) switch_rtp_destroy(switch_rtp **rtp_session) return; } -SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session) +SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp_t *rtp_session) { return rtp_session->sock; } -SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint16_t packet_size) +SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp_t *rtp_session, uint16_t packet_size) { rtp_session->packet_size = packet_size; } -SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session) +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp_t *rtp_session) { return rtp_session->packet_size; } -SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp *rtp_session, switch_payload_t payload) +SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp_t *rtp_session, switch_payload_t payload) { rtp_session->payload = payload; } -SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp *rtp_session) +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_payload(switch_rtp_t *rtp_session) { return rtp_session->payload; } -SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, switch_rtp_invalid_handler on_invalid) +SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp_t *rtp_session, switch_rtp_invalid_handler on_invalid) { rtp_session->invalid_handler = on_invalid; } -SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) +SWITCH_DECLARE(void) switch_rtp_set_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags) { switch_set_flag(rtp_session, flags); } -SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) +SWITCH_DECLARE(uint8_t) switch_rtp_test_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags) { return (uint8_t) switch_test_flag(rtp_session, flags); } -SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp *rtp_session, switch_rtp_flag_t flags) +SWITCH_DECLARE(void) switch_rtp_clear_flag(switch_rtp_t *rtp_session, switch_rtp_flag_t flags) { switch_clear_flag(rtp_session, flags); } -static int rtp_common_read(switch_rtp *rtp_session, switch_payload_t *payload_type, switch_frame_flag *flags) +static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_type, switch_frame_flag *flags) { switch_size_t bytes; switch_status status; @@ -606,7 +606,7 @@ static int rtp_common_read(switch_rtp *rtp_session, switch_payload_t *payload_ty return (int) bytes; } -SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) +SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp_t *rtp_session, void *data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) { int bytes = rtp_common_read(rtp_session, payload_type, flags); @@ -625,7 +625,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_read(switch_rtp *rtp_session, void *dat return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_session, switch_frame *frame) +SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp_session, switch_frame *frame) { int bytes = rtp_common_read(rtp_session, &frame->payload, &frame->flags); @@ -650,7 +650,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read_frame(switch_rtp *rtp_ses } -SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) +SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp_t *rtp_session, void **data, uint32_t *datalen, switch_payload_t *payload_type, switch_frame_flag *flags) { int bytes = rtp_common_read(rtp_session, payload_type, flags); @@ -667,7 +667,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_zerocopy_read(switch_rtp *rtp_session, return SWITCH_STATUS_SUCCESS; } -static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, switch_frame_flag *flags) +static int rtp_common_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint8_t m, switch_payload_t payload, switch_frame_flag *flags) { switch_size_t bytes; uint8_t packetize = (rtp_session->packet_size > datalen && (payload == rtp_session->payload)) ? 1 : 0; @@ -777,7 +777,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale send_msg->header.m = 1; rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0; if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_TALK)) { - switch_event *event; + switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_TALK) == SWITCH_STATUS_SUCCESS) { switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session); switch_channel_event_set_data(channel, event); @@ -794,7 +794,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale switch_clear_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_TALKING); rtp_session->vad_data.hangover_hits = rtp_session->vad_data.hangunder_hits = rtp_session->vad_data.cng_count = 0; if (switch_test_flag(&rtp_session->vad_data, SWITCH_VAD_FLAG_EVENTS_NOTALK)) { - switch_event *event; + switch_event_t *event; if (switch_event_create(&event, SWITCH_EVENT_NOTALK) == SWITCH_STATUS_SUCCESS) { switch_channel *channel = switch_core_session_get_channel(rtp_session->vad_data.session); switch_channel_event_set_data(channel, event); @@ -842,7 +842,7 @@ static int rtp_common_write(switch_rtp *rtp_session, void *data, uint32_t datale } -SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session) +SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp_t *rtp_session) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) { return SWITCH_STATUS_GENERR; @@ -852,7 +852,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_disable_vad(switch_rtp *rtp_session) return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags) +SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp_t *rtp_session, switch_core_session *session, switch_codec *codec, switch_vad_flag_t flags) { if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_VAD)) { return SWITCH_STATUS_GENERR; @@ -890,7 +890,7 @@ SWITCH_DECLARE(switch_status) switch_rtp_enable_vad(switch_rtp *rtp_session, swi return SWITCH_STATUS_SUCCESS; } -SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags) +SWITCH_DECLARE(int) switch_rtp_write(switch_rtp_t *rtp_session, void *data, uint32_t datalen, uint32_t ts, switch_frame_flag *flags) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { @@ -907,7 +907,7 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, uint32 } -SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame *frame, uint32_t ts) +SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp_t *rtp_session, switch_frame *frame, uint32_t ts) { uint8_t fwd = (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_RAW_WRITE) && switch_test_flag(frame, SFF_RAW_RTP)) ? 1 : 0; uint8_t packetize = (rtp_session->packet_size > frame->datalen && (frame->payload == rtp_session->payload)) ? 1 : 0; @@ -935,7 +935,7 @@ SWITCH_DECLARE(int) switch_rtp_write_frame(switch_rtp *rtp_session, switch_frame } -SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data, uint16_t datalen, uint8_t m, uint8_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags) +SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *data, uint16_t datalen, uint8_t m, uint8_t payload, uint32_t ts, uint16_t mseq, switch_frame_flag *flags) { if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { @@ -949,17 +949,17 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp *rtp_session, void *data, return rtp_common_write(rtp_session, data, datalen, m, payload, flags); } -SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp *rtp_session) +SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp_t *rtp_session) { return rtp_session->send_msg.header.ssrc; } -SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp *rtp_session, void *private_data) +SWITCH_DECLARE(void) switch_rtp_set_private(switch_rtp_t *rtp_session, void *private_data) { rtp_session->private_data = private_data; } -SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp *rtp_session) +SWITCH_DECLARE(void *)switch_rtp_get_private(switch_rtp_t *rtp_session) { return rtp_session->private_data; } diff --git a/src/switch_stun.c b/src/switch_stun.c index e72f246db4..709fad0568 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -273,7 +273,7 @@ SWITCH_DECLARE(switch_status) switch_stun_lookup (char **ip, char *stunip, switch_port_t stunport, char **err, - switch_memory_pool *pool) + switch_memory_pool_t *pool) { switch_sockaddr_t *local_addr = NULL, *remote_addr = NULL, *from_addr = NULL; diff --git a/src/switch_utils.c b/src/switch_utils.c index c1d94cf510..b54fb28b89 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -134,7 +134,7 @@ SWITCH_DECLARE(char *) switch_cut_path(char *in) } SWITCH_DECLARE(switch_status) switch_socket_create_pollfd(switch_pollfd_t *poll, switch_socket_t *sock, - switch_int16_t flags, switch_memory_pool *pool) + switch_int16_t flags, switch_memory_pool_t *pool) { switch_pollset_t *pollset;