adding const qualifiers across the api as appropriate.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5165 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-05-12 14:48:14 +00:00
parent 8107c49a64
commit a4ff7e88da
32 changed files with 255 additions and 206 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ SWITCH_DECLARE(void) switch_buffer_set_loops(switch_buffer_t *buffer, int32_t lo
* \param datalen amount of data to be written
* \return int amount of buffer used after the write, or 0 if no space available
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, void *data, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, const void *data, switch_size_t datalen);
/*! \brief Remove data from the buffer
* \param buffer any buffer of type switch_buffer_t
+4 -4
View File
@@ -128,7 +128,7 @@ struct switch_caller_extension {
\param extension_number extension number
\return a new extension object allocated from the session's memory pool
*/
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, char *extension_name, char *extension_number);
SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_core_session_t *session, const char *extension_name, const char *extension_number);
/*!
\brief Add an application (instruction) to the given extension
@@ -138,7 +138,7 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_caller_extension_new(switch_c
\param extra_data optional argument to the application
*/
SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session_t *session,
switch_caller_extension_t *caller_extension, char *application_name, char *extra_data);
switch_caller_extension_t *caller_extension, const char *application_name, const char *extra_data);
/*!
@@ -147,7 +147,7 @@ SWITCH_DECLARE(void) switch_caller_extension_add_application(switch_core_session
\param name the name
\note this function is meant for situations where the name paramater is the contents of the variable
*/
SWITCH_DECLARE(char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, char *name);
SWITCH_DECLARE(char *) switch_caller_get_field_by_name(switch_caller_profile_t *caller_profile, const char *name);
/*!
\brief Create a new caller profile object
@@ -191,7 +191,7 @@ SWITCH_DECLARE(switch_caller_profile_t *) switch_caller_profile_clone(switch_cor
\param event the event to add the information to
*/
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, char *prefix, switch_event_t *event);
SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_t *caller_profile, const char *prefix, switch_event_t *event);
SWITCH_END_EXTERN_C
/** @} */
+9 -9
View File
@@ -89,7 +89,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
\param str the string to check
\return the code
*/
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(char *str);
SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str);
/*!
\brief return the cause code for a given channel
@@ -103,7 +103,7 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(switch_channel_t *c
\param cause the code to check
\return the string
*/
SWITCH_DECLARE(char *) switch_channel_cause2str(switch_call_cause_t cause);
SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause);
/*!
\brief View the timetable of a channel
@@ -136,7 +136,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_init(switch_channel_t *channel, s
\param rpid the rpid if for the icon to use
\param status the status message
*/
SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, char *rpid, char *status);
SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const char *rpid, const char *status);
/*!
\brief Uninitalize a channel
@@ -218,7 +218,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_nodup(switch_channel
\param varname the name of the variable
\return the value of the requested variable
*/
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, char *varname);
SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel_t *channel, const char *varname);
/*!
* Start iterating over the entries in the channel variable list.
@@ -373,7 +373,7 @@ SWITCH_DECLARE(const switch_state_handler_table_t *) switch_channel_get_state_ha
\param private_info void pointer to private data
\return SWITCH_STATUS_SUCCESS if data was set
*/
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, char *key, void *private_info);
SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *channel, const char *key, const void *private_info);
/*!
\brief Retrieve private from a given channel
@@ -381,7 +381,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_set_private(switch_channel_t *cha
\param key unique keyname to retrieve your private data
\return void pointer to channel's private data
*/
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, char *key);
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, const char *key);
/*!
\brief Assign a name to a given channel
@@ -389,7 +389,7 @@ SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel_t *channel, cha
\param name name to assign
\return SWITCH_STATUS_SUCCESS if name was assigned
*/
SWITCH_DECLARE(switch_status_t) switch_channel_set_name(switch_channel_t *channel, char *name);
SWITCH_DECLARE(switch_status_t) switch_channel_set_name(switch_channel_t *channel, const char *name);
/*!
\brief Retrieve the name of a given channel
@@ -423,7 +423,7 @@ SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
\param dtmf string of digits to queue
\return SWITCH_STATUS_SUCCESS if successful
*/
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *channel, char *dtmf);
SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *channel, const char *dtmf);
/*!
\brief Retrieve DTMF digits from a given channel
@@ -446,7 +446,7 @@ SWITCH_DECLARE(const char *) switch_channel_state_name(switch_channel_state_t st
\param name the name of the state
\return the enum value (numeric)
*/
SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(char *name);
SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(const char *name);
/*!
\brief Add information about a given channel to an event object
+6 -6
View File
@@ -220,7 +220,7 @@ SWITCH_DECLARE(void) switch_core_port_allocator_destroy(switch_core_port_allocat
\param err a pointer to set any errors to
\note to be called at application startup
*/
SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err);
SWITCH_DECLARE(switch_status_t) switch_core_init(const char *console, const char **err);
/*!
\brief Initilize the core and load modules
@@ -228,7 +228,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console, const char **err
\param err a pointer to set any errors to
\note to be called at application startup instead of switch_core_init. Includes module loading.
*/
SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(char *console, const char **err);
SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(const char *console, const char **err);
/*!
\brief Set/Get Session Limit
@@ -503,7 +503,7 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(char
#ifdef SWITCH_DEBUG_RWLOCKS
#define switch_core_session_locate(uuid_str) switch_core_session_perform_locate(uuid_str, __FILE__, __SWITCH_FUNC__, __LINE__)
#else
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_str);
SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(const char *uuid_str);
#endif
/*!
@@ -511,14 +511,14 @@ SWITCH_DECLARE(switch_core_session_t *) switch_core_session_locate(char *uuid_st
\param varname the name of the variable
\return the value of the desired variable
*/
SWITCH_DECLARE(char *) switch_core_get_variable(char *varname);
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname);
/*!
\brief Add a global variable to the core
\param varname the name of the variable
\param value the value of the variable
*/
SWITCH_DECLARE(void) switch_core_set_variable(char *varname, char *value);
SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value);
/*!
\brief Hangup All Sessions
@@ -1395,7 +1395,7 @@ SWITCH_DECLARE(void) switch_core_runtime_loop(int bg);
\brief Set the output console to the desired file
\param console the file path
*/
SWITCH_DECLARE(switch_status_t) switch_core_set_console(char *console);
SWITCH_DECLARE(switch_status_t) switch_core_set_console(const char *console);
/*!
\brief Breakdown a number of milliseconds into various time spec
+14 -14
View File
@@ -97,21 +97,21 @@ SWITCH_DECLARE(void) switch_loadable_module_shutdown(void);
\param name the name of the endpoint
\return the desired endpoint interface
*/
SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(char *name);
SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(const char *name);
/*!
\brief Retrieve the codec interface by it's registered name
\param name the name of the codec
\return the desired codec interface
*/
SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name);
SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(const char *name);
/*!
\brief Retrieve the dialplan interface by it's registered name
\param name the name of the dialplan
\return the desired dialplan interface
*/
SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name);
SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(const char *name);
/*!
\brief build a dynamic module object and register it (for use in double embeded modules)
@@ -132,70 +132,70 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filen
\param name the name of the timer
\return the desired timer interface
*/
SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(char *name);
SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(const char *name);
/*!
\brief Retrieve the application interface by it's registered name
\param name the name of the application
\return the desired application interface
*/
SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(char *name);
SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(const char *name);
/*!
\brief Retrieve the API interface by it's registered name
\param name the name of the API
\return the desired API interface
*/
SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(char *name);
SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(const char *name);
/*!
\brief Retrieve the file format interface by it's registered name
\param name the name of the file format
\return the desired file format interface
*/
SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(char *name);
SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(const char *name);
/*!
\brief Retrieve the speech interface by it's registered name
\param name the name of the speech interface
\return the desired speech interface
*/
SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(char *name);
SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(const char *name);
/*!
\brief Retrieve the asr interface by it's registered name
\param name the name of the asr interface
\return the desired asr interface
*/
SWITCH_DECLARE(switch_asr_interface_t *) switch_loadable_module_get_asr_interface(char *name);
SWITCH_DECLARE(switch_asr_interface_t *) switch_loadable_module_get_asr_interface(const char *name);
/*!
\brief Retrieve the directory interface by it's registered name
\param name the name of the directory interface
\return the desired directory interface
*/
SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(char *name);
SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(const char *name);
/*!
\brief Retrieve the chat interface by it's registered name
\param name the name of the chat interface
\return the desired chat interface
*/
SWITCH_DECLARE(switch_chat_interface_t *) switch_loadable_module_get_chat_interface(char *name);
SWITCH_DECLARE(switch_chat_interface_t *) switch_loadable_module_get_chat_interface(const char *name);
/*!
\brief Retrieve the say interface by it's registered name
\param name the name of the say interface
\return the desired say interface
*/
SWITCH_DECLARE(switch_say_interface_t *) switch_loadable_module_get_say_interface(char *name);
SWITCH_DECLARE(switch_say_interface_t *) switch_loadable_module_get_say_interface(const char *name);
/*!
\brief Retrieve the management interface by it's registered name
\param relative_oid the relative oid of the management interface
\return the desired management interface
*/
SWITCH_DECLARE(switch_management_interface_t *) switch_loadable_module_get_management_interface(char *relative_oid);
SWITCH_DECLARE(switch_management_interface_t *) switch_loadable_module_get_management_interface(const char *relative_oid);
/*!
\brief Retrieve the list of loaded codecs into an array
@@ -226,7 +226,7 @@ SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(const switch_codec_
\param stream stream for output
\return the status returned by the API call
*/
SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, switch_core_session_t *session, switch_stream_handle_t *stream);
SWITCH_DECLARE(switch_status_t) switch_api_execute(const char *cmd, const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream);
/*!
\brief Load a module
+3 -3
View File
@@ -49,8 +49,8 @@ SWITCH_DECLARE(int) switch_regex_copy_substring(const char *subject, int *ovecto
SWITCH_DECLARE(void) switch_regex_free(void *data);
SWITCH_DECLARE(int) switch_regex_perform(char *field, char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen);
SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, char *data, char *field_data,
SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen);
SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_count, const char *data, const char *field_data,
char *substituted, uint32_t len, int *ovector);
/*!
@@ -59,7 +59,7 @@ SWITCH_DECLARE(void) switch_perform_substitution(switch_regex_t *re, int match_c
\param expression The regular expression to run against the string
\return Boolean if a match was found or not
*/
SWITCH_DECLARE(switch_status_t) switch_regex_match(char *target, char *expression);
SWITCH_DECLARE(switch_status_t) switch_regex_match(const char *target, const char *expression);
#define switch_regex_safe_free(re) if (re) {\
switch_regex_free(re);\
+4 -4
View File
@@ -111,9 +111,9 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_create(switch_rtp_t **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_t *) switch_rtp_new(char *rx_host,
SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(const char *rx_host,
switch_port_t rx_port,
char *tx_host,
const char *tx_host,
switch_port_t tx_port,
switch_payload_t payload,
uint32_t samples_per_interval,
@@ -128,7 +128,7 @@ SWITCH_DECLARE(switch_rtp_t *) switch_rtp_new(char *rx_host,
\param port the remote port
\param err pointer for error messages
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_session, const char *host, switch_port_t port, const char **err);
/*!
\brief Assign a local address to the RTP session
@@ -138,7 +138,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_set_remote_address(switch_rtp_t *rtp_
\param err pointer for error messages
\note this call also binds the RTP session's socket to the new address
*/
SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_session, char *host, switch_port_t port, const char **err);
SWITCH_DECLARE(switch_status_t) switch_rtp_set_local_address(switch_rtp_t *rtp_session, const char *host, switch_port_t port, const char **err);
/*!
\brief Kill the socket on an existing RTP session
+2 -2
View File
@@ -62,7 +62,7 @@ SWITCH_BEGIN_EXTERN_C
*/
SWITCH_DECLARE(uint32_t) switch_scheduler_add_task(time_t task_runtime,
switch_scheduler_func_t func,
char *desc, char *group, uint32_t cmd_id, void *cmd_arg, switch_scheduler_flag_t flags);
const char *desc, const char *group, uint32_t cmd_id, void *cmd_arg, switch_scheduler_flag_t flags);
/*!
\brief Delete a scheduled task
@@ -76,7 +76,7 @@ SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_id(uint32_t task_id);
\param group the group name
\return the number of jobs deleted
*/
SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_group(char *group);
SWITCH_DECLARE(uint32_t) switch_scheduler_del_task_group(const char *group);
/*!
+1 -1
View File
@@ -1018,7 +1018,7 @@ typedef void (*switch_scheduler_func_t) (switch_scheduler_task_t *task);
typedef switch_status_t (*switch_state_handler_t) (switch_core_session_t *);
typedef struct switch_stream_handle switch_stream_handle_t;
typedef switch_status_t (*switch_stream_handle_write_function_t) (switch_stream_handle_t *handle, const char *fmt, ...);
typedef switch_status_t (*switch_api_function_t) (char *in, switch_core_session_t *session, switch_stream_handle_t *stream);
typedef switch_status_t (*switch_api_function_t) (const char *in, switch_core_session_t *session, switch_stream_handle_t *stream);
typedef switch_status_t (*switch_input_callback_function_t) (switch_core_session_t *session, void *input,
switch_input_type_t input_type, void *buf, unsigned int buflen);
typedef struct switch_say_interface switch_say_interface_t;
+4 -4
View File
@@ -55,7 +55,7 @@ SWITCH_BEGIN_EXTERN_C
#define switch_is_file_path(file) ((*file == '/') || strstr(file, SWITCH_URL_SEPARATOR))
#endif
static inline switch_bool_t switch_is_digit_string(char *s) {
static inline switch_bool_t switch_is_digit_string(const char *s) {
while(s && *s) {
if (*s < 48 || *s > 57) {
@@ -104,7 +104,7 @@ SWITCH_DECLARE(char *) get_addr(char *buf, switch_size_t len, struct in_addr *in
\param priority the priority to get the name of
\return the printable form of the priority
*/
SWITCH_DECLARE(char *) switch_priority_name(switch_priority_t priority);
SWITCH_DECLARE(const char *) switch_priority_name(switch_priority_t priority);
/*!
\brief Return the RFC2833 character based on an event id
@@ -260,7 +260,7 @@ static inline switch_bool_t switch_strstr(char *s, char *q)
\param in the string
\return the epoch time in usec
*/
SWITCH_DECLARE(switch_time_t) switch_str_time(char *in);
SWITCH_DECLARE(switch_time_t) switch_str_time(const char *in);
/*!
\brief Declares a function designed to set a dymaic global string
@@ -288,7 +288,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char
\param esc the escape character
\return the escaped string
*/
SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in, char *delim, char esc);
SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in, const char *delim, char esc);
/*!
\brief Wait for a socket