libcdsb/include/extra/array.h

24 lines
1.3 KiB
C

/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "../array.h"
#ifndef LIBCDSB_EXTRA_ARRAY_H
#define LIBCDSB_EXTRA_ARRAY_H
#define array_get_by_index(s, index, data, callback) libcdsb_array_get(s, index, data, callback, 0)
#define array_pop_by_index(s, index, data, callback) libcdsb_array_get(s, index, data, callback, 1)
#define array_remove_by_index(s, index) libcdsb_array_get(s, index, 0, 0, 1)
#define array_foreach(x, data, callback) libcdsb_array_foreach(x, data, callback, 0)
extern ssize_t libcdsb_array_push(vtype_array* x, const void* value, vtype value_type) LIBCDSB_nt__ LIBCDSB_nn1__;
extern size_t libcdsb_array_count(const vtype_array* s, const void* value, vtype type) LIBCDSB_nt__ LIBCDSB_nn1__;
extern int libcdsb_array_find (vtype_array* x, const void* value, vtype type, void* data, array_access_callback, bool reverse, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
extern int libcdsb_array_get (vtype_array* x, ssize_t index, void* data, array_access_callback, bool cut) LIBCDSB_nt__ LIBCDSB_nn1__;
extern int libcdsb_array_foreach(vtype_array* x, void* data, array_access_callback, bool flush) LIBCDSB_nt__ LIBCDSB_nn13__;
#endif /* LIBCDSB_EXTRA_ARRAY_H */