--- /dev/null
+/*\r
+ * GPAC - Multimedia Framework C SDK\r
+ *\r
+ * Copyright (c) Jean Le Feuvre 2000-2005 \r
+ * All rights reserved\r
+ *\r
+ * This file is part of GPAC / common tools sub-project\r
+ *\r
+ * GPAC is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published by\r
+ * the Free Software Foundation; either version 2, or (at your option)\r
+ * any later version.\r
+ * \r
+ * GPAC is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Lesser General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU Lesser General Public\r
+ * License along with this library; see the file COPYING. If not, write to\r
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. \r
+ *\r
+ */\r
+\r
+#ifndef _GF_LIST_H_\r
+#define _GF_LIST_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/*!\r
+ * \file <gpac/list.h>\r
+ * \brief list functions.\r
+ */\r
+\r
+/*!\r
+ * \addtogroup list_grp list\r
+ * \ingroup utils_grp\r
+ * \brief List object\r
+ *\r
+ * This section documents the list object of the GPAC framework.\r
+ * @{\r
+ */\r
+\r
+#include <gpac/tools.h>\r
+\r
+typedef struct _tag_array GF_List;\r
+\r
+/*!\r
+ * \brief list constructor\r
+ *\r
+ * Constructs a new list object\r
+ * \return new list object\r
+ */\r
+GF_List *gf_list_new();\r
+/*!\r
+ * \brief list destructor\r
+ *\r
+ * Destructs a list object\r
+ * \param ptr list object to destruct\r
+ * \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+void gf_list_del(GF_List *ptr);\r
+/*!\r
+ * \brief get count\r
+ *\r
+ * Returns number of items in the list\r
+ * \param ptr target list object\r
+ * \return number of items in the list\r
+ */\r
+u32 gf_list_count(GF_List *ptr);\r
+/*!\r
+ * \brief add item\r
+ *\r
+ * Adds an item at the end of the list\r
+ * \param ptr target list object\r
+ * \param item item to add\r
+ */\r
+GF_Err gf_list_add(GF_List *ptr, void* item);\r
+/*!\r
+ * \brief inserts item\r
+ *\r
+ * Insert an item in the list\r
+ * \param ptr target list object\r
+ * \param item item to add\r
+ * \param position insertion position. It is expressed between 0 and gf_list_count-1, and any bigger value is equivalent to gf_list_add\r
+ */\r
+GF_Err gf_list_insert(GF_List *ptr, void *item, u32 position);\r
+/*!\r
+ * \brief removes item\r
+ *\r
+ * Removes an item from the list given its position\r
+ * \param ptr target list object\r
+ * \param position position of the item to remove. It is expressed between 0 and gf_list_count-1.\r
+ * \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+GF_Err gf_list_rem(GF_List *ptr, u32 position);\r
+/*!\r
+ * \brief gets item\r
+ *\r
+ * Gets an item from the list given its position\r
+ * \param ptr target list object\r
+ * \param position position of the item to get. It is expressed between 0 and gf_list_count-1.\r
+ */\r
+void *gf_list_get(GF_List *ptr, u32 position);\r
+/*!\r
+ * \brief finds item\r
+ *\r
+ * Finds an item in the list\r
+ * \param ptr target list object.\r
+ * \param item the item to find.\r
+ * \return 0-based item position in the list, or -1 if the item could not be found.\r
+ */\r
+s32 gf_list_find(GF_List *ptr, void *item);\r
+/*!\r
+ * \brief deletes item\r
+ *\r
+ * Deletes an item from the list\r
+ * \param ptr target list object.\r
+ * \param item the item to find.\r
+ * \return 0-based item position in the list before removal, or -1 if the item could not be found.\r
+ */\r
+s32 gf_list_del_item(GF_List *ptr, void *item);\r
+/*!\r
+ * \brief resets list\r
+ *\r
+ * Resets the content of the list\r
+ * \param ptr target list object.\r
+ * \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+void gf_list_reset(GF_List *ptr);\r
+/*!\r
+ * \brief gets last item\r
+ *\r
+ * Gets last item o fthe list \r
+ * \param ptr target list object\r
+ */\r
+void *gf_list_last(GF_List *ptr);\r
+/*!\r
+ * \brief removes last item\r
+ *\r
+ * Removes the last item of the list\r
+ * \param ptr target list object\r
+ * \note It is the caller responsability to destroy the content of the list if needed\r
+ */\r
+GF_Err gf_list_rem_last(GF_List *ptr);\r
+\r
+\r
+/*!\r
+ * \brief list enumerator\r
+ *\r
+ * Retrieves given list item and increment current position\r
+ * \param ptr target list object\r
+ * \param pos target item position. The position is automatically incremented regardless of the return value\r
+ * \note A typical enumeration will start with a value of 0 until NULL is returned.\r
+ */\r
+void *gf_list_enum(GF_List *ptr, u32 *pos);\r
+\r
+/*! @} */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
+\r
+#endif /*_GF_LIST_H_*/\r
+\r