diff options
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 13 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readblenentry.c | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index eeced13b57b..719a3c065ae 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -123,6 +123,19 @@ BLO_blendhandle_from_file( char *file); /** + * Open a blendhandle from memory. + * + * @param mem The data to load from. + * @param memsize The size of the data. + * @return A handle on success, or NULL on failure. + */ + + BlendHandle* +BLO_blendhandle_from_memory( + void *mem, + int memsize); + +/** * Gets the names of all the datablocks in a file * of a certain type (ie. All the scene names in * a file). diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index d66d802c8ee..da441214b37 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -76,6 +76,15 @@ BlendHandle *BLO_blendhandle_from_file(char *file) return bh; } +BlendHandle *BLO_blendhandle_from_memory(void *mem, int memsize) +{ + BlendHandle *bh; + + bh= (BlendHandle*)blo_openblendermemory(mem, memsize, NULL); + + return bh; +} + void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp) { FileData *fd= (FileData*) bh; |