From: Adam Dickmeiss Date: Tue, 11 Nov 2014 13:24:16 +0000 (+0100) Subject: Add yaz_array-to_uri_c X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=365653db2c98459624e7cd7064e673cbc24da46f;p=yaz-moved-to-github.git Add yaz_array-to_uri_c --- 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;