]> Kevux Git Server - fll/commitdiff
Update: add f_macro_file_clear() and f_macro_file_reset()
authorKevin Day <thekevinday@gmail.com>
Wed, 24 Jun 2020 05:15:28 +0000 (00:15 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 24 Jun 2020 05:15:28 +0000 (00:15 -0500)
level_0/f_file/c/file.h

index 07c9d453c1fb19a060187cbad07d297bd76d7e30..ecb8cb6d73de118a9ecd5d4db79fa45a5f6f0914 100644 (file)
@@ -107,6 +107,18 @@ extern "C" {
   } f_file;
 
   #define f_file_initialize { 0, f_file_flag_read_only, f_file_default_read_size, f_file_default_write_size }
+
+  #define f_macro_file_clear(file) \
+    file.id = 0; \
+    file.flag = 0; \
+    file.size_read = 0; \
+    file.size_write = 0;
+
+  #define f_macro_file_reset(file) \
+    file.id = 0; \
+    file.flag = f_file_flag_read_only; \
+    file.size_read = f_file_default_read_size; \
+    file.size_write = f_file_default_write_size;
 #endif // _di_f_file_
 
 /**