aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-09-13 12:30:22 +0200
committerTobias Brunner <tobias@strongswan.org>2012-09-13 15:42:38 +0200
commit1962e12fd3a0d80c56facf508ec8ee9ea2c92dc8 (patch)
tree5fd6a65c40b9b6a9982ab3de028858a3c983dc4d /src
parent8c2ec471494d4d45193c5ad97ea258a0c4d1f21b (diff)
downloadstrongswan-1962e12fd3a0d80c56facf508ec8ee9ea2c92dc8.tar.bz2
strongswan-1962e12fd3a0d80c56facf508ec8ee9ea2c92dc8.tar.xz
Make arguments for enumerator_create_token|directory const
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/utils/enumerator.c12
-rw-r--r--src/libstrongswan/utils/enumerator.h5
2 files changed, 10 insertions, 7 deletions
diff --git a/src/libstrongswan/utils/enumerator.c b/src/libstrongswan/utils/enumerator.c
index fb461b448..53c94f9dd 100644
--- a/src/libstrongswan/utils/enumerator.c
+++ b/src/libstrongswan/utils/enumerator.c
@@ -121,7 +121,7 @@ static bool enumerate_dir_enum(dir_enum_t *this, char **relative,
/**
* See header
*/
-enumerator_t* enumerator_create_directory(char *path)
+enumerator_t* enumerator_create_directory(const char *path)
{
int len;
dir_enum_t *this = malloc_thing(dir_enum_t);
@@ -168,9 +168,9 @@ typedef struct {
/** current position */
char *pos;
/** separater chars */
- char *sep;
+ const char *sep;
/** trim chars */
- char *trim;
+ const char *trim;
} token_enum_t;
/**
@@ -187,7 +187,8 @@ static void destroy_token_enum(token_enum_t *this)
*/
static bool enumerate_token_enum(token_enum_t *this, char **token)
{
- char *pos = NULL, *tmp, *sep, *trim;
+ const char *sep, *trim;
+ char *pos = NULL, *tmp;
bool last = FALSE;
/* trim leading characters/separators */
@@ -303,7 +304,8 @@ static bool enumerate_token_enum(token_enum_t *this, char **token)
/**
* See header
*/
-enumerator_t* enumerator_create_token(char *string, char *sep, char *trim)
+enumerator_t* enumerator_create_token(const char *string, const char *sep,
+ const char *trim)
{
token_enum_t *enumerator = malloc_thing(token_enum_t);
diff --git a/src/libstrongswan/utils/enumerator.h b/src/libstrongswan/utils/enumerator.h
index 12b5712ae..8c3d70173 100644
--- a/src/libstrongswan/utils/enumerator.h
+++ b/src/libstrongswan/utils/enumerator.h
@@ -93,7 +93,7 @@ enumerator_t *enumerator_create_single(void *item, void (*cleanup)(void *item));
* @param path path of the directory
* @return the directory enumerator, NULL on failure
*/
-enumerator_t* enumerator_create_directory(char *path);
+enumerator_t* enumerator_create_directory(const char *path);
/**
* Create an enumerator over tokens of a string.
@@ -106,7 +106,8 @@ enumerator_t* enumerator_create_directory(char *path);
* @param trim characters to trim from tokens
* @return enumerator over char* tokens
*/
-enumerator_t* enumerator_create_token(char *string, char *sep, char *trim);
+enumerator_t* enumerator_create_token(const char *string, const char *sep,
+ const char *trim);
/**
* Creates an enumerator which enumerates over enumerated enumerators :-).