Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-11-13 01:35:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-11-13 01:35:58 +0300
commita35345f8bab9502ba10920bf93a2547ef9d35f4c (patch)
tree6c725ccfc33767c007c998c65017d8b7952be80b /source/blender/blenlib/intern/BLI_linklist.c
parent8449f0d77640c466acbda7d6ceeb71bc48317b44 (diff)
2 utility functions added for projection painting.
* BLI_linklist_index() - to get an items index in a LinkList * BLI_memarena_use_malloc() - BLI_memarena_use_calloc alredy existed but there was no way to switch back to malloc. also added texnodes to cmake
Diffstat (limited to 'source/blender/blenlib/intern/BLI_linklist.c')
-rw-r--r--source/blender/blenlib/intern/BLI_linklist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 506a1036ed6..962bbeea373 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -50,6 +50,18 @@ int BLI_linklist_length(LinkNode *list) {
}
}
+int BLI_linklist_index(struct LinkNode *list, void *ptr)
+{
+ int index;
+
+ for (index = 0; list; list= list->next, index++) {
+ if (list->link == ptr)
+ return index;
+ }
+
+ return -1;
+}
+
void BLI_linklist_reverse(LinkNode **listp) {
LinkNode *rhead= NULL, *cur= *listp;