diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-09-04 09:31:25 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-09-04 09:31:25 +0400 |
commit | bb7339a7aec37bdb2ee8a21599e6c65b37ef1277 (patch) | |
tree | 6fb8da94c6e43098c606f768e722484b04b8645c /source/blender/blenlib/intern/listbase.c | |
parent | 37f2c8a64c3277f100ab084ef1bb3846bc7b2c62 (diff) | |
parent | 8a320974f1b3e6004db3b3ad64f97742f878cbee (diff) |
merge with trunk at r31523
Diffstat (limited to 'source/blender/blenlib/intern/listbase.c')
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index 0a6831558d1..776f2d085df 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -374,6 +374,27 @@ void *BLI_findstring(ListBase *listbase, const char *id, int offset) return NULL; } +void *BLI_findstring_ptr(ListBase *listbase, const char *id, int offset) +{ + Link *link= NULL; + const char *id_iter; + + if (listbase == NULL) return NULL; + + link= listbase->first; + while (link) { + /* exact copy of BLI_findstring(), except for this line */ + id_iter= *((const char **)(((const char *)link) + offset)); + + if(id[0] == id_iter[0] && strcmp(id, id_iter)==0) + return link; + + link= link->next; + } + + return NULL; +} + int BLI_findstringindex(ListBase *listbase, const char *id, int offset) { Link *link= NULL; |