112#include "qinternal.h"
113#include "containers/qgrow.h"
135 qgrow_t *grow = (qgrow_t *) calloc(1,
sizeof(qgrow_t));
141 grow->list =
qlist(options);
142 if (grow->list == NULL) {
178bool qgrow_add(qgrow_t *grow,
const void *data,
size_t size) {
179 return grow->list->addlast(grow->list, data, size);
194 return grow->list->addlast(grow->list, str, strlen(str));
210 DYNAMIC_VSPRINTF(str, format);
230 return grow->list->size(grow->list);
242 return grow->list->datasize(grow->list);
259 return grow->list->toarray(grow->list, size);
277 return grow->list->tostring(grow->list);
286 grow->list->clear(grow->list);
300 return grow->list->debug(grow->list, out);
309 grow->list->free(grow->list);
void qgrow_free(qgrow_t *grow)
qgrow->free(): De-allocate grow
bool qgrow_debug(qgrow_t *grow, FILE *out)
qgrow->debug(): Print out stored elements for debugging purpose.
bool qgrow_addstr(qgrow_t *grow, const char *str)
qgrow->addstr(): Stack string
bool qgrow_add(qgrow_t *grow, const void *data, size_t size)
qgrow->add(): Stack object
size_t qgrow_size(qgrow_t *grow)
qgrow->size(): Returns the number of elements in this grow.
qgrow_t * qgrow(int options)
Initialize grow.
bool qgrow_addstrf(qgrow_t *grow, const char *format,...)
qgrow->addstrf(): Stack formatted string
void qgrow_clear(qgrow_t *grow)
qgrow->clear(): Removes all of the elements from this grow.
char * qgrow_tostring(qgrow_t *grow)
qgrow->tostring(): Returns a string representation of this grow, containing string representation of ...
void * qgrow_toarray(qgrow_t *grow, size_t *size)
qgrow->toarray(): Returns the serialized chunk containing all the elements in this grow.
size_t qgrow_datasize(qgrow_t *grow)
qgrow->datasize(): Returns the sum of total element size in this grow.
qlist_t * qlist(int options)
Create new qlist_t linked-list container.