aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tucker@tuckerevans.com>2020-07-03 00:13:19 -0400
committerTucker Evans <tucker@tuckerevans.com>2020-07-04 22:29:39 -0400
commit7ed6d089f5533904ac556edac4accc7ef9a8badc (patch)
tree37239afaca18f3365ed2d50d3f72a8e03db6247a
parent8d5b381b540fe1d780311e4f4059dce014a6cb91 (diff)
Add anchors for functions in vector documentation
-rw-r--r--collections/vector/vector.adoc10
1 files changed, 7 insertions, 3 deletions
diff --git a/collections/vector/vector.adoc b/collections/vector/vector.adoc
index 4920893..63cdd78 100644
--- a/collections/vector/vector.adoc
+++ b/collections/vector/vector.adoc
@@ -1,7 +1,7 @@
Vector
======
Tucker Evans
-v0.7, 2020-07-03
+v0.7.1, 2020-07-03
A basic vector, that hold pointers to your data structures.
@@ -14,14 +14,14 @@ Types
-----
+vec+
-~~~~~
+
This structure holds all internal information regarding a vector.
All functions (except constructors) expect a pointer to this struct as their
first parameter.
Functions
---------
-
+[[vec_new]]
+vec* vec_new()+
~~~~~~~~~~~~~~~~
Constructs an empty vector.
@@ -48,6 +48,7 @@ Examples
vec *vector = vec_with_capacity(16);
----
+[[vec_size]]
+int vec_size(vec *self)+
~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the number of elements in vector +self+.
@@ -64,6 +65,7 @@ vec_push_back(vector, NULL);
assert(vec_size(vector) == 1);
----
+[[vec_push]]
+void vec_push(vec *self, void *item)+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pushes +item+ into back of +self+. This may cause a resize of the internal buffer.
@@ -79,6 +81,7 @@ vec_push(vector, NULL);
assert(vec_size(vector) == 1);
----
+[[vec_index]]
+void* vec_index(vec *self, int index)+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Returns the element at position +index+ of +self+.
@@ -102,6 +105,7 @@ vec_push(vector, str_dup(str3));
assert(str_cmp(vec_index(vector, 1), str2) == 0);
----
+[[vec_pop]]
+void* vec_pop(vec *self)+
~~~~~~~~~~~~~~~~~~~~~~~~~~
Pops an item off of the back of the vector +self+.