From f9f4f3192a42bdebb85e171f68005237b46f3631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Wed, 18 Dec 2013 00:03:11 +0100 Subject: [PATCH] rename uc_strvec_expand->uc_strvec_check_expand, and clarify docs --- include/ucore/strvec.h | 4 ++-- src/strvec.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ucore/strvec.h b/include/ucore/strvec.h index 46c8f5b..c854161 100644 --- a/include/ucore/strvec.h +++ b/include/ucore/strvec.h @@ -38,12 +38,12 @@ void uc_strv_init(struct UCStrv *strv); int uc_strv_grow(struct UCStrv *strv, size_t cnt); /** - * Expand the UCStrv to hold 1 more item + * Expand the UCStrv to hold attleast 1 more item if needed * * @param strv UCStrv to expand * @return 0 on success, otherwise failure **/ -int uc_strv_expand(struct UCStrv *strv); +int uc_strv_check_expand(struct UCStrv *strv); /** * Append a string to the UCStrv, the string will be copied in diff --git a/src/strvec.c b/src/strvec.c index 7919ad5..276a0be 100644 --- a/src/strvec.c +++ b/src/strvec.c @@ -24,7 +24,7 @@ int uc_strv_grow(struct UCStrv *strv, size_t cnt) return 0; } -int uc_strv_expand(struct UCStrv *strv) +int uc_strv_check_expand(struct UCStrv *strv) { int rc = 0; @@ -41,7 +41,7 @@ int uc_strv_append(struct UCStrv *strv, const char *str) int rc; char *dup; - rc = uc_strv_expand(strv); + rc = uc_strv_check_expand(strv); if (rc != 0) { return rc; } @@ -60,7 +60,7 @@ int uc_strv_append(struct UCStrv *strv, const char *str) int uc_strv_append_nocopy(struct UCStrv *strv, char *str) { int rc; - rc = uc_strv_expand(strv); + rc = uc_strv_check_expand(strv); if (rc != 0) { return rc; @@ -76,7 +76,7 @@ int uc_strv_null_terminate(struct UCStrv *strv) { int rc; - rc = uc_strv_expand(strv); + rc = uc_strv_check_expand(strv); if (rc != 0) { return rc; }