#include "ks_config.h"
#include "ks_array.h"
#include "ks_string.h"
#include <string.h>
#include <stdio.h>
Go to the source code of this file.
Functions | |
| int | ks_array_length (ks_array_t *a) |
| ks_type_t * | ks_array_type () |
| ks_array_t * | ks_array_new (void) |
| void | ks_array_init (ks_array_t *a) |
| void | ks_array_free (ks_array_t *a) |
| void | ks_array_fini (ks_array_t *a) |
| void | ks_array_extend (ks_array_t *a, int size) |
| void | ks_array_set (ks_array_t *a, int idx, ks_base_t *ptr) |
| ks_base_t * | ks_array_get (ks_array_t *a, int idx) |
| void | ks_array_add (ks_array_t *a, ks_base_t *ptr) |
| void | ks_array_remove (ks_array_t *a, int idx) |
| void | ks_array_sort (ks_array_t *a, ks_array_compar func) |
Definition in file ks_array.c.
|
||||||||||||
|
Add a new object to a ks_array_t. If there is no room left in the ks_array_t array, the amount of memory allocated to the ks_array_t is doubled using ks_array_extend(), and then the new object is added.
Definition at line 252 of file ks_array.c. References _ks_array_t::data, ks_array_extend(), _ks_array_t::length, and _ks_array_t::size. Referenced by ks_assoc_keys(), ks_assoc_put(), ks_bquery_combiner_add(), ks_bquery_composite_add(), ks_bquery_feed_add(), ks_bquery_identity_add_tagged(), and main(). |
|
||||||||||||
|
Increase the amount of memory allocated for storing elements in a ks_array_t.
Definition at line 193 of file ks_array.c. References _ks_array_t::data, ks_realloc(), and _ks_array_t::size. Referenced by ks_array_add(). |
|
|
Destroy all of the elements stored in a ks_array_t, and free the memory used to hold store those elements in the given ks_array_t, leaving the ks_array_t empty (in the same state as a ks_array_t newly created by ks_array_new()).
Definition at line 151 of file ks_array.c. References _ks_array_t::data, ks_array_get(), and ks_free(). Referenced by ks_array_free(), ks_assoc_fini(), ks_bquery_free(), and ks_socket_free(). |
|
|
Destroy a given ks_array_t and free all memory that has been allocated for it and any elements it contains.
Definition at line 134 of file ks_array.c. References ks_array_fini(), and ks_free(). Referenced by main(). |
|
||||||||||||
|
Retrieve the element stored at a given location in a ks_array_t.
Definition at line 234 of file ks_array.c. References _ks_array_t::data. Referenced by ks_array_fini(), ks_assoc_keys(), and ks_response_fact(). |
|
|
Initialise a ks_array_t to a known, default state. The given ks_array_t should be empty (either have been freshly created with ks_array_new(), or have just been cleared by ks_array_fini()) to prevent memory leaks.
Definition at line 117 of file ks_array.c. References _ks_array_t::base, _ks_array_t::data, ks_malloc(), _ks_array_t::length, _ks_array_t::size, and _ks_base_t::type. Referenced by ks_array_new(), ks_assoc_init(), ks_bquery_new(), and ks_socket_new(). |
|
|
Return the number of elements stored a given ks_array_t.
Definition at line 47 of file ks_array.c. References _ks_array_t::length. Referenced by ks_array_sort(), ks_assoc_keys(), ks_assoc_size(), ks_response_facts_length(), and main(). |
|
|
Create a new ks_array_t
Definition at line 100 of file ks_array.c. References ks_array_init(), and ks_malloc(). Referenced by ks_assoc_keys(), and main(). |
|
||||||||||||
|
Remove a specific object from a ks_array_t, healing the hole it leaves behind.
Definition at line 270 of file ks_array.c. References _ks_array_t::data, and _ks_array_t::length. |
|
||||||||||||||||
|
Store a ks_base_t in a specific location in a ks_array_t, first destroying anything that was originally stored at that location in the ks_array_t.
Definition at line 216 of file ks_array.c. References _ks_array_t::data. |
|
||||||||||||
|
Sort a ks_array_t.
Definition at line 290 of file ks_array.c. References _ks_array_t::data, and ks_array_length(). |
|
|
Get metaclass for ks_array_t objects.
Definition at line 88 of file ks_array.c. |
1.4.4