]> Kevux Git Server - fll/commitdiff
Update: IKI Write from main/data.callback to main/data.call.
authorKevin Day <Kevin@kevux.org>
Wed, 19 Feb 2025 00:52:11 +0000 (18:52 -0600)
committerKevin Day <Kevin@kevux.org>
Wed, 19 Feb 2025 00:52:11 +0000 (18:52 -0600)
Rename `callback` to `call` to e consistent with recent naming changes.

level_3/iki_write/c/eki/main.c
level_3/iki_write/c/eki/print.c
level_3/iki_write/c/eki/print.h
level_3/iki_write/c/eki/process.c
level_3/iki_write/c/eki/process.h
level_3/iki_write/c/iki/main.c
level_3/iki_write/c/iki/print.c
level_3/iki_write/c/iki/print.h
level_3/iki_write/c/iki/process.c
level_3/iki_write/c/iki/process.h
level_3/iki_write/c/main/common/type.h

index f410530d319f64c5bf38a9a296e8036b185df45b..a0d10a0babd5ee6b7c65ef90528219fcbbe65016 100644 (file)
@@ -16,9 +16,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.program.output.custom = (void *) &data;
   data.program.warning.custom = (void *) &data;
 
-  data.callback.load_objects_content_pipe = &iki_write_eki_load_objects_content_pipe;
-  data.callback.print_help = &iki_write_eki_print_message_help;
-  data.callback.process_objects_content = &iki_write_eki_process_objects_content;
+  data.call.load_objects_content_pipe = &iki_write_eki_load_objects_content_pipe;
+  data.call.print_help = &iki_write_eki_print_message_help;
+  data.call.process_objects_content = &iki_write_eki_process_objects_content;
 
   f_console_parameter_t parameters[] = iki_write_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
