changeset 116:c602d8cfa619

Refactoring: unified naming of string vector functions.
author Sascha Wilde <wilde@intevation.de>
date Fri, 21 Mar 2014 17:42:00 +0100
parents 447a7abee6c7
children 080660b2ce7d
files cinst/main.c common/strhelp.c common/strhelp.h
diffstat 3 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/cinst/main.c	Fri Mar 21 17:13:24 2014 +0100
+++ b/cinst/main.c	Fri Mar 21 17:42:00 2014 +0100
@@ -92,17 +92,17 @@
         }
         if (*buf == 'I') {
             /* Remove leading I: and trailing \r\n */
-            array_append_str(to_install, buf+2, len - 4);
+            strv_append(to_install, buf+2, len - 4);
             continue;
         }
         if (*buf == 'R') {
             /* Remove leading R: and trailing \r\n */
-            array_append_str(to_remove, buf+2, len - 4);
+            strv_append(to_remove, buf+2, len - 4);
             continue;
         }
         if (strcmp("UNINSTALL", buf) == 0) {
             /* Remove trailing \r\n */
-            array_append_str(to_remove, buf, len - 2);
+            strv_append(to_remove, buf, len - 2);
         }
     }
 
@@ -255,8 +255,8 @@
 #endif
 
     /* Make valgrind happy */
-    strfreev(to_install);
-    strfreev(to_remove);
+    strv_free(to_install);
+    strv_free(to_remove);
     free(certificate_list);
 
     return 0;
--- a/common/strhelp.c	Fri Mar 21 17:13:24 2014 +0100
+++ b/common/strhelp.c	Fri Mar 21 17:42:00 2014 +0100
@@ -51,7 +51,7 @@
     return i;
 }
 
-void array_append_str(char ***pArray, const char *string, const size_t len)
+void strv_append (char ***pArray, const char *string, const size_t len)
 {
     unsigned int old_len = 0;
 
@@ -90,7 +90,7 @@
 }
 
 void
-strfreev (char **str_array)
+strv_free (char **str_array)
 {
   if (str_array)
     {
--- a/common/strhelp.h	Fri Mar 21 17:13:24 2014 +0100
+++ b/common/strhelp.h	Fri Mar 21 17:42:00 2014 +0100
@@ -29,7 +29,7 @@
  * @param[in] string pointer to the string to append to the list.
  * @param[in] len length of the string to append to the list
  * */
-void array_append_str(char ***pArray, const char *string, const size_t len);
+void strv_append (char ***pArray, const char *string, const size_t len);
 
 /* @brief append a string to another string.
  *
@@ -38,8 +38,8 @@
  * @param[in] appendage pointer to the string to append.
  * @param[in] len length of the string to append.
  * */
-void str_append_str(char **pDst, size_t *dst_len, const char *appendage,
+void str_append_str (char **pDst, size_t *dst_len, const char *appendage,
                     const size_t len);
 
-void strfreev (char **str_array);
+void strv_free (char **str_array);
 #endif

http://wald.intevation.org/projects/trustbridge/