Skip to content

Latest commit

 

History

History
79 lines (59 loc) · 1.23 KB

File metadata and controls

79 lines (59 loc) · 1.23 KB

Vector

Header

#include <kcs/ext.h>

Type

Use vector_of_() macro to declare it.

Public Members

No public members.

Public Functions

vector_of_(type, var);
  • Declaration of the variable of var as vector with the type of type.
void vector_free(obj);
  • Frees a vector object.
  • Do not access to the freed object.
int vector_size(obj);
  • Returns the element count of obj.
void vector_resize(obj, size);
  • Resizes obj to append size elements more.
void vector_push(obj, value);
  • Appends value to the tail of obj.
void vector_unshift(obj, value);
  • Appends value to the head of obj.
void vector_pop(obj);
  • Removes the last element of obj.
void vector_head(obj);
  • Accesses the head element of obj.
void vector_last(obj);
  • Accesses the last element of obj.
void vector_shrinkto(obj, size);
  • Shrinks obj down to size.
void vector_shrinkby(obj, size);
  • Shrinks obj down by size.
void vector_remove(obj, index, count);
  • Removes elements from obj with count from index.