[Freeswitch-svn] [commit] r4447 - in freeswitch/trunk/src: . include mod/xml_int/mod_xml_curl
Freeswitch SVN
mikej at freeswitch.org
Mon Mar 5 00:49:53 EST 2007
Author: mikej
Date: Mon Mar 5 00:49:52 2007
New Revision: 4447
Modified:
freeswitch/trunk/src/include/switch_types.h
freeswitch/trunk/src/include/switch_xml.h
freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
freeswitch/trunk/src/switch_xml.c
Log:
constify some xml functions
Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h (original)
+++ freeswitch/trunk/src/include/switch_types.h Mon Mar 5 00:49:52 2007
@@ -1029,11 +1029,11 @@
typedef switch_status_t (*switch_module_shutdown_t) (void);
typedef struct switch_xml *switch_xml_t;
typedef struct switch_core_time_duration switch_core_time_duration_t;
-typedef switch_xml_t (*switch_xml_search_function_t)(char *section,
- char *tag_name,
- char *key_name,
- char *key_value,
- char *params,
+typedef switch_xml_t (*switch_xml_search_function_t)(const char *section,
+ const char *tag_name,
+ const char *key_name,
+ const char *key_value,
+ const char *params,
void *user_data);
/* things we don't deserve to know about */
Modified: freeswitch/trunk/src/include/switch_xml.h
==============================================================================
--- freeswitch/trunk/src/include/switch_xml.h (original)
+++ freeswitch/trunk/src/include/switch_xml.h Mon Mar 5 00:49:52 2007
@@ -316,20 +316,20 @@
///\param node a pointer to the requested node
///\param params optional URL formatted params to pass to external gateways
///\return SWITCH_STATUS_SUCCESS if successful root and node will be assigned
-SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
- char *tag_name,
- char *key_name,
- char *key_value,
+SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
+ const char *tag_name,
+ const char *key_name,
+ const char *key_value,
switch_xml_t *root,
switch_xml_t *node,
- char *params);
+ const char *params);
///\brief open a config in the core registry
///\param file_path the name of the config section e.g. modules.conf
///\param node a pointer to point to the node if it is found
///\param params optional URL formatted params to pass to external gateways
///\return the root xml node associated with the current request or NULL
-SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(char *file_path, switch_xml_t *node, char *params);
+SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t *node, const char *params);
///\brief bind a search function to an external gateway
///\param function the search function to bind
@@ -342,7 +342,7 @@
///\brief parse a string for a list of sections
///\param str a | delimited list of section names
///\return the section mask
-SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(char *str);
+SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(const char *str);
SWITCH_END_EXTERN_C
Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c (original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c Mon Mar 5 00:49:52 2007
@@ -56,11 +56,11 @@
}
-static switch_xml_t xml_url_fetch(char *section,
- char *tag_name,
- char *key_name,
- char *key_value,
- char *params,
+static switch_xml_t xml_url_fetch(const char *section,
+ const char *tag_name,
+ const char *key_name,
+ const char *key_value,
+ const char *params,
void *user_data)
{
char filename[512] = "";
Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c (original)
+++ freeswitch/trunk/src/switch_xml.c Mon Mar 5 00:49:52 2007
@@ -112,7 +112,7 @@
{ NULL, 0}
};
-SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(char *str)
+SWITCH_DECLARE(switch_xml_section_t) switch_xml_parse_section_string(const char *str)
{
size_t x;
char buf[1024] = "";
@@ -950,12 +950,12 @@
int fd = -1, write_fd = -1;
switch_xml_t xml = NULL;
char *new_file = NULL;
- char *abs;
+ const char *abs;
if ((abs = strrchr(file, '/')) || (abs = strrchr(file, '\\'))) {
abs++;
} else {
- abs = (char *)file;
+ abs = file;
}
if (!(new_file = switch_mprintf("%s%s%s.fsxml", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, abs))) {
@@ -991,13 +991,13 @@
}
-SWITCH_DECLARE(switch_status_t) switch_xml_locate(char *section,
- char *tag_name,
- char *key_name,
- char *key_value,
+SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
+ const char *tag_name,
+ const char *key_name,
+ const char *key_value,
switch_xml_t *root,
switch_xml_t *node,
- char *params)
+ const char *params)
{
switch_xml_t conf = NULL;
switch_xml_t tag = NULL;
@@ -1154,7 +1154,7 @@
return SWITCH_STATUS_FALSE;
}
-SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(char *file_path, switch_xml_t *node, char *params)
+SWITCH_DECLARE(switch_xml_t) switch_xml_open_cfg(const char *file_path, switch_xml_t *node, const char *params)
{
switch_xml_t xml = NULL, cfg = NULL;
More information about the Freeswitch-svn
mailing list