index a770b93cbe31d7e19edec26a9f9344e7991a7896..3efbbc0dc2a01d59256949fcf5df092e1137e47c 100644 (file)
@@ -46,9 +46,9 @@ extern "C" {
 #endif // _di_iki_write_eki_print_error_objects_not_valid_
 
 #ifndef _di_iki_write_eki_print_message_help_
-  void iki_write_eki_print_message_help(fl_print_t * const print) {
+  f_status_t iki_write_eki_print_message_help(fl_print_t * const print) {
 
-    if (!print) return;
+    if (!print) return F_status_set_error(F_output_not);
 
     f_file_stream_lock(print->to);
 
@@ -66,6 +66,8 @@ extern "C" {
 
     f_file_stream_flush(print->to);
     f_file_stream_unlock(print->to);
+
+    return F_okay;
   }
 #endif // _di_iki_write_eki_print_message_help_
 
index 69824e94e5ad2358cfda95222eeb18d862e843f8..36d340de58cb229085c2cd068c7524efe885e3f3 100644 (file)
@@ -57,9 +57,15 @@ extern "C" {
  *   The output structure to print to.
  *
  *   This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_iki_write_eki_print_message_help_
-  extern void iki_write_eki_print_message_help(fl_print_t * const print);
+  extern f_status_t iki_write_eki_print_message_help(fl_print_t * const print);
 #endif // _di_iki_write_eki_print_message_help_
 
 /**
index 6cd7d8b344f6095ac1e75544dadc623fa36b437c..d55fb0d663ea984c5e527ecf1a920c5b7aacef31 100644 (file)
@@ -5,13 +5,11 @@ extern "C" {
 #endif
 
 #ifndef _di_iki_write_eki_load_objects_content_pipe_
-  void iki_write_eki_load_objects_content_pipe(void * const void_main, const f_range_t range, uint8_t * const pipe_state) {
+  void iki_write_eki_load_objects_content_pipe(iki_write_main_t * const main, const f_range_t range, uint8_t * const pipe_state) {
 
-    if (!void_main) return;
+    if (!main) return;
 
-    iki_write_main_t * const main = (iki_write_main_t *) void_main;
-
-    if (!pipe_state || !main->callback.process_objects_content) {
+    if (!pipe_state || !main->call.process_objects_content) {
       main->setting.state.status = F_status_set_error(F_parameter);
 
       iki_write_print_error(&main->program.error, macro_iki_write_f(iki_write_callback_load_objects_content_pipe));
@@ -30,7 +28,7 @@ extern "C" {
         }
       }
 
-      main->callback.process_objects_content((void *) main, main->cache.objects, main->cache.content);
+      main->call.process_objects_content((void *) main, main->cache.objects, main->cache.content);
       if (F_status_is_error(main->setting.state.status)) return;
 
       fll_print_dynamic_raw(f_string_eol_s, main->program.output.to);
@@ -117,11 +115,9 @@ extern "C" {
 #endif // _di_iki_write_eki_load_objects_content_pipe_
 
 #ifndef _di_iki_write_eki_process_objects_content_
-  void iki_write_eki_process_objects_content(void * const void_main, const f_string_statics_t objects, const f_string_static_t content) {
-
-    if (!void_main) return;
+  void iki_write_eki_process_objects_content(iki_write_main_t * const main, const f_string_statics_t objects, const f_string_static_t content) {
 
-    iki_write_main_t * const main = (iki_write_main_t *) void_main;
+    if (!main) return;
 
     {
       f_number_unsigned_t i = 0;
index 1fc7e2a0685efa81cc8c1a3c2ea0b04c7d17287e..af4411818b9b26eb42ea8b3e08ce67d38fa8116a 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
  * @see f_iki_write()
  */
 #ifndef _di_iki_write_eki_load_objects_content_pipe_
-  extern void iki_write_eki_load_objects_content_pipe(void * const main, const f_range_t range, uint8_t * const pipe_state);
+  extern void iki_write_eki_load_objects_content_pipe(iki_write_main_t * const main, const f_range_t range, uint8_t * const pipe_state);
 #endif // _di_iki_write_eki_load_objects_content_pipe_
 
 /**
@@ -72,7 +72,7 @@ extern "C" {
  * @see f_iki_eki_write()
  */
 #ifndef _di_iki_write_eki_process_objects_content_
-  extern void iki_write_eki_process_objects_content(void * const main, const f_string_statics_t objects, const f_string_static_t content);
+  extern void iki_write_eki_process_objects_content(iki_write_main_t * const main, const f_string_statics_t objects, const f_string_static_t content);
 #endif // _di_iki_write_eki_process_objects_content_
 
 #ifdef __cplusplus
index a0686051798ef77a9a644be90e7439e0e927526d..257301482f150eae37c3082321810184da59fff5 100644 (file)
@@ -16,9 +16,9 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
   data.program.output.custom = (void *) &data;
   data.program.warning.custom = (void *) &data;
 
-  data.callback.load_objects_content_pipe = &iki_write_iki_load_objects_content_pipe;
-  data.callback.print_help = &iki_write_iki_print_message_help;
-  data.callback.process_objects_content = &iki_write_iki_process_objects_content;
+  data.call.load_objects_content_pipe = &iki_write_iki_load_objects_content_pipe;
+  data.call.print_help = &iki_write_iki_print_message_help;
+  data.call.process_objects_content = &iki_write_iki_process_objects_content;
 
   f_console_parameter_t parameters[] = iki_write_console_parameter_t_initialize;
   data.program.parameters.array = parameters;
index 1c2d78c26eb4c1df205347e2c1956b40315da7b5..697abedb1a5861576aacf844299b33ba14f1b9db 100644 (file)
@@ -23,9 +23,9 @@ extern "C" {
 #endif // _di_iki_write_iki_print_error_object_not_valid_
 
 #ifndef _di_iki_write_iki_print_message_help_
-  void iki_write_iki_print_message_help(fl_print_t * const print) {
+  f_status_t iki_write_iki_print_message_help(fl_print_t * const print) {
 
-    if (!print) return;
+    if (!print) return F_status_set_error(F_output_not);
 
     f_file_stream_lock(print->to);
 
@@ -43,6 +43,8 @@ extern "C" {
 
     f_file_stream_flush(print->to);
     f_file_stream_unlock(print->to);
+
+    return F_okay;
   }
 #endif // _di_iki_write_iki_print_message_help_
 
index a75e0b6ba8dece381fb6e2fc9ee5da1f41aa02aa..b167eb3f6d2a90ac145ab8c5d28b138e22c95cd4 100644 (file)
@@ -39,9 +39,15 @@ extern "C" {
  *   The output structure to print to.
  *
  *   This does not alter print.custom.setting.state.status.
+ *
+ * @return
+ *   F_okay on success.
+ *   F_output_not on success, but no printing is performed.
+ *
+ *   F_output_not (with error bit) if setting is NULL.
  */
 #ifndef _di_iki_write_iki_print_message_help_
-  extern void iki_write_iki_print_message_help(fl_print_t * const print);
+  extern f_status_t iki_write_iki_print_message_help(fl_print_t * const print);
 #endif // _di_iki_write_iki_print_message_help_
 
 /**
index 28a480d632f4c3efd1d5d01c63d4bbd18c9cbe43..ea8efaedbaadde7574b942515887b47d6f55020c 100644 (file)
@@ -5,13 +5,11 @@ extern "C" {
 #endif
 
 #ifndef _di_iki_write_iki_load_objects_content_pipe_
-  void iki_write_iki_load_objects_content_pipe(void * const void_main, const f_range_t range, uint8_t * const pipe_state) {
+  void iki_write_iki_load_objects_content_pipe(iki_write_main_t * const main, const f_range_t range, uint8_t * const pipe_state) {
 
-    if (!void_main) return;
+    if (!main) return;
 
-    iki_write_main_t * const main = (iki_write_main_t *) void_main;
-
-    if (!pipe_state || !main->callback.process_objects_content) {
+    if (!pipe_state || !main->call.process_objects_content) {
       main->setting.state.status = F_status_set_error(F_parameter);
 
       iki_write_print_error(&main->program.error, macro_iki_write_f(iki_write_callback_load_objects_content_pipe));
@@ -32,7 +30,7 @@ extern "C" {
         }
       }
 
-      main->callback.process_objects_content((void *) main, main->cache.objects, main->cache.content);
+      main->call.process_objects_content((void *) main, main->cache.objects, main->cache.content);
       if (F_status_is_error(main->setting.state.status)) return;
 
       fll_print_dynamic_raw(f_string_eol_s, main->program.output.to);
@@ -68,11 +66,9 @@ extern "C" {
 #endif // _di_iki_write_iki_load_objects_content_pipe_
 
 #ifndef _di_iki_write_iki_process_objects_content_
-  void iki_write_iki_process_objects_content(void * const void_main, const f_string_statics_t objects, const f_string_static_t content) {
-
-    if (!void_main) return;
+  void iki_write_iki_process_objects_content(iki_write_main_t * const main, const f_string_statics_t objects, const f_string_static_t content) {
 
-    iki_write_main_t * const main = (iki_write_main_t *) void_main;
+    if (!main) return;
 
     // Only the first index is used because IKI only supports one Object (Vocabulary).
     if (!objects.used || !objects.array[0].used) {
index adba6eca6ada26db1c0c76cbecbe1975b2f21b86..4de4838c4a3618f545d372e01b74ec39db3c5283 100644 (file)
@@ -44,7 +44,7 @@ extern "C" {
  * @see f_iki_write()
  */
 #ifndef _di_iki_write_iki_load_objects_content_pipe_
-  extern void iki_write_iki_load_objects_content_pipe(void * const main, const f_range_t range, uint8_t * const pipe_state);
+  extern void iki_write_iki_load_objects_content_pipe(iki_write_main_t * const main, const f_range_t range, uint8_t * const pipe_state);
 #endif // _di_iki_write_iki_load_objects_content_pipe_
 
 /**
@@ -71,7 +71,7 @@ extern "C" {
  * @see f_iki_write()
  */
 #ifndef _di_iki_write_iki_process_objects_content_
-  extern void iki_write_iki_process_objects_content(void * const main, const f_string_statics_t objects, const f_string_static_t content);
+  extern void iki_write_iki_process_objects_content(iki_write_main_t * const main, const f_string_statics_t objects, const f_string_static_t content);
 #endif // _di_iki_write_iki_process_objects_content_
 
 #ifdef __cplusplus
index 3f2f123cb6d1fe658bdfbee499c52b33a04c3ad9..39b504ac09114d4307e5cb771c96dc43b36c87c0 100644 (file)
@@ -61,8 +61,8 @@ extern "C" {
  */
 #ifndef _di_iki_write_call_t_
   typedef void (*iki_write_settings_load_call_t)(const f_console_arguments_t arguments, iki_write_main_t * const main);
-  typedef void (*iki_write_load_objects_content_pipe_call_t)(void * const main, const f_range_t range, uint8_t * const pipe_state);
-  typedef void (*iki_write_process_objects_content_call_t)(void * const main, const f_string_statics_t objects, const f_string_static_t content);
+  typedef void (*iki_write_load_objects_content_pipe_call_t)(iki_write_main_t * const main, const f_range_t range, uint8_t * const pipe_state);
+  typedef void (*iki_write_process_objects_content_call_t)(iki_write_main_t * const main, const f_string_statics_t objects, const f_string_static_t content);
 
   typedef struct {
     iki_write_load_objects_content_pipe_call_t load_objects_content_pipe;