aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_container_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-09-11 14:22:06 +0000
committerChristian Grothoff <christian@grothoff.org>2009-09-11 14:22:06 +0000
commitb60d9cfa7d42f0a933d7de137a2c8b17eaece4dd (patch)
treebf608b2d60dd749984a3d4473636df0099215814 /src/include/gnunet_container_lib.h
parentbeb7e51b1c1606856e2a8cbe2d6f5d64a56ca3b8 (diff)
downloadgnunet-b60d9cfa7d42f0a933d7de137a2c8b17eaece4dd.tar.gz
gnunet-b60d9cfa7d42f0a933d7de137a2c8b17eaece4dd.zip
eliminating not-used vector code
Diffstat (limited to 'src/include/gnunet_container_lib.h')
-rw-r--r--src/include/gnunet_container_lib.h135
1 files changed, 0 insertions, 135 deletions
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h
index 97814f5c7..79d7866ed 100644
--- a/src/include/gnunet_container_lib.h
+++ b/src/include/gnunet_container_lib.h
@@ -824,141 +824,6 @@ unsigned int
824GNUNET_CONTAINER_heap_get_size (struct GNUNET_CONTAINER_Heap *heap); 824GNUNET_CONTAINER_heap_get_size (struct GNUNET_CONTAINER_Heap *heap);
825 825
826 826
827/* ******************** Vector *************** */
828
829/**
830 * Handle to a vector
831 */
832struct GNUNET_CONTAINER_Vector;
833
834/**
835 * A debug function that traverses the linked list and prints the
836 * sizes of the segments.
837 */
838void GNUNET_CONTAINER_vector_dump(struct GNUNET_CONTAINER_Vector *v);
839
840/**
841 * Allocate a new vector structure with a single empty data segment.
842 */
843struct GNUNET_CONTAINER_Vector * GNUNET_CONTAINER_vector_create(unsigned int vss);
844
845/**
846 * Free vector structure including its data segments, but _not_ including the
847 * stored void pointers. It is the user's responsibility to empty the vector
848 * when necessary to avoid memory leakage.
849 */
850void GNUNET_CONTAINER_vector_destroy(struct GNUNET_CONTAINER_Vector *v);
851
852/**
853 * Return the size of the vector.
854 */
855size_t GNUNET_CONTAINER_vector_size(struct GNUNET_CONTAINER_Vector *v);
856
857/**
858 * Insert a new element in the vector at given index. The return value is
859 * OK on success, SYSERR if the index is out of bounds.
860 */
861int GNUNET_CONTAINER_vector_insert_at(struct GNUNET_CONTAINER_Vector *v,
862 void *object,
863 unsigned int index);
864
865/**
866 * Insert a new element at the end of the vector.
867 */
868void GNUNET_CONTAINER_vector_insert_last(struct GNUNET_CONTAINER_Vector *v, void *object);
869
870/**
871 * Return the element at given index in the vector or NULL if the index is out
872 * of bounds. The iterator is set to point to the returned element.
873 */
874void * GNUNET_CONTAINER_vector_get_at(struct GNUNET_CONTAINER_Vector *v,
875 unsigned int index);
876
877/**
878 * Return the first element in the vector, whose index is 0, or NULL if the
879 * vector is empty. The iterator of the vector is set to point to the first
880 * element.
881 */
882void * GNUNET_CONTAINER_vector_get_first(struct GNUNET_CONTAINER_Vector *v);
883
884/**
885 * Return the last element in the vector or NULL if the vector is
886 * empty. The iterator of the vector is set to the last element.
887 */
888void * GNUNET_CONTAINER_vector_get_last(struct GNUNET_CONTAINER_Vector *v);
889
890/**
891 * Return the next element in the vector, as called after vector_get_at() or
892 * vector_get_first(). The return value is NULL if there are no more elements
893 * in the vector or if the iterator has not been set.
894 */
895void * GNUNET_CONTAINER_vector_get_next(struct GNUNET_CONTAINER_Vector *v);
896
897/**
898 * Return the previous element in the vector, as called after vector_get_at()
899 * or vector_get_last(). The return value is NULL if there are no more
900 * elements in the vector or if the iterator has not been set.
901 */
902void * GNUNET_CONTAINER_vector_get_previous(struct GNUNET_CONTAINER_Vector * v);
903
904/**
905 * Delete and return the element at given index. NULL is returned if index is
906 * out of bounds.
907 */
908void * GNUNET_CONTAINER_vector_remove_at(struct GNUNET_CONTAINER_Vector *v,
909 unsigned int index);
910
911/**
912 * Delete and return the last element in the vector, or NULL if the vector
913 * is empty.
914 */
915void *GNUNET_CONTAINER_vector_remove_last (struct GNUNET_CONTAINER_Vector *v);
916
917/**
918 * Delete and return given object from the vector, or return NULL if the object
919 * is not found.
920 */
921void * GNUNET_CONTAINER_vector_remove_object(struct GNUNET_CONTAINER_Vector *v, void *object);
922
923/**
924 * Set the given index in the vector. The old value of the index is
925 * returned, or NULL if the index is out of bounds.
926 */
927void *GNUNET_CONTAINER_vector_set_at (struct GNUNET_CONTAINER_Vector *v,
928 void *object,
929 unsigned int index);
930
931/**
932 * Set the index occupied by the given object to point to the new object.
933 * The old object is returned, or NULL if it's not found.
934 */
935void *GNUNET_CONTAINER_vector_set_object(struct GNUNET_CONTAINER_Vector *v,
936 void *object,
937 void *oldObject);
938
939/**
940 * Swaps the contents of index1 and index2. Return value is OK
941 * on success, SYSERR if either index is out of bounds.
942 */
943int GNUNET_CONTAINER_vector_swap(struct GNUNET_CONTAINER_Vector *v,
944 unsigned int index1,
945 unsigned int index2);
946
947/**
948 * Return the index of given element or -1 if the element is not found.
949 */
950unsigned int GNUNET_CONTAINER_vector_index_of(struct GNUNET_CONTAINER_Vector *v,
951 void *object);
952
953/*
954 * Return the data stored in the vector as a single dynamically allocated
955 * array of (void *), which must be free(3)d by the user. Use the functions
956 * get_{at,first,last,next,previous} instead, unless you really need to access
957 * everything in the vector as fast as possible.
958 */
959void ** GNUNET_CONTAINER_vector_elements (struct GNUNET_CONTAINER_Vector *v);
960
961
962#if 0 /* keep Emacsens' auto-indent happy */ 827#if 0 /* keep Emacsens' auto-indent happy */
963{ 828{
964#endif 829#endif