Guarantee that we are always dealing with 1-byte values by using int8_t instead of char.
They should be identical, but this prevents a given system from doing something different.
char by default is signed.
*/
#ifndef _di_f_color_control_
typedef struct f_color_control {
- const char *blink;
- const char *bold;
- const char *conceal;
- const char *reverse;
- const char *underline;
+ const int8_t *blink;
+ const int8_t *bold;
+ const int8_t *conceal;
+ const int8_t *reverse;
+ const int8_t *underline;
} f_color_control;
#define f_color_control_names_initialize { "blink", "bold", "conceal", "reverse", "underline" }
*/
#ifndef _di_f_color_standard_io_
typedef struct {
- const char *error;
- const char *message;
- const char *warning;
- const char *strong_error;
- const char *strong_message;
- const char *strong_warning;
+ const int8_t *error;
+ const int8_t *message;
+ const int8_t *warning;
+ const int8_t *strong_error;
+ const int8_t *strong_message;
+ const int8_t *strong_warning;
} f_color_standard_io;
#define f_color_standard_io_names_initialize { "error", "message", "warning", "strong_error", "strong_message", "strong_warning" }
*/
#ifndef _di_f_color_help_
typedef struct {
- const char *alert;
- const char *command;
- const char *comment;
- const char *emphasize;
- const char *standard;
- const char *syntax;
- const char *title;
- const char *topic;
- const char *version;
+ const int8_t *alert;
+ const int8_t *command;
+ const int8_t *comment;
+ const int8_t *emphasize;
+ const int8_t *standard;
+ const int8_t *syntax;
+ const int8_t *title;
+ const int8_t *topic;
+ const int8_t *version;
} f_color_help;
#define f_color_help_names_initialize { "alert", "command", "comment", "emphasize", "standard", "syntax", "title", "topic", "version" }
#ifndef _di_f_color_format_
typedef struct {
- const char *begin;
- const char *end;
- const char *medium;
+ const int8_t *begin;
+ const int8_t *end;
+ const int8_t *medium;
} f_color_format;
#define f_color_format_initialize_linux { "\033[", "m", ";" }
*/
#ifndef _di_f_color_
typedef struct {
- const char *reset;
- const char *bold;
- const char *underline;
- const char *blink;
- const char *reverse;
- const char *conceal;
- const char *black;
- const char *red;
- const char *green;
- const char *yellow;
- const char *blue;
- const char *purple;
- const char *teal;
- const char *white;
- const char *black_bg;
- const char *red_bg;
- const char *green_bg;
- const char *yellow_bg;
- const char *blue_bg;
- const char *purple_bg;
- const char *teal_bg;
- const char *white_bg;
- const char *bright_black;
- const char *bright_red;
- const char *bright_green;
- const char *bright_yellow;
- const char *bright_blue;
- const char *bright_purple;
- const char *bright_teal;
- const char *bright_white;
- const char *bright_black_bg;
- const char *bright_red_bg;
- const char *bright_green_bg;
- const char *bright_yellow_bg;
- const char *bright_blue_bg;
- const char *bright_purple_bg;
- const char *bright_teal_bg;
- const char *bright_white_bg;
+ const int8_t *reset;
+ const int8_t *bold;
+ const int8_t *underline;
+ const int8_t *blink;
+ const int8_t *reverse;
+ const int8_t *conceal;
+ const int8_t *black;
+ const int8_t *red;
+ const int8_t *green;
+ const int8_t *yellow;
+ const int8_t *blue;
+ const int8_t *purple;
+ const int8_t *teal;
+ const int8_t *white;
+ const int8_t *black_bg;
+ const int8_t *red_bg;
+ const int8_t *green_bg;
+ const int8_t *yellow_bg;
+ const int8_t *blue_bg;
+ const int8_t *purple_bg;
+ const int8_t *teal_bg;
+ const int8_t *white_bg;
+ const int8_t *bright_black;
+ const int8_t *bright_red;
+ const int8_t *bright_green;
+ const int8_t *bright_yellow;
+ const int8_t *bright_blue;
+ const int8_t *bright_purple;
+ const int8_t *bright_teal;
+ const int8_t *bright_white;
+ const int8_t *bright_black_bg;
+ const int8_t *bright_red_bg;
+ const int8_t *bright_green_bg;
+ const int8_t *bright_yellow_bg;
+ const int8_t *bright_blue_bg;
+ const int8_t *bright_purple_bg;
+ const int8_t *bright_teal_bg;
+ const int8_t *bright_white_bg;
} f_color;
#define f_color_initialize_linux { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47" }
*/
#ifndef _di_f_console_parameter_
typedef struct {
- const char *symbol_short;
- const char *symbol_long;
- const char *symbol_other;
+ const int8_t *symbol_short;
+ const int8_t *symbol_long;
+ const int8_t *symbol_other;
const uint8_t has_additional;
const uint8_t type;
#endif
#ifndef _di_f_is_decimal_
- f_return_status f_is_decimal(const char character) {
+ f_return_status f_is_decimal(const int8_t character) {
if (character > 0x29 && character < 0x40) {
return f_true;
#endif // _di_f_is_decimal_
#ifndef _di_f_is_hexidecimal_
- f_return_status f_is_hexidecimal(const char character) {
+ f_return_status f_is_hexidecimal(const int8_t character) {
if (character > 0x29 && character < 0x40) {
return f_true;
#endif // _di_f_is_hexidecimal_
#ifndef _di_f_character_to_decimal_
- f_return_status f_character_to_decimal(const char character, unsigned long *decimal) {
+ f_return_status f_character_to_decimal(const int8_t character, unsigned long *decimal) {
#ifndef _di_level_0_parameter_checking_
if (decimal == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_character_to_decimal_
#ifndef _di_f_character_to_hexidecimal_
- f_return_status f_character_to_hexidecimal(const char character, unsigned long *decimal) {
+ f_return_status f_character_to_hexidecimal(const int8_t character, unsigned long *decimal) {
#ifndef _di_level_0_parameter_checking_
if (decimal == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
* f_false if character is not a decimal.
*/
#ifndef _di_f_is_decimal_
- extern f_return_status f_is_decimal(const char character);
+ extern f_return_status f_is_decimal(const int8_t character);
#endif // _di_f_is_decimal_
/**
* f_false if character is not a hexidecimal.
*/
#ifndef _di_f_is_hexidecimal_
- extern f_return_status f_is_hexidecimal(const char character);
+ extern f_return_status f_is_hexidecimal(const int8_t character);
#endif // _di_f_is_hexidecimal_
/**
* f_invalid_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_character_to_decimal_
- extern f_return_status f_character_to_decimal(const char character, unsigned long *decimal);
+ extern f_return_status f_character_to_decimal(const int8_t character, unsigned long *decimal);
#endif // _di_f_character_to_decimal_
/**
* f_invalid_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_character_to_hexidecimal_
- extern f_return_status f_character_to_hexidecimal(const char character, unsigned long *decimal);
+ extern f_return_status f_character_to_hexidecimal(const int8_t character, unsigned long *decimal);
#endif // _di_f_character_to_hexidecimal_
/**
f_file_mode mode;
} f_file;
- #define f_file_initialize { 0, sizeof(char), 0, (f_file_mode) f_file_read_only }
+ #define f_file_initialize { 0, sizeof(int8_t), 0, (f_file_mode) f_file_read_only }
#endif // _di_f_file_
/**
if (new_pointer) {
if (new_pointer != *pointer) {
if (new_length > old_length) {
- // char * is of a data type size of 1, casting it to char should result in a single-length increment.
+ // uint8_t * is of a data type size of 1, casting it to uint8_t should result in a single-length increment.
// this is done to avoid problems with (void *) having arithmetic issues.
- memset(((char *) new_pointer) + (type * old_length), 0, type * (new_length - old_length));
+ memset(((uint8_t *) new_pointer) + (type * old_length), 0, type * (new_length - old_length));
}
*pointer = new_pointer;
if (old_length > 0) {
if (new_length < old_length) {
- // char * is of a data type size of 1, casting it to char should result in a single-length increment.
+ // uint8_t * is of a data type size of 1, casting it to uint8_t should result in a single-length increment.
// this is done to avoid problems with (void *) having arithmetic issues.
- memset(((char *)*pointer) + new_length, 0, type * (old_length - new_length));
+ memset(((uint8_t *)*pointer) + new_length, 0, type * (old_length - new_length));
}
}
if (new_pointer) {
if (new_pointer != *pointer) {
if (new_length > old_length) {
- // char * is of a data type size of 1, casting it to bool should result in a single-length increment.
+ // uint8_t * is of a data type size of 1, casting it to bool should result in a single-length increment.
// this is done to avoid problems with (void *) having arithmetic issues.
- memset(((char *)new_pointer) + (type * old_length), 0, type * (new_length - old_length));
+ memset(((uint8_t *)new_pointer) + (type * old_length), 0, type * (new_length - old_length));
}
*pointer = new_pointer;
* The max size is to be the (max supported size - 1) such that that last number can be used for overflow operations.
*/
#ifndef _di_f_type_sizes_
- #define f_unsigned_char_size (((unsigned char) -1) - 1)
+ #define f_unsigned_char_size (((uint8_t) -1) - 1)
#define f_unsigned_short_size (((unsigned short) -1) - 1)
#define f_unsigned_int_size (((unsigned int) -1) - 1)
#define f_unsigned_long_size (((unsigned long) -1) - 1)
#define f_unsigned_long_long_size (((unsigned long long) -1) - 1)
#define f_unsigned_double_size (((unsigned double) -1) - 1)
#define f_unsigned_long_double_size (((unsigned double) -1) - 1)
- #define f_signed_char_size ((((unsigned char) -1) / 2) - 1)
+ #define f_signed_char_size ((((uint8_t) -1) / 2) - 1)
#define f_signed_short_size ((((unsigned short) -1) / 2) - 1)
#define f_signed_int_size ((((unsigned int) -1) / 2) - 1)
#define f_signed_long_size ((((unsigned long) -1) / 2) - 1)
#ifndef _di_f_utf_is_big_endian_
f_return_status f_utf_is_big_endian() {
uint16_t test_int = (0x01 << 8) | 0x02;
- char test_char[2] = {0x01, 0x02};
+ int8_t test_char[2] = {0x01, 0x02};
if (!memcmp(&test_int, test_char, 2)) {
return f_true;
unsigned short width = f_macro_utf_character_width_is(character);
if (width == 0) {
- char ascii = character >> 24;
+ int8_t ascii = character >> 24;
if (isspace(ascii)) {
return f_true;
unsigned short width = f_macro_utf_character_width_is(character);
if (width == 0) {
- char ascii = character >> 24;
+ int8_t ascii = character >> 24;
if (isspace(ascii)) {
return f_true;
*max_width = width;
if (f_utf_is_big_endian()) {
- memcpy(*character, &utf_character, sizeof(char) * width);
+ memcpy(*character, &utf_character, sizeof(int8_t) * width);
}
else {
uint32_t utf = 0;
utf = (f_macro_utf_character_to_char_4(utf_character) << 24) | (f_macro_utf_character_to_char_3(utf_character) << 16) | (f_macro_utf_character_to_char_2(utf_character) << 8) | f_macro_utf_character_to_char_1(utf_character);
}
- memcpy(*character, &utf, sizeof(char) * width);
+ memcpy(*character, &utf, sizeof(int8_t) * width);
}
return f_none;
#ifndef _di_f_utf_bom_
#define f_utf_bom_length 3
- const static char f_utf_bom[f_utf_bom_length] = { 0xef, 0xbb, 0xbf }; // 1110 1111, 1011 1011, 1011 1111
+ const static int8_t f_utf_bom[f_utf_bom_length] = { 0xef, 0xbb, 0xbf }; // 1110 1111, 1011 1011, 1011 1111
#endif // _di_f_utf_bom_
/**
* This is intended to be used when a single variable is desired to represent a 1-byte, 2-byte, 3-byte, or even 4-byte character.
*
* This "character" type is stored as a big-endian 4-byte integer (32-bits).
- * A helper function, f_utf_is_big_endian(), is provided to detect system endianness so that character arrays (char []) can be correctly processed.
+ * A helper function, f_utf_is_big_endian(), is provided to detect system endianness so that character arrays (int8_t []) can be correctly processed.
*
* The byte structure is intended to be read left to right.
*
*
* The f_macro_utf_character_mask_char_* are used to get a specific UTF-8 block as a single character range.
*
- * The f_macro_utf_character_to_char_* are used to convert a f_utf_character into a char, for a given 8-bit block.
+ * The f_macro_utf_character_to_char_* are used to convert a f_utf_character into a int8_t, for a given 8-bit block.
*
- * The f_macro_utf_character_from_char_* are used to convert a char into part of a f_utf_character, for a given 8-bit block.
+ * The f_macro_utf_character_from_char_* are used to convert a int8_t into part of a f_utf_character, for a given 8-bit block.
*
* The f_macro_utf_character_width is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width.
* The f_macro_utf_character_width_is is used to determine the width of the UTF-8 character based on f_macro_utf_byte_width_is.
#define f_utf_space_separator_line_length 3
#define f_utf_space_separator_paragraph_length 3
- const static char f_utf_space_em[f_utf_space_em_length] = { 0xe2, 0x80, 0x83 };
- const static char f_utf_space_em_quad[f_utf_space_em_quad_length] = { 0xe2, 0x80, 0x81 };
- const static char f_utf_space_em_per_three[f_utf_space_em_per_three_length] = { 0xe2, 0x80, 0x84 };
- const static char f_utf_space_em_per_four[f_utf_space_em_per_four_length] = { 0xe2, 0x80, 0x85 };
- const static char f_utf_space_em_per_six[f_utf_space_em_per_six_length] = { 0xe2, 0x80, 0x86 };
+ const static int8_t f_utf_space_em[f_utf_space_em_length] = { 0xe2, 0x80, 0x83 };
+ const static int8_t f_utf_space_em_quad[f_utf_space_em_quad_length] = { 0xe2, 0x80, 0x81 };
+ const static int8_t f_utf_space_em_per_three[f_utf_space_em_per_three_length] = { 0xe2, 0x80, 0x84 };
+ const static int8_t f_utf_space_em_per_four[f_utf_space_em_per_four_length] = { 0xe2, 0x80, 0x85 };
+ const static int8_t f_utf_space_em_per_six[f_utf_space_em_per_six_length] = { 0xe2, 0x80, 0x86 };
- const static char f_utf_space_en[f_utf_space_en_length] = { 0xe2, 0x80, 0x82 };
- const static char f_utf_space_en_quad[f_utf_space_en_quad_length] = { 0xe2, 0x80, 0x80 };
+ const static int8_t f_utf_space_en[f_utf_space_en_length] = { 0xe2, 0x80, 0x82 };
+ const static int8_t f_utf_space_en_quad[f_utf_space_en_quad_length] = { 0xe2, 0x80, 0x80 };
- const static char f_utf_space_line_feed_reverse[f_utf_space_line_feed_reverse_length] = { 0xc2, 0x8d };
- const static char f_utf_space_line_next[f_utf_space_line_next_length] = { 0xc2, 0x85 };
+ const static int8_t f_utf_space_line_feed_reverse[f_utf_space_line_feed_reverse_length] = { 0xc2, 0x8d };
+ const static int8_t f_utf_space_line_next[f_utf_space_line_next_length] = { 0xc2, 0x85 };
- const static char f_utf_space_medium_mathematical[f_utf_space_medium_mathematical_length] = { 0xe2, 0x81, 0x9f };
+ const static int8_t f_utf_space_medium_mathematical[f_utf_space_medium_mathematical_length] = { 0xe2, 0x81, 0x9f };
- const static char f_utf_space_no_break[f_utf_space_no_break_length] = { 0xc2, 0xa0 };
- const static char f_utf_space_no_break_narrow[f_utf_space_no_break_narrow_length] = { 0xe2, 0x80, 0xaf };
+ const static int8_t f_utf_space_no_break[f_utf_space_no_break_length] = { 0xc2, 0xa0 };
+ const static int8_t f_utf_space_no_break_narrow[f_utf_space_no_break_narrow_length] = { 0xe2, 0x80, 0xaf };
- const static char f_utf_space_ogham[f_utf_space_ogham_length] = { 0xe1, 0x9a, 0x80 };
- const static char f_utf_space_figure[f_utf_space_figure_length] = { 0xe2, 0x80, 0x87 };
- const static char f_utf_space_punctuation[f_utf_space_punctuation_length] = { 0xe2, 0x80, 0x88 };
- const static char f_utf_space_thin[f_utf_space_thin_length] = { 0xe2, 0x80, 0x89 };
- const static char f_utf_space_hair[f_utf_space_hair_length] = { 0xe2, 0x80, 0x8a };
- const static char f_utf_space_ideographic[f_utf_space_ideographic_length] = { 0xe3, 0x80, 0x80 };
+ const static int8_t f_utf_space_ogham[f_utf_space_ogham_length] = { 0xe1, 0x9a, 0x80 };
+ const static int8_t f_utf_space_figure[f_utf_space_figure_length] = { 0xe2, 0x80, 0x87 };
+ const static int8_t f_utf_space_punctuation[f_utf_space_punctuation_length] = { 0xe2, 0x80, 0x88 };
+ const static int8_t f_utf_space_thin[f_utf_space_thin_length] = { 0xe2, 0x80, 0x89 };
+ const static int8_t f_utf_space_hair[f_utf_space_hair_length] = { 0xe2, 0x80, 0x8a };
+ const static int8_t f_utf_space_ideographic[f_utf_space_ideographic_length] = { 0xe3, 0x80, 0x80 };
- const static char f_utf_space_separator_line[f_utf_space_separator_line_length] = { 0xe2, 0x80, 0xa8 };
- const static char f_utf_space_separator_paragraph[f_utf_space_separator_paragraph_length] = { 0xe2, 0x80, 0xa8 };
+ const static int8_t f_utf_space_separator_line[f_utf_space_separator_line_length] = { 0xe2, 0x80, 0xa8 };
+ const static int8_t f_utf_space_separator_paragraph[f_utf_space_separator_paragraph_length] = { 0xe2, 0x80, 0xa8 };
#endif // _di_f_utf_space_
/**
#define f_utf_substitute_open_box_length 3
#define f_utf_substitute_open_box_shouldered_length 3
- const static char f_utf_substitute_symbol_blank[f_utf_substitute_symbol_blank_length] = { 0xe2, 0x90, 0xa2 };
- const static char f_utf_substitute_symbol_space[f_utf_substitute_symbol_space_length] = { 0xe2, 0x90, 0xa0 };
+ const static int8_t f_utf_substitute_symbol_blank[f_utf_substitute_symbol_blank_length] = { 0xe2, 0x90, 0xa2 };
+ const static int8_t f_utf_substitute_symbol_space[f_utf_substitute_symbol_space_length] = { 0xe2, 0x90, 0xa0 };
- const static char f_utf_substitute_middle_dot[f_utf_substitute_middle_dot_length] = { 0xc2, 0xb7 };
+ const static int8_t f_utf_substitute_middle_dot[f_utf_substitute_middle_dot_length] = { 0xc2, 0xb7 };
- const static char f_utf_substitute_open_box[f_utf_substitute_open_box_length] = { 0xe2, 0x90, 0xa3 };
- const static char f_utf_substitute_open_box_shouldered[f_utf_substitute_open_box_shouldered_length] = { 0xe2, 0x8d, 0xbd };
+ const static int8_t f_utf_substitute_open_box[f_utf_substitute_open_box_length] = { 0xe2, 0x90, 0xa3 };
+ const static int8_t f_utf_substitute_open_box_shouldered[f_utf_substitute_open_box_shouldered_length] = { 0xe2, 0x8d, 0xbd };
#endif // _di_f_utf_substitute_
/**
#endif // _di_f_utf_char_to_character_
/**
- * Convert a specialized f_utf_character type to a char, stored as a string (character buffer).
+ * Convert a specialized f_utf_character type to a int8_t, stored as a string (character buffer).
*
* This will also convert ASCII characters stored in the utf_character array.
*
* @param utf_character
* The UTF-8 characterr to convert from.
* @param character
- * A char representation of the UTF-8 character, stored as a string of width bytes.
+ * A int8_t representation of the UTF-8 character, stored as a string of width bytes.
* If max_width is 0, then this should not be allocated (set the pointer address to 0).
* @param max_width
* The number of bytes the generated character represents.
#endif
#ifndef _di_fl_color_set_
- f_return_status fl_color_set(FILE *file, const f_color_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5) {
+ f_return_status fl_color_set(FILE *file, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) {
#ifndef _di_level_1_parameter_checking_
if (file == 0) return f_status_set_error(f_invalid_parameter);
if (color1 == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_color_set_
#ifndef _di_fl_color_save_
- f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5) {
+ f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) {
#ifndef _di_level_1_parameter_checking_
if (buffer == 0) return f_status_set_error(f_invalid_parameter);
if (color1 == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_color_save_
#ifndef _di_fl_color_print_
- f_return_status fl_color_print(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const char *string, ...) {
+ f_return_status fl_color_print(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...) {
#ifndef _di_level_1_parameter_checking_
if (file == 0) return f_status_set_error(f_invalid_parameter);
if (string == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_color_print_
#ifndef _di_fl_color_print_line_
- f_return_status fl_color_print_line(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const char *string, ...) {
+ f_return_status fl_color_print_line(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...) {
#ifndef _di_level_1_parameter_checking_
if (file == 0) return f_status_set_error(f_invalid_parameter);
if (string == 0) return f_status_set_error(f_invalid_parameter);
// switch to the appropriate terminal color mode
{
- char *environment = getenv("TERM");
+ int8_t *environment = getenv("TERM");
if (!environment || strncmp(environment, "linux", 6) == 0) {
context->color_list = f_color_linux;
* f_invalid_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_color_set_
- extern f_return_status fl_color_set(FILE *file, const f_color_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5);
+ extern f_return_status fl_color_set(FILE *file, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5);
#define fl_macro_color_set_1(file, format, color1) fl_color_set(file, format, color1, 0, 0, 0, 0)
#define fl_macro_color_set_2(file, format, color1, color2) fl_color_set(file, format, color1, color2, 0, 0, 0)
* f_reallocation_error (with error bit) on memory reallocation error.
*/
#ifndef _di_fl_color_save_
- extern f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const char *color1, const char *color2, const char *color3, const char *color4, const char *color5);
+ extern f_return_status fl_color_save(f_string_dynamic *buffer, const f_color_format format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5);
#define fl_macro_color_save_1(buffer, format, color1) fl_color_save(buffer, format, color1, 0, 0, 0, 0)
#define fl_macro_color_save_2(buffer, format, color1, color2) fl_color_save(buffer, format, color1, color2, 0, 0, 0)
* f_output_error (with error bit) on output error.
*/
#ifndef _di_fl_color_print_
- extern f_return_status fl_color_print(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const char *string, ...);
+ extern f_return_status fl_color_print(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...);
#endif // _di_fl_color_print_
/**
* f_output_error (with error bit) on output error.
*/
#ifndef _di_fl_color_print_line_
- extern f_return_status fl_color_print_line(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const char *string, ...);
+ extern f_return_status fl_color_print_line(FILE *file, const f_string_dynamic start_color, const f_string_dynamic end_color, const int8_t *string, ...);
#endif // _di_fl_color_print_line_
/**
return status;
}
- memcpy(names->array[names->used].string, listing[counter]->d_name, sizeof(char) * size);
+ memcpy(names->array[names->used].string, listing[counter]->d_name, sizeof(int8_t) * size);
names->array[names->used].used = size;
names->used++;
}
* The number of steps to decrement the start position.
* The steps refer to characters and not integers.
* Essentially this number is considered against the width of every character found.
- * (For ASCII each step would be (sizeof(char)).
- * (For UTF-8 character of width 3, each step would be (3 * sizeof(char)).
+ * (For ASCII each step would be (sizeof(int8_t)).
+ * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)).
*
* @return
* f_none on success.
* The number of steps to increment the start position.
* The steps refer to characters and not integers.
* Essentially this number is considered against the width of every character found.
- * (For ASCII each step would be (sizeof(char)).
- * (For UTF-8 character of width 3, each step would be (3 * sizeof(char)).
+ * (For ASCII each step would be (sizeof(int8_t)).
+ * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)).
*
* @return
* f_none on success.
}
// handle quote support
- char quoted = f_string_eos;
+ int8_t quoted = f_string_eos;
// identify where the object begins
if (buffer->string[input->start] == f_fss_delimit_slash) {
}
// handle quote support
- char quoted = f_string_eos;
+ int8_t quoted = f_string_eos;
// identify where the object begins
if (buffer->string[input->start] == f_fss_delimit_slash) {
}
f_bool has_delimit = f_false;
- char quoted = f_string_eos;
+ int8_t quoted = f_string_eos;
f_bool continue_main_loop = f_false;
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
- char quoted = f_string_eos;
+ int8_t quoted = f_string_eos;
f_string_location buffer_position = f_string_location_initialize;
f_string_length start_position = 0;
}
if (serialized->used == 0) {
- memcpy(serialized->string + serialized->used, value.string, sizeof(char) * value.used);
+ memcpy(serialized->string + serialized->used, value.string, sizeof(int8_t) * value.used);
serialized->used += value.used;
}
else {
- memcpy(serialized->string + serialized->used, f_serialized_simple_splitter_string, sizeof(char));
- memcpy(serialized->string + serialized->used + 1, value.string, sizeof(char) * value.used);
+ memcpy(serialized->string + serialized->used, f_serialized_simple_splitter_string, sizeof(int8_t));
+ memcpy(serialized->string + serialized->used + 1, value.string, sizeof(int8_t) * value.used);
serialized->used += value.used + 1;
}
return status;
}
- memcpy(result->string, buffer.string + location.start, sizeof(char) * size);
+ memcpy(result->string, buffer.string + location.start, sizeof(int8_t) * size);
result->used = size;
return f_none;
#endif // _di_fl_string_rip_
#ifndef _di_fl_string_seek_line_until_graph_
- f_return_status fl_string_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const char placeholder) {
+ f_return_status fl_string_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_string_seek_line_until_graph_
#ifndef _di_fl_string_seek_line_until_non_graph_
- f_return_status fl_string_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const char placeholder) {
+ f_return_status fl_string_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_string_seek_line_until_non_graph_
#ifndef _di_fl_string_seek_line_to_
- f_return_status fl_string_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const char seek_to_this) {
+ f_return_status fl_string_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_string_seek_line_to_utf_character_
#ifndef _di_fl_string_seek_to_
- f_return_status fl_string_seek_to(const f_string_dynamic buffer, f_string_location *location, const char seek_to_this) {
+ f_return_status fl_string_seek_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
* f_reallocation_error (with error bit) on memory reallocation error.
*/
#ifndef _di_fl_string_seek_line_until_graph_
- extern f_return_status fl_string_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const char placeholder);
+ extern f_return_status fl_string_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder);
#endif // _di_fl_string_seek_line_until_graph_
/**
* f_reallocation_error (with error bit) on memory reallocation error.
*/
#ifndef _di_fl_string_seek_line_until_non_graph_
- extern f_return_status fl_string_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const char placeholder);
+ extern f_return_status fl_string_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder);
#endif // _di_fl_string_seek_line_until_non_graph_
/**
* @see fl_string_seek_line_to_utf_character()
*/
#ifndef _di_fl_string_seek_line_to_
- extern f_return_status fl_string_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const char seek_to_this);
+ extern f_return_status fl_string_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this);
#endif // _di_fl_string_seek_line_to_
/**
* @see fl_string_seek_to_utf_character()
*/
#ifndef _di_fl_string_seek_to_
- extern f_return_status fl_string_seek_to(const f_string_dynamic buffer, f_string_location *location, const char seek_to_this);
+ extern f_return_status fl_string_seek_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this);
#endif // _di_fl_string_seek_to_
/**
#endif // _di_fl_utf_seek_line_to_
#ifndef _di_fl_utf_seek_line_to_char_
- f_return_status fl_utf_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const char seek_to_this) {
+ f_return_status fl_utf_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_fl_utf_string_seek_to_
#ifndef _di_fl_utf_string_seek_to_char_
- f_return_status fl_utf_string_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const char seek_to_this) {
+ f_return_status fl_utf_string_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (location == 0) return f_status_set_error(f_invalid_parameter);
if (location->start < 0) return f_status_set_error(f_invalid_parameter);
* @see fl_utf_seek_line_to()
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
- extern f_return_status fl_utf_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const char seek_to_this);
+ extern f_return_status fl_utf_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this);
#endif // _di_fl_utf_string_seek_line_to_char_
/**
* @see fl_utf_string_seek_to()
*/
#ifndef _di_fl_utf_string_seek_to_character_
- extern f_return_status fl_utf_string_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const char seek_to_this);
+ extern f_return_status fl_utf_string_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this);
#endif // _di_fl_utf_string_seek_to_character_
/**
return status;
}
- memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(char) * arguments.array[i].used);
+ memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(int8_t) * arguments.array[i].used);
fixed_arguments[i + 1][arguments.array[i].used] = f_string_eos;
} // for
return status;
}
- memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(char) * arguments.array[i].used);
+ memcpy(fixed_arguments[i + 1], arguments.array[i].string, sizeof(int8_t) * arguments.array[i].used);
fixed_arguments[i + 1][arguments.array[i].used] = f_string_eos;
} // for
}
}
else if (data.mode == byte_dump_mode_binary) {
- char binary_string[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ int8_t binary_string[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
binary_string[0] = ((byte >> 7) & 0x01) ? '1' : '0';
binary_string[1] = ((byte >> 6) & 0x01) ? '1' : '0';
return status;
}
- memcpy((void *)file_path.string, network_path, sizeof(char) * network_path_length);
- memcpy((void *)(file_path.string + network_path_length), data->devices.array[i].string, sizeof(char) * data->devices.array[i].used);
- memcpy((void *)(file_path.string + network_path_length + data->devices.array[i].used), firewall_file_suffix, sizeof(char) * firewall_file_suffix_length);
+ memcpy((void *)file_path.string, network_path, sizeof(int8_t) * network_path_length);
+ memcpy((void *)(file_path.string + network_path_length), data->devices.array[i].string, sizeof(int8_t) * data->devices.array[i].used);
+ memcpy((void *)(file_path.string + network_path_length + data->devices.array[i].used), firewall_file_suffix, sizeof(int8_t) * firewall_file_suffix_length);
file_path.used = network_path_length + data->devices.array[i].used + firewall_file_suffix_length;
file_path.string[file_path.used] = 0;
f_macro_fss_contents_delete(status, contents);
#define firewall_macro_concat_string(destination, source, length) \
- memcpy((void *)(destination), source, sizeof(char) * length);
+ memcpy((void *)(destination), source, sizeof(int8_t) * length);
#define firewall_macro_rule_contents_has_incorrect_items(index, total_items) \
local.rule_contents.array[index].used <= 0 || local.rule_contents.array[index].used > total_items