[Bf-blender-cvs] [6bca694befe] master: Comments: add doxy sections to readfile.c

Campbell Barton noreply at git.blender.org
Fri Feb 22 08:24:14 CET 2019


Commit: 6bca694befe351dc72b8d28408c70e1fba5b4609
Author: Campbell Barton
Date:   Fri Feb 22 18:15:56 2019 +1100
Branches: master
https://developer.blender.org/rB6bca694befe351dc72b8d28408c70e1fba5b4609

Comments: add doxy sections to readfile.c

Some minor changes to arrange code into useful sections too.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index eac2775e0e1..d032a2bf9ab 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -21,7 +21,6 @@
  * \ingroup blenloader
  */
 
-
 #include "zlib.h"
 
 #include <limits.h>
@@ -245,6 +244,7 @@
 
 
 /* local prototypes */
+static void read_libraries(FileData *basefd, ListBase *mainlist);
 static void *read_struct(FileData *fd, BHead *bh, const char *blockname);
 static void direct_link_modifiers(FileData *fd, ListBase *lb);
 static BHead *find_bhead_from_code_name(FileData *fd, const short idcode, const char *name);
@@ -306,8 +306,9 @@ static const char *library_parent_filepath(Library *lib)
 	return lib->parent ? lib->parent->filepath : "<direct>";
 }
 
-
-/* ************** OldNewMap ******************* */
+/* -------------------------------------------------------------------- */
+/** \name OldNewMap API
+ * \{ */
 
 typedef struct OldNew {
 	const void *oldp;
@@ -484,11 +485,11 @@ static void oldnewmap_free(OldNewMap *onm)
 #undef PERTURB_SHIFT
 #undef ITER_SLOTS
 
-/***/
+/** \} */
 
-static void read_libraries(FileData *basefd, ListBase *mainlist);
-
-/* ************ help functions ***************** */
+/* -------------------------------------------------------------------- */
+/** \name Helper Functions
+ * \{ */
 
 static void add_main_to_main(Main *mainvar, Main *from)
 {
@@ -676,8 +677,11 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
 	return m;
 }
 
+/** \} */
 
-/* ************ FILE PARSING ****************** */
+/* -------------------------------------------------------------------- */
+/** \name File Parsing
+ * \{ */
 
 static void switch_endian_bh4(BHead4 *bhead)
 {
@@ -1106,6 +1110,12 @@ static int *read_file_thumbnail(FileData *fd)
 	return blend_thumb;
 }
 
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name File Data API
+ * \{ */
+
 static int fd_read_gzip_from_file(FileData *filedata, void *buffer, uint size)
 {
 	int readsize = gzread(filedata->gzfiledes, buffer, size);
@@ -1441,7 +1451,11 @@ void blo_filedata_free(FileData *fd)
 	}
 }
 
-/* ************ DIV ****************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Public Utilities
+ * \{ */
 
 /**
  * Check whether given path ends with a blend file compatible extension (.blend, .ble or .blend.gz).
@@ -1560,7 +1574,11 @@ BlendThumbnail *BLO_thumbnail_from_file(const char *filepath)
 	return data;
 }
 
-/* ************** OLD POINTERS ******************* */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Old/New Pointer Map
+ * \{ */
 
 static void *newdataadr(FileData *fd, const void *adr)      /* only direct databocks */
 {
@@ -1999,9 +2017,11 @@ void blo_add_library_pointer_map(ListBase *old_mainlist, FileData *fd)
 	fd->old_mainlist = old_mainlist;
 }
 
+/** \} */
 
-/* ********** END OLD POINTERS ****************** */
-/* ********** READ FILE ****************** */
+/* -------------------------------------------------------------------- */
+/** \name DNA Struct Loading
+ * \{ */
 
 static void switch_endian_structs(const struct SDNA *filesdna, BHead *bhead)
 {
@@ -2187,7 +2207,11 @@ static void test_pointer_array(FileData *fd, void **mat)
 	}
 }
 
-/* ************ READ ID Properties *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID Properties
+ * \{ */
 
 static void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd);
 static void IDP_LibLinkProperty(IDProperty *prop, FileData *fd);
@@ -2367,7 +2391,11 @@ static void IDP_LibLinkProperty(IDProperty *prop, FileData *fd)
 	}
 }
 
-/* ************ READ IMAGE PREVIEW *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read Image Preview
+ * \{ */
 
 static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_prv)
 {
@@ -2388,7 +2416,11 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
 	return prv;
 }
 
-/* ************ READ ID *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID
+ * \{ */
 
 static void lib_link_id(FileData *fd, Main *main)
 {
@@ -2452,7 +2484,11 @@ static void direct_link_id(FileData *fd, ID *id)
 	}
 }
 
-/* ************ READ CurveMapping *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read CurveMapping
+ * \{ */
 
 /* cuma itself has been read! */
 static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap)
@@ -2469,7 +2505,11 @@ static void direct_link_curvemapping(FileData *fd, CurveMapping *cumap)
 	}
 }
 
