Socket was not fully converted into basic status codes (not having connect).
I can see future work in sockets whee I may actually add connect codes back, but I won't know until I spend dedicate time on it.
Add additional status codes that should probably exist for consistency purposes.
With F_file_open_not removed, split behavior into two checks:
- F_file for file descriptor errors.
- F_file_closed for file not open errors.
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
ssize_t size_read = 0;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
ssize_t size_read = 0;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
ssize_t size_read = 0;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
if (written) *written = 0;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
if (written) *written = 0;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0 || total == 0) {
if (written) *written = 0;
if (range.start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
if (written) *written = 0;
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see read()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see read()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see read()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see write()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see write()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see write()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see write()
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see f_file_write()
F_address,
F_block,
F_bound_out,
+ F_connected,
F_connected_not,
F_critical,
F_descriptor,
F_eof,
F_eol,
F_eos,
+ F_exist,
F_exist_not,
F_failure,
F_fork,
F_process_too_many,
F_prohibited,
F_read_only,
- F_socket,
F_space_not,
F_stop,
F_syntax,
F_unsupported,
F_utf,
F_value,
+ F_value_not,
F_warn,
F_write_only,
#endif // _di_F_status_basic_
F_file_descriptor,
F_file_descriptor_max,
F_file_empty,
- F_file_error,
F_file_flush,
F_file_found,
F_file_found_not,
F_file_open,
+ F_file_opened,
F_file_open_max,
- F_file_open_not,
F_file_purge,
F_file_read,
F_file_reallocation,
F_directory_closed,
F_directory_descriptor,
F_directory_empty,
+ F_directory_empty_not,
F_directory_found,
F_directory_found_not,
F_directory_flush,
F_directory_link_max,
F_directory_open,
- F_directory_open_not,
F_directory_purge,
F_directory_read,
F_directory_stream,
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
- F_socket_connect_client,
- F_socket_connect_target,
+ F_socket,
+ F_socket_client,
F_socket_receive,
F_socket_send,
+ F_socket_target,
#endif // _di_F_status_socket_
#ifndef _di_F_status_compare_
F_access_denied_user,
F_access_denied_world,
F_access_denied_write,
+ F_access_granted,
+ F_access_granted_execute,
+ F_access_granted_group,
+ F_access_granted_read,
+ F_access_granted_super, // "super" as in super user (root user).
+ F_access_granted_user,
+ F_access_granted_world,
+ F_access_granted_write,
#endif // _di_F_status_access_
// Required.
#ifndef _di_level_1_parameter_checking_
if (file == 0) return F_status_set_error(F_parameter);
if (header == 0) return F_status_set_error(F_parameter);
- if (file->id == 0) return F_status_set_error(F_file_open_not);
- if (file->id < 0) return F_status_set_error(F_file_error);
+ if (file->id == 0) return F_status_set_error(F_file_closed);
+ if (file->id < 0) return F_status_set_error(F_file);
#endif // _di_level_1_parameter_checking_
{
*
* Errors from (with error bit): f_file_read_until().
* Errors from (with error bit): fl_fss_identify()
- * File errors (with error bit): F_file_seek, F_file_open_not.
+ * File errors (with error bit): F_file_seek, F_file_closed.
*
* @see f_file_read_until()
* @see fl_fss_identify()
case F_bound_out:
*string = FL_status_string_bound_out;
break;
+ case F_connected:
+ *string = FL_status_string_connected;
+ break;
case F_connected_not:
*string = FL_status_string_connected_not;
break;
case F_eos:
*string = FL_status_string_eos;
break;
+ case F_exist:
+ *string = FL_status_string_exist;
+ break;
case F_exist_not:
*string = FL_status_string_exist_not;
break;
case F_read_only:
*string = FL_status_string_read_only;
break;
- case F_socket:
- *string = FL_status_string_socket;
- break;
case F_space_not:
*string = FL_status_string_space_not;
break;
case F_value:
*string = FL_status_string_value;
break;
+ case F_value_not:
+ *string = FL_status_string_value_not;
+ break;
case F_warn:
*string = FL_status_string_warn;
break;
case F_file_open_max:
*string = FL_status_string_file_open_max;
break;
- case F_file_open_not:
- *string = FL_status_string_file_open_not;
+ case F_file_opened:
+ *string = FL_status_string_file_opened;
break;
case F_file_purge:
*string = FL_status_string_file_purge;
case F_directory_empty:
*string = FL_status_string_directory_empty;
break;
+ case F_directory_empty_not:
+ *string = FL_status_string_directory_empty_not;
+ break;
case F_directory_found:
*string = FL_status_string_directory_found;
break;
case F_directory_open:
*string = FL_status_string_directory_open;
break;
- case F_directory_open_not:
- *string = FL_status_string_directory_open_not;
- break;
case F_directory_purge:
*string = FL_status_string_directory_purge;
break;
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
- case F_socket_connect_client:
- *string = FL_status_string_socket_client;
+ case F_socket:
+ *string = FL_status_string_socket;
break;
- case F_socket_connect_target:
- *string = FL_status_string_socket_target;
+ case F_socket_client:
+ *string = FL_status_string_socket_client;
break;
case F_socket_receive:
*string = FL_status_string_socket_receive;
case F_socket_send:
*string = FL_status_string_socket_send;
break;
+ case F_socket_target:
+ *string = FL_status_string_socket_target;
+ break;
#endif // _di_F_status_socket_
#ifndef _di_F_error_compare_
break;
#endif // _di_F_status_compare_
- #ifndef _di_F_status_access_denied_
+ #ifndef _di_F_status_access_
case F_access_denied:
*string = FL_status_string_access_denied;
break;
case F_access_denied_super:
*string = FL_status_string_access_denied_super;
break;
- #endif // _di_F_status_access_denied_
+ case F_access_granted:
+ *string = FL_status_string_access_granted;
+ break;
+ case F_access_granted_user:
+ *string = FL_status_string_access_granted_user;
+ break;
+ case F_access_granted_group:
+ *string = FL_status_string_access_granted_group;
+ break;
+ case F_access_granted_world:
+ *string = FL_status_string_access_granted_world;
+ break;
+ case F_access_granted_read:
+ *string = FL_status_string_access_granted_read;
+ break;
+ case F_access_granted_write:
+ *string = FL_status_string_access_granted_write;
+ break;
+ case F_access_granted_execute:
+ *string = FL_status_string_access_granted_execute;
+ break;
+ case F_access_granted_super:
+ *string = FL_status_string_access_granted_super;
+ break;
+ #endif // _di_F_status_access_
case F_status_code_last:
*string = FL_status_string_status_code_last;
#define FL_status_string_address "F_address"
#define FL_status_string_block "F_block"
#define FL_status_string_bound_out "F_bound_out"
+ #define FL_status_string_connected "F_connected"
#define FL_status_string_connected_not "F_connected_not"
#define FL_status_string_critical "F_critical"
#define FL_status_string_descriptor "F_descriptor"
#define FL_status_string_eof "F_eof"
#define FL_status_string_eol "F_eol"
#define FL_status_string_eos "F_eos"
+ #define FL_status_string_exist "F_exist"
#define FL_status_string_exist_not "F_exist_not"
#define FL_status_string_failure "F_failure"
#define FL_status_string_fork "F_fork"
#define FL_status_string_process_too_many "F_process_too_many"
#define FL_status_string_prohibited "F_prohibited"
#define FL_status_string_read_only "F_read_only"
- #define FL_status_string_socket "F_socket"
#define FL_status_string_space_not "F_space_not"
#define FL_status_string_stop "F_stop"
#define FL_status_string_syntax "F_syntax"
#define FL_status_string_unsupported "F_unsupported"
#define FL_status_string_utf "F_utf"
#define FL_status_string_value "F_value"
+ #define FL_status_string_value_not "F_value_not"
#define FL_status_string_warn "F_warn"
#define FL_status_string_write_only "F_write_only"
#define FL_status_string_address_length 9
#define FL_status_string_block_length 7
#define FL_status_string_bound_out_length 11
+ #define FL_status_string_connected_length 11
#define FL_status_string_connected_not_length 15
#define FL_status_string_critical_length 10
#define FL_status_string_descriptor_length 12
#define FL_status_string_eof_length 5
#define FL_status_string_eol_length 5
#define FL_status_string_eos_length 5
+ #define FL_status_string_exist_length 7
#define FL_status_string_exist_not_length 11
#define FL_status_string_failure_length 9
#define FL_status_string_fork_length 6
#define FL_status_string_process_too_many_length 18
#define FL_status_string_prohibited_length 12
#define FL_status_string_read_only_length 11
- #define FL_status_string_socket_length 8
#define FL_status_string_space_not_length 11
#define FL_status_string_stop_length 6
#define FL_status_string_syntax_length 8
#define FL_status_string_unsupported_length 13
#define FL_status_string_utf_length 5
#define FL_status_string_value_length 7
+ #define FL_status_string_value_not_length 11
#define FL_status_string_warn_length 6
#define FL_status_string_write_only_length 12
#endif // _di_F_status_basic_
#define FL_status_string_file_found_not "F_file_found_not"
#define FL_status_string_file_open "F_file_open"
#define FL_status_string_file_open_max "F_file_open_max"
- #define FL_status_string_file_open_not "F_file_open_not"
+ #define FL_status_string_file_opened "F_file_opened"
#define FL_status_string_file_purge "F_file_purge"
#define FL_status_string_file_read "F_file_read"
#define FL_status_string_file_reallocation "F_file_reallocation"
#define FL_status_string_file_found_not_length 16
#define FL_status_string_file_open_length 11
#define FL_status_string_file_open_max_length 15
- #define FL_status_string_file_open_not_length 15
+ #define FL_status_string_file_opened_length 13
#define FL_status_string_file_purge_length 12
#define FL_status_string_file_read_length 11
#define FL_status_string_file_reallocation_length 19
#define FL_status_string_directory_closed "F_directory_closed"
#define FL_status_string_directory_descriptor "F_directory_descriptor"
#define FL_status_string_directory_empty "F_directory_empty"
+ #define FL_status_string_directory_empty_not "F_directory_empty_not"
#define FL_status_string_directory_found "F_directory_found"
#define FL_status_string_directory_found_not "F_directory_found_not"
#define FL_status_string_directory_flush "F_directory_flush"
#define FL_status_string_directory_link_max "F_directory_link_max"
#define FL_status_string_directory_open "F_directory_open"
- #define FL_status_string_directory_open_not "F_directory_open_not"
#define FL_status_string_directory_purge "F_directory_purge"
#define FL_status_string_directory_read "F_directory_read"
#define FL_status_string_directory_stream "F_directory_stream"
#define FL_status_string_directory_closed_length 18
#define FL_status_string_directory_descriptor_length 22
#define FL_status_string_directory_empty_length 17
+ #define FL_status_string_directory_empty_not_length 21
#define FL_status_string_directory_found_length 17
#define FL_status_string_directory_found_not_length 21
#define FL_status_string_directory_flush_length 17
#define FL_status_string_directory_link_max_length 20
#define FL_status_string_directory_open_length 16
- #define FL_status_string_directory_open_not_length 20
#define FL_status_string_directory_purge_length 17
#define FL_status_string_directory_read_length 16
#define FL_status_string_directory_stream_length 18
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
- #define FL_status_string_socket_client "F_socket_connect_client"
- #define FL_status_string_socket_target "F_socket_connect_target"
+ #define FL_status_string_socket "F_socket"
+ #define FL_status_string_socket_client "F_socket_client"
#define FL_status_string_socket_receive "F_socket_receive"
#define FL_status_string_socket_send "F_socket_send"
+ #define FL_status_string_socket_target "F_socket_target"
- #define FL_status_string_socket_client_length 23
- #define FL_status_string_socket_target_length 23
+ #define FL_status_string_socket_length 8
+ #define FL_status_string_socket_client_length 15
#define FL_status_string_socket_receive_length 16
#define FL_status_string_socket_send_length 13
+ #define FL_status_string_socket_target_length 15
#endif // _di_F_status_socket_
#ifndef _di_F_status_compare_
#define FL_status_string_than_less_length 11
#endif // _di_F_status_compare_
- #ifndef _di_F_status_access_denied_
+ #ifndef _di_F_status_access_
#define FL_status_string_access_denied "F_access_denied"
#define FL_status_string_access_denied_user "F_access_denied_user"
#define FL_status_string_access_denied_group "F_access_denied_group"
#define FL_status_string_access_denied_write "F_access_denied_write"
#define FL_status_string_access_denied_execute "F_access_denied_execute"
#define FL_status_string_access_denied_super "F_access_denied_super"
-
- #define FL_status_string_access_denied_length 15
- #define FL_status_string_access_denied_user_length 20
- #define FL_status_string_access_denied_group_length 21
- #define FL_status_string_access_denied_world_length 21
- #define FL_status_string_access_denied_read_length 20
- #define FL_status_string_access_denied_write_length 21
- #define FL_status_string_access_denied_execute_length 23
- #define FL_status_string_access_denied_super_length 21
- #endif // _di_F_status_access_denied_
+ #define FL_status_string_access_granted "F_access_granted"
+ #define FL_status_string_access_granted_user "F_access_granted_user"
+ #define FL_status_string_access_granted_group "F_access_granted_group"
+ #define FL_status_string_access_granted_world "F_access_granted_world"
+ #define FL_status_string_access_granted_read "F_access_granted_read"
+ #define FL_status_string_access_granted_write "F_access_granted_write"
+ #define FL_status_string_access_granted_execute "F_access_granted_execute"
+ #define FL_status_string_access_granted_super "F_access_granted_super"
+
+ #define FL_status_string_access_denied_length 15
+ #define FL_status_string_access_denied_user_length 20
+ #define FL_status_string_access_denied_group_length 21
+ #define FL_status_string_access_denied_world_length 21
+ #define FL_status_string_access_denied_read_length 20
+ #define FL_status_string_access_denied_write_length 21
+ #define FL_status_string_access_denied_execute_length 23
+ #define FL_status_string_access_denied_super_length 21
+ #define FL_status_string_access_granted_length 16
+ #define FL_status_string_access_granted_user_length 21
+ #define FL_status_string_access_granted_group_length 22
+ #define FL_status_string_access_granted_world_length 22
+ #define FL_status_string_access_granted_read_length 21
+ #define FL_status_string_access_granted_write_length 22
+ #define FL_status_string_access_granted_execute_length 24
+ #define FL_status_string_access_granted_super_length 22
+ #endif // _di_F_status_access_
#define FL_status_string_status_code_last "F_status_code_last"
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
*
* @see fl_utf_file_write()
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
f_status status = F_none;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
*written = 0;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
*written = 0;
if (buffer.used >= buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0 || total == 0) {
*written = 0;
if (range.start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id <= 0) return F_status_set_error(F_file_open_not);
+ if (file.id < 0) return F_status_set_error(F_file);
+ if (file.id == 0) return F_status_set_error(F_file_closed);
if (buffer.used == 0) {
*written = 0;
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file.
*
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file.
*
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_eof (with error bit) if UTF-8 character was incomplete at the end of the file.
*
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location.
* F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string.
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location.
* F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string.
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location.
* F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string.
* F_buffer (with error bit) if the buffer is invalid.
* F_interrupted (with error bit) if interrupt was received.
* F_input_output (with error bit) on I/O error.
- * F_file_open_not (with error bit) if file is not open.
+ * F_file (with error bit) if file descriptor is in an error state.
+ * F_file_closed (with error bit) if file is not open.
* F_file_type_directory (with error bit) if file descriptor represents a directory.
* F_incomplete_utf_stop (with error bit) if UTF-8 character was incomplete at the stop location.
* F_incomplete_utf_eos (with error bit) if UTF-8 character was incomplete at the end of the string.
if (status == F_memory_allocation || status == F_memory_reallocation) {
fl_color_print_line(file, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
- else if (status == F_file_open_not) {
+ else if (status == F_file_closed) {
fl_color_print(file, context.error, context.reset, "INTERNAL ERROR: The file '");
fl_color_print(file, context.notable, context.reset, "%s", file_name);
fl_color_print_line(file, context.error, context.reset, "' is no longer open.");
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_connected, length, FL_status_string_connected_length) == F_equal_to) {
+ *code = F_connected;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_connected_not, length, FL_status_string_connected_not_length) == F_equal_to) {
*code = F_connected_not;
return F_none;
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_exist, length, FL_status_string_exist_length) == F_equal_to) {
+ *code = F_exist;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_exist_not, length, FL_status_string_exist_not_length) == F_equal_to) {
*code = F_exist_not;
return F_none;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_socket, length, FL_status_string_socket_length) == F_equal_to) {
- *code = F_socket;
- return F_none;
- }
-
if (fl_string_compare(string, FL_status_string_space_not, length, FL_status_string_space_not_length) == F_equal_to) {
*code = F_space_not;
return F_none;
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_value_not, length, FL_status_string_value_not_length) == F_equal_to) {
+ *code = F_value_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_warn, length, FL_status_string_warn_length) == F_equal_to) {
*code = F_warn;
return F_none;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_file_open_not, length, FL_status_string_file_open_not_length) == F_equal_to) {
- *code = F_file_open_not;
+ if (fl_string_compare(string, FL_status_string_file_opened, length, FL_status_string_file_opened_length) == F_equal_to) {
+ *code = F_file_opened;
return F_none;
}
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_directory_empty_not, length, FL_status_string_directory_empty_not_length) == F_equal_to) {
+ *code = F_directory_empty_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_directory_found, length, FL_status_string_directory_found_length) == F_equal_to) {
*code = F_directory_found;
return F_none;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_directory_open_not, length, FL_status_string_directory_open_not_length) == F_equal_to) {
- *code = F_directory_open_not;
- return F_none;
- }
-
if (fl_string_compare(string, FL_status_string_directory_purge, length, FL_status_string_directory_purge_length) == F_equal_to) {
*code = F_directory_purge;
return F_none;
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
- if (fl_string_compare(string, FL_status_string_socket_client, length, FL_status_string_socket_client_length) == F_equal_to) {
- *code = F_socket_connect_client;
+ if (fl_string_compare(string, FL_status_string_socket, length, FL_status_string_socket_length) == F_equal_to) {
+ *code = F_socket;
return F_none;
}
- if (fl_string_compare(string, FL_status_string_socket_target, length, FL_status_string_socket_target_length) == F_equal_to) {
- *code = F_socket_connect_target;
+ if (fl_string_compare(string, FL_status_string_socket_client, length, FL_status_string_socket_client_length) == F_equal_to) {
+ *code = F_socket_client;
return F_none;
}
*code = F_socket_send;
return F_none;
}
+
+ if (fl_string_compare(string, FL_status_string_socket_target, length, FL_status_string_socket_target_length) == F_equal_to) {
+ *code = F_socket_target;
+ return F_none;
+ }
#endif // _di_F_status_socket_
#ifndef _di_F_status_compare_
}
#endif // _di_F_status_compare_
- #ifndef _di_F_status_access_denied_
+ #ifndef _di_F_status_access_
if (fl_string_compare(string, FL_status_string_access_denied, length, FL_status_string_access_denied_length) == F_equal_to) {
*code = F_access_denied;
return F_none;
*code = F_access_denied_super;
return F_none;
}
- #endif // _di_F_status_access_denied_
+
+ if (fl_string_compare(string, FL_status_string_access_granted, length, FL_status_string_access_granted_length) == F_equal_to) {
+ *code = F_access_granted;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_user, length, FL_status_string_access_granted_user_length) == F_equal_to) {
+ *code = F_access_granted_user;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_group, length, FL_status_string_access_granted_group_length) == F_equal_to) {
+ *code = F_access_granted_group;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_world, length, FL_status_string_access_granted_world_length) == F_equal_to) {
+ *code = F_access_granted_world;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_read, length, FL_status_string_access_granted_read_length) == F_equal_to) {
+ *code = F_access_granted_read;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_write, length, FL_status_string_access_granted_write_length) == F_equal_to) {
+ *code = F_access_granted_write;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_execute, length, FL_status_string_access_granted_execute_length) == F_equal_to) {
+ *code = F_access_granted_execute;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_access_granted_super, length, FL_status_string_access_granted_super_length) == F_equal_to) {
+ *code = F_access_granted_super;
+ return F_none;
+ }
+ #endif // _di_F_status_access_
if (fl_string_compare(string, FL_status_string_status_code_last, length, FL_status_string_status_code_last_length) == F_equal_to) {
*code = F_status_code_last;
else if (status == F_number_overflow) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string);
}
- else if (status == F_file_open_not) {
+ else if (status == F_file_closed) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string);
}
else if (status == F_file_seek) {
else if (status == F_number_overflow) {
fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
}
- else if (status == F_file_open_not) {
+ else if (status == F_file_closed) {
fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
}
else if (status == F_file_seek) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until().");
} else if (status == F_number_overflow) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
- } else if (status == F_file_open_not) {
+ } else if (status == F_file_closed) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
} else if (status == F_file_seek) {
fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);