From 365653db2c98459624e7cd7064e673cbc24da46f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 11 Nov 2014 14:24:16 +0100 Subject: [PATCH] Add yaz_array-to_uri_c --- include/yaz/srw.h | 2 ++ src/uri.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/yaz/srw.h b/include/yaz/srw.h index 2c7cc01..57cc597 100644 --- a/include/yaz/srw.h +++ b/include/yaz/srw.h @@ -248,6 +248,8 @@ YAZ_EXPORT int yaz_uri_to_array(const char *path, ODR o, char ***name, char ***val); YAZ_EXPORT void yaz_array_to_uri(char **path, ODR o, char **name, char **value); +YAZ_EXPORT void yaz_array_to_uri_c(char **path, ODR o, + const char **name, const char **value); /** \brief encodes URI component \param dst destination string (should be at least 3*strlen(uri)+1) diff --git a/src/uri.c b/src/uri.c index efa11bf..c845709 100644 --- a/src/uri.c +++ b/src/uri.c @@ -95,7 +95,7 @@ void yaz_decode_uri_component(char *dst, const char *uri, size_t len) *dst = '\0'; } -void yaz_array_to_uri(char **path, ODR o, char **name, char **value) +void yaz_array_to_uri_c(char **path, ODR o, const char **name, const char **value) { size_t i, szp = 0, sz = 1; for(i = 0; name[i]; i++) @@ -118,6 +118,11 @@ void yaz_array_to_uri(char **path, ODR o, char **name, char **value) (*path)[szp] = '\0'; } +void yaz_array_to_uri(char **path, ODR o, char **name, char **value) +{ + yaz_array_to_uri_c(path, o, (const char **) name, (const char **)value); +} + int yaz_uri_to_array(const char *path, ODR o, char ***name, char ***val) { int no = 2; -- 1.7.10.4