34#ifndef SIMCLIST_NO_DUMPRESTORE
44#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
57typedef int32_t list_hash_t;
59#ifndef SIMCLIST_NO_DUMPRESTORE
62 struct timeval timestamp;
65 list_hash_t list_hash;
80typedef int (*element_comparator)(
const void *a,
const void *b);
93typedef int (*element_seeker)(
const void *el,
const void *indicator);
104typedef size_t (*element_meter)(
const void *el);
115typedef list_hash_t (*element_hash_computer)(
const void *el);
135typedef void *(*element_serializer)(
const void *restrict el, uint32_t *restrict serializ_len);
152typedef void *(*element_unserializer)(
const void *restrict data, uint32_t *restrict data_len);
166 element_comparator comparator;
168 element_seeker seeker;
173 element_hash_computer hasher;
175 element_serializer serializer;
177 element_unserializer unserializer;
190 unsigned int spareelsnum;
192#ifdef SIMCLIST_WITH_THREADS
194 unsigned int threadcount;
199 unsigned int iter_pos;
212int list_init(
list_t *restrict l);
223void list_destroy(
list_t *restrict l);
237int list_attributes_comparator(
list_t *restrict l, element_comparator comparator_fun);
251int list_attributes_seeker(
list_t *restrict l, element_seeker seeker_fun);
283int list_attributes_copy(
list_t *restrict l, element_meter metric_fun,
int copy_data);
303int list_attributes_hash_computer(
list_t *restrict l, element_hash_computer hash_computer_fun);
324int list_attributes_serializer(
list_t *restrict l, element_serializer serializer_fun);
346int list_attributes_unserializer(
list_t *restrict l, element_unserializer unserializer_fun);
358int list_append(
list_t *restrict l,
const void *data);
370int list_prepend(
list_t *restrict l,
const void *restrict data);
380void *list_fetch(
list_t *restrict l);
389void *list_get_at(
const list_t *restrict l,
unsigned int pos);
403void *list_get_max(
const list_t *restrict l);
417void *list_get_min(
const list_t *restrict l);
426void *list_extract_at(
list_t *restrict l,
unsigned int pos);
436int list_insert_at(
list_t *restrict l,
const void *data,
unsigned int pos);
453int list_delete(
list_t *restrict l,
const void *data);
462int list_delete_at(
list_t *restrict l,
unsigned int pos);
472int list_delete_range(
list_t *restrict l,
unsigned int posstart,
unsigned int posend);
485int list_clear(
list_t *restrict l);
493unsigned int list_size(
const list_t *restrict l);
503int list_empty(
const list_t *restrict l);
522int list_locate(
const list_t *restrict l,
const void *data);
537void *list_seek(
list_t *restrict l,
const void *indicator);
558int list_contains(
const list_t *restrict l,
const void *data);
594int list_sort(
list_t *restrict l,
int versus);
606int list_iterator_start(
list_t *restrict l);
614void *list_iterator_next(
list_t *restrict l);
622int list_iterator_hasnext(
const list_t *restrict l);
630int list_iterator_stop(
list_t *restrict l);
640int list_hash(
const list_t *restrict l, list_hash_t *restrict hash);
642#ifndef SIMCLIST_NO_DUMPRESTORE
658int list_dump_getinfo_filedescriptor(
int fd,
list_dump_info_t *restrict info);
673int list_dump_getinfo_file(
const char *restrict filename,
list_dump_info_t *restrict info);
709int list_dump_filedescriptor(
const list_t *restrict l,
int fd,
size_t *restrict len);
732int list_dump_file(
const list_t *restrict l,
const char *restrict filename,
size_t *restrict len);
752int list_restore_filedescriptor(
list_t *restrict l,
int fd,
size_t *restrict len);
770int list_restore_file(
list_t *restrict l,
const char *restrict filename,
size_t *len);
779int list_comparator_int8_t(
const void *a,
const void *b);
785int list_comparator_int16_t(
const void *a,
const void *b);
791int list_comparator_int32_t(
const void *a,
const void *b);
797int list_comparator_int64_t(
const void *a,
const void *b);
803int list_comparator_uint8_t(
const void *a,
const void *b);
809int list_comparator_uint16_t(
const void *a,
const void *b);
815int list_comparator_uint32_t(
const void *a,
const void *b);
821int list_comparator_uint64_t(
const void *a,
const void *b);
827int list_comparator_float(
const void *a,
const void *b);
833int list_comparator_double(
const void *a,
const void *b);
839int list_comparator_string(
const void *a,
const void *b);
846size_t list_meter_int8_t(
const void *el);
852size_t list_meter_int16_t(
const void *el);
858size_t list_meter_int32_t(
const void *el);
864size_t list_meter_int64_t(
const void *el);
870size_t list_meter_uint8_t(
const void *el);
876size_t list_meter_uint16_t(
const void *el);
882size_t list_meter_uint32_t(
const void *el);
888size_t list_meter_uint64_t(
const void *el);
894size_t list_meter_float(
const void *el);
900size_t list_meter_double(
const void *el);
906size_t list_meter_string(
const void *el);
913list_hash_t list_hashcomputer_int8_t(
const void *el);
919list_hash_t list_hashcomputer_int16_t(
const void *el);
925list_hash_t list_hashcomputer_int32_t(
const void *el);
931list_hash_t list_hashcomputer_int64_t(
const void *el);
937list_hash_t list_hashcomputer_uint8_t(
const void *el);
943list_hash_t list_hashcomputer_uint16_t(
const void *el);
949list_hash_t list_hashcomputer_uint32_t(
const void *el);
955list_hash_t list_hashcomputer_uint64_t(
const void *el);
961list_hash_t list_hashcomputer_float(
const void *el);
967list_hash_t list_hashcomputer_double(
const void *el);
973list_hash_t list_hashcomputer_string(
const void *el);