libcdsb/include/extra/array.h

24 lines
1.3 KiB
C
Raw Normal View History

2022-06-02 15:52:43 +03:00
/* 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
2022-06-09 16:26:11 +03:00
#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)
2022-06-04 21:52:00 +03:00
#define array_foreach(x, data, callback) libcdsb_array_foreach(x, data, callback, 0)
2022-06-09 16:26:11 +03:00
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__;
2022-06-05 20:01:10 +03:00
2022-06-09 16:26:11 +03:00
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__;
2022-06-02 15:52:43 +03:00
#endif /* LIBCDSB_EXTRA_ARRAY_H */