# HG changeset patch # User Sascha Wilde # Date 1395420120 -3600 # Node ID c602d8cfa6195e8e25c1ab47401967ca23a2f4d4 # Parent 447a7abee6c79ce34a003b22d609b45130f5fbd9 Refactoring: unified naming of string vector functions. diff -r 447a7abee6c7 -r c602d8cfa619 cinst/main.c --- 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; diff -r 447a7abee6c7 -r c602d8cfa619 common/strhelp.c --- 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) { diff -r 447a7abee6c7 -r c602d8cfa619 common/strhelp.h --- 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