general improvements

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5078 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-05-03 16:28:23 +00:00
parent 9d5d251987
commit 1be5b1ff45
8 changed files with 599 additions and 59 deletions
+41
View File
@@ -818,6 +818,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_destroy(switch_hash_t * hash);
*/
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert(switch_hash_t * hash, const char *key, const void *data);
/*!
\brief Insert data into a hash
\param hash the hash to add data to
\param key the name of the key to add the data to
\param data the data to add
\param mutex optional mutex to lock
\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_t) switch_core_hash_insert_locked(switch_hash_t * hash, const char *key, const void *data, switch_mutex_t *mutex);
/*!
\brief Insert data into a hash with dynamicly allocated key name
\param hash the hash to add data to
@@ -827,6 +838,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert(switch_hash_t * hash, co
*/
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_dup(switch_hash_t * hash, const char *key, const void *data);
/*!
\brief Insert data into a hash with dynamicly allocated key name
\param hash the hash to add data to
\param key the name of the key to add the data to
\param data the data to add
\param mutex optional mutex to lock
\return SWITCH_STATUS_SUCCESS if the data is added
*/
SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_dup_locked(switch_hash_t * hash, const char *key, const void *data, switch_mutex_t *mutex);
/*!
\brief Delete data from a hash based on desired key
\param hash the hash to delete from
@@ -835,6 +856,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_insert_dup(switch_hash_t * hash
*/
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete(switch_hash_t * hash, const char *key);
/*!
\brief Delete data from a hash based on desired key
\param hash the hash to delete from
\param key the key from which to delete the data
\param mutex optional mutex to lock
\return SWITCH_STATUS_SUCCESS if the data is deleted
*/
SWITCH_DECLARE(switch_status_t) switch_core_hash_delete_locked(switch_hash_t * hash, const char *key, switch_mutex_t *mutex);
/*!
\brief Retrieve data from a given hash
\param hash the hash to retrieve from
@@ -842,6 +872,17 @@ SWITCH_DECLARE(switch_status_t) switch_core_hash_delete(switch_hash_t * hash, co
\return a pointer to the data held in the key
*/
SWITCH_DECLARE(void *) switch_core_hash_find(switch_hash_t * hash, const char *key);
/*!
\brief Retrieve data from a given hash
\param hash the hash to retrieve from
\param key the key to retrieve
\param mutex optional mutex to lock
\return a pointer to the data held in the key
*/
SWITCH_DECLARE(void *) switch_core_hash_find_locked(switch_hash_t * hash, const char *key, switch_mutex_t *mutex);
///\}
///\defgroup timer Timer Functions
+12 -3
View File
@@ -228,15 +228,24 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
*/
SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, switch_core_session_t *session, switch_stream_handle_t *stream);
/*!
\brief Load a module
\param dir the directory where the module resides
\param fname the file name of the module
\param runtime option to start the runtime thread if it exists
\param err pointer to error message
\return the status
*/
SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname, switch_bool_t runtime);
SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname, switch_bool_t runtime, const char **err);
/*!
\brief Unoad a module
\param dir the directory where the module resides
\param fname the file name of the module
\param err pointer to error message
\return the status
*/
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err);
/* Prototypes of module interface functions */
+5 -1
View File
@@ -420,6 +420,7 @@ typedef enum {
SWITCH_STATUS_MORE_DATA - Need More Data
SWITCH_STATUS_NOTFOUND - Not Found
SWITCH_STATUS_UNLOAD - Unload
SWITCH_STATUS_NOUNLOAD - Never Unload
</pre>
*/
typedef enum {
@@ -438,7 +439,8 @@ typedef enum {
SWITCH_STATUS_SOCKERR,
SWITCH_STATUS_MORE_DATA,
SWITCH_STATUS_NOTFOUND,
SWITCH_STATUS_UNLOAD
SWITCH_STATUS_UNLOAD,
SWITCH_STATUS_NOUNLOAD
} switch_status_t;
@@ -816,6 +818,7 @@ typedef enum {
SWITCH_EVENT_NOTALK - Not Talking Detected
SWITCH_EVENT_SESSION_CRASH - Session Crashed
SWITCH_EVENT_MODULE_LOAD - Module was loaded
SWITCH_EVENT_MODULE_UNLOAD - Module was unloaded
SWITCH_EVENT_DTMF - DTMF was sent
SWITCH_EVENT_MESSAGE - A Basic Message
SWITCH_EVENT_PRESENCE_IN - Presence in
@@ -863,6 +866,7 @@ typedef enum {
SWITCH_EVENT_NOTALK,
SWITCH_EVENT_SESSION_CRASH,
SWITCH_EVENT_MODULE_LOAD,
SWITCH_EVENT_MODULE_UNLOAD,
SWITCH_EVENT_DTMF,
SWITCH_EVENT_MESSAGE,
SWITCH_EVENT_PRESENCE_IN,