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>2014-01-31 17:51:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-31 19:01:00 +0400
commit34a05325842eb6a0d87904399a41336b04f701d0 (patch)
tree9e3f27c6a249db0776c4a328306c734bfcfb5b59 /source/blender/blenloader
parenteeefbbcc78ff308c06b32b5887be0faca781c3c6 (diff)
Code cleanup: comments and warnings
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/BLO_readfile.h73
-rw-r--r--source/blender/blenloader/intern/readfile.c2
2 files changed, 41 insertions, 34 deletions
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index b39f247ccd3..4fb983c119b 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -83,7 +83,9 @@ typedef struct BlendFileData {
* indicating the cause of the failure.
* \return The data of the file.
*/
-BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *reports);
+BlendFileData *BLO_read_from_file(
+ const char *filepath,
+ struct ReportList *reports);
/**
* Open a blender file from memory. The function
@@ -96,34 +98,38 @@ BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *repor
* indicating the cause of the failure.
* \return The data of the file.
*/
-BlendFileData *BLO_read_from_memory(const void *mem, int memsize, struct ReportList *reports);
+BlendFileData *BLO_read_from_memory(
+ const void *mem, int memsize,
+ struct ReportList *reports);
/**
* oldmain is old main, from which we will keep libraries, images, ..
* file name is current file, only for retrieving library data */
-BlendFileData *BLO_read_from_memfile(struct Main *oldmain, const char *filename, struct MemFile *memfile, struct ReportList *reports);
+BlendFileData *BLO_read_from_memfile(
+ struct Main *oldmain, const char *filename, struct MemFile *memfile,
+ struct ReportList *reports);
/**
* Free's a BlendFileData structure and _all_ the
* data associated with it (the userdef data, and
* the main libblock data).
- *
+ *
* \param bfd The structure to free.
*/
void
BLO_blendfiledata_free(BlendFileData *bfd);
-
+
/**
* Open a blendhandle from a file path.
- *
+ *
* \param file The file path to open.
* \param reports Report errors in opening the file (can be NULL).
* \return A handle on success, or NULL on failure.
*/
-BlendHandle *
-BLO_blendhandle_from_file(const char *filepath,
- struct ReportList *reports);
+BlendHandle *BLO_blendhandle_from_file(
+ const char *filepath,
+ struct ReportList *reports);
/**
* Open a blendhandle from memory.
@@ -133,53 +139,49 @@ BLO_blendhandle_from_file(const char *filepath,
* \return A handle on success, or NULL on failure.
*/
-BlendHandle *
-BLO_blendhandle_from_memory(const void *mem,
- int memsize);
+BlendHandle *BLO_blendhandle_from_memory(
+ const 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).
- *
+ *
* \param bh The blendhandle to access.
* \param ofblocktype The type of names to get.
* \param tot_names The length of the returned list.
* \return A BLI_linklist of strings. The string links
* should be freed with malloc.
*/
-struct LinkNode *
-BLO_blendhandle_get_datablock_names(BlendHandle *bh,
- int ofblocktype,
- int *tot_names);
+struct LinkNode *BLO_blendhandle_get_datablock_names(
+ BlendHandle *bh,
+ int ofblocktype, int *tot_names);
/**
* Gets the previews of all the datablocks in a file
* of a certain type (ie. All the scene names in
* a file).
- *
+ *
* \param bh The blendhandle to access.
* \param ofblocktype The type of names to get.
* \param tot_prev The length of the returned list.
* \return A BLI_linklist of PreviewImage. The PreviewImage links
* should be freed with malloc.
*/
-struct LinkNode *
-BLO_blendhandle_get_previews(BlendHandle *bh,
- int ofblocktype,
- int *tot_prev);
+struct LinkNode *BLO_blendhandle_get_previews(
+ BlendHandle *bh,
+ int ofblocktype, int *tot_prev);
/**
* Gets the names of all the datablock groups in a
* file. (ie. file contains Scene, Mesh, and Lamp
* datablocks).
- *
+ *
* \param bh The blendhandle to access.
* \return A BLI_linklist of strings. The string links
* should be freed with malloc.
*/
-struct LinkNode *
-BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
+struct LinkNode *BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
/**
* Close and free a blendhandle. The handle
@@ -189,10 +191,10 @@ BLO_blendhandle_get_linkable_groups(BlendHandle *bh);
*/
void
BLO_blendhandle_close(BlendHandle *bh);
-
+
/***/
-#define GROUP_MAX 32
+#define BLO_GROUP_MAX 32
bool BLO_has_bfile_extension(const char *str);
@@ -211,7 +213,9 @@ bool BLO_is_a_library(const char *path, char *dir, char *group);
* \param filepath Used for relative linking, copied to the lib->name
* \return the library Main, to be passed to BLO_library_append_named_part as mainl.
*/
-struct Main *BLO_library_append_begin(struct Main *mainvar, BlendHandle **bh, const char *filepath);
+struct Main *BLO_library_append_begin(
+ struct Main *mainvar, BlendHandle **bh,
+ const char *filepath);
/**
@@ -223,7 +227,9 @@ struct Main *BLO_library_append_begin(struct Main *mainvar, BlendHandle **bh, co
* \param idcode The kind of datablock to link.
* \return the appended ID when found.
*/
-struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode);
+struct ID *BLO_library_append_named_part(
+ struct Main *mainl, BlendHandle **bh,
+ const char *idname, const int idcode);
/**
* Link/Append a named datablock from an external blend file.
@@ -237,7 +243,9 @@ struct ID *BLO_library_append_named_part(struct Main *mainl, BlendHandle **bh, c
* \param flag Options for linking, used for instancing.
* \return the appended ID when found.
*/
-struct ID *BLO_library_append_named_part_ex(const struct bContext *C, struct Main *mainl, BlendHandle **bh, const char *idname, const int idcode, const short flag);
+struct ID *BLO_library_append_named_part_ex(
+ const struct bContext *C, struct Main *mainl, BlendHandle **bh,
+ const char *idname, const int idcode, const short flag);
void BLO_library_append_end(const struct bContext *C, struct Main *mainl, BlendHandle **bh, int idcode, short flag);
@@ -246,7 +254,7 @@ void BLO_library_append_all(struct Main *mainl, BlendHandle *bh);
void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
BlendFileData *blo_read_blendafterruntime(int file, const char *name, int actualsize, struct ReportList *reports);
-
+
/* internal function but we need to expose it */
void blo_lib_link_screen_restore(struct Main *newmain, struct bScreen *curscreen, struct Scene *curscene);
@@ -274,5 +282,4 @@ void BLO_update_defaults_startup_blend(struct Main *mainvar);
}
#endif
-#endif
-
+#endif /* __BLO_READFILE_H__ */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 2a1ca226d31..3e10d7440bb 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1192,7 +1192,7 @@ bool BLO_is_a_library(const char *path, char *dir, char *group)
/* now we know that we are in a blend file and it is safe to
* assume that gp actually points to a group */
if (strcmp("Screen", gp) != 0)
- BLI_strncpy(group, gp, GROUP_MAX);
+ BLI_strncpy(group, gp, BLO_GROUP_MAX);
}
return 1;
}