The max size for what is now called F_status_size_max_with_bits_d is (2^16)-1 and not 2^16.
/**
* Status masks.
+ *
+ * The f_status_t is required to be exactly 16 bits, the first two high order bits represent error and warning respectively.
+ *
+ * The F_status_set_fine() is provided to remove the error, warning, and signal bits.
+ *
+ * F_status_size_*:
+ * - max: Maximum valid number representing a status code (without the error, signal, or warning bits).
+ * - max_with_bits: Maximum valid number representing a status code including the error, signal, or warning bits.
*/
#ifndef _di_f_status_masks_
-
- // f_status_t is required to be exactly 16 bits, the first two high order bits represent error and warning respectively.
#define F_status_bit_error 0x8000 // 1000 0000 0000 0000
#define F_status_bit_signal 0xc000 // 1100 0000 0000 0000
#define F_status_bit_warning 0x4000 // 0100 0000 0000 0000
- #define F_status_mask_fine 0x3fff // 0011 1111 1111 1111
- #define F_status_mask_code 0xc000 // 1100 0000 0000 0000
+ #define F_status_mask_fine 0x3fff // 0011 1111 1111 1111
+ #define F_status_mask_code 0xc000 // 1100 0000 0000 0000
#define F_status_is_error(status) (status & F_status_bit_error)
#define F_status_is_fine(status) ((status & F_status_mask_code) == 0)
#define F_status_set_error(status) (status | F_status_bit_error)
#define F_status_set_signal(status) (status | F_status_bit_signal)
#define F_status_set_warning(status) (status | F_status_bit_warning)
+ #define F_status_set_fine(status) (status & F_status_mask_fine)
- // Use F_status_set_fine to remove the error, warning, and signal bits.
- #define F_status_set_fine(status) (status & F_status_mask_fine)
-
- // Maximum size of the status code.
- #define F_status_size_max 0x3fff
- #define F_status_size_max_with_signal 0x10000
+ #define F_status_size_max_d 0x3fff
+ #define F_status_size_max_with_bits_d 0xffff
#endif // _di_f_status_masks_
/**
F_space_not,
F_start,
F_start_not,
+ F_status,
+ F_status_not,
F_stop,
F_stop_not,
F_stream,
const f_string_static_t f_status_space_not_s = macro_f_string_static_t_initialize(F_status_space_not_s, 0, F_status_space_not_s_length);
const f_string_static_t f_status_start_s = macro_f_string_static_t_initialize(F_status_start_s, 0, F_status_start_s_length);
const f_string_static_t f_status_start_not_s = macro_f_string_static_t_initialize(F_status_start_not_s, 0, F_status_start_not_s_length);
+ const f_string_static_t f_status_status_s = macro_f_string_static_t_initialize(F_status_status_s, 0, F_status_status_s_length);
+ const f_string_static_t f_status_status_not_s = macro_f_string_static_t_initialize(F_status_status_not_s, 0, F_status_status_not_s_length);
const f_string_static_t f_status_stop_s = macro_f_string_static_t_initialize(F_status_stop_s, 0, F_status_stop_s_length);
const f_string_static_t f_status_stop_not_s = macro_f_string_static_t_initialize(F_status_stop_not_s, 0, F_status_stop_not_s_length);
const f_string_static_t f_status_stream_s = macro_f_string_static_t_initialize(F_status_stream_s, 0, F_status_stream_s_length);
*name = f_status_start_not_s;
break;
+ case F_status:
+ *name = f_status_status_s;
+ break;
+
+ case F_status_not:
+ *name = f_status_status_not_s;
+ break;
+
case F_stop:
*name = f_status_stop_s;
break;
#define F_status_space_not_s "F_space_not"
#define F_status_start_s "F_start"
#define F_status_start_not_s "F_start_not"
+ #define F_status_status_s "F_status"
+ #define F_status_status_not_s "F_status_not"
#define F_status_stop_s "F_stop"
#define F_status_stop_not_s "F_stop_not"
#define F_status_stream_s "F_stream"
#define F_status_space_not_s_length 11
#define F_status_start_s_length 7
#define F_status_start_not_s_length 11
+ #define F_status_status_s_length 8
+ #define F_status_status_not_s_length 12
#define F_status_stop_s_length 6
#define F_status_stop_not_s_length 10
#define F_status_stream_s_length 8
extern const f_string_static_t f_status_space_not_s;
extern const f_string_static_t f_status_start_s;
extern const f_string_static_t f_status_start_not_s;
+ extern const f_string_static_t f_status_status_s;
+ extern const f_string_static_t f_status_status_not_s;
extern const f_string_static_t f_status_stop_s;
extern const f_string_static_t f_status_stop_not_s;
extern const f_string_static_t f_status_stream_s;
return F_none;
}
+ if (fl_string_dynamic_compare(name, f_status_status_s) == F_equal_to) {
+ *code = F_status;
+
+ return F_none;
+ }
+
+ if (fl_string_dynamic_compare(name, f_status_status_not_s) == F_equal_to) {
+ *code = F_status_not;
+
+ return F_none;
+ }
+
if (fl_string_dynamic_compare(name, f_status_stop_s) == F_equal_to) {
*code = F_stop;
f_status_t status = fl_conversion_dynamic_to_number_unsigned(value, number);
- if (*number > F_status_size_max_with_signal) {
+ if (*number > F_status_size_max_with_bits_d) {
fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
return status;
f_status_t status = fl_conversion_dynamic_to_number_unsigned(value, number);
- if (*number > F_status_size_max_with_signal) {
+ if (*number > F_status_size_max_with_bits_d) {
fl_print_format("%[out of range%]%r", main->output.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s);
return status;