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>2011-03-12 17:38:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-12 17:38:00 +0300
commita41694938231a108ed414561311663c3c4ae7c4c (patch)
treefa491b06eebd640b88bde199ac82e150d5c89a3b /source/blender/blenloader/intern/readblenentry.c
parentc678bd2d7de115945e5df83b11742a62582c4d40 (diff)
- BKE_idcode_iter_step() - function to step over all ID codes.
- BLO_blendhandle_get_datablock_names() now takes an arg for the total items in the list, saves the caller counting.
Diffstat (limited to 'source/blender/blenloader/intern/readblenentry.c')
-rw-r--r--source/blender/blenloader/intern/readblenentry.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c
index eda0ac1c375..4a8ef3a9317 100644
--- a/source/blender/blenloader/intern/readblenentry.c
+++ b/source/blender/blenloader/intern/readblenentry.c
@@ -123,21 +123,24 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp)
fprintf(fp, "]\n");
}
-LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype)
+LinkNode *BLO_blendhandle_get_datablock_names(BlendHandle *bh, int ofblocktype, int *tot_names)
{
FileData *fd= (FileData*) bh;
LinkNode *names= NULL;
BHead *bhead;
+ int tot= 0;
for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) {
if (bhead->code==ofblocktype) {
char *idname= bhead_id_name(fd, bhead);
-
+
BLI_linklist_prepend(&names, strdup(idname+2));
+ tot++;
} else if (bhead->code==ENDB)
break;
}
-
+
+ *tot_names= tot;
return names;
}