Operations against unsigned are generally safer than the signed equivalents.
Using the generic 'char' may be different between compilers and expecations cannot be guaranteed.
This could result in obscure security issues.
Changing this to 'unsigned char' guarantees consistent behavior.
There are problems with some standard libc functions that expect char.
Explicitly cast to 'char' in these cases.
// Must be set to 0 to avoid problems due to the design of getpwuid()/getpwuid_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
const int result = getpwuid_r(id, &password, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getpwuid_r(id, &password, buffer, length, &pointer);
// Must be set to 0 to avoid problems due to the design of getpwnam()/getpwnam_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
// Must be set to 0 to avoid problems due to the design of getgrnam()/getgrnam_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
int result = getgrnam_r(name.string, &group_data, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getgrnam_r(name.string, &group_data, buffer, length, &pointer);
// Must be set to 0 to avoid problems due to the design of getpwuid()/getpwuid_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
const int result = getgrgid_r(id, &group_data, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getgrgid_r(id, &group_data, buffer, length, &pointer);
// Must be set to 0 to avoid problems due to the design of getpwnam()/getpwnam_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getpwnam_r(name.string, &password, buffer, length, &pointer);
// Must be set to 0 to avoid problems due to the design of getpwuid()/getpwuid_r().
errno = 0;
- char buffer[length];
+ unsigned char buffer[length];
const int result = getpwuid_r(id, &password, buffer, length, &pointer);
if (result) {
length = F_account_pwd_length_fallback_second_d;
- char buffer[F_account_pwd_length_fallback_second_d];
+ unsigned char buffer[F_account_pwd_length_fallback_second_d];
const int result = getpwuid_r(id, &password, buffer, length, &pointer);
if (!name) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- char *result = cap_to_name(code);
+ unsigned char *result = cap_to_name(code);
if (result) {
const f_array_length_t length = strlen(result);
ssize_t length = 0;
- char *result = cap_to_text(capability, &length);
+ unsigned char *result = cap_to_text(capability, &length);
if (result) {
if (text->used + length + 1 > text->size) {
// Switch to the appropriate terminal color mode.
{
- char *environment = getenv(f_color_terminal_name_s.string);
+ unsigned char *environment = getenv(f_color_terminal_name_s.string);
if (!environment || strncmp(environment, f_color_terminal_value_linux_s.string, f_color_terminal_value_linux_s.used) == 0) {
macro_f_color_t_set_linux(context->list);
* - xterminal: X-Terminal color code set.
*/
#ifndef _di_f_color_code_t_
- typedef char f_color_code_t;
+ typedef unsigned char f_color_code_t;
#define F_color_code_none_d 0
#define F_color_code_linux_d 1
*/
#ifndef _di_f_console_parameter_t_
typedef struct {
- const char *symbol_short;
- const char *symbol_long;
- const char *symbol_other;
+ const unsigned char *symbol_short;
+ const unsigned char *symbol_long;
+ const unsigned char *symbol_other;
const uint8_t values_total;
const uint8_t type;
#endif
#ifndef _di_f_conversion_character_is_binary_
- f_status_t f_conversion_character_is_binary(const char character) {
+ f_status_t f_conversion_character_is_binary(const unsigned char character) {
if (character == 0x30 || character == 0x31) {
return F_true;
#endif // _di_f_conversion_character_is_binary_
#ifndef _di_f_conversion_character_is_decimal_
- f_status_t f_conversion_character_is_decimal(const char character) {
+ f_status_t f_conversion_character_is_decimal(const unsigned char character) {
if (character > 0x2f && character < 0x3a) {
return F_true;
#endif // _di_f_conversion_character_is_decimal_
#ifndef _di_f_conversion_character_is_duodecimal_
- f_status_t f_conversion_character_is_duodecimal(const char character) {
+ f_status_t f_conversion_character_is_duodecimal(const unsigned char character) {
if (character > 0x2f && character < 0x3a) {
return F_true;
#endif // _di_f_conversion_character_is_duodecimal_
#ifndef _di_f_conversion_character_is_hexidecimal_
- f_status_t f_conversion_character_is_hexidecimal(const char character) {
+ f_status_t f_conversion_character_is_hexidecimal(const unsigned char character) {
if (character > 0x2f && character < 0x3a) {
return F_true;
#endif // _di_f_conversion_character_is_hexidecimal_
#ifndef _di_f_conversion_character_is_octal_
- f_status_t f_conversion_character_is_octal(const char character) {
+ f_status_t f_conversion_character_is_octal(const unsigned char character) {
if (character > 0x2f && character < 0x38) {
return F_true;
#endif // _di_f_conversion_character_is_octal_
#ifndef _di_f_conversion_character_to_binary_
- f_status_t f_conversion_character_to_binary(const char character, uint8_t * const number) {
+ f_status_t f_conversion_character_to_binary(const unsigned char character, uint8_t * const number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_binary_
#ifndef _di_f_conversion_character_to_decimal_
- f_status_t f_conversion_character_to_decimal(const char character, uint8_t * const number) {
+ f_status_t f_conversion_character_to_decimal(const unsigned char character, uint8_t * const number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_decimal_
#ifndef _di_f_conversion_character_to_duodecimal_
- f_status_t f_conversion_character_to_duodecimal(const char character, uint8_t * const number) {
+ f_status_t f_conversion_character_to_duodecimal(const unsigned char character, uint8_t * const number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_duodecimal_
#ifndef _di_f_conversion_character_to_hexidecimal_
- f_status_t f_conversion_character_to_hexidecimal(const char character, uint8_t * const number) {
+ f_status_t f_conversion_character_to_hexidecimal(const unsigned char character, uint8_t * const number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_conversion_character_to_hexidecimal_
#ifndef _di_f_conversion_character_to_octal_
- f_status_t f_conversion_character_to_octal(const char character, uint8_t * const number) {
+ f_status_t f_conversion_character_to_octal(const unsigned char character, uint8_t * const number) {
#ifndef _di_level_0_parameter_checking_
if (!number) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* F_false if character is not a binary.
*/
#ifndef _di_f_conversion_character_is_binary_
- extern f_status_t f_conversion_character_is_binary(const char character);
+ extern f_status_t f_conversion_character_is_binary(const unsigned char character);
#endif // _di_f_conversion_character_is_binary_
/**
* F_false if character is not a decimal.
*/
#ifndef _di_f_conversion_character_is_decimal_
- extern f_status_t f_conversion_character_is_decimal(const char character);
+ extern f_status_t f_conversion_character_is_decimal(const unsigned char character);
#endif // _di_f_conversion_character_is_decimal_
/**
* F_false if character is not a duodecimal.
*/
#ifndef _di_f_conversion_character_is_duodecimal_
- extern f_status_t f_conversion_character_is_duodecimal(const char character);
+ extern f_status_t f_conversion_character_is_duodecimal(const unsigned char character);
#endif // _di_f_conversion_character_is_duodecimal_
/**
* F_false if character is not a hexidecimal.
*/
#ifndef _di_f_conversion_character_is_hexidecimal_
- extern f_status_t f_conversion_character_is_hexidecimal(const char character);
+ extern f_status_t f_conversion_character_is_hexidecimal(const unsigned char character);
#endif // _di_f_conversion_character_is_hexidecimal_
/**
* F_false if character is not an octal.
*/
#ifndef _di_f_conversion_character_is_octal_
- extern f_status_t f_conversion_character_is_octal(const char character);
+ extern f_status_t f_conversion_character_is_octal(const unsigned char character);
#endif // _di_f_conversion_character_is_octal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_binary_
- extern f_status_t f_conversion_character_to_binary(const char character, uint8_t * const number);
+ extern f_status_t f_conversion_character_to_binary(const unsigned char character, uint8_t * const number);
#endif // _di_f_conversion_character_to_binary_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_decimal_
- extern f_status_t f_conversion_character_to_decimal(const char character, uint8_t * const number);
+ extern f_status_t f_conversion_character_to_decimal(const unsigned char character, uint8_t * const number);
#endif // _di_f_conversion_character_to_decimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_duodecimal_
- extern f_status_t f_conversion_character_to_duodecimal(const char character, uint8_t * const number);
+ extern f_status_t f_conversion_character_to_duodecimal(const unsigned char character, uint8_t * const number);
#endif // _di_f_conversion_character_to_duodecimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_hexidecimal_
- extern f_status_t f_conversion_character_to_hexidecimal(const char character, uint8_t * const number);
+ extern f_status_t f_conversion_character_to_hexidecimal(const unsigned char character, uint8_t * const number);
#endif // _di_f_conversion_character_to_hexidecimal_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_conversion_character_to_octal_
- extern f_status_t f_conversion_character_to_octal(const char character, uint8_t * const number);
+ extern f_status_t f_conversion_character_to_octal(const unsigned char character, uint8_t * const number);
#endif // _di_f_conversion_character_to_octal_
/**
f_number_unsigned_t current = number;
f_number_unsigned_t work = 0;
- for (char c = 0; digits; --digits) {
+ for (unsigned char c = 0; digits; --digits) {
work = current / power;
current -= work * power;
return F_status_set_error(F_output);
}
- char c = 0;
+ unsigned char c = 0;
switch (data.base) {
case 2:
f_number_unsigned_t current = number;
f_number_unsigned_t work = 0;
- for (char c = 0; digits; --digits) {
+ for (unsigned char c = 0; digits; --digits) {
work = current / power;
current -= work * power;
#endif // !defined(_di_f_conversion_number_signed_to_string_) || !defined(_di_f_conversion_number_unsigned_to_string_)
#if !defined(_di_f_conversion_number_signed_to_string_) || !defined(_di_f_conversion_number_unsigned_to_string_)
- void private_f_conversion_digit_to_string_pad(const f_conversion_data_t data, const char pad, int total, f_string_dynamic_t * const destination) {
+ void private_f_conversion_digit_to_string_pad(const f_conversion_data_t data, const unsigned char pad, int total, f_string_dynamic_t * const destination) {
for (; total; --total) {
destination->string[destination->used++] = pad;
if (data.flag & F_conversion_data_flag_base_prepend_d) {
destination->string[destination->used++] = f_string_ascii_0_s.string[0];
- char c = 0;
+ unsigned char c = 0;
switch (data.base) {
case 2:
* @see f_conversion_number_unsigned_to_string()
*/
#if !defined(_di_f_conversion_number_signed_to_string_) || !defined(_di_f_conversion_number_unsigned_to_string_)
- extern void private_f_conversion_digit_to_string_pad(const f_conversion_data_t data, const char pad, int total, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+ extern void private_f_conversion_digit_to_string_pad(const f_conversion_data_t data, const unsigned char pad, int total, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_conversion_number_signed_to_string_) || !defined(_di_f_conversion_number_unsigned_to_string_)
/**
// There is no reason to include "." and ".." in the directory listing.
if (!strncmp(listing[i]->d_name, "..", 3) || !strncmp(listing[i]->d_name, ".", 2)) {
- f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
+ f_memory_delete(size, sizeof(unsigned char *), (void **) & listing[i]);
continue;
}
memcpy(names->array[names->used].string, listing[i]->d_name, size);
names->array[names->used++].used = size;
- f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
+ f_memory_delete(size, sizeof(unsigned char *), (void **) & listing[i]);
} // for
for (; i < length; ++i) {
- f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
+ f_memory_delete(size, sizeof(unsigned char *), (void **) & listing[i]);
} // for
f_memory_delete(1, sizeof(struct dirent *), (void **) & listing);
int result = 0;
if (depth_max) {
- result = nftw(path.string, private_f_directory_remove_recursively, depth_max, FTW_DEPTH | FTW_PHYS);
+ result = nftw((char *) path.string, private_f_directory_remove_recursively, depth_max, FTW_DEPTH | FTW_PHYS);
if (result == 0 && !preserve) {
result = remove(path.string);
int result = 0;
if (depth_max) {
- result = nftw(path.string, custom, depth_max, FTW_DEPTH | FTW_PHYS);
+ result = nftw((char *) path.string, custom, depth_max, FTW_DEPTH | FTW_PHYS);
if (result == 0 && !preserve) {
result = remove(path.string);
}
// POSIX basename() modifies the path, so protect it (and add a terminating NULL).
- char path_argument[path.used + 1];
+ unsigned char path_argument[path.used + 1];
f_string_t path_to_name;
memcpy(path_argument, path.string, path.used);
}
// POSIX dirname() modifies the path, so protect it (and add a terminating NULL).
- char path_argument[path.used + 1];
+ unsigned char path_argument[path.used + 1];
f_string_t path_to_name;
memcpy(path_argument, path.string, path.used);
ssize_t size_read = 0;
ssize_t size_write = 0;
- char *buffer[size_block];
+ unsigned char *buffer[size_block];
memset(buffer, 0, size_block);
ssize_t size_read = 0;
ssize_t size_write = 0;
- char *buffer[size_block];
+ unsigned char *buffer[size_block];
memset(buffer, 0, size_block);
#endif // !defined(_di_f_file_stat_by_id_) || !defined(_di_f_file_size_by_id_)
#if !defined(_di_f_file_stream_descriptor_) || !defined(_di_f_file_stream_open_) || !defined(_di_f_file_stream_reopen_)
- const char *private_f_file_stream_open_mode_determine(const int flag) {
+ const unsigned char *private_f_file_stream_open_mode_determine(const int flag) {
if (flag & F_file_flag_read_write_d) {
if (flag & F_file_flag_truncate_d) {
* @see f_file_stream_reopen()
*/
#if !defined(_di_f_file_stream_descriptor_) || !defined(_di_f_file_stream_open_) || !defined(_di_f_file_stream_reopen_)
- extern const char *private_f_file_stream_open_mode_determine(const int flag) F_attribute_visibility_internal_d;
+ extern const unsigned char *private_f_file_stream_open_mode_determine(const int flag) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_file_stream_descriptor_) || !defined(_di_f_file_stream_open_) || !defined(_di_f_file_stream_reopen_)
/**
#endif // !defined(_di_f_iki_datas_append_) || !defined(_di_f_iki_datas_decrease_by_) || !defined(_di_f_iki_datas_increase_) || !defined(_di_f_iki_datas_increase_by_) || !defined(_di_f_iki_datas_resize_)
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
- f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const char quote) {
+ f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const unsigned char quote) {
f_array_length_t delimits = 0;
* @see f_iki_content_partial_is()
*/
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
- extern f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const char quote) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_iki_content_partial_is(const f_string_t buffer, const f_array_length_t length, const unsigned char quote) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
/**
if (!path) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- char buffer[F_path_length_max_d];
+ unsigned char buffer[F_path_length_max_d];
if (!getcwd(buffer, F_path_length_max_d)) {
if (errno == EACCES) return F_status_set_error(F_access_denied);
#endif // _di_f_print_
#ifndef _di_f_print_character_
- f_status_t f_print_character(const char character, FILE * const output) {
+ f_status_t f_print_character(const unsigned char character, FILE * const output) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_print_character_
#ifndef _di_f_print_character_safely_
- f_status_t f_print_character_safely(const char character, FILE * const output) {
+ f_status_t f_print_character_safely(const unsigned char character, FILE * const output) {
#ifndef _di_level_0_parameter_checking_
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_print_character_safely_
#ifndef _di_f_print_character_safely_get_
- const f_string_static_t f_print_character_safely_get(const char character) {
+ const f_string_static_t f_print_character_safely_get(const unsigned char character) {
return private_f_print_character_safely_get(character);
}
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_character_
- extern f_status_t f_print_character(const char character, FILE * const output);
+ extern f_status_t f_print_character(const unsigned char character, FILE * const output);
#endif // _di_f_print_character_
/**
* @see fwrite_unlocked()
*/
#ifndef _di_f_print_character_safely_
- extern f_status_t f_print_character_safely(const char character, FILE * const output);
+ extern f_status_t f_print_character_safely(const unsigned char character, FILE * const output);
#endif // _di_f_print_character_safely_
/**
* A string with a non-zero used length is returned are NULL terminated (after the used length).
*/
#ifndef _di_f_print_character_safely_get_
- extern const f_string_static_t f_print_character_safely_get(const char character);
+ extern const f_string_static_t f_print_character_safely_get(const unsigned char character);
#endif // _di_f_print_character_safely_get_
/**
#endif // !defined(_di_f_print_to_) || !defined(_di_f_print_dynamic_to_) || !defined(_di_f_print_dynamic_partial_to_)
#if !defined(_di_f_print_to_character_safely_) || !defined(_di_f_print_to_safely_) || !defined(_di_f_print_to_safely_dynamic_) || !defined(_di_f_print_to_safely_dynamic_partial_) || !defined(_di_f_print_to_safely_terminated_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_)
- f_status_t private_f_print_to_character_safely(const char character, const int id) {
+ f_status_t private_f_print_to_character_safely(const unsigned char character, const int id) {
if (character == 0x7f) {
if (write(id, f_print_sequence_delete_s.string, f_print_sequence_delete_s.used) != -1) {
* @see f_print_to_except_in_dynamic_partial_safely()
*/
#if !defined(_di_f_print_to_character_safely_) || !defined(_di_f_print_to_safely_) || !defined(_di_f_print_to_safely_dynamic_) || !defined(_di_f_print_to_safely_dynamic_partial_) || !defined(_di_f_print_to_safely_terminated_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_)
- extern f_status_t private_f_print_to_character_safely(const char character, const int id) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_print_to_character_safely(const unsigned char character, const int id) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_print_to_character_safely_) || !defined(_di_f_print_to_safely_) || !defined(_di_f_print_to_safely_dynamic_) || !defined(_di_f_print_to_safely_dynamic_partial_) || !defined(_di_f_print_to_safely_terminated_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_)
/**
#endif // _di_f_print_to_
#ifndef _di_f_print_to_character_
- f_status_t f_print_to_character(const char character, const int id) {
+ f_status_t f_print_to_character(const unsigned char character, const int id) {
#ifndef _di_level_0_parameter_checking_
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_print_to_character_
#ifndef _di_f_print_to_character_safely_
- f_status_t f_print_to_character_safely(const char character, const int id) {
+ f_status_t f_print_to_character_safely(const unsigned char character, const int id) {
#ifndef _di_level_0_parameter_checking_
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* @see write()
*/
#ifndef _di_f_print_to_character_
- extern f_status_t f_print_to_character(const char character, const int id);
+ extern f_status_t f_print_to_character(const unsigned char character, const int id);
#endif // _di_f_print_to_character_
/**
* @see write()
*/
#ifndef _di_f_print_to_character_safely_
- extern f_status_t f_print_to_character_safely(const char character, const int id);
+ extern f_status_t f_print_to_character_safely(const unsigned char character, const int id);
#endif // _di_f_print_to_character_safely_
/**
#endif // !defined(_di_f_print_) || !defined(_di_f_print_dynamic_) || !defined(_di_f_print_dynamic_partial_)
#if !defined(_di_f_print_character_safely_get_) || !defined(_di_f_print_dynamic_partial_safely_) || !defined(_di_f_print_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_safely_)
- const f_string_static_t private_f_print_character_safely_get(const char character) {
+ const f_string_static_t private_f_print_character_safely_get(const unsigned char character) {
if (character == 0x7f) {
return f_print_sequence_delete_s;
* @see f_print_except_in_dynamic_partial_safely()
*/
#if !defined(_di_f_print_character_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_dynamic_) || !defined(_di_f_print_safely_dynamic_partial_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_)
- extern f_status_t private_f_print_character_safely(const char character, FILE * const output) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_print_character_safely(const unsigned char character, FILE * const output) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_print_character_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_dynamic_) || !defined(_di_f_print_safely_dynamic_partial_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_)
/**
* @see f_print_to_safely()
*/
#if !defined(_di_f_print_character_safely_get_) || !defined(_di_f_print_dynamic_partial_safely_) || !defined(_di_f_print_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_safely_)
- extern const f_string_static_t private_f_print_character_safely_get(const char character) F_attribute_visibility_internal_d;
+ extern const f_string_static_t private_f_print_character_safely_get(const unsigned char character) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_print_character_safely_get_) || !defined(_di_f_print_dynamic_partial_safely_) || !defined(_di_f_print_dynamic_safely_) || !defined(_di_f_print_except_dynamic_partial_safely_) || !defined(_di_f_print_except_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_safely_) || !defined(_di_f_print_except_in_dynamic_partial_safely_) || !defined(_di_f_print_except_in_safely_) || !defined(_di_f_print_except_safely_) || !defined(_di_f_print_safely_) || !defined(_di_f_print_safely_terminated_) || !defined(_di_f_print_to_dynamic_partial_safely_) || !defined(_di_f_print_to_dynamic_safely_) || !defined(_di_f_print_to_except_dynamic_partial_safely_) || !defined(_di_f_print_to_except_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_safely_) || !defined(_di_f_print_to_except_in_dynamic_partial_safely_) || !defined(_di_f_print_to_except_in_safely_) || !defined(_di_f_print_to_except_safely_) || !defined(_di_f_print_to_safely_)
/**
#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
- f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(char), (void **) & dynamic->string);
+ f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(unsigned char), (void **) & dynamic->string);
if (F_status_is_error_not(status)) {
dynamic->size = length;
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
- const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(char), (void **) & dynamic->string);
+ const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(unsigned char), (void **) & dynamic->string);
if (F_status_is_error_not(status)) {
dynamic->size = length;
* therefore this gets defined here.
*/
#ifdef _en_BUG_strnlen_
- extern size_t strnlen(const char * const string, size_t max_length);
+ extern size_t strnlen(const unsigned char * const string, size_t max_length);
#endif // _en_BUG_strnlen_
/**
* F_string_t_size_d is provided to help safely navigate this.
*/
#ifndef _di_f_string_t_
- typedef char *f_string_t;
+ typedef unsigned char *f_string_t;
#define f_string_t_initialize 0
* When "f_string_constant_t * xxx" is passed to a function, then "xxx" can be changed.
*/
#ifndef _di_f_string_constant_t_
- typedef const char *f_string_constant_t;
+ typedef const unsigned char *f_string_constant_t;
#define f_string_constant_t_initialize 0
#endif // _di_f_string_dynamic_seek_line_
#ifndef _di_f_string_dynamic_seek_line_to_
- f_status_t f_string_dynamic_seek_line_to(const f_string_static_t buffer, const char seek_to_this, f_string_range_t * const range) {
+ f_status_t f_string_dynamic_seek_line_to(const f_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_dynamic_seek_line_to_
#ifndef _di_f_string_dynamic_seek_to_
- f_status_t f_string_dynamic_seek_to(const f_string_static_t buffer, const char seek_to_this, f_string_range_t * const range) {
+ f_status_t f_string_dynamic_seek_to(const f_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t * const range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_seek_line_to_
- extern f_status_t f_string_dynamic_seek_line_to(const f_string_static_t buffer, const char seek_to_this, f_string_range_t * const range);
+ extern f_status_t f_string_dynamic_seek_line_to(const f_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t * const range);
#endif // _di_f_string_dynamic_seek_line_to_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_seek_to_
- extern f_status_t f_string_dynamic_seek_to(const f_string_static_t buffer, const char seek_to_this, f_string_range_t * const range);
+ extern f_status_t f_string_dynamic_seek_to(const f_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t * const range);
#endif // _di_f_string_dynamic_seek_to_
/**
*/
#ifndef _di_f_fll_id_t_
typedef struct {
- char name[64];
+ unsigned char name[64];
uint16_t type;
uint8_t used;
#endif // _di_f_utf_string_dynamic_seek_line_
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const char seek_to_this, f_string_range_t *range) {
+ f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t *range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_utf_string_dynamic_seek_line_to_
#ifndef _di_f_utf_string_dynamic_seek_to_
- f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const char seek_to_this, f_string_range_t *range) {
+ f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t *range) {
#ifndef _di_level_0_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_line_to_
- extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const char seek_to_this, f_string_range_t *range);
+ extern f_status_t f_utf_string_dynamic_seek_line_to(const f_utf_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t *range);
#endif // _di_f_utf_string_dynamic_seek_line_to_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_utf_string_dynamic_seek_to_
- extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const char seek_to_this, f_string_range_t *range);
+ extern f_status_t f_utf_string_dynamic_seek_to(const f_utf_string_static_t buffer, const unsigned char seek_to_this, f_string_range_t *range);
#endif // _di_f_utf_string_dynamic_seek_to_
/**
path.used = control_group.path.used + control_group.groups.array[i].used + F_control_group_path_system_suffix_s_length;
- char path_string[path.used + 1];
+ unsigned char path_string[path.used + 1];
path.string = path_string;
if (control_group.path.used) {
f_array_length_t at_path = 0;
f_string_static_t tree = f_string_static_t_initialize;
- char tree_string[path.used + 1];
+ unsigned char tree_string[path.used + 1];
tree.string = tree_string;
tree.used = path.used;
tree_string[path.used] = 0;
destination_sub.used = destination.used + listing.directory.array[i].used + 1;
destination_sub.size = destination_sub.used;
- char path_source_sub[source_sub.used + 1];
- char path_destination_sub[destination_sub.used + 1];
+ unsigned char path_source_sub[source_sub.used + 1];
+ unsigned char path_destination_sub[destination_sub.used + 1];
memcpy(path_source_sub, source.string, source.used);
memcpy(path_source_sub + source.used + 1, listing.directory.array[i].string, listing.directory.array[i].used);
path_source.used = source.used + file.used + 2;
path_destination.used = destination.used + file.used + 2;
- char path_source_string[path_source.used];
- char path_destination_string[path_destination.used];
+ unsigned char path_source_string[path_source.used];
+ unsigned char path_destination_string[path_destination.used];
path_source.string = path_source_string;
path_destination.string = path_destination_string;
destination_sub.used = destination.used + listing.directory.array[i].used + 1;
destination_sub.size = destination_sub.used;
- char path_source_sub[source_sub.used + 1];
- char path_destination_sub[destination_sub.used + 1];
+ unsigned char path_source_sub[source_sub.used + 1];
+ unsigned char path_destination_sub[destination_sub.used + 1];
memcpy(path_source_sub, source.string, source.used);
memcpy(path_source_sub + source.used + 1, listing.directory.array[i].string, listing.directory.array[i].used);
path_source.used = source.used + file.used + 2;
path_destination.used = destination.used + file.used + 2;
- char path_source_string[path_source.used];
- char path_destination_string[path_destination.used];
+ unsigned char path_source_string[path_source.used];
+ unsigned char path_destination_string[path_destination.used];
path_source.string = path_source_string;
path_destination.string = path_destination_string;
// There is no reason to include "." and ".." in the directory listing.
if (!strncmp(name_directory.string, "..", 3) || !strncmp(name_directory.string, ".", 2)) {
- f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
+ f_memory_resize(1, 0, sizeof(unsigned char *), (void **) & entity[i]);
continue;
}
memcpy(names->array[names->used].string, name_directory.string, name_directory.used);
names->array[names->used++].used = name_directory.used;
- f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
+ f_memory_resize(1, 0, sizeof(unsigned char *), (void **) & entity[i]);
} // for
closedir(parent);
for (; i < length; ++i) {
- f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
+ f_memory_resize(1, 0, sizeof(unsigned char *), (void **) & entity[i]);
} // for
f_memory_resize(1, 0, sizeof(struct dirent *), (void **) & entity);
paths->array[paths->used].used = 0;
if (total) {
- char buffer[total + 1];
+ unsigned char buffer[total + 1];
for (j = first, k = 0; j < i; ++j) {
paths->array[paths->used].used = 0;
if (total) {
- char buffer[total];
+ unsigned char buffer[total];
for (j = 0, k = 0; j < total; ++j) {
f_array_length_t i = 0;
uint8_t width = 0;
- const char quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0];
+ const unsigned char quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0];
// If there are any spaces, then this will be quoted so find the first non-placeholder character.
for (; destination_range.start < destination->used; ++destination_range.start) {
}
// Handle quoted support.
- char quote_found = 0;
+ unsigned char quote_found = 0;
if (quoted) {
*quoted = 0;
f_array_length_t item_total = 0;
f_array_length_t i = 0;
- const char quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0];
+ const unsigned char quote_char = quoted == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0];
// Use placeholders for potential quote and potential delimited quote to avoid doing things such as memmove().
destination->string[destination->used++] = f_fss_delimit_placeholder_s.string[0];
}
else if (*string < 0x56) {
if (*string == f_string_ascii_C_s.string[0]) {
- char value[1] = { (char) va_arg(apl, int) };
+ unsigned char value[1] = { (unsigned char) va_arg(apl, int) };
*status = f_print_safely(value, 1, stream);
}
else if (*string < 0x72) {
if (*string == f_string_ascii_c_s.string[0]) {
- const char value = (char) va_arg(apl, uint32_t);
+ const unsigned char value = (unsigned char) va_arg(apl, uint32_t);
if (!fputc_unlocked(value, stream)) {
*status = F_status_set_error(F_output);
}
else if (type == f_print_format_type_double_32_e || type == f_print_format_type_double_64_e) {
unsigned int f = 0;
- char format[33];
- char buffer[129];
+ unsigned char format[33];
+ unsigned char buffer[129];
memset(format, 0, 33);
memset(buffer, 0, 129);
{
f_array_length_t j = 0;
- char number[5] = { 0, 0, 0, 0, 0 };
+ unsigned char number[5] = { 0, 0, 0, 0, 0 };
for (++range->start; range->start <= range->stop && j < 4; ++range->start, ++j) {
#endif // _di_fl_utf_string_dynamic_rip_nulless_
#ifndef _di_fl_utf_string_dynamic_seek_line_to_char_
- f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const char seek_to_this) {
+ f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const unsigned char seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_non_
#ifndef _di_fl_utf_string_dynamic_seek_to_char_
- f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const char seek_to_this) {
+ f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const unsigned char seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
#endif // _di_fl_utf_string_rip_nulless_
#ifndef _di_fl_utf_string_seek_line_to_char_
- f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_string_range_t * const range, const char seek_to_this) {
+ f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_string_range_t * const range, const unsigned char seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
#endif // _di_fl_utf_string_seek_line_until_graph_non_
#ifndef _di_fl_utf_string_seek_to_char_
- f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_string_range_t * const range, const char seek_to_this) {
+ f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_string_range_t * const range, const unsigned char seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_to_char_
- extern f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const char seek_to_this);
+ extern f_status_t fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const unsigned char seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_line_to_char_
/**
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_char_
- extern f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const char seek_to_this);
+ extern f_status_t fl_utf_string_dynamic_seek_to_char(const f_utf_string_static_t buffer, f_string_range_t * const range, const unsigned char seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_char_
/**
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
- extern f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_string_range_t * const range, const char seek_to_this);
+ extern f_status_t fl_utf_string_seek_line_to_char(const f_utf_string_t string, f_string_range_t * const range, const unsigned char seek_to_this);
#endif // _di_fl_utf_string_seek_line_to_char_
/**
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
#ifndef _di_fl_utf_string_seek_to_character_
- extern f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_string_range_t * const range, const char seek_to_this);
+ extern f_status_t fl_utf_string_seek_to_char(const f_utf_string_t string, f_string_range_t * const range, const unsigned char seek_to_this);
#endif // _di_fl_utf_string__seek_to_character_
#ifdef __cplusplus
#endif
#if !defined(_di_fl_utf_file_read_) || !defined(_di_fl_utf_file_read_until_) || !defined(_di_fl_utf_file_read_range_)
- void private_fl_utf_file_process_read_buffer(const f_string_t buffer_read, const ssize_t size_read, f_utf_string_dynamic_t * const buffer, char buffer_char[], uint8_t * const width, int8_t * const width_last) {
+ void private_fl_utf_file_process_read_buffer(const f_string_t buffer_read, const ssize_t size_read, f_utf_string_dynamic_t * const buffer, unsigned char buffer_char[], uint8_t * const width, int8_t * const width_last) {
uint8_t increment_by = 0;
* @see fl_utf_file_read_until()
*/
#if !defined(_di_fl_utf_file_read_) || !defined(_di_fl_utf_file_read_until_) || !defined(_di_fl_utf_file_read_range_)
- void private_fl_utf_file_process_read_buffer(const f_string_t buffer_read, const ssize_t size_read, f_utf_string_dynamic_t * const buffer, char buffer_char[], uint8_t * const width, int8_t * const width_last) F_attribute_visibility_internal_d;
+ extern void private_fl_utf_file_process_read_buffer(const f_string_t buffer_read, const ssize_t size_read, f_utf_string_dynamic_t * const buffer, unsigned char buffer_char[], uint8_t * const width, int8_t * const width_last) F_attribute_visibility_internal_d;
#endif // !defined(_di_fl_utf_file_read_) || !defined(_di_fl_utf_file_read_until_) || !defined(_di_fl_utf_file_read_range_)
/**
uint8_t width = 0;
int8_t width_last = -1;
- char buffer_read[file.size_read];
- char buffer_char[4] = { 0, 0, 0, 0 };
+ unsigned char buffer_read[file.size_read];
+ unsigned char buffer_char[4] = { 0, 0, 0, 0 };
memset(&buffer_read, 0, sizeof(file.size_read));
uint8_t width = 0;
int8_t width_last = -1;
- char buffer_read[file.size_read];
- char buffer_char[4] = { 0, 0, 0, 0 };
+ unsigned char buffer_read[file.size_read];
+ unsigned char buffer_char[4] = { 0, 0, 0, 0 };
memset(&buffer_read, 0, sizeof(file.size_read));
buffer_size = total;
}
- char buffer_read[buffer_size];
- char buffer_char[4] = { 0, 0, 0, 0 };
+ unsigned char buffer_read[buffer_size];
+ unsigned char buffer_char[4] = { 0, 0, 0, 0 };
memset(&buffer_read, 0, sizeof(buffer_size));
path.used = control_group.path.used + control_group.groups.array[i].used;
- char path_string[path.used + 1];
+ unsigned char path_string[path.used + 1];
path.string = path_string;
if (control_group.path.used) {
program_name.used = program.used ? program.used : arguments.array[0].used;
}
- char program_name_string[program_name.used + 1];
+ unsigned char program_name_string[program_name.used + 1];
program_name.string = program_name_string;
private_fll_execute_path_arguments_fixate(program.used ? program : arguments.array[0], arguments, last_slash, !program.used, program_name, fixed_arguments);
}
}
- char program_path[found->used + 1];
+ unsigned char program_path[found->used + 1];
program_path[found->used] = 0;
memcpy(&program_path, found->string, found->used);
} // for
}
- code = execv(program_path, fixed_arguments);
+ code = execv(program_path, (char **) fixed_arguments);
}
else {
if (environment) {
}
if (last_slash) {
- code = execv(program.used ? program.string : arguments.array[0].string, fixed_arguments);
+ code = execv(program.used ? program.string : arguments.array[0].string, (char **) fixed_arguments);
}
else {
- code = execvp(program.used ? program.string : arguments.array[0].string, fixed_arguments);
+ code = execvp(program.used ? program.string : arguments.array[0].string, (char **) fixed_arguments);
}
}
program_name.used = program.used ? program.used : arguments.array[0].used;
}
- char program_name_string[program_name.used + 1];
+ unsigned char program_name_string[program_name.used + 1];
program_name.string = program_name_string;
private_fll_execute_path_arguments_fixate(program.used ? program : arguments.array[0], arguments, last_slash, !program.used, program_name, fixed_arguments);
}
}
- char program_path[found->used + 1];
+ unsigned char program_path[found->used + 1];
program_path[found->used] = 0;
memcpy(&program_path, found->string, found->used);
if (F_status_is_error(status)) return status;
}
- int code = direct ? execv(program.string, fixed_arguments) : execvp(program.string, fixed_arguments);
+ int code = direct ? execv(program.string, (char **) fixed_arguments) : execvp(program.string, (char **) fixed_arguments);
if (code == -1) {
if (errno == EACCES) code = F_execute_access;
if (F_status_is_error(status)) return status;
}
- int code = direct ? execv(program.string, fixed_arguments) : execvp(program.string, fixed_arguments);
+ int code = direct ? execv(program.string, (char **) fixed_arguments) : execvp(program.string, (char **) fixed_arguments);
// Close the write pipe for the child when done.
close(descriptors[0]);
path_sub.used = path.used + list[i]->array[j].used + 1;
- char path_sub_string[path_sub.used + 1];
+ unsigned char path_sub_string[path_sub.used + 1];
path_sub.string = path_sub_string;
memcpy(path_sub.string, path.string, path.used);
path_sub.used = path.used + listing.directory.array[i].used + 1;
- char path_sub_string[path_sub.used + 1];
+ unsigned char path_sub_string[path_sub.used + 1];
path_sub.string = path_sub_string;
memcpy(path_sub.string, path.string, path.used);
path_sub.used = path.used + list[i]->array[j].used + 1;
- char path_sub_string[path_sub.used + 1];
+ unsigned char path_sub_string[path_sub.used + 1];
path_sub.string = path_sub_string;
memcpy(path_sub.string, path.string, path.used);
path_sub.used = path.used + listing.directory.array[i].used + 1;
- char path_sub_string[path_sub.used + 1];
+ unsigned char path_sub_string[path_sub.used + 1];
path_sub.string = path_sub_string;
memcpy(path_sub.string, path.string, path.used);
#endif
#if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
- f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t * const escaped) {
+ f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const unsigned char quote, f_string_dynamic_t * const escaped) {
f_status_t status = F_none;
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
- f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t * const unescaped) {
+ f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const unsigned char quote, f_string_dynamic_t * const unescaped) {
f_status_t status = F_none;
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#if !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
- extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t * const escaped) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_iki_content_partial_escape(const f_string_static_t content, const f_string_range_t range, const unsigned char quote, f_string_dynamic_t * const escaped) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
/**
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
- extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const char quote, f_string_dynamic_t * const unescaped) F_attribute_visibility_internal_d;
+ extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const unsigned char quote, f_string_dynamic_t * const unescaped) F_attribute_visibility_internal_d;
#endif // !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
#ifdef __cplusplus
#endif // _di_fll_print_
#ifndef _di_fll_print_character_
- f_status_t fll_print_character(const char character, FILE * const output) {
+ f_status_t fll_print_character(const unsigned char character, FILE * const output) {
flockfile(output);
#endif // _di_fll_print_character_
#ifndef _di_fll_print_character_safely_
- f_status_t fll_print_character_safely(const char character, FILE * const output) {
+ f_status_t fll_print_character_safely(const unsigned char character, FILE * const output) {
flockfile(output);
* @see f_print_character()
*/
#ifndef _di_fll_print_character_
- extern f_status_t fll_print_character(const char character, FILE * const output);
+ extern f_status_t fll_print_character(const unsigned char character, FILE * const output);
#endif // _di_fll_print_character_
/**
* @see f_print_character_safely()
*/
#ifndef _di_fll_print_character_safely_
- extern f_status_t fll_print_character_safely(const char character, FILE * const output);
+ extern f_status_t fll_print_character_safely(const unsigned char character, FILE * const output);
#endif // _di_fll_print_character_safely_
/**
f_status_t status = F_none;
uint64_t position = 0;
- char byte = 0;
+ unsigned char byte = 0;
+ unsigned char offset = 0;
int byte_get = 0;
- uint8_t offset = 0;
int8_t width_utf = -1;
int8_t width_current = 0;
byte_get = fseek(file.stream, main->first, SEEK_SET);
}
else {
- char skip[main->first];
+ unsigned char skip[main->first];
- byte_get = fread(skip, sizeof(char), main->first, file.stream);
+ byte_get = fread(skip, sizeof(unsigned char), main->first, file.stream);
}
}
characters.size = main->width;
// Record when a character is invalid.
- char invalid[main->width];
- memset(&invalid, 0, sizeof(char) * main->width);
+ unsigned char invalid[main->width];
+ memset(&invalid, 0, sizeof(unsigned char) * main->width);
if (byte_get >= 0) {
for (uint16_t signal_check = 0; ; ) {
if (byte_get < 0) break;
- byte = (char) byte_get;
+ byte = (unsigned char) byte_get;
// Storing the next character is designated by width_utf == -1.
if (width_utf == -1) {
if (character_reset) {
characters.used = 0;
character_reset = F_false;
- memset(&invalid, 0, sizeof(uint8_t) * main->width);
+ memset(&invalid, 0, sizeof(unsigned char) * main->width);
}
character_current = characters.used++;
#endif // _di_byte_dump_file_
#ifndef _di_byte_dump_print_character_fragment_
- bool byte_dump_print_character_fragment(byte_dump_main_t * const main, const f_utf_string_static_t characters, const char invalid[], const uint8_t width_utf, const char byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, uint8_t *offset) {
+ bool byte_dump_print_character_fragment(byte_dump_main_t * const main, const f_utf_string_static_t characters, const unsigned char invalid[], const uint8_t width_utf, const unsigned char byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, unsigned char *offset) {
- char byte = 0;
+ unsigned char byte = 0;
bool reset = F_false;
fl_print_format("%[%016_UL%] ", main->output.to.stream, main->context.set.notable, cell->row, main->context.set.notable);
if (*offset) {
- uint8_t offset_to_print = *offset;
+ unsigned char offset_to_print = *offset;
// Pad the buffer with spaces to hide any skipped bytes (skipped via --first).
while (offset_to_print && cell->column < main->width) {
#endif // _di_byte_dump_print_character_fragment_
#ifndef _di_byte_dump_print_text_
- void byte_dump_print_text(byte_dump_main_t * const main, const f_utf_string_static_t characters, const char invalid[], byte_dump_previous_t *previous, uint8_t *offset) {
+ void byte_dump_print_text(byte_dump_main_t * const main, const f_utf_string_static_t characters, const unsigned char invalid[], byte_dump_previous_t *previous, unsigned char *offset) {
+ unsigned char c = 0;
uint8_t at = 0;
- uint8_t c = 0;
uint8_t width_utf = 0;
bool print = F_true;
- char byte[5] = { 0, 0, 0, 0, 0 };
+ unsigned char byte[5] = { 0, 0, 0, 0, 0 };
fl_print_format(" %[%r%] ", main->output.to.stream, main->context.set.notable, byte_dump_character_wall_s, main->context.set.notable);
* @see byte_dump_print_text()
*/
#ifndef _di_byte_dump_print_character_fragment_
- extern bool byte_dump_print_character_fragment(byte_dump_main_t * const main, const f_utf_string_static_t characters, const char invalid[], const uint8_t width_utf, const char byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, uint8_t *offset) F_attribute_visibility_internal_d;
+ extern bool byte_dump_print_character_fragment(byte_dump_main_t * const main, const f_utf_string_static_t characters, const unsigned char invalid[], const uint8_t width_utf, const unsigned char byte_current, byte_dump_previous_t *previous, byte_dump_cell_t *cell, unsigned char *offset) F_attribute_visibility_internal_d;
#endif // _di_byte_dump_print_character_fragment_
/**
* Will be reduced to 0 once used.
*/
#ifndef _di_byte_dump_print_text_
- extern void byte_dump_print_text(byte_dump_main_t * const main, const f_utf_string_static_t characters, const char invalid[], byte_dump_previous_t *previous, uint8_t *offset) F_attribute_visibility_internal_d;
+ extern void byte_dump_print_text(byte_dump_main_t * const main, const f_utf_string_static_t characters, const unsigned char invalid[], byte_dump_previous_t *previous, unsigned char *offset) F_attribute_visibility_internal_d;
#endif // _di_byte_dump_print_text_
#ifdef __cplusplus
* - endian_big: Designate that the packet is in big endian order (when not set then packet is in little endian order).
*/
#ifndef _di_controller_control_packet_flag_
- #define controller_control_packet_flag_binary_d 0x1
- #define controller_control_packet_flag_endian_big_d 0x2
+ #define controller_control_packet_flag_binary_d 0x10000000
+ #define controller_control_packet_flag_endian_big_d 0x01000000
#endif // _di_controller_control_packet_flag_
/**
control->client.id = -1;
}*/
+ printf("\nDEBUG: begin client accept, addr=%ul, server id = %i, client id = %i\n", control->client, control->server.id, control->client.id);
+ fll_print_format("\nDEBUG: begin client accept, addr=%ul, server id = %i, client id = %i\n", stdout, control->client, control->server.id, control->client.id);
+
f_status_t status = f_socket_accept(&control->client, control->server.id);
+ printf("\nDEBUG: client accept, at 1, status = %d\n", F_status_set_fine(status));
if (F_status_is_error(status)) {
f_socket_disconnect(&control->client, f_socket_close_fast_e);
control->input.used = 0;
control->output.used = 0;
- char buffer[controller_control_default_socket_buffer_d + 1];
+ unsigned char buffer[controller_control_default_socket_buffer_d + 1];
size_t length = 0;
memset(buffer, 0, controller_control_default_socket_buffer_d + 1);
// Pre-process the packet header.
control->client.size_read = controller_control_default_socket_header_d;
status = f_socket_read(&control->client, f_socket_flag_peek_d, buffer, &length);
+ printf("\nDEBUG: client accept, at 2, status = %d\n", F_status_set_fine(status));
if (F_status_is_error(status)) {
f_socket_disconnect(&control->client, f_socket_close_fast_e);
if (!length) {
status = controller_control_respond_error_string(global, control, F_empty, "Received packet is empty.");
+ printf("\nDEBUG: client accept, at 3, status = %d\n", F_status_set_fine(status));
f_socket_disconnect(&control->client, f_socket_close_fast_e);
if (length < controller_control_default_socket_header_d) {
status = controller_control_respond_error_string(global, control, F_too_large, "Received packet is too small.");
+ printf("\nDEBUG: client accept, at 4, status = %d\n", F_status_set_fine(status));
f_socket_disconnect(&control->client, f_socket_close_fast_e);
if (length > controller_control_default_socket_buffer_max_d) {
status = controller_control_respond_error_string(global, control, F_too_large, "Received packet is too large.");
+ printf("\nDEBUG: client accept, at 5, status = %d\n", F_status_set_fine(status));
f_socket_disconnect(&control->client, f_socket_close_fast_e);
return F_valid_not;
}
+ // @todo rewrite based on control_payload_build(), but need to pre-process what is needed for the payload.
const uint8_t packet_flag = controller_control_packet_header_flag(buffer);
const uint32_t packet_length = controller_control_packet_header_length(packet_flag & controller_control_packet_flag_endian_big_d, buffer);
if (packet_flag & controller_control_packet_flag_binary_d) {
status = controller_control_respond_error_string(global, control, F_supported_not, "Binary is not a currently supported packet mode.");
+ printf("\nDEBUG: client accept, at 6, status = %d\n", F_status_set_fine(status));
f_socket_disconnect(&control->client, f_socket_close_fast_e);
do {
status = f_socket_read(&control->client, 0, &control->input, &total);
+ printf("\nDEBUG: client accept, at 7, status = %d\n", F_status_set_fine(status));
if (F_status_is_error(status)) {
controller_control_respond_error_string(global, control, F_status_set_fine(status), "Failure while reading from control->client socket.");
}
// @todo process the data.
+ fll_print_format("\nDEBUG: received packet: '%q'\n", stdout, control->input);
// @todo send any responses.
#endif // _di_controller_control_configure_server_
#ifndef _di_controller_control_packet_header_flag_
- uint8_t controller_control_packet_header_flag(const char buffer[]) {
- return (uint8_t) ((buffer[0] & 0x8) ? controller_control_packet_flag_binary_d : 0) | ((buffer[0] & 0x4) ? controller_control_packet_flag_endian_big_d : 0);
+ uint8_t controller_control_packet_header_flag(const unsigned char buffer[]) {
+ return (uint8_t) (((buffer[0] & 0x8) ? controller_control_packet_flag_binary_d : 0) | ((buffer[0] & 0x4) ? controller_control_packet_flag_endian_big_d : 0));
}
#endif // _di_controller_control_packet_header_flag_
#ifndef _di_controller_control_packet_header_length_
- uint32_t controller_control_packet_header_length(const bool is_big, const char buffer[]) {
+ uint32_t controller_control_packet_header_length(const bool is_big, const unsigned char buffer[]) {
register uint32_t length = (((buffer[0] & 0x3f) << 26) | (buffer[1] << 18) | (buffer[2] << 10) | (buffer[3] << 2) | ((buffer[4] & 0xc0) >> 6));
control->output.used = 0;
control->cache_3.used = 0;
+ printf("\nDEBUG: controller_control_respond_error(), at start\n");
{
const f_conversion_data_t data_conversion = macro_f_conversion_data_t_initialize(10, 0, 1);
if (F_status_is_error(status2)) return status2;
}
+ printf("\nDEBUG: controller_control_respond_error(), before write\n");
+
return f_socket_write(&control->client, 0, control->output.string, 0);
}
#endif // _di_controller_control_respond_error_
* The 8-bit number representing the flags.
*/
#ifndef _di_controller_control_packet_header_flag_
- extern uint8_t controller_control_packet_header_flag(const char buffer[]) F_attribute_visibility_internal_d;
+ extern uint8_t controller_control_packet_header_flag(const unsigned char buffer[]) F_attribute_visibility_internal_d;
#endif // _di_controller_control_packet_header_flag_
/**
* The 32-bit number representing the length.
*/
#ifndef _di_controller_control_packet_header_length_
- extern uint32_t controller_control_packet_header_length(const bool is_big, const char buffer[]) F_attribute_visibility_internal_d;
+ extern uint32_t controller_control_packet_header_length(const bool is_big, const unsigned char buffer[]) F_attribute_visibility_internal_d;
#endif // _di_controller_control_packet_header_length_
/**
path.used = cache->action.name_file.used;
}
- char path_string[path.used + 1];
+ unsigned char path_string[path.used + 1];
path.string = path_string;
if (global.setting->path_setting.used) {
f_array_length_t length = destination->used - setting->path_current.used;
if (length) {
- char temporary[--length];
+ unsigned char temporary[--length];
temporary[length] = 0;
memcpy(temporary, destination->string + setting->path_current.used + 1, length);
}
const f_array_length_t id_rule_length = entry_action->parameters.array[0].used + entry_action->parameters.array[1].used + 1;
- char id_rule_name[id_rule_length + 1];
+ unsigned char id_rule_name[id_rule_length + 1];
const f_string_static_t alias_rule = macro_f_string_static_t_initialize2(id_rule_name, id_rule_length);
memcpy(id_rule_name, entry_action->parameters.array[0].string, entry_action->parameters.array[0].used);
const f_array_length_t cache_name_item_used = cache->action.name_item.used;
const f_array_length_t cache_name_file_used = cache->action.name_file.used;
- char cache_name_action[cache_name_action_used];
- char cache_name_item[cache_name_item_used];
- char cache_name_file[cache_name_file_used];
+ unsigned char cache_name_action[cache_name_action_used];
+ unsigned char cache_name_item[cache_name_item_used];
+ unsigned char cache_name_file[cache_name_file_used];
memcpy(cache_name_action, cache->action.name_action.string, cache->action.name_action.used);
memcpy(cache_name_item, cache->action.name_item.string, cache->action.name_item.used);
f_string_static_t buffer = f_string_static_t_initialize;
buffer.used = (content.stop - content.start) + 1;
- char buffer_string[buffer.used + 1];
+ unsigned char buffer_string[buffer.used + 1];
memcpy(buffer_string, source.string + content.start, buffer.used);
buffer_string[buffer.used] = 0;
f_string_static_t buffer = f_string_static_t_initialize;
buffer.used = options[i].used + controller_parameter_map_option_s.used;
- char buffer_string[buffer.used];
+ unsigned char buffer_string[buffer.used];
buffer.string = buffer_string;
memcpy(buffer_string, options[i].string, options[i].used);
f_string_static_t buffer = f_string_static_t_initialize;
buffer.used = options[i].used + controller_parameter_map_value_s.used;
- char buffer_string[buffer.used];
+ unsigned char buffer_string[buffer.used];
buffer.string = buffer_string;
memcpy(buffer_string, options[i].string, options[i].used);
f_string_static_t alias_other_buffer = f_string_static_t_initialize;
alias_other_buffer.used = global.setting->rules.array[id_rule].alias.used;
- char alias_other_buffer_string[alias_other_buffer.used + 1];
+ unsigned char alias_other_buffer_string[alias_other_buffer.used + 1];
alias_other_buffer.string = alias_other_buffer_string;
memcpy(alias_other_buffer_string, global.setting->rules.array[id_rule].alias.string, alias_other_buffer.used);
const f_array_length_t line_item = cache->action.line_item;
const f_array_length_t length_name_item = cache->action.name_item.used;
- char name_item[length_name_item];
+ unsigned char name_item[length_name_item];
name_item[length_name_item] = 0;
memcpy(name_item, cache->action.name_item.string, length_name_item);
controller_control_t *control = &global->setting->control;
do {
+ fll_print_format("\nDEBUG: Control Thread Main Loop, server id = %il.\n", stdout, control->server.id);
// Remove any overly large buffers.
if (control->cache_1.size > controller_control_default_socket_cache_d) {
status = f_socket_listen(&control->server, controller_control_default_socket_backlog_d);
+ fll_print_format("\nDEBUG: Listen returned, status = %ui.\n", stdout, status);
+
if (F_status_is_error(status)) {
controller_print_error(global->thread, global->main->error, F_status_set_fine(status), "f_socket_listen", F_true);
status = controller_control_accept(global, control);
if (status == F_child) break;
+ fll_print_format("\nDEBUG: Accept returned, status = %ui.\n", stdout, F_status_set_fine(status));
+
if (F_status_is_error(status)) {
controller_print_error(global->thread, global->main->error, F_status_set_fine(status), "controller_control_accept", F_true);
}
status = F_none;
+ fll_print_format("\nDEBUG: End of loop.\n", stdout);
+
} while (global->thread->enabled == controller_thread_enabled_e);
+ fll_print_format("\nDEBUG: Out of loop.\n", stdout);
+
if (status == F_child) {
// A forked child process should deallocate memory on exit.
controller_thread_delete_simple(global->thread);
controller_setting_delete_simple(global->setting);
controller_main_delete(global->main);
+
+ fll_print_format("\nDEBUG: child exit, all data should be deleted.\n", stdout);
}
+ fll_print_format("\nDEBUG: cache should be deleted, final exit.\n", stdout);
+
return 0;
}
#endif // _di_controller_thread_control_
The size block\:
The size block represents the size of the entire packet (the control block, the size blocks, and the payload block).
- This number is an 32-bit unsigned integer.
- The size block may contain up to 4 32-bit unsigned integers.
- If the size is less than the max value of a 32-bit integer (4294967295), then the remaining 32-bit unsigned integers may be omitted.
+ This number is a single 32-bit unsigned integer.
- Example size that is less than 2^32-1\:
+ Example packet structure\:
[ control block ] [ size block ] [ payload block ]
[ 0b10000000 ] [ 0b00000000 0b00000000 0b00000100 0b11010010 ] [ size: 1229 (1234 - 5) ]
- Example size that is less than 2^64-1\:
- [ control block ] [ size block ] [ size block ] [ payload block ]
- [ 0b10000000 ] [ 0b11111111 0b11111111 0b11111111 0b11111111 ] [ 0b00000000 0b00000000 0b00000000 0b11001000 ] [ size: 4294967486 (4294967495 - 9) ]
-
The payload block\:
This block is represented by the FSS-000e payload specification and its structure ad use is described in the next sections.
The error payload is intended to communicate some sort of failure.
The error payload is only sent in response to some request (and not in response to another response).
The control (the client) is not expected to send error payloads and the controller (the service) should send an error in response to an error payload or ignore it entirely.
- The "status" from the "header" designates the status code.
+ The "status" from the "header" designates the status code as either a status code name string or a status code number (where a number may have error and warning bits).
The "payload" will contain a NULL terminated string representing the message used to describe the error.
Packet Structure\:
Packet is grouped into the following blocks\:
- control: A single 1-byte block representing contol codes.
- - size: A set of 1 to 4 4-byte blocks representing the size of the entire packet.
+ - size: A single 4-byte block representing the size of the entire packet, including the contol block.
The "header" Object contains the following FSS-0001 Extended Objects (depending on "type")\:
- action: A valid action type: "freeze", "kill", "pause", "reboot", "reload", "rerun", "restart", "resume", "shutdown", "start", "stop", or "thaw".
- length: A positive whole number inclusively between 0 and 4294965248 representing the length of the "payload".
- - status: The string name representing an FSS status code, such as F_none or F_failure.
+ - status: The status code name or number representing an FSS status code, such as F_none, F_failure, or 200 (where a number may have error and warning bits).
- type: The packet type that is one of "error" and "controller".
When there are multiple Objects of the same name inside the "header"\:
- action: The order represents the order in which the actions are performed.
- length: There may only be one length Object, all others after the first are ignored.
- - status: The first represents the status and all other represent additional statuses.
+ - status: A status for each action, in the same order as the order of the action.
- type: The first represent the type and all others represents a sub-type.
There are different headers and payload properties based on the "type".
}
}
- char parameter_file_name_string[parameter_file_name.used + 1];
- char parameter_file_name_major_string[parameter_file_name_major.used + 1];
- char parameter_file_name_minor_string[parameter_file_name_minor.used + 1];
- char parameter_file_name_micro_string[parameter_file_name_micro.used + 1];
- char parameter_file_name_nano_string[parameter_file_name_nano.used + 1];
+ unsigned char parameter_file_name_string[parameter_file_name.used + 1];
+ unsigned char parameter_file_name_major_string[parameter_file_name_major.used + 1];
+ unsigned char parameter_file_name_minor_string[parameter_file_name_minor.used + 1];
+ unsigned char parameter_file_name_micro_string[parameter_file_name_micro.used + 1];
+ unsigned char parameter_file_name_nano_string[parameter_file_name_nano.used + 1];
parameter_file_name.string = parameter_file_name_string;
parameter_file_name_major.string = parameter_file_name_major_string;
parameter_linker.used += parameter_file_name_nano.used;
}
- char parameter_file_path_string[parameter_file_path.used + 1];
- char parameter_linker_string[parameter_linker.used + 1];
+ unsigned char parameter_file_path_string[parameter_file_path.used + 1];
+ unsigned char parameter_linker_string[parameter_linker.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_linker.string = parameter_linker_string;
f_string_static_t parameter_file_path = f_string_static_t_initialize;
parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name.used;
- char parameter_file_path_string[parameter_file_path.used + 1];
+ unsigned char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
{
parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
- char parameter_file_path_string[parameter_file_path.used + 1];
+ unsigned char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
{
parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
- char parameter_file_path_string[parameter_file_path.used + 1];
+ unsigned char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
if (data_build->setting.version_file != fake_build_version_type_micro_e && parameter_file_name_micro.used) {
parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_micro.used;
- char parameter_file_path_string[parameter_file_path.used + 1];
+ unsigned char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
parameter_file_path_string[parameter_file_path.used] = 0;
destination.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used;
destination.used += data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used;
- char destination_string[destination.used + 1];
+ unsigned char destination_string[destination.used + 1];
destination.string = destination_string;
destination_string[destination.used] = 0;
destination.used = 0;
source.used = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
- char source_string[source.used + 1];
+ unsigned char source_string[source.used + 1];
source.string = source_string;
source_string[source.used] = 0;
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
parameter_file_name_path.used = main->path_build_objects_shared.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
- char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+ unsigned char parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
parameter_file_name_path.used = main->path_build_objects_static.used + data_build->setting.build_name.used + fake_build_parameter_object_name_suffix_s.used;
- char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+ unsigned char parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
parameter_file_name_path.used = main->path_build_programs_shared.used + data_build->setting.build_name.used;
- char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+ unsigned char parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
f_string_static_t link_project_library = f_string_static_t_initialize;
link_project_library.used = fake_build_parameter_library_link_file_s.used + data_build->setting.build_name.used;
- char link_project_library_string[link_project_library.used + 1];
+ unsigned char link_project_library_string[link_project_library.used + 1];
link_project_library.string = link_project_library_string;
link_project_library_string[link_project_library.used] = 0;
f_string_static_t source_library = f_string_static_t_initialize;
source_library.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build->setting.build_name.used + fake_build_parameter_library_name_suffix_static_s.used;
- char source_library_string[source_library.used + 1];
+ unsigned char source_library_string[source_library.used + 1];
source_library.string = source_library_string;
source_library_string[source_library.used] = 0;
source_library.used = 0;
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
parameter_file_name_path.used = main->path_build_programs_static.used + data_build->setting.build_name.used;
- char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+ unsigned char parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
parameter_file_name_path_string[parameter_file_name_path.used] = 0;
f_string_static_t path_headers = f_string_static_t_initialize;
path_headers.used = main->path_build_includes.used + data_build->setting.path_headers.used;
- char path_headers_string[path_headers.used + 1];
+ unsigned char path_headers_string[path_headers.used + 1];
path_headers.string = path_headers_string;
if (data_build->setting.path_headers.used) {
{
f_array_length_t build_libraries_length = fake_build_parameter_library_link_path_s.used + main->path_build_libraries_shared.used;
- char build_libraries[build_libraries_length + 1];
+ unsigned char build_libraries[build_libraries_length + 1];
memcpy(build_libraries, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used);
f_array_length_t build_includes_length = fake_build_parameter_library_include_s.used + main->path_build_includes.used;
- char build_includes[build_includes_length + 1];
+ unsigned char build_includes[build_includes_length + 1];
memcpy(build_includes, fake_build_parameter_library_include_s.string, fake_build_parameter_library_include_s.used);
memcpy(build_includes + fake_build_parameter_library_include_s.used, main->path_build_includes.string, main->path_build_includes.used);
if (F_status_is_error_not(*status)) {
buffer.used = fake_build_parameter_library_include_s.used + main->path_work_includes.used;
- char buffer_string[buffer.used + 1];
+ unsigned char buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
if (data_build->setting.search_shared && (is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) {
buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_shared.used;
- char buffer_string[buffer.used + 1];
+ unsigned char buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
if (data_build->setting.search_static && (!is_shared || !data_build->setting.search_exclusive) && F_status_is_error_not(*status)) {
buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_static.used;
- char buffer_string[buffer.used + 1];
+ unsigned char buffer_string[buffer.used + 1];
buffer.string = buffer_string;
buffer_string[buffer.used] = 0;
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_dark_s.used;
- char argument_string[argument.used + 1];
+ unsigned char argument_string[argument.used + 1];
argument.string = argument_string;
argument_string[argument.used] = 0;
f_string_static_t argument = f_string_static_t_initialize;
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_quiet_s.used;
- char argument_string[argument.used + 1];
+ unsigned char argument_string[argument.used + 1];
argument.string = argument_string;
argument_string[argument.used] = 0;
source.used = path->used + sources[i]->array[j].used;
- char source_string[source.used + 1];
+ unsigned char source_string[source.used + 1];
source.string = source_string;
source_string[source.used] = 0;
fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
- char source_string[source.used + fake_path_part_script_s.used + 1];
+ unsigned char source_string[source.used + fake_path_part_script_s.used + 1];
source.string = source_string;
fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
- char source_string[source.used + 1];
+ unsigned char source_string[source.used + 1];
source.string = source_string;
fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
f_string_static_t path_headers = f_string_static_t_initialize;
path_headers.used = main->path_build_includes.used + data_build.setting.path_headers.used;
- char path_headers_string[path_headers.used + 1];
+ unsigned char path_headers_string[path_headers.used + 1];
path_headers.string = path_headers_string;
memcpy(path_headers_string, main->path_build_includes.string, main->path_build_includes.used);
fake_build_path_source_length(main, &data_build, &data_build.setting.path_sources, &source);
- char source_string[source.used + fake_path_part_script_s.used + 1];
+ unsigned char source_string[source.used + fake_path_part_script_s.used + 1];
source.string = source_string;
fake_build_path_source_string(main, &data_build, &data_build.setting.path_sources, &source);
fake_build_path_source_length(main, data_build, &data_build->setting.path_sources, &source);
- char source_string[source.used + sources[i]->array[j].used + 1];
+ unsigned char source_string[source.used + sources[i]->array[j].used + 1];
source.string = source_string;
fake_build_path_source_string(main, data_build, &data_build->setting.path_sources, &source);
source.used += generic->used;
}
- char source_string[source.used + 1];
+ unsigned char source_string[source.used + 1];
source.string = source_string;
fake_build_path_source_string(main, data_build, &data_build->setting.path_sources_object, &source);
destination.used += arguments.array[i].used + 1;
}
- char destination_string[destination.used + 1];
+ unsigned char destination_string[destination.used + 1];
destination.string = destination_string;
destination_string[destination.used] = 0;
destination.used += arguments.array[i].used + 1;
}
- char destination_string[destination.used + 1];
+ unsigned char destination_string[destination.used + 1];
destination.string = destination_string;
destination_string[destination.used] = 0;
f_string_static_t path_file = f_string_static_t_initialize;
path_file.used = data_make->main->path_data_build.used + arguments.array[0].used;
- char path_file_string[path_file.used + 1];
+ unsigned char path_file_string[path_file.used + 1];
path_file.string = path_file_string;
path_file_string[path_file.used] = 0;
fake_skeleton_path_source_length(main, &fake_path_part_cpp_s, &sources_cpp);
fake_skeleton_path_source_length(main, &fake_path_part_script_s, &sources_script);
- char sources_string[sources.used + 1];
- char sources_bash_string[sources_bash.used + 1];
- char sources_c_string[sources_c.used + 1];
- char sources_cpp_string[sources_cpp.used + 1];
- char sources_script_string[sources_script.used + 1];
+ unsigned char sources_string[sources.used + 1];
+ unsigned char sources_bash_string[sources_bash.used + 1];
+ unsigned char sources_c_string[sources_c.used + 1];
+ unsigned char sources_cpp_string[sources_cpp.used + 1];
+ unsigned char sources_script_string[sources_script.used + 1];
sources.string = sources_string;
sources_bash.string = sources_bash_string;
f_string_static_t path_file_other = f_string_static_t_initialize;
path_file_other.used = firewall_network_path_s.used + firewall_file_other_s.used;
- char path_file_other_string[path_file_other.used + 1];
+ unsigned char path_file_other_string[path_file_other.used + 1];
path_file_other.string = path_file_other_string;
path_file_other_string[path_file_other.used] = 0;
f_string_static_t path_file_first = f_string_static_t_initialize;
path_file_first.used = firewall_network_path_s.used + firewall_file_first_s.used;
- char path_file_first_string[path_file_first.used + 1];
+ unsigned char path_file_first_string[path_file_first.used + 1];
path_file_first.string = path_file_first_string;
path_file_first_string[path_file_first.used] = 0;
f_array_length_t i = 0;
f_array_length_t j = 0;
- char block_character[4] = { 0, 0, 0, 0 };
+ unsigned char block_character[4] = { 0, 0, 0, 0 };
f_string_static_t character = macro_f_string_static_t_initialize2(block_character, 4);
do {
}
else if (data->main->parameters.array[utf8_parameter_verify_e].result == f_console_result_none_e) {
if (data->mode & utf8_mode_to_binary_d) {
- char byte[5] = { 0, 0, 0, 0, 0 };
+ unsigned char byte[5] = { 0, 0, 0, 0, 0 };
f_string_static_t character = macro_f_string_static_t_initialize2(byte, 5);
status = f_utf_unicode_from(codepoint, 4, &character.string);
f_array_length_t i = 0;
f_array_length_t j = 0;
- char block[4] = { 0, 0, 0, 0 };
+ unsigned char block[4] = { 0, 0, 0, 0 };
f_string_static_t character = macro_f_string_static_t_initialize2(block, 4);
do {