Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/fluidsynth/src/utils/fluid_list.h
4396 views
1
/* GLIB - Library of useful routines for C programming
2
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02110-1301, USA.
18
*/
19
20
#ifndef _FLUID_LIST_H
21
#define _FLUID_LIST_H
22
23
#include "fluidsynth_priv.h"
24
25
/*
26
*
27
* Lists
28
*
29
* A sound font loader has to pack the data from the .SF2 file into
30
* list structures of this type.
31
*
32
*/
33
34
typedef struct _fluid_list_t fluid_list_t;
35
36
typedef int (*fluid_compare_func_t)(const void *a, const void *b);
37
38
struct _fluid_list_t
39
{
40
void *data;
41
fluid_list_t *next;
42
};
43
44
fluid_list_t *new_fluid_list(void);
45
void delete_fluid_list(fluid_list_t *list);
46
void delete1_fluid_list(fluid_list_t *list);
47
fluid_list_t *fluid_list_sort(fluid_list_t *list, fluid_compare_func_t compare_func);
48
fluid_list_t *fluid_list_append(fluid_list_t *list, void *data);
49
fluid_list_t *fluid_list_prepend(fluid_list_t *list, void *data);
50
fluid_list_t *fluid_list_remove(fluid_list_t *list, void *data);
51
fluid_list_t *fluid_list_remove_link(fluid_list_t *list, fluid_list_t *llink);
52
fluid_list_t *fluid_list_nth(fluid_list_t *list, int n);
53
fluid_list_t *fluid_list_last(fluid_list_t *list);
54
fluid_list_t *fluid_list_insert_at(fluid_list_t *list, int n, void *data);
55
int fluid_list_idx(fluid_list_t *list, void *data);
56
int fluid_list_size(fluid_list_t *list);
57
58
#define fluid_list_next(slist) ((slist) ? (((fluid_list_t *)(slist))->next) : NULL)
59
#define fluid_list_get(slist) ((slist) ? ((slist)->data) : NULL)
60
61
int fluid_list_str_compare_func(const void *a, const void *b);
62
63
#endif /* _FLUID_LIST_H */
64
65