]> Kevux Git Server - fll/commitdiff
Cleanup: Have enumeration types support "none" and have the "// enum" comment at...
authorKevin Day <thekevinday@gmail.com>
Thu, 5 Oct 2023 03:12:45 +0000 (22:12 -0500)
committerKevin Day <thekevinday@gmail.com>
Thu, 5 Oct 2023 03:12:45 +0000 (22:12 -0500)
This makes the code more consistent with the intended style practices.

level_0/f_file/c/file/common.h
level_0/f_iki/c/iki/common.h
level_0/f_print/c/print/common.h
level_0/f_socket/c/socket/common.h
level_0/f_type/c/type/file.h
level_0/f_utf/c/utf/common.h
level_1/fl_conversion/c/conversion/common.h
level_2/fll_error/c/error/common.h

index cc71a5d5f5e4bf6123e4fdf7595e6c484b62a3a0..186e79fc52b23918daacf9f5f3e81ed917aa9298 100644 (file)
@@ -362,7 +362,7 @@ extern "C" {
  */
 #ifndef _di_f_file_stat_flags_e_
   enum {
-    f_file_stat_flag_none_e      = 0,
+    f_file_stat_flag_none_e      = 0x0,
     f_file_stat_flag_exclusive_e = 0x1,
     f_file_stat_flag_group_e     = 0x2,
     f_file_stat_flag_owner_e     = 0x4,
index f2f5f339cbe19a02cb39f73fdfecb7c084f4a69c..7fd7e9bd6253fea14f7d0356aaa10c46e2394e4a 100644 (file)
@@ -45,7 +45,7 @@ extern "C" {
  */
 #ifndef _di_f_iki_state_flag_e_
   enum {
-    f_iki_state_flag_none_e                  = 0,
+    f_iki_state_flag_none_e                  = 0x0,
     f_iki_state_flag_utf_fail_on_valid_not_e = 0x1,
   }; // enum
 #endif // _di_f_iki_state_flag_e_
index 5cbb668c5d2c7625ca3b2f296ff21716f3e378b3..0feef3bbcd4f46693d02a83a50236f9280772e77 100644 (file)
@@ -322,6 +322,7 @@ extern "C" {
  * Provide type format flags.
  *
  * f_print_format_type_*:
+ *   - none:                                   No type set.
  *   - character:                "c",          Type is a 1-byte unsigned character.
  *   - character_safe:           "C",          Type is a 1-byte unsigned character, where control characters and invalid UTF-8 are replaced.
  *   - color_after:              "]",          Type is a f_color_set_t such that the f_color_set_t.after is used.
@@ -352,7 +353,8 @@ extern "C" {
  */
 #ifndef _di_f_print_format_type_e_
   enum {
-    f_print_format_type_character_e = 1,
+    f_print_format_type_none_e = 0,
+    f_print_format_type_character_e,
     f_print_format_type_character_safe_e,
     f_print_format_type_color_after_e,
     f_print_format_type_color_before_e,
index 345b8ae5076d18eec119789e9a8176d4fabf9345..6221a4a413d554e660c6c1c44b6cd5addb4ecf38 100644 (file)
@@ -129,13 +129,14 @@ extern "C" {
     f_socket_address_family_wanpipe_e     = AF_WANPIPE,
     f_socket_address_family_x25_e         = AF_X25,
     f_socket_address_family_max_e         = AF_MAX,
-  };
+  }; // enum
 #endif // _di_f_socket_address_family_e_
 
 /**
  * Socket Closes.
  *
  * f_socket_close_*:
+ *   - None:       No value set.
  *   - fast:       Fast Socket close, as in close().
  *   - read:       Read close, as in shutdown(, SHUT_RD).
  *   - read_write: Read/Write close, as in shutdown(, SHUT_RDWR).
@@ -143,11 +144,12 @@ extern "C" {
  */
 #ifndef _di_f_socket_close_e_
   enum {
-    f_socket_close_fast_e = 1,
+    f_socket_close_none_e = 0,
+    f_socket_close_fast_e,
     f_socket_close_read_e,
     f_socket_close_write_e,
     f_socket_close_read_write_e,
-  };
+  }; // enum
 #endif // _di_f_socket_close_e_
 
 /**
@@ -183,7 +185,7 @@ extern "C" {
     f_socket_flag_truncate_e      = MSG_TRUNC,
     f_socket_flag_wait_all_e      = MSG_WAITALL,
     f_socket_flag_wait_not_e      = MSG_DONTWAIT,
-  };
+  }; // enum
 #endif // _di_f_socket_flag_e_
 
 /**
@@ -241,7 +243,7 @@ extern "C" {
     f_socket_level_tipc_e      = SOL_TIPC,
     f_socket_level_tls_e       = SOL_TLS,
     f_socket_level_x25_e       = SOL_X25,
-  };
+  }; // enum
 #endif // _di_f_socket_level_e_
 
 /**
@@ -263,7 +265,7 @@ extern "C" {
     f_socket_message_flag_record_end_e       = MSG_EOR,
     f_socket_message_flag_truncate_e         = MSG_TRUNC,
     f_socket_message_flag_truncate_control_e = MSG_CTRUNC,
-  };
+  }; // enum
 #endif // _di_f_socket_message_flag_e_
 
 /**
@@ -399,7 +401,7 @@ extern "C" {
     f_socket_option_type_e                     = SO_TYPE,
     f_socket_option_wifi_status_e              = SO_WIFI_STATUS,
     f_socket_option_zero_copy_e                = SO_ZEROCOPY,
-  };
+  }; // enum
 #endif // _di_f_socket_option_e_
 
 /**
@@ -521,7 +523,7 @@ extern "C" {
     f_socket_protocol_wesp_e            = 141,
     f_socket_protocol_xns_idp_e         = 22,
     f_socket_protocol_xtp_e             = 36,
-  };
+  }; // enum
 #endif // _di_f_socket_protocol_e_
 
 /**
@@ -621,7 +623,7 @@ extern "C" {
     f_socket_protocol_family_wanpipe_e     = PF_WANPIPE,
     f_socket_protocol_family_x25_e         = PF_X25,
     f_socket_protocol_family_max_e         = PF_MAX,
-  };
+  }; // enum
 #endif // _di_f_socket_protocol_family_e_
 
 /**
@@ -645,7 +647,7 @@ extern "C" {
     f_socket_type_nonblocking_e       = SOCK_NONBLOCK,
     f_socket_type_raw_e               = SOCK_RAW,
     f_socket_type_stream_e            = SOCK_STREAM,
-  };
+  }; // enum
 #endif // _di_f_socket_type_e_
 
 #ifdef __cplusplus
index f82c34b0f1486bcb8aec402c89f00b8526e518bf..7c828753821eb4a3abbbb87b186f1a19a3ca4387 100644 (file)
@@ -276,7 +276,7 @@ extern "C" {
     #else
       f_poll_hang_up_read_e = 0x2000,
     #endif // POLLRDHUP
-  };
+  }; // enum
 #endif // _di_f_poll_e_
 
 /**
index 3b1e9a3a9166a2ffaf0c88691e546ad4b909d6bb..3cf696b02db7cc0fa611f6cdfcae0e992293c7fd 100644 (file)
@@ -382,7 +382,7 @@ extern "C" {
  */
 #ifndef _di_f_utf_width_e_
   enum {
-    F_utf_width_none_e,
+    F_utf_width_none_e = 0,
     F_utf_width_ambiguous_e,
     F_utf_width_full_e,
     F_utf_width_half_e,
index 7e8f07804872062527a072c867537973bd4dac9f..ef5390baaa907ed574554bfff37ba9549b775c14 100644 (file)
@@ -94,7 +94,7 @@ extern "C" {
     fl_conversion_data_flag_endian_big_e    = 0x1,
     fl_conversion_data_flag_endian_little_e = 0x2,
     fl_conversion_data_flag_negative_e      = 0x4,
-  };
+  }; // enum
 #endif // _di_fl_conversion_data_flag_e_
 
 #ifdef __cplusplus
index 9471c122b3c545a8e8018b3ff75bc1c1a3b7f43f..add8695ac9f4ada0380834bfe33393b9d8ce996e 100644 (file)
@@ -20,6 +20,7 @@ extern "C" {
  * Error file types.
  *
  * fll_error_file_type_*:
+ *   - none:      No error.
  *   - file:      File error.
  *   - link:      Link error.
  *   - directory: Directory error.
@@ -29,7 +30,8 @@ extern "C" {
  */
 #ifndef _di_fll_error_file_type_e_
   enum {
-    fll_error_file_type_file_e = 1,
+    fll_error_file_type_none_e = 0,
+    fll_error_file_type_file_e,
     fll_error_file_type_link_e,
     fll_error_file_type_directory_e,
     fll_error_file_type_path_e,
@@ -48,7 +50,7 @@ extern "C" {
  */
 #ifndef _di_fll_error_file_flag_e_
   enum {
-    fll_error_file_flag_none_e     = 0,
+    fll_error_file_flag_none_e     = 0x0,
     fll_error_file_flag_fallback_e = 0x1,
     fll_error_file_flag_simple_e   = 0x2,
   }; // enum