All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
modules/common/target/Darwin-i386/include/aerospike/as_arraylist.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2008-2013 by Aerospike.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to
6  * deal in the Software without restriction, including without limitation the
7  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8  * sell copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20  * IN THE SOFTWARE.
21  *****************************************************************************/
22 
23 #pragma once
24 
25 #include <aerospike/as_integer.h>
26 #include <aerospike/as_string.h>
27 #include <aerospike/as_bytes.h>
28 #include <aerospike/as_list.h>
29 #include <aerospike/as_map.h>
30 #include <aerospike/as_val.h>
31 
32 #include <stdbool.h>
33 #include <stdint.h>
34 
35 /******************************************************************************
36  * TYPES
37  *****************************************************************************/
38 
39 /**
40  * An dynamic array implementation for as_list.
41  *
42  * as_arryalist can either be initialize on the stack or the heap.
43  *
44  * For stack allocation, you have two choices:
45  * - `as_arraylist_init()` - uses `cf_malloc()` to initialize the internal storage
46  * on the heap.
47  * - `as_arraylist_inita()` - uses `alloca()` to initialize the internal storage
48  * on the stack.
49  *
50  * The key differences between the two is `as_arraylist_inita()` can't be
51  * dynamically resized and is solely on the stack.
52  *
53  * The following is using a `as_arraylist_inita()`:
54  * ~~~~~~~~~~{.c}
55  * as_arraylist list;
56  * as_arraylist_inita(&list, 2);
57  * ~~~~~~~~~~
58  *
59  * You will notice that the code is quite similar to `as_arraylist_init()`:
60  * ~~~~~~~~~~{.c}
61  * as_arraylist list;
62  * as_arraylist_init(&list, 2, 0);
63  * ~~~~~~~~~~
64  *
65  * If you need a new heap allocated list, then use `as_arraylist_new()`:
66  *
67  * ~~~~~~~~~~{.c}
68  * as_arraylist * list = as_arraylist_new(2, 0);
69  * ~~~~~~~~~~
70  *
71  * When you are finished using the list, then you should release the list and
72  * associated resources, using `as_arraylist_destroy()`:
73  *
74  * ~~~~~~~~~~{.c}
75  * as_arraylist_destroy(list);
76  * ~~~~~~~~~~
77  *
78  *
79  * The `as_arraylist` is a subtype of `as_list`. This allows you to
80  * alternatively use `as_list` functions, by typecasting `as_arraylist` to
81  * `as_list`.
82  *
83  * ~~~~~~~~~~{.c}
84  * as_arraylist list;
85  * as_list * l = (as_list *) as_arraylist_init(&list, 3, 0);
86  * as_list_append_int64(l, 1);
87  * as_list_append_int64(l, 2);
88  * as_list_append_int64(l, 3);
89  * as_list_destroy(l);
90  * ~~~~~~~~~~
91  *
92  * Each of the `as_list` functions proxy to the `as_arraylist` functions.
93  * So, calling `as_list_destroy()` is equivalent to calling
94  * `as_arraylist_destroy()`.
95  *
96  * @extends as_list
97  * @ingroup aerospike_t
98  */
99 typedef struct as_arraylist_s {
100 
101  /**
102  * @private
103  * as_arraylist is an as_list.
104  * You can cast as_arraylist to as_list.
105  */
106  as_list _;
107 
108  /**
109  * Number of elements to add, when capacity is reached.
110  * If 0 (zero), then capacity can't be expanded.
111  */
112  uint32_t block_size;
113 
114  /**
115  * The total number elements allocated.
116  */
117  uint32_t capacity;
118 
119  /**
120  * The number of elements used.
121  */
122  uint32_t size;
123 
124  /**
125  * The elements of the list.
126  */
127  as_val ** elements;
128 
129  /**
130  * If true, then as_arraylist.elements will be freed when
131  * as_arraylist_destroy() is called.
132  */
133  bool free;
134 
135 } as_arraylist;
136 
137 /**
138  * Status codes for various as_arraylist operations.
139  */
140 typedef enum as_arraylist_status_e {
141 
142  /**
143  * Normal operation.
144  */
146 
147  /**
148  * Unable to expand capacity, because cf_realloc() failed.
149  */
151 
152  /**
153  * Unable to expand capacity, because as_arraylist.block_size is 0.
154  */
156 
158 
159 /******************************************************************************
160  * MACROS
161  ******************************************************************************/
162 
163 /**
164  * Initialize a stack allocated as_arraylist, with element storage on
165  * the stack.
166  *
167  * This differs from as_arraylist_init(), in that as_arraylist_init()
168  * allocates element storage on the heap.
169  *
170  * @param __list The as_list to initialize
171  * @param __n The number of elements to allocate to the list.
172  *
173  * @return On success, the initialize list. Otherwise NULL.
174  * @relatesalso as_arraylist
175  */
176 #define as_arraylist_inita(__list, __n)\
177  as_arraylist_init((__list), 0, 0);\
178  (__list)->free = false;\
179  (__list)->capacity = __n;\
180  (__list)->size = 0;\
181  (__list)->elements = (as_val **) alloca(sizeof(as_val *) * __n);
182 
183 /*******************************************************************************
184  * INSTANCE FUNCTIONS
185  ******************************************************************************/
186 
187 /**
188  * Initialize a stack allocated as_arraylist, with element storage on the
189  * heap.
190  *
191  * This differs from as_arraylist_inita(), in that as_arraylist_inita()
192  * allocates element storage on the stack.
193  *
194  * @param list The as_list to initialize
195  * @param capacity The number of elements to allocate to the list.
196  * @param block_size The number of elements to grow the list by, when the
197  * capacity has been reached.
198  *
199  * @return On success, the initialize list. Otherwise NULL.
200  * @relatesalso as_arraylist
201  */
202 as_arraylist * as_arraylist_init(as_arraylist * list, uint32_t capacity, uint32_t block_size);
203 
204 /**
205  * Create and initialize a heap allocated list as as_arraylist.
206  *
207  * @param capacity The number of elements to allocate to the list.
208  * @param block_size The number of elements to grow the list by, when the
209  * capacity has been reached.
210  *
211  * @return On success, the new list. Otherwise NULL.
212  * @relatesalso as_arraylist
213  */
214 as_arraylist * as_arraylist_new(uint32_t capacity, uint32_t block_size);
215 
216 /**
217  * Destoy the list and release resources.
218  *
219  * @param list The list to destroy.
220  * @relatesalso as_arraylist
221  */
223 
224 /*******************************************************************************
225  * VALUE FUNCTIONS
226  ******************************************************************************/
227 
228 /**
229  * The hash value of the list.
230  *
231  * @param list The list.
232  *
233  * @return The hash value of the list.
234  * @relatesalso as_arraylist
235  */
236 uint32_t as_arraylist_hashcode(const as_arraylist * list);
237 
238 /**
239  * The number of elements in the list.
240  *
241  * @param list The list.
242  *
243  * @return The number of elements in the list.
244  * @relatesalso as_arraylist
245  */
246 uint32_t as_arraylist_size(const as_arraylist * list);
247 
248 /*******************************************************************************
249  * ACCESSOR AND MODIFIER FUNCTIONS
250  ******************************************************************************/
251 
252 /**
253  * Get the first element of the list.
254  *
255  * @param list The list to get the first element from.
256  *
257  * @return The first element of the list. Otherwise NULL.
258  * @relatesalso as_arraylist
259  */
260 as_val * as_arraylist_head(const as_arraylist * list);
261 
262 /**
263  * Returns a new list containing all elements other than the head
264  *
265  * @param list The list to get the elements from.
266  *
267  * @return A new list of all elements after the first element.
268  * @relatesalso as_arraylist
269  */
271 
272 /**
273  * Return a new list with the first n elements removed.
274  *
275  * @param list The list.
276  * @param n The number of elements to remove.
277  *
278  * @return A new list of all elements after the first n elements.
279  * @relatesalso as_arraylist
280  */
281 as_arraylist * as_arraylist_drop(const as_arraylist * list, uint32_t n);
282 
283 /**
284  * Return a new list containing the first n elements.
285  *
286  * @param list The list.
287  * @param n The number of elements to take.
288  *
289  * @return A new list of the first n elements.
290  * @relatesalso as_arraylist
291  */
292 as_arraylist * as_arraylist_take(const as_arraylist * list, uint32_t n);
293 
294 /******************************************************************************
295  * GET FUNCTIONS
296  ******************************************************************************/
297 
298 /**
299  * Return the value at the specified index.
300  *
301  * @param list The list.
302  * @param index The index of the element.
303  *
304  * @return The value at given index, if it exists. Otherwise NULL.
305  * @relatesalso as_arraylist
306  */
307 as_val * as_arraylist_get(const as_arraylist * list, const uint32_t index);
308 
309 /**
310  * Return an int64_t value at the specified index of the list.
311  *
312  * @param list The list.
313  * @param index The index of the element.
314  *
315  * @return The value at given index, if it exists. Otherwise NULL.
316  * @relatesalso as_arraylist
317  */
318 int64_t as_arraylist_get_int64(const as_arraylist * list, const uint32_t index);
319 
320 /**
321  * Return a NULL-terminated value at the specified index of the list.
322  *
323  * @param list The list.
324  * @param index The index of the element.
325  *
326  * @return The value at given index, if it exists. Otherwise NULL.
327  * @relatesalso as_arraylist
328  */
329 char * as_arraylist_get_str(const as_arraylist * list, const uint32_t index);
330 
331 /**
332  * Return an as_integer value at the specified index of the list.
333  *
334  * @param list The list.
335  * @param index The index of the element.
336  *
337  * @return The value at given index, if it exists. Otherwise NULL.
338  * @relatesalso as_arraylist
339  */
340 static inline as_integer * as_arraylist_get_integer(const as_arraylist * list, const uint32_t index)
341 {
342  return as_integer_fromval(as_arraylist_get(list, index));
343 }
344 
345 /**
346  * Return an as_string value at the specified index of the list.
347  *
348  * @param list The list.
349  * @param index The index of the element.
350  *
351  * @return The value at given index, if it exists. Otherwise NULL.
352  * @relatesalso as_arraylist
353  */
354 static inline as_string * as_arraylist_get_string(const as_arraylist * list, const uint32_t index)
355 {
356  return as_string_fromval(as_arraylist_get(list, index));
357 }
358 
359 /**
360  * Return an as_bytes value at the specified index of the list.
361  *
362  * @param list The list.
363  * @param index The index of the element.
364  *
365  * @return The value at given index, if it exists. Otherwise NULL.
366  * @relatesalso as_arraylist
367  */
368 static inline as_bytes * as_arraylist_get_bytes(const as_arraylist * list, const uint32_t index)
369 {
370  return as_bytes_fromval(as_arraylist_get(list, index));
371 }
372 
373 /**
374  * Return an as_list value at the specified index of the list.
375  *
376  * @param list The list.
377  * @param index The index of the element.
378  *
379  * @return The value at given index, if it exists. Otherwise NULL.
380  * @relatesalso as_arraylist
381  */
382 static inline as_list * as_arraylist_get_list(const as_arraylist * list, const uint32_t index)
383 {
384  return as_list_fromval(as_arraylist_get(list, index));
385 }
386 
387 /**
388  * Return an as_map value at the specified index of the list.
389  *
390  * @param list The list.
391  * @param index The index of the element.
392  *
393  * @return The value at given index, if it exists. Otherwise NULL.
394  * @relatesalso as_arraylist
395  */
396 static inline as_map * as_arraylist_get_map(const as_arraylist * list, const uint32_t index)
397 {
398  return as_map_fromval(as_arraylist_get(list, index));
399 }
400 
401 /******************************************************************************
402  * SET FUNCTIONS
403  ******************************************************************************/
404 
405 /**
406  * Set a value at the specified index of the list.
407  *
408  * Notice that in order to maintain proper object/memory management, we
409  * just first destroy (as_val_destroy()) the old object at element position(i)
410  * before assigning the new element. Also note that the object at element
411  * position (i) is assumed to exist, so all element positions must be
412  * appropriately initialized to zero.
413  *
414  * @param list The list.
415  * @param index Position in the list.
416  * @param value The value to set at the given index.
417  *
418  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
419  * @relatesalso as_arraylist
420  */
421 int as_arraylist_set(as_arraylist * list, const uint32_t index, as_val * value);
422 
423 /**
424  * Set an int64_t value at the specified index of the list.
425  *
426  * @param list The list.
427  * @param index Position in the list.
428  * @param value The value to set at the given index.
429  *
430  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
431  * @relatesalso as_arraylist
432  */
433 int as_arraylist_set_int64(as_arraylist * list, const uint32_t index, int64_t value);
434 
435 /**
436  * Set a NULL-terminated string value at the specified index of the list.
437  *
438  * @param list The list.
439  * @param index Position in the list.
440  * @param value The value to set at the given index.
441  *
442  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
443  * @relatesalso as_arraylist
444  */
445 int as_arraylist_set_str(as_arraylist * list, const uint32_t index, const char * value);
446 
447 /**
448  * Set an as_integer value at the specified index of the list.
449  *
450  * @param list The list.
451  * @param index Position in the list.
452  * @param value The value to set at the given index.
453  *
454  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
455  * @relatesalso as_arraylist
456  */
457 static inline int as_arraylist_set_integer(as_arraylist * list, const uint32_t index, as_integer * value)
458 {
459  return as_arraylist_set(list, index, (as_val *) value);
460 }
461 
462 /**
463  * Set an as_string value at the specified index of the list.
464  *
465  * @param list The list.
466  * @param index Position in the list.
467  * @param value The value to set at the given index.
468  *
469  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
470  * @relatesalso as_arraylist
471  */
472 static inline int as_arraylist_set_string(as_arraylist * list, const uint32_t index, as_string * value)
473 {
474  return as_arraylist_set(list, index, (as_val *) value);
475 }
476 
477 /**
478  * Set an as_bytes value at the specified index of the list.
479  *
480  * @param list The list.
481  * @param index Position in the list.
482  * @param value The value to set at the given index.
483  *
484  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
485  * @relatesalso as_arraylist
486  */
487 static inline int as_arraylist_set_bytes(as_arraylist * list, const uint32_t index, as_bytes * value)
488 {
489  return as_arraylist_set(list, index, (as_val *) value);
490 }
491 
492 /**
493  * Set an as_list value at the specified index of the list.
494  *
495  * @param list The list.
496  * @param index Position in the list.
497  * @param value The value to set at the given index.
498  *
499  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
500  * @relatesalso as_arraylist
501  */
502 static inline int as_arraylist_set_list(as_arraylist * list, const uint32_t index, as_list * value)
503 {
504  return as_arraylist_set(list, index, (as_val *) value);
505 }
506 
507 /**
508  * Set an as_map value at the specified index of the list.
509  *
510  * @param list The list.
511  * @param index Position in the list.
512  * @param value The value to set at the given index.
513  *
514  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
515  * @relatesalso as_arraylist
516  */
517 static inline int as_arraylist_set_map(as_arraylist * list, const uint32_t index, as_map * value)
518 {
519  return as_arraylist_set(list, index, (as_val *) value);
520 }
521 
522 /******************************************************************************
523  * APPEND FUNCTIONS
524  ******************************************************************************/
525 
526 /**
527  * Add the value to the end of the list.
528  *
529  * @param list The list.
530  * @param value The value to prepend.
531  *
532  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
533  * @relatesalso as_arraylist
534  */
535 int as_arraylist_append(as_arraylist * list, as_val * value);
536 
537 /**
538  * Add an int64_t to the end of the list.
539  *
540  * @param list The list.
541  * @param value The value to prepend.
542  *
543  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
544  * @relatesalso as_arraylist
545  */
546 int as_arraylist_append_int64(as_arraylist * list, int64_t value);
547 
548 /**
549  * Add a NULL-terminated string to the end of the list.
550  *
551  * @param list The list.
552  * @param value The value to prepend.
553  *
554  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
555  * @relatesalso as_arraylist
556  */
557 int as_arraylist_append_str(as_arraylist * list, const char * value);
558 
559 /**
560  * Add an as_integer to the end of the list.
561  *
562  * @param list The list.
563  * @param value The value to prepend.
564  *
565  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
566  * @relatesalso as_arraylist
567  */
568 static inline int as_arraylist_append_integer(as_arraylist * list, as_integer * value)
569 {
570  return as_arraylist_append(list, (as_val *) value);
571 }
572 
573 /**
574  * Add an as_string to the end of the list.
575  *
576  * @param list The list.
577  * @param value The value to prepend.
578  *
579  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
580  * @relatesalso as_arraylist
581  */
582 static inline int as_arraylist_append_string(as_arraylist * list, as_string * value)
583 {
584  return as_arraylist_append(list, (as_val *) value);
585 }
586 
587 /**
588  * Add an as_bytes to the end of the list.
589  *
590  * @param list The list.
591  * @param value The value to prepend.
592  *
593  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
594  * @relatesalso as_arraylist
595  */
596 static inline int as_arraylist_append_bytes(as_arraylist * list, as_bytes * value)
597 {
598  return as_arraylist_append(list, (as_val *) value);
599 }
600 
601 /**
602  * Add an as_list to the end of the list.
603  *
604  * @param list The list.
605  * @param value The value to prepend.
606  *
607  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
608  * @relatesalso as_arraylist
609  */
610 static inline int as_arraylist_append_list(as_arraylist * list, as_list * value)
611 {
612  return as_arraylist_append(list, (as_val *) value);
613 }
614 
615 /**
616  * Add an as_map to the end of the list.
617  *
618  * @param list The list.
619  * @param value The value to prepend.
620  *
621  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
622  * @relatesalso as_arraylist
623  */
624 static inline int as_arraylist_append_map(as_arraylist * list, as_map * value)
625 {
626  return as_arraylist_append(list, (as_val *) value);
627 }
628 
629 /******************************************************************************
630  * PREPEND FUNCTIONS
631  ******************************************************************************/
632 
633 /**
634  * Add the value to the beginning of the list.
635  *
636  * @param list The list.
637  * @param value The value to prepend.
638  *
639  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
640  * @relatesalso as_arraylist
641  */
642 int as_arraylist_prepend(as_arraylist * list, as_val * value);
643 
644 /**
645  * Add an int64_t to the beginning of the list.
646  *
647  * @param list The list.
648  * @param value The value to prepend.
649  *
650  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
651  * @relatesalso as_arraylist
652  */
653 int as_arraylist_prepend_int64(as_arraylist * list, int64_t value);
654 
655 /**
656  * Add a NULL-terminated string to the beginning of the list.
657  *
658  * @param list The list.
659  * @param value The value to prepend.
660  *
661  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
662  * @relatesalso as_arraylist
663  */
664 int as_arraylist_prepend_str(as_arraylist * list, const char * value);
665 
666 /**
667  * Add an as_integer to the beginning of the list.
668  *
669  * @param list The list.
670  * @param value The value to prepend.
671  *
672  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
673  * @relatesalso as_arraylist
674  */
675 static inline int as_arraylist_prepend_integer(as_arraylist * list, as_integer * value)
676 {
677  return as_arraylist_prepend(list, (as_val *) value);
678 }
679 
680 /**
681  * Add an as_string to the beginning of the list.
682  *
683  * @param list The list.
684  * @param value The value to prepend.
685  *
686  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
687  * @relatesalso as_arraylist
688  */
689 static inline int as_arraylist_prepend_string(as_arraylist * list, as_string * value)
690 {
691  return as_arraylist_prepend(list, (as_val *) value);
692 }
693 
694 /**
695  * Add an as_bytes to the beginning of the list.
696  *
697  * @param list The list.
698  * @param value The value to prepend.
699  *
700  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
701  * @relatesalso as_arraylist
702  */
703 static inline int as_arraylist_prepend_bytes(as_arraylist * list, as_bytes * value)
704 {
705  return as_arraylist_prepend(list, (as_val *) value);
706 }
707 
708 /**
709  * Add an as_list to the beginning of the list.
710  *
711  * @param list The list.
712  * @param value The value to prepend.
713  *
714  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
715  * @relatesalso as_arraylist
716  */
717 static inline int as_arraylist_prepend_list(as_arraylist * list, as_list * value)
718 {
719  return as_arraylist_prepend(list, (as_val *) value);
720 }
721 
722 /**
723  * Add an as_map to the beginning of the list.
724  *
725  * @param list The list.
726  * @param value The value to prepend.
727  *
728  * @return AS_ARRAYLIST_OK on success. Otherwise an error occurred.
729  * @relatesalso as_arraylist
730  */
731 static inline int as_arraylist_prepend_map(as_arraylist * list, as_map * value)
732 {
733  return as_arraylist_prepend(list, (as_val *) value);
734 }
735 
736 /******************************************************************************
737  * ITERATION FUNCTIONS
738  ******************************************************************************/
739 
740 /**
741  * Call the callback function for each element in the list.
742  *
743  * @param list The list to iterate.
744  * @param callback The function to call for each element in the list.
745  * @param udata User-data to be sent to the callback.
746  *
747  * @return true if iteration completes fully. false if iteration was aborted.
748  *
749  * @relatesalso as_arraylist
750  */
751 bool as_arraylist_foreach(const as_arraylist * list, as_list_foreach_callback callback, void * udata);
752 
static as_integer * as_integer_fromval(const as_val *v)
uint32_t as_arraylist_size(const as_arraylist *list)
static int as_arraylist_append_map(as_arraylist *list, as_map *value)
int as_arraylist_set_int64(as_arraylist *list, const uint32_t index, int64_t value)
int as_arraylist_set_str(as_arraylist *list, const uint32_t index, const char *value)
static int as_arraylist_set_string(as_arraylist *list, const uint32_t index, as_string *value)
as_val * as_arraylist_head(const as_arraylist *list)
as_arraylist * as_arraylist_new(uint32_t capacity, uint32_t block_size)
static int as_arraylist_prepend_integer(as_arraylist *list, as_integer *value)
int as_arraylist_prepend_str(as_arraylist *list, const char *value)
bool(* as_list_foreach_callback)(as_val *value, void *udata)
static as_list * as_arraylist_get_list(const as_arraylist *list, const uint32_t index)
static as_string * as_arraylist_get_string(const as_arraylist *list, const uint32_t index)
int as_arraylist_set(as_arraylist *list, const uint32_t index, as_val *value)
static int as_arraylist_set_bytes(as_arraylist *list, const uint32_t index, as_bytes *value)
int as_arraylist_append_int64(as_arraylist *list, int64_t value)
as_arraylist * as_arraylist_tail(const as_arraylist *list)
int as_arraylist_prepend_int64(as_arraylist *list, int64_t value)
static int as_arraylist_prepend_bytes(as_arraylist *list, as_bytes *value)
static int as_arraylist_prepend_string(as_arraylist *list, as_string *value)
static as_integer * as_arraylist_get_integer(const as_arraylist *list, const uint32_t index)
static int as_arraylist_prepend_list(as_arraylist *list, as_list *value)
static int as_arraylist_set_integer(as_arraylist *list, const uint32_t index, as_integer *value)
int as_arraylist_append(as_arraylist *list, as_val *value)
int as_arraylist_prepend(as_arraylist *list, as_val *value)
static int as_arraylist_set_list(as_arraylist *list, const uint32_t index, as_list *value)
int64_t as_arraylist_get_int64(const as_arraylist *list, const uint32_t index)
char * as_arraylist_get_str(const as_arraylist *list, const uint32_t index)
as_arraylist * as_arraylist_init(as_arraylist *list, uint32_t capacity, uint32_t block_size)
uint32_t as_arraylist_hashcode(const as_arraylist *list)
static as_map * as_arraylist_get_map(const as_arraylist *list, const uint32_t index)
static as_bytes * as_bytes_fromval(const as_val *v)
static int as_arraylist_prepend_map(as_arraylist *list, as_map *value)
static as_string * as_string_fromval(const as_val *v)
void as_arraylist_destroy(as_arraylist *list)
bool as_arraylist_foreach(const as_arraylist *list, as_list_foreach_callback callback, void *udata)
static as_list * as_list_fromval(as_val *v)
as_arraylist * as_arraylist_drop(const as_arraylist *list, uint32_t n)
static int as_arraylist_append_integer(as_arraylist *list, as_integer *value)
static int as_arraylist_set_map(as_arraylist *list, const uint32_t index, as_map *value)
static int as_arraylist_append_string(as_arraylist *list, as_string *value)
static int as_arraylist_append_list(as_arraylist *list, as_list *value)
static as_map * as_map_fromval(const as_val *val)
static int as_arraylist_append_bytes(as_arraylist *list, as_bytes *value)
as_val * as_arraylist_get(const as_arraylist *list, const uint32_t index)
as_arraylist * as_arraylist_take(const as_arraylist *list, uint32_t n)
static as_bytes * as_arraylist_get_bytes(const as_arraylist *list, const uint32_t index)
int as_arraylist_append_str(as_arraylist *list, const char *value)