Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00028 #ifndef BLI_LISTBASE_H 00029 #define BLI_LISTBASE_H 00030 00035 #include "DNA_listBase.h" 00036 //struct ListBase; 00037 //struct LinkData; 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00043 void BLI_insertlink(struct ListBase *listbase, void *vprevlink, void *vnewlink); 00044 void *BLI_findlink(const struct ListBase *listbase, int number); 00045 int BLI_findindex(const struct ListBase *listbase, void *vlink); 00046 int BLI_findstringindex(const struct ListBase *listbase, const char *id, const int offset); 00047 00048 /* find forwards */ 00049 void *BLI_findstring(const struct ListBase *listbase, const char *id, const int offset); 00050 void *BLI_findstring_ptr(const struct ListBase *listbase, const char *id, const int offset); 00051 00052 /* find backwards */ 00053 void *BLI_rfindstring(const struct ListBase *listbase, const char *id, const int offset); 00054 void *BLI_rfindstring_ptr(const struct ListBase *listbase, const char *id, const int offset); 00055 00056 void BLI_freelistN(struct ListBase *listbase); 00057 void BLI_addtail(struct ListBase *listbase, void *vlink); 00058 void BLI_remlink(struct ListBase *listbase, void *vlink); 00059 int BLI_remlink_safe(struct ListBase *listbase, void *vlink); 00060 00061 void BLI_addhead(struct ListBase *listbase, void *vlink); 00062 void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnewlink); 00063 void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink); 00064 void BLI_sortlist(struct ListBase *listbase, int (*cmp)(void *, void *)); 00065 void BLI_freelist(struct ListBase *listbase); 00066 int BLI_countlist(const struct ListBase *listbase); 00067 void BLI_freelinkN(struct ListBase *listbase, void *vlink); 00068 00069 void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src); 00070 void BLI_duplicatelist(struct ListBase *dst, const struct ListBase *src); 00071 00072 /* create a generic list node containing link to provided data */ 00073 struct LinkData *BLI_genericNodeN(void *data); 00074 00075 #ifdef __cplusplus 00076 } 00077 #endif 00078 00079 #endif