diff options
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; |