diff options
Diffstat (limited to 'collections/vector/vector.c')
-rw-r--r-- | collections/vector/vector.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/collections/vector/vector.c b/collections/vector/vector.c index 5cb56ef..a7e0845 100644 --- a/collections/vector/vector.c +++ b/collections/vector/vector.c @@ -174,6 +174,22 @@ int index; return root->base[index]; } +void vec_swap(root, i, j) +vec *root; +int i,j; +{ + void *tmp; + + if (!root || i >= root->end || i < 0 || j >= root->end || j < 0) + return; + + tmp = root->base[i]; + root->base[i] = root->base[j]; + root->base[j] = tmp; + + return; +} + void vec_clear(root) vec *root; { |