diff options
-rw-r--r-- | src/include/gnunet_container_lib.h | 4 | ||||
-rw-r--r-- | src/util/container_vector.c | 4 | ||||
-rw-r--r-- | src/util/test_container_vector.c | 12 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index d0bd9c5a3..59ed430d0 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -790,14 +790,14 @@ void GNUNET_CONTAINER_vector_dump(struct GNUNET_CONTAINER_Vector *v); | |||
790 | /** | 790 | /** |
791 | * Allocate a new vector structure with a single empty data segment. | 791 | * Allocate a new vector structure with a single empty data segment. |
792 | */ | 792 | */ |
793 | struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_new(unsigned int vss); | 793 | struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_create(unsigned int vss); |
794 | 794 | ||
795 | /** | 795 | /** |
796 | * Free vector structure including its data segments, but _not_ including the | 796 | * Free vector structure including its data segments, but _not_ including the |
797 | * stored void pointers. It is the user's responsibility to empty the vector | 797 | * stored void pointers. It is the user's responsibility to empty the vector |
798 | * when necessary to avoid memory leakage. | 798 | * when necessary to avoid memory leakage. |
799 | */ | 799 | */ |
800 | void GNUNET_CONTAINER_vector_free(struct GNUNET_CONTAINER_Vector *v); | 800 | void GNUNET_CONTAINER_vector_destroy(struct GNUNET_CONTAINER_Vector *v); |
801 | 801 | ||
802 | /** | 802 | /** |
803 | * Return the size of the vector. | 803 | * Return the size of the vector. |
diff --git a/src/util/container_vector.c b/src/util/container_vector.c index d9e4fab47..1e3726202 100644 --- a/src/util/container_vector.c +++ b/src/util/container_vector.c | |||
@@ -272,7 +272,7 @@ static void vectorFindObject(struct GNUNET_CONTAINER_Vector *v, | |||
272 | /** | 272 | /** |
273 | * Allocate a new vector structure with a single empty data segment. | 273 | * Allocate a new vector structure with a single empty data segment. |
274 | */ | 274 | */ |
275 | struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_new(unsigned int vss) { | 275 | struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_create(unsigned int vss) { |
276 | struct GNUNET_CONTAINER_Vector *rvalue; | 276 | struct GNUNET_CONTAINER_Vector *rvalue; |
277 | 277 | ||
278 | if (vss < 2) | 278 | if (vss < 2) |
@@ -296,7 +296,7 @@ struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_new(unsigned int vss) { | |||
296 | * stored void pointers. It is the user's responsibility to empty the vector | 296 | * stored void pointers. It is the user's responsibility to empty the vector |
297 | * when necessary to avoid memory leakage. | 297 | * when necessary to avoid memory leakage. |
298 | */ | 298 | */ |
299 | void GNUNET_CONTAINER_vector_free(struct GNUNET_CONTAINER_Vector *v) { | 299 | void GNUNET_CONTAINER_vector_destroy(struct GNUNET_CONTAINER_Vector *v) { |
300 | VectorSegment * vs; | 300 | VectorSegment * vs; |
301 | VectorSegment * vsNext; | 301 | VectorSegment * vsNext; |
302 | 302 | ||
diff --git a/src/util/test_container_vector.c b/src/util/test_container_vector.c index ddd6cdd3e..580ed5ae0 100644 --- a/src/util/test_container_vector.c +++ b/src/util/test_container_vector.c | |||
@@ -30,7 +30,7 @@ | |||
30 | static int test(int size) { | 30 | static int test(int size) { |
31 | struct GNUNET_CONTAINER_Vector * v; | 31 | struct GNUNET_CONTAINER_Vector * v; |
32 | 32 | ||
33 | v = GNUNET_CONTAINER_vector_new(size); | 33 | v = GNUNET_CONTAINER_vector_create(size); |
34 | if (0 != GNUNET_CONTAINER_vector_size(v)) | 34 | if (0 != GNUNET_CONTAINER_vector_size(v)) |
35 | { DUMP(v); return 1; } | 35 | { DUMP(v); return 1; } |
36 | if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, "first", 0)) | 36 | if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, "first", 0)) |
@@ -76,7 +76,7 @@ static int test(int size) { | |||
76 | { DUMP(v); return 1; } | 76 | { DUMP(v); return 1; } |
77 | if (0 != GNUNET_CONTAINER_vector_size(v)) | 77 | if (0 != GNUNET_CONTAINER_vector_size(v)) |
78 | { DUMP(v); return 1; } | 78 | { DUMP(v); return 1; } |
79 | GNUNET_CONTAINER_vector_free(v); | 79 | GNUNET_CONTAINER_vector_destroy(v); |
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
82 | 82 | ||
@@ -84,7 +84,7 @@ static int test2(int size) { | |||
84 | long i; | 84 | long i; |
85 | struct GNUNET_CONTAINER_Vector * v; | 85 | struct GNUNET_CONTAINER_Vector * v; |
86 | 86 | ||
87 | v = GNUNET_CONTAINER_vector_new(size); | 87 | v = GNUNET_CONTAINER_vector_create(size); |
88 | 88 | ||
89 | for (i=0;i<500;i++) | 89 | for (i=0;i<500;i++) |
90 | if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, (void*)i, 0)) | 90 | if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, (void*)i, 0)) |
@@ -109,16 +109,16 @@ static int test2(int size) { | |||
109 | if (i != (long) GNUNET_CONTAINER_vector_get_previous(v)) | 109 | if (i != (long) GNUNET_CONTAINER_vector_get_previous(v)) |
110 | { DUMP(v); return 1; } | 110 | { DUMP(v); return 1; } |
111 | 111 | ||
112 | GNUNET_CONTAINER_vector_free(v); | 112 | GNUNET_CONTAINER_vector_destroy(v); |
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
115 | 115 | ||
116 | 116 | ||
117 | int main(int argc, | 117 | int main(int argc, |
118 | char * argv[]) { | 118 | char * argv[]) { |
119 | if (NULL != GNUNET_CONTAINER_vector_new(0)) | 119 | if (NULL != GNUNET_CONTAINER_vector_create(0)) |
120 | { printf("At %d\n", __LINE__); return 1; } | 120 | { printf("At %d\n", __LINE__); return 1; } |
121 | if (NULL != GNUNET_CONTAINER_vector_new(1)) | 121 | if (NULL != GNUNET_CONTAINER_vector_create(1)) |
122 | { printf("At %d\n", __LINE__); return 1; } | 122 | { printf("At %d\n", __LINE__); return 1; } |
123 | if (test(2) != 0) | 123 | if (test(2) != 0) |
124 | { printf("At %d\n", __LINE__); return 1; } | 124 | { printf("At %d\n", __LINE__); return 1; } |