part 1 of many standardizing typedefed types to end in _t

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1292 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2006-04-29 01:00:52 +00:00
parent 751ca005d3
commit d0347b2a95
41 changed files with 344 additions and 333 deletions
+7 -7
View File
@@ -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
+6 -6
View File
@@ -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
/**
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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
+24 -24
View File
@@ -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
+17 -17
View File
@@ -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
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
+7 -7
View File
@@ -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;
};
+6 -6
View File
@@ -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
+31 -31
View File
@@ -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);
/*!
\}
+1 -1
View File
@@ -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);
+7 -8
View File
@@ -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
<pre>
@@ -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);
+1 -1
View File
@@ -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