gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8821 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r8821 - in gnunet/src: include util
Date: Sat, 8 Aug 2009 08:10:24 -0600

Author: durner
Date: 2009-08-08 08:10:24 -0600 (Sat, 08 Aug 2009)
New Revision: 8821

Modified:
   gnunet/src/include/gnunet_container_lib.h
   gnunet/src/util/container_vector.c
   gnunet/src/util/test_container_vector.c
Log:
naming

Modified: gnunet/src/include/gnunet_container_lib.h
===================================================================
--- gnunet/src/include/gnunet_container_lib.h   2009-08-08 13:48:41 UTC (rev 
8820)
+++ gnunet/src/include/gnunet_container_lib.h   2009-08-08 14:10:24 UTC (rev 
8821)
@@ -790,14 +790,14 @@
 /**
  * Allocate a new vector structure with a single empty data segment.
  */
-struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_new(unsigned int vss);
+struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_create(unsigned int 
vss);
 
 /**
  * Free vector structure including its data segments, but _not_ including the
  * stored void pointers. It is the user's responsibility to empty the vector
  * when necessary to avoid memory leakage.
  */
-void GNUNET_CONTAINER_vector_free(struct GNUNET_CONTAINER_Vector *v);
+void GNUNET_CONTAINER_vector_destroy(struct GNUNET_CONTAINER_Vector *v);
 
 /**
  * Return the size of the vector.

Modified: gnunet/src/util/container_vector.c
===================================================================
--- gnunet/src/util/container_vector.c  2009-08-08 13:48:41 UTC (rev 8820)
+++ gnunet/src/util/container_vector.c  2009-08-08 14:10:24 UTC (rev 8821)
@@ -272,7 +272,7 @@
 /**
  * Allocate a new vector structure with a single empty data segment.
  */
-struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_new(unsigned int vss) 
{
+struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_create(unsigned int 
vss) {
    struct GNUNET_CONTAINER_Vector *rvalue;
 
    if (vss < 2)
@@ -296,7 +296,7 @@
  * stored void pointers. It is the user's responsibility to empty the vector
  * when necessary to avoid memory leakage.
  */
-void GNUNET_CONTAINER_vector_free(struct GNUNET_CONTAINER_Vector *v) {
+void GNUNET_CONTAINER_vector_destroy(struct GNUNET_CONTAINER_Vector *v) {
   VectorSegment * vs;
   VectorSegment * vsNext;
 

Modified: gnunet/src/util/test_container_vector.c
===================================================================
--- gnunet/src/util/test_container_vector.c     2009-08-08 13:48:41 UTC (rev 
8820)
+++ gnunet/src/util/test_container_vector.c     2009-08-08 14:10:24 UTC (rev 
8821)
@@ -30,7 +30,7 @@
 static int test(int size) {
   struct GNUNET_CONTAINER_Vector * v;
 
-  v = GNUNET_CONTAINER_vector_new(size);
+  v = GNUNET_CONTAINER_vector_create(size);
   if (0 != GNUNET_CONTAINER_vector_size(v))
     { DUMP(v); return 1; }
   if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, "first", 0))
@@ -76,7 +76,7 @@
     { DUMP(v); return 1; }
   if (0 != GNUNET_CONTAINER_vector_size(v))
     { DUMP(v); return 1; }
-  GNUNET_CONTAINER_vector_free(v);
+  GNUNET_CONTAINER_vector_destroy(v);
   return 0;
 }
 
@@ -84,7 +84,7 @@
   long i;
   struct GNUNET_CONTAINER_Vector * v;
 
-  v = GNUNET_CONTAINER_vector_new(size);
+  v = GNUNET_CONTAINER_vector_create(size);
 
   for (i=0;i<500;i++)
     if (GNUNET_OK != GNUNET_CONTAINER_vector_insert_at(v, (void*)i, 0))
@@ -109,16 +109,16 @@
     if (i != (long) GNUNET_CONTAINER_vector_get_previous(v))
       { DUMP(v); return 1; }
 
-  GNUNET_CONTAINER_vector_free(v);
+  GNUNET_CONTAINER_vector_destroy(v);
   return 0;
 }
 
 
 int main(int argc,
         char * argv[]) {
-  if (NULL != GNUNET_CONTAINER_vector_new(0))
+  if (NULL != GNUNET_CONTAINER_vector_create(0))
     { printf("At %d\n", __LINE__); return 1; }
-  if (NULL != GNUNET_CONTAINER_vector_new(1))
+  if (NULL != GNUNET_CONTAINER_vector_create(1))
     { printf("At %d\n", __LINE__); return 1; }
   if (test(2) != 0)
     { printf("At %d\n", __LINE__); return 1; }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]