XMMS2
src/include/xmmsc/xmmsv_list.h
Go to the documentation of this file.
00001 /*  XMMS2 - X Music Multiplexer System
00002  *  Copyright (C) 2003-2011 XMMS2 Team
00003  *
00004  *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
00005  *
00006  *  This library is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU Lesser General Public
00008  *  License as published by the Free Software Foundation; either
00009  *  version 2.1 of the License, or (at your option) any later version.
00010  *
00011  *  This library is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  *  Lesser General Public License for more details.
00015  */
00016 
00017 
00018 #ifndef __XMMSV_LIST_H__
00019 #define __XMMSV_LIST_H__
00020 
00021 #include "xmmsc/xmmsv_general.h"
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /**
00028  * @defgroup ListType Lists
00029  * @ingroup ValueType
00030  * @{
00031  */
00032 
00033 xmmsv_t *xmmsv_new_list (void);
00034 
00035 int xmmsv_list_get (xmmsv_t *listv, int pos, xmmsv_t **val);
00036 int xmmsv_list_set (xmmsv_t *listv, int pos, xmmsv_t *val);
00037 int xmmsv_list_append (xmmsv_t *listv, xmmsv_t *val);
00038 int xmmsv_list_insert (xmmsv_t *listv, int pos, xmmsv_t *val);
00039 int xmmsv_list_remove (xmmsv_t *listv, int pos);
00040 int xmmsv_list_move (xmmsv_t *listv, int old_pos, int new_pos);
00041 int xmmsv_list_clear (xmmsv_t *listv);
00042 int xmmsv_list_get_size (xmmsv_t *listv);
00043 int xmmsv_list_restrict_type (xmmsv_t *listv, xmmsv_type_t type);
00044 
00045 int xmmsv_list_get_string (xmmsv_t *v, int pos, const char **val);
00046 int xmmsv_list_get_int (xmmsv_t *v, int pos, int32_t *val);
00047 int xmmsv_list_get_coll (xmmsv_t *v, int pos, xmmsv_coll_t **val);
00048 
00049 int xmmsv_list_set_string (xmmsv_t *v, int pos, const char *val);
00050 int xmmsv_list_set_int (xmmsv_t *v, int pos, int32_t val);
00051 int xmmsv_list_set_coll (xmmsv_t *v, int pos, xmmsv_coll_t *val);
00052 
00053 int xmmsv_list_insert_string (xmmsv_t *v, int pos, const char *val);
00054 int xmmsv_list_insert_int (xmmsv_t *v, int pos, int32_t val);
00055 int xmmsv_list_insert_coll (xmmsv_t *v, int pos, xmmsv_coll_t *val);
00056 
00057 int xmmsv_list_append_string (xmmsv_t *v, const char *val);
00058 int xmmsv_list_append_int (xmmsv_t *v, int32_t val);
00059 int xmmsv_list_append_coll (xmmsv_t *v, xmmsv_coll_t *val);
00060 
00061 /**
00062  * @defgroup ListIterType Iteration
00063  * @{
00064  */
00065 
00066 typedef void (*xmmsv_list_foreach_func) (xmmsv_t *value, void *user_data);
00067 int xmmsv_list_foreach (xmmsv_t *listv, xmmsv_list_foreach_func func, void* user_data);
00068 
00069 typedef struct xmmsv_list_iter_St xmmsv_list_iter_t;
00070 int xmmsv_get_list_iter (const xmmsv_t *val, xmmsv_list_iter_t **it);
00071 void xmmsv_list_iter_explicit_destroy (xmmsv_list_iter_t *it);
00072 
00073 int  xmmsv_list_iter_entry (xmmsv_list_iter_t *it, xmmsv_t **val);
00074 int  xmmsv_list_iter_valid (xmmsv_list_iter_t *it);
00075 void xmmsv_list_iter_first (xmmsv_list_iter_t *it);
00076 void xmmsv_list_iter_last (xmmsv_list_iter_t *it);
00077 void xmmsv_list_iter_next (xmmsv_list_iter_t *it);
00078 void xmmsv_list_iter_prev (xmmsv_list_iter_t *it);
00079 int  xmmsv_list_iter_seek (xmmsv_list_iter_t *it, int pos);
00080 int  xmmsv_list_iter_tell (const xmmsv_list_iter_t *it);
00081 xmmsv_t *xmmsv_list_iter_get_parent (const xmmsv_list_iter_t *it);
00082 
00083 int  xmmsv_list_iter_insert (xmmsv_list_iter_t *it, xmmsv_t *val);
00084 int  xmmsv_list_iter_remove (xmmsv_list_iter_t *it);
00085 
00086 int xmmsv_list_iter_entry_string (xmmsv_list_iter_t *it, const char **val);
00087 int xmmsv_list_iter_entry_int (xmmsv_list_iter_t *it, int32_t *val);
00088 int xmmsv_list_iter_entry_coll (xmmsv_list_iter_t *it, xmmsv_coll_t **val);
00089 
00090 int xmmsv_list_iter_insert_string (xmmsv_list_iter_t *it, const char *val);
00091 int xmmsv_list_iter_insert_int (xmmsv_list_iter_t *it, int32_t val);
00092 int xmmsv_list_iter_insert_coll (xmmsv_list_iter_t *it, xmmsv_coll_t *val);
00093 /** @} */
00094 
00095 /** @} */
00096 
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100 
00101 #endif