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:
authorJacques Lucke <jacques@blender.org>2020-05-02 20:08:37 +0300
committerJacques Lucke <jacques@blender.org>2020-05-02 20:08:37 +0300
commit5240df4e0c72b9496b8b1b161be487018a91ec64 (patch)
tree2c3cbc468f6a4cf0f526f7b054a58bb2f730a2d4
parent150950e30f0841924503c2cb3461be008721f982 (diff)
start writing comments
-rw-r--r--source/blender/blenloader/BLO_read_write.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenloader/BLO_read_write.h b/source/blender/blenloader/BLO_read_write.h
index d7a3c34b8b8..064d7b3cd78 100644
--- a/source/blender/blenloader/BLO_read_write.h
+++ b/source/blender/blenloader/BLO_read_write.h
@@ -31,8 +31,13 @@ typedef struct BlendExpander BlendExpander;
/* API for file writing.
**********************************************/
-void BLO_write_raw(BlendWriter *writer, int size_in_bytes, const void *data_ptr);
+/**
+ * When NULL is passed as data_ptr, nothing is done.
+ */
+/**
+ * Write a single DNA struct to the file.
+ */
void BLO_write_struct_by_name(BlendWriter *writer, const char *struct_name, const void *data_ptr);
void BLO_write_struct_array_by_name(BlendWriter *writer,
const char *struct_name,
@@ -68,12 +73,25 @@ int BLO_get_struct_id_by_name(BlendWriter *writer, const char *struct_name);
#define BLO_write_id_struct(writer, struct_name, id_address, id) \
blo_write_id_struct(writer, BLO_get_struct_id(writer, struct_name), id_address, id)
+/**
+ * Write the data in the given memory buffer to the file. The pointer is used to identify the
+ * buffer when the file is loaded.
+ */
+void BLO_write_raw(BlendWriter *writer, int size_in_bytes, const void *data_ptr);
+
+/**
+ * Wrappers around BLO_write_raw that are more convenient in many cases.
+ */
void BLO_write_int32_array(BlendWriter *writer, int size, const int32_t *data_ptr);
void BLO_write_uint32_array(BlendWriter *writer, int size, const uint32_t *data_ptr);
void BLO_write_float_array(BlendWriter *writer, int size, const float *data_ptr);
void BLO_write_float3_array(BlendWriter *writer, int size, const float *data_ptr);
void BLO_write_string(BlendWriter *writer, const char *str);
+/**
+ * Sometimes different data is written depending on whether the file is saved to disk or used for
+ * undo. This function returns true when the current file-writing is done for undo.
+ */
bool BLO_write_is_undo(BlendWriter *writer);
/* API for data pointer reading.