-/* ************ READ Brush *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Brush
+ * \{ */
 
 /* library brush linking after fileread */
 static void lib_link_brush(FileData *fd, Main *main)
@@ -2531,7 +2571,11 @@ static void direct_link_brush(FileData *fd, Brush *brush)
 	brush->icon_imbuf = NULL;
 }
 
-/* ************ READ Palette *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Palette
+ * \{ */
 
 static void lib_link_palette(FileData *fd, Main *main)
 {
@@ -2569,7 +2613,11 @@ static void direct_link_paint_curve(FileData *fd, PaintCurve *pc)
 	pc->points = newdataadr(fd, pc->points);
 }
 
-/* ************ READ PACKEDFILE *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read PackedFile
+ * \{ */
 
 static PackedFile *direct_link_packedfile(FileData *fd, PackedFile *oldpf)
 {
@@ -2582,9 +2630,11 @@ static PackedFile *direct_link_packedfile(FileData *fd, PackedFile *oldpf)
 	return pf;
 }
 
-/* ************ READ ANIMATION STUFF ***************** */
+/** \} */
 
-/* Legacy Data Support (for Version Patching) ----------------------------- */
+/* -------------------------------------------------------------------- */
+/** \name Read Animation (legacy for version patching)
+ * \{ */
 
 // XXX deprecated - old animation system
 static void lib_link_ipo(FileData *fd, Main *main)
@@ -2653,7 +2703,11 @@ static void lib_link_constraint_channels(FileData *fd, ID *id, ListBase *chanbas
 	}
 }
 
-/* Data Linking ----------------------------- */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Action
+ * \{ */
 
 static void lib_link_fmodifiers(FileData *fd, ID *id, ListBase *list)
 {
@@ -3015,7 +3069,11 @@ static void direct_link_animdata(FileData *fd, AnimData *adt)
 	adt->actstrip = newdataadr(fd, adt->actstrip);
 }
 
-/* ************ READ CACHEFILES *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: CacheFiles
+ * \{ */
 
 static void lib_link_cachefiles(FileData *fd, Main *bmain)
 {
@@ -3041,7 +3099,11 @@ static void direct_link_cachefile(FileData *fd, CacheFile *cache_file)
 	direct_link_animdata(fd, cache_file->adt);
 }
 
-/* ************ READ WORKSPACES *************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: WorkSpace
+ * \{ */
 
 static void lib_link_workspaces(FileData *fd, Main *bmain)
 {
@@ -3115,25 +3177,11 @@ static void lib_link_workspace_instance_hook(FileData *fd, WorkSpaceInstanceHook
 	BKE_workspace_active_set(hook, newlibadr(fd, id->lib, workspace));
 }
 
+/** \} */
 
-/* ************ READ MOTION PATHS *************** */
-
-/* direct data for cache */
-static void direct_link_motionpath(FileData *fd, bMotionPath *mpath)
-{
-	/* sanity check */
-	if (mpath == NULL)
-		return;
-
-	/* relink points cache */
-	mpath->points = newdataadr(fd, mpath->points);
-
-	mpath->points_vbo = NULL;
-	mpath->batch_line = NULL;
-	mpath->batch_points = NULL;
-}
-
-/* ************ READ NODE TREE *************** */
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Node Tree
+ * \{ */
 
 /* Single node tree (also used for material/scene trees), ntree is not NULL */
 static void lib_link_ntree(FileData *fd, ID *id, bNodeTree *ntree)
@@ -3551,7 +3599,11 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
 	/* type verification is in lib-link */
 }
 
-/* ************ READ ARMATURE ***************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Armature
+ * \{ */
 
 /* temp struct used to transport needed info to lib_link_constraint_cb() */
 typedef struct tConstraintLinkData {
@@ -3785,7 +3837,11 @@ static void direct_link_armature(FileData *fd, bArmature *arm)
 	arm->act_edbone = NULL;
 }
 
-/* ************ READ CAMERA ***************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Camera
+ * \{ */
 
 static void lib_link_camera(FileData *fd, Main *main)
 {
@@ -3821,8 +3877,11 @@ static void direct_link_camera(FileData *fd, Camera *ca)
 	}
 }
 
+/** \} */
 
-/* ************ READ LAMP ***************** */
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Light
+ * \{ */
 
 static void lib_link_lamp(FileData *fd, Main *main)
 {
@@ -3861,7 +3920,11 @@ static void direct_link_lamp(FileData *fd, Lamp *la)
 	la->preview = direct_link_preview_image(fd, la->preview);
 }
 
-/* ************ READ keys ***************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Shape Keys
+ * \{ */
 
 void blo_do_versions_key_uidgen(Key *key)
 {
@@ -3938,7 +4001,11 @@ static void direct_link_key(FileData *fd, Key *key)
 	}
 }
 
-/* ************ READ mball ***************** */
+/** \} */
+
+/* -------------------------------------------------------------------- */
+/** \name Read ID: Met

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list