myMPD
Internal API documentation
Loading...
Searching...
No Matches
sds_array.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-3.0-or-later
3 myMPD (c) 2018-2026 Juergen Mang <mail@jcgames.de>
4 https://github.com/jcorporation/mympd
5*/
6
10
11#ifndef MYMPD_SDS_ARRAY_H
12#define MYMPD_SDS_ARRAY_H
13
14#include "dist/sds/sds.h"
15
16#include <stdbool.h>
17
22 unsigned length;
23 unsigned capacity;
24 sds *items;
25};
26
27enum {
28 SDS_ARRAY_START_CAPACITY = 16
29};
30
31struct t_sds_array *sds_array_new(void);
32void sds_array_init(struct t_sds_array *array);
33void sds_array_clear(struct t_sds_array *array);
34void sds_array_free(struct t_sds_array *array);
35bool sds_array_push(struct t_sds_array *array, sds s);
36bool sds_array_shuffle(struct t_sds_array *array);
37bool sds_array_sort(struct t_sds_array *array, bool desc);
38
39#endif
void sds_array_clear(struct t_sds_array *array)
Definition sds_array.c:48
bool sds_array_sort(struct t_sds_array *array, bool desc)
Definition sds_array.c:110
void sds_array_init(struct t_sds_array *array)
Definition sds_array.c:38
bool sds_array_push(struct t_sds_array *array, sds s)
Definition sds_array.c:71
bool sds_array_shuffle(struct t_sds_array *array)
Definition sds_array.c:86
struct t_sds_array * sds_array_new(void)
Definition sds_array.c:28
void sds_array_free(struct t_sds_array *array)
Definition sds_array.c:59
Definition sds_array.h:21
sds * items
Pointer to the array of sds strings.
Definition sds_array.h:24
unsigned capacity
Maximum number of elements the array can hold before resizing.
Definition sds_array.h:23
unsigned length
Current number of elements in the array.
Definition sds_array.h:22