Path: blob/master/libs/fluidsynth/src/utils/fluid_list.h
4396 views
/* GLIB - Library of useful routines for C programming1* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald2*3* This library is free software; you can redistribute it and/or4* modify it under the terms of the GNU Lesser General Public5* License as published by the Free Software Foundation; either6* version 2 of the License, or (at your option) any later version.7*8* This library is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU11* Lesser General Public License for more details.12*13* You should have received a copy of the GNU Lesser General Public14* License along with this library; if not, write to the15* Free Software Foundation, Inc., 59 Temple Place - Suite 330,16* Boston, MA 02110-1301, USA.17*/1819#ifndef _FLUID_LIST_H20#define _FLUID_LIST_H2122#include "fluidsynth_priv.h"2324/*25*26* Lists27*28* A sound font loader has to pack the data from the .SF2 file into29* list structures of this type.30*31*/3233typedef struct _fluid_list_t fluid_list_t;3435typedef int (*fluid_compare_func_t)(const void *a, const void *b);3637struct _fluid_list_t38{39void *data;40fluid_list_t *next;41};4243fluid_list_t *new_fluid_list(void);44void delete_fluid_list(fluid_list_t *list);45void delete1_fluid_list(fluid_list_t *list);46fluid_list_t *fluid_list_sort(fluid_list_t *list, fluid_compare_func_t compare_func);47fluid_list_t *fluid_list_append(fluid_list_t *list, void *data);48fluid_list_t *fluid_list_prepend(fluid_list_t *list, void *data);49fluid_list_t *fluid_list_remove(fluid_list_t *list, void *data);50fluid_list_t *fluid_list_remove_link(fluid_list_t *list, fluid_list_t *llink);51fluid_list_t *fluid_list_nth(fluid_list_t *list, int n);52fluid_list_t *fluid_list_last(fluid_list_t *list);53fluid_list_t *fluid_list_insert_at(fluid_list_t *list, int n, void *data);54int fluid_list_idx(fluid_list_t *list, void *data);55int fluid_list_size(fluid_list_t *list);5657#define fluid_list_next(slist) ((slist) ? (((fluid_list_t *)(slist))->next) : NULL)58#define fluid_list_get(slist) ((slist) ? ((slist)->data) : NULL)5960int fluid_list_str_compare_func(const void *a, const void *b);6162#endif /* _FLUID_LIST_H */636465