I was working on stuff a while back and was taken away from the project for quite a while.
These are some uncommitted changes that I would rather commit immediately and then move forward.
There are some other changes I will follow up in separate commits, such as the socket work and the init work.
/* FLL - Level 0
* Project: Colors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_color_max_size_
// instead, they are intended to only point to existing data, so these should neither be allocated nor deallocated
#ifndef _di_f_color_control_
typedef struct f_color_control {
- const f_autochar *bold;
- const f_autochar *underline;
- const f_autochar *blink;
- const f_autochar *reverse;
- const f_autochar *conceal;
+ f_const f_autochar *bold;
+ f_const f_autochar *underline;
+ f_const f_autochar *blink;
+ f_const f_autochar *reverse;
+ f_const f_autochar *conceal;
} f_color_control;
#define f_color_control_names_initialize { "bold", "underline", "blink", "reverse", "conceal" }
#ifndef _di_f_color_standard_io_
typedef struct {
- const f_autochar *message;
- const f_autochar *warning;
- const f_autochar *error;
- const f_autochar *strong_message; // an emphasized message
- const f_autochar *strong_warning; // an emphasized warning
- const f_autochar *strong_error; // an emphasized error
+ f_const f_autochar *message;
+ f_const f_autochar *warning;
+ f_const f_autochar *error;
+ f_const f_autochar *strong_message; // an emphasized message
+ f_const f_autochar *strong_warning; // an emphasized warning
+ f_const f_autochar *strong_error; // an emphasized error
} f_color_standard_io;
#define f_color_standard_io_names_initialize { "message", "warning", "error", "strong_message", "strong_warning", "strong_error" }
#ifndef _di_f_color_help_
typedef struct {
- const f_autochar *title; // name printed
- const f_autochar *version; // version printed
- const f_autochar *topic; // topic such as 'Usage'
- const f_autochar *command; // color for a specific command, such as '-h'
- const f_autochar *syntax; // color for syntax, such as '[' and '<'
- const f_autochar *alert; // some form of alert such as 'Not Implemented Yet'
- const f_autochar *comment; // not quite important text, but still should be seen
- const f_autochar *standard; // the normal text color
- const f_autochar *emphasize; // make sure something stands out to emphasize it
+ f_const f_autochar *title; // name printed
+ f_const f_autochar *version; // version printed
+ f_const f_autochar *topic; // topic such as 'Usage'
+ f_const f_autochar *command; // color for a specific command, such as '-h'
+ f_const f_autochar *syntax; // color for syntax, such as '[' and '<'
+ f_const f_autochar *alert; // some form of alert such as 'Not Implemented Yet'
+ f_const f_autochar *comment; // not quite important text, but still should be seen
+ f_const f_autochar *standard; // the normal text color
+ f_const f_autochar *emphasize; // make sure something stands out to emphasize it
} f_color_help;
#define f_color_help_names_initialize { "title", "version", "topic", "command", "syntax", "alert", "comment", "standard", "emphasize" }
#ifndef _di_f_colors_format_
typedef struct {
- const f_autochar *begin;
- const f_autochar *medium;
- const f_autochar *end;
+ f_const f_autochar *begin;
+ f_const f_autochar *medium;
+ f_const f_autochar *end;
} f_colors_format;
#define f_colors_format_initialize_linux { "\033[", ";", "m" }
#ifndef _di_f_colors_
typedef struct {
- const f_autochar *reset;
- const f_autochar *bold;
- const f_autochar *underline;
- const f_autochar *blink;
- const f_autochar *reverse;
- const f_autochar *conceal;
- const f_autochar *black;
- const f_autochar *red;
- const f_autochar *green;
- const f_autochar *yellow;
- const f_autochar *blue;
- const f_autochar *purple;
- const f_autochar *teal;
- const f_autochar *white;
- const f_autochar *black_bg;
- const f_autochar *red_bg;
- const f_autochar *green_bg;
- const f_autochar *yellow_bg;
- const f_autochar *blue_bg;
- const f_autochar *purple_bg;
- const f_autochar *teal_bg;
- const f_autochar *white_bg;
- const f_autochar *bright_black;
- const f_autochar *bright_red;
- const f_autochar *bright_green;
- const f_autochar *bright_yellow;
- const f_autochar *bright_blue;
- const f_autochar *bright_purple;
- const f_autochar *bright_teal;
- const f_autochar *bright_white;
- const f_autochar *bright_black_bg;
- const f_autochar *bright_red_bg;
- const f_autochar *bright_green_bg;
- const f_autochar *bright_yellow_bg;
- const f_autochar *bright_blue_bg;
- const f_autochar *bright_purple_bg;
- const f_autochar *bright_teal_bg;
- const f_autochar *bright_white_bg;
+ f_const f_autochar *reset;
+ f_const f_autochar *bold;
+ f_const f_autochar *underline;
+ f_const f_autochar *blink;
+ f_const f_autochar *reverse;
+ f_const f_autochar *conceal;
+ f_const f_autochar *black;
+ f_const f_autochar *red;
+ f_const f_autochar *green;
+ f_const f_autochar *yellow;
+ f_const f_autochar *blue;
+ f_const f_autochar *purple;
+ f_const f_autochar *teal;
+ f_const f_autochar *white;
+ f_const f_autochar *black_bg;
+ f_const f_autochar *red_bg;
+ f_const f_autochar *green_bg;
+ f_const f_autochar *yellow_bg;
+ f_const f_autochar *blue_bg;
+ f_const f_autochar *purple_bg;
+ f_const f_autochar *teal_bg;
+ f_const f_autochar *white_bg;
+ f_const f_autochar *bright_black;
+ f_const f_autochar *bright_red;
+ f_const f_autochar *bright_green;
+ f_const f_autochar *bright_yellow;
+ f_const f_autochar *bright_blue;
+ f_const f_autochar *bright_purple;
+ f_const f_autochar *bright_teal;
+ f_const f_autochar *bright_white;
+ f_const f_autochar *bright_black_bg;
+ f_const f_autochar *bright_red_bg;
+ f_const f_autochar *bright_green_bg;
+ f_const f_autochar *bright_yellow_bg;
+ f_const f_autochar *bright_blue_bg;
+ f_const f_autochar *bright_purple_bg;
+ f_const f_autochar *bright_teal_bg;
+ f_const f_autochar *bright_white_bg;
} f_colors;
#define f_colors_initialize_linux { "0", "1", "4", "5", "7", "8", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47", "30", "31", "32", "33", "34", "35", "36", "37", "40", "41", "42", "43", "44", "45", "46", "47" }
#endif // _di_f_colors_
#ifndef _di_f_default_colors_
- static const f_colors_format f_colors_format_linux = f_colors_format_initialize_linux;
- static const f_colors_format f_colors_format_xterminal = f_colors_format_initialize_xterminal;
- static const f_colors f_colors_linux = f_colors_initialize_linux;
- static const f_colors f_colors_xterminal = f_colors_initialize_xterminal;
+ static f_const f_colors_format f_colors_format_linux = f_colors_format_initialize_linux;
+ static f_const f_colors_format f_colors_format_xterminal = f_colors_format_initialize_xterminal;
+ static f_const f_colors f_colors_linux = f_colors_initialize_linux;
+ static f_const f_colors f_colors_xterminal = f_colors_initialize_xterminal;
#endif // _di_f_default_colors_
#ifdef __cplusplus
/* FLL - Level 0
* Project: Console
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_0/console.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_console_identify_
- f_return_status f_console_identify(const f_string input, f_console_id *result) {
+ f_return_status f_console_identify(f_const f_string input, f_console_id *result) {
#ifndef _di_level_0_parameter_checking_
- if (result == f_null) return f_error_set_error(f_invalid_parameter);
+ if (result == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
- const f_string_length length = strnlen(input, 4);
+ f_const f_string_length length = strnlen(input, 4);
if (length == 0) {
*result = f_console_none;
/* FLL - Level 0
* Project: Console
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// result values that represent the type of command found
#ifndef _di_f_console_parameter_
typedef struct {
- const f_autochar *symbol_short;
- const f_autochar *symbol_long;
- const f_autochar *symbol_extra;
- const f_autochar *symbol_other;
+ f_const f_autochar *symbol_short;
+ f_const f_autochar *symbol_long;
+ f_const f_autochar *symbol_extra;
+ f_const f_autochar *symbol_other;
- const f_bool has_additional;
- const f_u_int type;
+ f_const f_bool has_additional;
+ f_const f_u_int type;
f_u_int result;
f_string_lengths additional;
f_string_length length;
#ifndef _di_f_console_identify_
// This is used to help standardize a single method of handling command line option parsing.
// This should allow for every single command line program to use the same form of syntax for command line options.
- f_extern f_return_status f_console_identify(const f_string input, f_console_id *result);
+ f_extern f_return_status f_console_identify(f_const f_string input, f_console_id *result);
#endif // _di_f_console_identify_
// perform checks against short & long options to see if the string is one of them (normal)
/* FLL - Level 0
* Project: Conversion
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_0/conversion.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_is_digit_
- f_return_status f_is_digit(const f_autochar character) {
+ f_return_status f_is_digit(f_const f_autochar character) {
// at this point, it seems that it would incur more overhead to use the libc isdigit here, so just use one less call and test it here
switch (character) {
#endif // _di_f_is_digit_
#ifndef _di_f_is_hexdigit_
- f_return_status f_is_hexdigit(const f_autochar character) {
+ f_return_status f_is_hexdigit(f_const f_autochar character) {
switch (character) {
case '0':
#endif // _di_f_is_hexdigit_
#ifndef _di_f_character_to_digit_
- f_return_status f_character_to_digit(const f_autochar character, f_u_long *digit) {
+ f_return_status f_character_to_digit(f_const f_autochar character, f_u_long *digit) {
#ifndef _di_level_0_parameter_checking_
- if (digit == f_null) return f_error_set_error(f_invalid_parameter);
+ if (digit == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
switch (character) {
#endif // _di_f_character_to_digit_
#ifndef _di_f_character_to_hexdigit_
- f_return_status f_character_to_hexdigit(const f_autochar character, f_u_long *digit) {
+ f_return_status f_character_to_hexdigit(f_const f_autochar character, f_u_long *digit) {
#ifndef _di_level_0_parameter_checking_
- if (digit == f_null) return f_error_set_error(f_invalid_parameter);
+ if (digit == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
switch (character) {
#endif // _di_f_character_to_hexdigit_
#ifndef _di_f_string_to_digit_
- f_return_status f_string_to_digit(const f_string string, f_u_long *digit, const f_string_location location) {
+ f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_const f_string_location location) {
#ifndef _di_level_0_parameter_checking_
- if (digit == f_null) return f_error_set_error(f_invalid_parameter);
+ if (digit == 0) return f_error_set_error(f_invalid_parameter);
if (location.start < 0) return f_error_set_error(f_invalid_parameter);
if (location.stop <= location.start) return f_error_set_error(f_invalid_parameter);
if (string == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_f_string_to_digit_
#ifndef _di_f_string_to_hexdigit_
- f_return_status f_string_to_hexdigit(const f_string string, f_u_long *digit, const f_string_location location) {
+ f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location) {
#ifndef _di_level_0_parameter_checking_
- if (digit == f_null) return f_error_set_error(f_invalid_parameter);
+ if (digit == 0) return f_error_set_error(f_invalid_parameter);
if (location.start < 0) return f_error_set_error(f_invalid_parameter);
if (location.stop <= location.start) return f_error_set_error(f_invalid_parameter);
if (string == 0) return f_error_set_error(f_invalid_parameter);
/* FLL - Level 0
* Project: Conversion
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_is_digit_
// convert a single character into the digit that it represents
- f_extern f_return_status f_is_digit(const f_autochar character);
+ f_extern f_return_status f_is_digit(f_const f_autochar character);
#endif // _di_f_is_digit_
#ifndef _di_f_is_hexdigit_
// convert a single character into the hexidecimal digit that it represents
- f_extern f_return_status f_is_hexdigit(const f_autochar character);
+ f_extern f_return_status f_is_hexdigit(f_const f_autochar character);
#endif // _di_f_is_hexdigit_
#ifndef _di_f_character_to_digit_
// convert a single character into the digit that it represents
- f_extern f_return_status f_character_to_digit(const f_autochar character, f_u_long *digit);
+ f_extern f_return_status f_character_to_digit(f_const f_autochar character, f_u_long *digit);
#endif // _di_f_character_to_digit_
#ifndef _di_f_character_to_hexdigit_
// convert a single character into the hexidecimal digit that it represents
- f_extern f_return_status f_character_to_hexdigit(const f_autochar character, f_u_long *digit);
+ f_extern f_return_status f_character_to_hexdigit(f_const f_autochar character, f_u_long *digit);
#endif // _di_f_character_to_hexdigit_
#ifndef _di_f_string_to_digit_
// works like atoi, except there is a start/stop range
// convert a series of positive numbers into a string, stopping at one of the following: EOS, max_length, or a non-digit
// will not process signed statuses (+/-)
- f_extern f_return_status f_string_to_digit(const f_string string, f_u_long *digit, const f_string_location location);
+ f_extern f_return_status f_string_to_digit(f_const f_string string, f_u_long *digit, f_const f_string_location location);
#endif // _di_f_string_to_digit_
#ifndef _di_f_string_to_hexdigit_
// works like atoi, except there is a start/stop range and that this is for hexidecimal digits
// convert a series of positive numbers into a string, stopping at one of the following: EOS, max_length, or a non-hexdigit
// will not process signed statuses (+/-)
- f_extern f_return_status f_string_to_hexdigit(const f_string string, f_u_long *digit, const f_string_location location);
+ f_extern f_return_status f_string_to_hexdigit(f_const f_string string, f_u_long *digit, f_const f_string_location location);
#endif // _di_f_string_to_hexdigit_
#ifdef __cplusplus
/* FLL - Level 0
* Project: Errors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#ifndef _F_errors_h
#define _F_errors_h
+// libc includes
+#include <errno.h>
+
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_macro_test_for_basic_errors_
#endif // _di_f_errors_signals_
#ifndef _di_f_errors_basic_
- f_none = 197, // start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255).
- f_dummy, // to only be used as a placeholder
- f_warn, // warning
+ f_none = 197, // start at 197 to allow compatibility with the reserved bash return codes (keep in mind fss return codes can be larger than 255).
+ f_dummy, // to only be used as a placeholder
+ f_warn, // warning
f_critical,
- f_unknown, // For the "code should never get here" errors. (this is an EMERGENCY error)
+ f_unknown, // For the "code should never get here" errors. (this is an EMERGENCY error)
f_unsupported,
- f_invalid_parameter,
- f_invalid_syntax,
- f_invalid_data,
- f_no_data, // warning
+ f_no_data, // warning
+ f_out_of_memory,
+ f_input_error,
f_output_error,
+ f_input_output_error,
f_does_not_exist,
+ f_not_connected,
f_failure,
+ f_interrupted, // usually by a signal.
+ f_loop, // such as infinite recursion.
#endif // _di_f_errors_basic_
+ #ifndef _di_f_errors_invalid_
+ f_invalid,
+ f_invalid_parameter,
+ f_invalid_syntax,
+ f_invalid_data,
+ f_invalid_file,
+ f_invalid_directory,
+ f_invalid_socket,
+ f_invalid_device,
+ f_invalid_link,
+ f_invalid_pipe,
+ f_invalid_address,
+ f_invalid_port,
+ f_invalid_value, // similar to f_invalid_parameter, but the parameter value is invalid (example: an integer value representing aboolean and having a 3 as a value).
+ f_invalid_buffer,
+ f_invalid_process,
+ #endif // _di_f_errors_invalid_
+
+ #ifndef _di_f_errors_busy_
+ f_busy, // such as address in use, or port in use.
+ f_busy_address,
+ f_busy_port,
+ f_busy_socket,
+ f_busy_device,
+ f_busy_pipe,
+ f_busy_buffer,
+ f_busy_process,
+ #endif // _di_f_errors_busy_
+
+ #ifndef _di_f_errors_unavailable_
+ f_unavailable,
+ f_unavailable_address,
+ f_unavailable_port,
+ f_unavailable_socket,
+ f_unavailable_device,
+ f_unavailable_pipe,
+ f_unavailable_buffer,
+ f_unavailable_process,
+ #endif // _di_f_errors_unavailable_
+
#ifndef _di_f_errors_digits_
f_underflow,
f_overflow,
#endif // _di_f_errors_digits_
#ifndef _di_f_errors_buffers_
- f_no_data_on_eof, // warning
- f_no_data_on_eol, // warning
- f_no_data_on_eos, // warning
- f_no_data_on_stop, // warning
- f_none_on_eof, // warning
- f_none_on_eol, // warning
- f_none_on_eos, // warning
- f_none_on_stop, // "stop" location was reached
+ f_no_data_on_eof, // warning
+ f_no_data_on_eol, // warning
+ f_no_data_on_eos, // warning
+ f_no_data_on_stop, // warning
+ f_none_on_eof, // warning
+ f_none_on_eol, // warning
+ f_none_on_eos, // warning
+ f_none_on_stop, // "stop" location was reached
f_error_on_eof,
f_error_on_eol,
f_error_on_eos,
#ifndef _di_f_errors_fork_
f_fork_failed,
+ f_too_many_processes,
#endif // _di_f_errors_fork_
#ifndef _di_f_errors_file_
f_file_synchronize_error,
f_file_descriptor_error,
f_file_not_found,
+ f_file_found,
f_file_is_empty,
f_file_not_open,
f_file_allocation_error,
f_directory_error,
#endif // _di_f_errors_directory_
+ #ifndef _di_f_errors_socket_
+ f_socket_connection_client_error,
+ f_socket_connection_target_error,
+ f_socket_receive_error,
+ f_socket_send_error,
+ #endif // _di_f_errors_socket_
+
#ifndef _di_f_errors_non_
f_less_than,
f_equal_to,
f_greater_than,
#endif // _di_f_errors_non_
+ #ifndef _di_f_errors_access_denied_
+ f_access_denied,
+ f_access_denied_user,
+ f_access_denied_group,
+ f_access_denied_world,
+ f_access_denied_read,
+ f_access_denied_write,
+ f_access_denied_execute,
+ f_access_denied_super, // not super user (aka: not root).
+ #endif // _di_f_errors_access_denied_
+
// required
f_last_error_code
}; // enum
/* FLL - Level 0
* Project: File
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/file.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_file_open_
- f_return_status f_file_open(f_file *file_information, const f_string filename) {
+ f_return_status f_file_open(f_file *file_information, f_const f_string filename) {
#ifndef _di_level_0_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
// if file->mode is unset, then this may cause a segfault, depending on whether or not the libc will handle this appropriately
#ifndef _di_f_file_close_
f_return_status f_file_close(f_file *file_information) {
#ifndef _di_level_0_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
if (file_information->file == 0) return f_error_set_error(f_file_not_open);
#ifndef _di_f_file_flush_
f_return_status f_file_flush(f_file *file_information) {
#ifndef _di_level_0_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
if (file_information->file == 0) return f_error_set_error(f_file_not_open);
#endif // _di_f_file_flush_
#ifndef _di_f_file_read_
- f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, const f_file_position location) {
+ f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location) {
#ifndef _di_level_0_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
if (buffer->used >= buffer->size) return f_error_set_error(f_invalid_parameter);
if (location.buffer_start < 0) return f_error_set_error(f_invalid_parameter);
#ifndef _di_f_file_read_fifo_
f_return_status f_file_read_fifo(f_file *file_information, f_dynamic_string *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
if (buffer->used >= buffer->size) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
}
#endif // _di_f_file_read_fifo_
+#ifndef _di_f_file_stat_
+ f_return_status f_file_stat(f_const f_string file, f_stat *stat) {
+ if (stat != 0) {
+ return f_none;
+ }
+
+ f_int result = 0;
+
+ result = stat(file, stat);
+ if (result < 0) {
+ if (errno == ENAMETOOLONG || errno == EFAULT) {
+ return f_error_set_error(f_invalid_parameter);
+ }
+ else if (errno == ENOMEM) {
+ return f_error_set_error(f_out_of_memory);
+ }
+ else if (errno == EOVERFLOW) {
+ return f_error_set_error(f_overflow);
+ }
+ else if (errno == ENOTDIR) {
+ return f_error_set_error(f_invalid_directory);
+ }
+ else if (errno == ENOENT) {
+ return f_file_not_found;
+ }
+ else if (errno == EACCESS) {
+ return f_error_set_error(f_access_denied);
+ }
+ else if (errno == ELOOP) {
+ return f_error_set_error(f_loop);
+ }
+
+ return f_error_set_error(f_file_stat_error);
+ }
+
+ return f_none;
+ }
+#endif // _di_f_file_stat_
+
+#ifndef _di_f_file_stat_by_id_
+ f_return_status f_file_stat_by_id(f_const f_s_int file_id, f_stat *stat) {
+ #ifndef _di_level_0_parameter_checking_
+ if (file_id <= 0) return f_error_set_error(f_invalid_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (stat != 0) {
+ return f_none;
+ }
+
+ f_int result = 0;
+
+ result = stat(file, stat);
+ if (result < 0) {
+ if (errno == ENAMETOOLONG || errno == EFAULT) {
+ return f_error_set_error(f_invalid_parameter);
+ }
+ else if (errno == ENOMEM) {
+ return f_error_set_error(f_out_of_memory);
+ }
+ else if (errno == EOVERFLOW) {
+ return f_error_set_error(f_overflow);
+ }
+ else if (errno == ENOTDIR) {
+ return f_error_set_error(f_invalid_directory);
+ }
+ else if (errno == ENOENT) {
+ return f_file_not_found;
+ }
+ else if (errno == EACCESS) {
+ return f_error_set_error(f_access_denied);
+ }
+ else if (errno == ELOOP) {
+ return f_error_set_error(f_loop);
+ }
+
+ return f_error_set_error(f_file_stat_error);
+ }
+
+ return f_none;
+ }
+#endif // _di_f_file_stat_by_id_
+
#ifdef __cplusplus
} // extern "C"
#endif
/* FLL - Level 0
* Project: File
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_file_types_
#ifndef _di_f_file_
typedef struct {
f_file_id id; // file descriptor
- f_file_type file; // the file data type
+ f_file_p file; // the file data type
f_file_mode mode; // how the file is to be accessed (or is being accessed)
f_size_t byte_size; // how many bytes to use on each read/write (for normal string handling this should be sizeof(f_string)
} f_file;
#ifndef _di_f_file_open_
// open a particular file and save its stream
// filename = name of the file
- f_extern f_return_status f_file_open(f_file *file_information, const f_string filename);
+ f_extern f_return_status f_file_open(f_file *file_information, f_const f_string filename);
#endif // _di_f_file_open_
#ifndef _di_f_file_close_
#ifndef _di_f_file_read_
// read a given amount of data from the buffer, will auto-seek to where
- f_extern f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, const f_file_position location);
+ f_extern f_return_status f_file_read(f_file *file_information, f_dynamic_string *buffer, f_const f_file_position location);
#endif // _di_f_file_read_
#ifndef _di_f_file_read_fifo_
f_extern f_return_status f_file_read_fifo(f_file *file_information, f_dynamic_string *buffer);
#endif // _di_f_file_read_fifo_
+#ifndef _di_f_file_stat_
+ f_extern f_return_status f_file_stat(f_const f_string file, f_stat *stat);
+#endif // _di_f_file_stat_
+
+#ifndef _di_f_file_stat_by_id_
+ f_extern f_return_status f_file_stat_by_id(f_const f_s_int file_id, f_stat *stat);
+#endif // _di_f_file_stat_by_id_
+
#ifdef __cplusplus
} // extern "C"
#endif
/* FLL - Level 0
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_fss_types_
typedef f_string_location f_fss_object;
#define f_fss_object_initialize f_string_location_initialize
- #define f_new_fss_object(status, object, length) status = f_new_array((void **) & object, sizeof(f_fss_object), length)
- #define f_delete_fss_object(status, object) status = f_delete((void **) & object)
- #define f_destroy_fss_object(status, object, size) status = f_destroy((void **) & object, sizeof(f_fss_object), size)
+ #define f_new_fss_object(status, object, length) status = f_new_array((f_void_p *) & object, sizeof(f_fss_object), length)
+ #define f_delete_fss_object(status, object) status = f_delete((f_void_p *) & object)
+ #define f_destroy_fss_object(status, object, size) status = f_destroy((f_void_p *) & object, sizeof(f_fss_object), size)
#define f_resize_fss_object(status, object, old_length, new_length) \
- status = f_resize((void **) & object, sizeof(f_fss_object), old_length, new_length)
+ status = f_resize((f_void_p *) & object, sizeof(f_fss_object), old_length, new_length)
#define f_adjust_fss_object(status, object, old_length, new_length) \
- status = f_adjust((void **) & object, sizeof(f_fss_object), old_length, new_length)
+ status = f_adjust((f_void_p *) & object, sizeof(f_fss_object), old_length, new_length)
#endif // _di_fss_object_
// This holds an array of fss_object
/* FLL - Level 0
* Project: Memory
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/memory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_new_
- f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length) {
+ f_return_status f_new_array(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) {
#ifndef _di_level_0_parameter_checking_
if (type <= 0) return f_error_set_error(f_invalid_parameter);
if (pointer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_f_new_
#if ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) )
- f_return_status f_delete(void **pointer, const f_memory_size_t type, const f_memory_length length) {
+ f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) {
#ifndef _di_level_0_parameter_checking_
if (pointer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
#endif // ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) )
#if ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) )
- f_return_status f_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length) {
+ f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length) {
#ifndef _di_level_0_parameter_checking_
if (length < 0) return f_error_set_error(f_invalid_parameter);
if (type <= 0) return f_error_set_error(f_invalid_parameter);
#endif // ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) )
#if ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) )
- f_return_status f_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) {
+ f_return_status f_resize(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length) {
#ifndef _di_level_0_parameter_checking_
if (type <= 0) return f_error_set_error(f_invalid_parameter);
if (old_length < 0) return f_error_set_error(f_invalid_parameter);
if (old_length == new_length) return f_none;
if (*pointer != 0) {
- void *new_pointer = 0;
+ f_void_p new_pointer = 0;
// allocate new space
if (new_length > 0) {
if (new_pointer != *pointer) {
if (new_length > old_length) {
// bool * is of a data type size of 1, casting it to bool should result in a single-length increment
- // this is done to avoid problems with (void *) having arithmetic issues
+ // this is done to avoid problems with (f_void_p) having arithmetic issues
memset(((char *) new_pointer) + (type * old_length), 0, type * (new_length - old_length));
}
#endif // ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) )
#if ! ( defined (_di_f_adjust_) || defined (_f_memory_FORCE_fast_memory_) )
- f_return_status f_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length) {
+ f_return_status f_adjust(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length) {
#ifndef _di_level_0_parameter_checking_
if (type <= 0) return f_error_set_error(f_invalid_parameter);
if (old_length < 0) return f_error_set_error(f_invalid_parameter);
if (old_length == new_length) return f_none;
if (*pointer != 0) {
- void *new_pointer = 0;
+ f_void_p new_pointer = 0;
if (old_length > 0) {
if (new_length < old_length) {
// bool * is of a data type size of 1, casting it to bool should result in a single-length increment
- // this is done to avoid problems with (void *) having arithmetic issues
+ // this is done to avoid problems with (f_void_p) having arithmetic issues
memset(((char *)*pointer) + new_length, 0, type * (old_length - new_length));
}
}
if (new_pointer != *pointer) {
if (new_length > old_length) {
// char * is of a data type size of 1, casting it to bool should result in a single-length increment
- // this is done to avoid problems with (void *) having arithmetic issues
+ // this is done to avoid problems with (f_void_p) having arithmetic issues
memset(((char *)new_pointer) + (type * old_length), 0, type * (new_length - old_length));
}
/* FLL - Level 0
* Project: Memory
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifdef _f_memory_FORCE_secure_memory_
#ifndef _di_f_new_
// Create some dynamically allocated array of some length
#define f_new(pointer,type) f_new_array(pointer, type, 1)
- f_extern f_return_status f_new_array(void **pointer, const f_memory_size_t type, const f_memory_length length);
+ f_extern f_return_status f_new_array(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length);
#endif // _di_f_new_
#if ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) )
// deletes some dynamically allocated data
// f_delete, will not change any of the data to 0 prior to deallocation
// type and length are not used by this function normally but must be provided for the cases when f_delete is swapped with f_destroy (or vice-versa)
- f_extern f_return_status f_delete(void **pointer, const f_memory_size_t type, const f_memory_length length);
+ f_extern f_return_status f_delete(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length);
#endif // ! ( defined (_di_f_delete_) || defined (_f_memory_FORCE_secure_memory_) )
#if ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) )
// securely deletes some dynamically allocated data
// f_destroy, will change all data to 0 prior to deallocation
- f_extern f_return_status f_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length);
+ f_extern f_return_status f_destroy(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length length);
#endif // ! ( defined (_di_f_destroy_) || defined (_f_memory_FORCE_fast_memory_) )
#if ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) )
// resizes some dynamically allocated data
// f_resize, will not change any of the data prior to deallocation
- f_extern f_return_status f_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length);
+ f_extern f_return_status f_resize(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length);
#endif // ! ( defined (_di_f_resize_) || defined (_f_memory_FORCE_secure_memory_) )
#if ! ( defined (_di_f_adjust_) || defined (_f_memory_FORCE_fast_memory_) )
// securely resizes some dynamically allocated data
// f_adjust, will change all data to 0 prior to deallocation
- f_extern f_return_status f_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length);
+ f_extern f_return_status f_adjust(f_void_p *pointer, f_const f_memory_size_t type, f_const f_memory_length old_length, f_const f_memory_length new_length);
#endif // _di_f_adjust_
// structure: the structure to operate on
// type: the structure type
#define f_delete_structure(status, structure, type) \
- status = f_delete((void **) & structure.array, sizeof(type), structure.size); \
+ status = f_delete((f_void_p *) & structure.array, sizeof(type), structure.size); \
if (status == f_none) { \
structure.size = 0; \
structure.used = 0; \
// structure: the structure to operate on
// type: the structure type
#define f_destroy_structure(status, structure, type) \
- status = f_destroy((void **) & structure.array, sizeof(type), structure.size); \
+ status = f_destroy((f_void_p *) & structure.array, sizeof(type), structure.size); \
if (status == f_none) { \
structure.size = 0; \
structure.used = 0; \
// structure: the structure to operate on
// type: the structure type
#define f_resize_structure(status, structure, type, new_length) \
- status = f_resize((void **) & structure.array, sizeof(type), structure.size, new_length); \
+ status = f_resize((f_void_p *) & structure.array, sizeof(type), structure.size, new_length); \
if (status == f_none) { \
structure.size = new_length; \
if (structure.used > structure.size) structure.used = new_length; \
// structure: the structure to operate on
// type: the structure type
#define f_adjust_structure(status, structure, type, new_length) \
- status = f_adjust((void **) & structure.array, sizeof(type), structure.size, new_length); \
+ status = f_adjust((f_void_p *) & structure.array, sizeof(type), structure.size, new_length); \
if (status == f_none) { \
structure.size = new_length; \
if (structure.used > structure.size) structure.used = new_length; \
f_delete_structure(status, structures.array[structures.size], type); \
if (status != f_none) break; \
} \
- if (status == f_none) status = f_delete((void **) & structures.array, sizeof(type), structures.size); \
+ if (status == f_none) status = f_delete((f_void_p *) & structures.array, sizeof(type), structures.size); \
if (status == f_none) structures.used = 0;
#endif // _di_f_delete_structures_
f_destroy_structure(status, structures.array[structures.size], type); \
if (status != f_none) break; \
} \
- if (status == f_none) status = f_destroy((void **) & structures.array, sizeof(type), structures.size); \
+ if (status == f_none) status = f_destroy((f_void_p *) & structures.array, sizeof(type), structures.size); \
if (status == f_none) structures.used = 0;
#endif // _di_f_destroy_structures_
if (status != f_none) break; \
} \
} \
- if (status == f_none) status = f_resize((void **) & structures.array, sizeof(type), structures.size, new_length); \
+ if (status == f_none) status = f_resize((f_void_p *) & structures.array, sizeof(type), structures.size, new_length); \
if (status == f_none) { \
if (new_length > structures.size) { \
length_variable i = structures.size; \
if (status != f_none) break; \
} \
} \
- if (status == f_none) status = f_adjust((void **) & structures.array, sizeof(type), structures.size, new_length); \
+ if (status == f_none) status = f_adjust((f_void_p *) & structures.array, sizeof(type), structures.size, new_length); \
if (status == f_none) { \
if (new_length > structures.size) { \
length_variable i = structures.size; \
/* FLL - Level 0
* Project: Paths
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#define _F_filesystem_paths_h
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// KFS Filesystem Paths
-#ifdef _en_kevux_filesystem_paths_
+#ifdef _di_kevux_standard_paths_
// disable the FHS default paths
- #define _di_filesystem_paths_
+ #define _di_filesystem_hierarch_standard_paths_
// KFS Root Level
- #define f_path_devices "/devices"
- #define f_path_external "/external"
- #define f_path_libraries "/libraries"
- #define f_path_programs "/programs"
- #define f_path_system "/system"
- #define f_path_temporary "/temporary"
- #define f_path_home "/home"
-
- // FHS Root Level
- #define f_path_boot f_path_devices"/boot"
- #define f_path_hardware f_path_devices"/devices"
- #define f_path_processes f_path_devices"/processes"
- #define f_path_systemfs f_path_devices"/systemfs"
+ #define f_path_devices "/devices"
+ #define f_path_external "/external"
+ #define f_path_libraries "/libraries"
+ #define f_path_programs "/programs"
+ #define f_path_temporary "/temporary"
+ #define f_path_home "/home"
+ #define f_path_run "/run"
+ #define f_path_binary "/.system"
+
+ // Kernel Level
+ #define f_path_boot f_path_devices"/boot"
+ #define f_path_hardware f_path_devices"/devices"
+ #define f_path_processes f_path_devices"/processes"
+ #define f_path_system f_path_devices"/system"
// Program Level
- #define f_path_programs_public f_path_programs"/public"
- #define f_path_programs_system f_path_programs"/system"
- #define f_path_programs_remote f_path_programs"/remote"
- #define f_path_programs_services f_path_programs"/services"
- #define f_path_programs_toolchain f_path_programs"/toolchain"
- #define f_path_programs_users f_path_programs"/users"
- #define f_path_programs_susers f_path_programs"/users"
- #define f_path_programs_boot f_path_boot"/programs"
- #define f_path_programs_sboot f_path_boot"/programs"
+ #define f_path_programs_public f_path_programs"/public"
+ #define f_path_programs_system f_path_programs"/system"
+ #define f_path_programs_remote f_path_programs"/remote"
+ #define f_path_programs_services f_path_programs"/targets"
+ #define f_path_programs_toolchain f_path_programs"/toolchain"
+ #define f_path_programs_users f_path_programs"/users"
+ #define f_path_programs_susers f_path_programs"/users"
+ #define f_path_programs_boot f_path_boot"/programs"
+ #define f_path_programs_sboot f_path_boot"/programs"
// Library Level
- #define f_path_libraries_public f_path_libraries"/public"
- #define f_path_libraries_system f_path_libraries"/system"
- #define f_path_libraries_remote f_path_libraries"/remote"
- #define f_path_libraries_services f_path_libraries"/services"
- #define f_path_libraries_toolchain f_path_libraries"/toolchain"
- #define f_path_libraries_users f_path_libraries"/users"
- #define f_path_libraries_boot f_path_boot"/libraries"
+ #define f_path_libraries_public f_path_libraries"/public"
+ #define f_path_libraries_system f_path_libraries"/system"
+ #define f_path_libraries_remote f_path_libraries"/remote"
+ #define f_path_libraries_services f_path_libraries"/targets"
+ #define f_path_libraries_toolchain f_path_libraries"/toolchain"
+ #define f_path_libraries_users f_path_libraries"/users"
+ #define f_path_libraries_boot f_path_boot"/libraries"
// Home Level
- #define f_path_home_services f_path_home"/services"
- #define f_path_home_share f_path_home"/share"
- #define f_path_home_users f_path_home"/users"
- #define f_path_home_websites f_path_home"/websites"
+ #define f_path_home_services f_path_home"/services"
+ #define f_path_home_share f_path_home"/share"
+ #define f_path_home_users f_path_home"/users"
+ #define f_path_home_websites f_path_home"/websites"
// System Level
- #define f_path_system_logs f_path_system"/logs"
- #define f_path_system_settings f_path_system"/settings"
- #define f_path_system_data f_path_system"/data"
- #define f_path_system_variables f_path_system"/variables" // for backwards FHS support only, use of this directory is considered bad practice for KFS, use f_path_temporary_variables instead
+ #define f_path_system_logs f_path_system"/logs"
+ #define f_path_system_settings f_path_system"/settings"
+ #define f_path_system_data f_path_system"/data"
+ #define f_path_system_variables f_path_system"/variables" // for backwards FHS support only, use of this directory is considered bad practice for KFS, use f_path_temporary_variables instead
// Temporary Level
- #define f_path_temporary_public f_path_temporary"/public"
- #define f_path_temporary_services f_path_temporary"/services"
- #define f_path_temporary_users f_path_temporary"/users"
- #define f_path_temporary_variables f_path_temporary"/variables"
+ #define f_path_temporary_public f_path_temporary"/public"
+ #define f_path_temporary_services f_path_temporary"/services"
+ #define f_path_temporary_users f_path_temporary"/users"
+ #define f_path_temporary_variables f_path_temporary"/variables"
// Private User Directories
- #define f_path_user_downloads "~/downloads"
- #define f_path_user_desktop "~/desktop"
- #define f_path_user_private "~/.private"
- #define f_path_user_settings "~/.settings"
- #define f_path_user_data "~/.data"
-#endif //_en_kevux_filesystem_paths_
+ #define f_path_user_downloads "downloads"
+ #define f_path_user_desktop "desktop"
+ #define f_path_user_private "private"
+ #define f_path_user_settings "settings"
+ #define f_path_user_data "data"
+ #define f_path_user_temporary "temporary"
+ #define f_path_user_shared "shared"
+#endif // _di_kevux_standard_paths_
// FHS Filesystem Paths
-#ifndef _di_filesystem_paths_
+#ifndef _di_filesystem_hierarch_standard_paths_
+ // disable the kevux standard default paths
+ #define _di_kevux_standard_paths_
+
// KFS Root Level
- #define f_path_devices "/"
- #define f_path_external "/mnt"
- #define f_path_libraries "/"
- #define f_path_programs "/"
- #define f_path_system "/"
- #define f_path_temporary "/"
- #define f_path_home "/home"
+ #define f_path_devices "/"
+ #define f_path_external "/mnt"
+ #define f_path_libraries "/"
+ #define f_path_programs "/"
+ #define f_path_temporary "/"
+ #define f_path_home "/home"
+ #define f_path_run "/run"
+ #define f_path_binary "/.system"
// FHS Root Level
- #define f_path_boot "/boot"
- #define f_path_hardware "/dev"
- #define f_path_processes "/proc"
- #define f_path_systemfs "/sysfs"
+ #define f_path_boot "/boot"
+ #define f_path_hardware "/dev"
+ #define f_path_processes "/proc"
+ #define f_path_system "/sysfs"
// Program Level
- #define f_path_programs_public "/usr/bin"
- #define f_path_programs_system "/usr/sbin"
- #define f_path_programs_remote "/usr/bin"
- #define f_path_programs_services "/usr/sbin"
- #define f_path_programs_toolchain "/usr/bin"
- #define f_path_programs_users "/usr/local/bin"
- #define f_path_programs_susers "/usr/local/sbin"
- #define f_path_programs_boot "/bin"
- #define f_path_programs_sboot "/sbin"
+ #define f_path_programs_public "/usr/bin"
+ #define f_path_programs_system "/usr/sbin"
+ #define f_path_programs_remote "/usr/bin"
+ #define f_path_programs_services "/usr/sbin"
+ #define f_path_programs_toolchain "/usr/bin"
+ #define f_path_programs_users "/usr/local/bin"
+ #define f_path_programs_susers "/usr/local/sbin"
+ #define f_path_programs_boot "/bin"
+ #define f_path_programs_sboot "/sbin"
// Library Level
- #define f_path_libraries_public "/usr/lib"
- #define f_path_libraries_system "/usr/lib"
- #define f_path_libraries_remote "/usr/lib"
- #define f_path_libraries_services "/usr/lib"
- #define f_path_libraries_toolchain "/usr/lib"
- #define f_path_libraries_users "/usr/local/lib"
- #define f_path_libraries_boot "/lib"
+ #define f_path_libraries_public "/usr/lib"
+ #define f_path_libraries_system "/usr/lib"
+ #define f_path_libraries_remote "/usr/lib"
+ #define f_path_libraries_services "/usr/lib"
+ #define f_path_libraries_toolchain "/usr/lib"
+ #define f_path_libraries_users "/usr/local/lib"
+ #define f_path_libraries_boot "/lib"
// Home Level
- #define f_path_home_services "/srv"
- #define f_path_home_share "/"
- #define f_path_home_users f_path_home
- #define f_path_home_websites "/srv/www"
+ #define f_path_home_services "/srv"
+ #define f_path_home_share "/"
+ #define f_path_home_users f_path_home
+ #define f_path_home_websites "/srv/www"
// System Level
- #define f_path_system_logs "/var/log"
- #define f_path_system_settings "/etc"
- #define f_path_system_data "/usr/share"
- #define f_path_system_variables "/var"
+ #define f_path_system_logs "/var/log"
+ #define f_path_system_settings "/etc"
+ #define f_path_system_data "/usr/share"
+ #define f_path_system_variables "/var"
// Temporary Level
- #define f_path_temporary_public "/tmp"
- #define f_path_temporary_services "/tmp"
- #define f_path_temporary_users "/tmp"
- #define f_path_temporary_variables "/var/tmp"
+ #define f_path_temporary_public "/tmp"
+ #define f_path_temporary_services "/tmp"
+ #define f_path_temporary_users "/tmp"
+ #define f_path_temporary_variables "/var/tmp"
// Private User Directories
- #define f_path_user_downloads "~"
- #define f_path_user_desktop "~/Desktop"
- #define f_path_user_private "~"
- #define f_path_user_settings "~"
- #define f_path_user_data "~"
-#endif // _di_filesystem_paths_
+ #define f_path_user_downloads "downloads"
+ #define f_path_user_desktop "desktop"
+ #define f_path_user_private ""
+ #define f_path_user_settings ""
+ #define f_path_user_data ""
+ #define f_path_user_temporary ""
+ #define f_path_user_shared ""
+#endif // _di_filesystem_hierarch_standard_paths_
#ifdef __cplusplus
} // extern "C"
/* FLL - Level 0
* Project: Paths
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/filesystem_paths.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// TODO: don't forget to completely restructure the paths layout before 0.1.0 is released
/* FLL - Level 0
* Project: Pipe
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/pipe.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_pipe_exists_
// returns f_true if the standard input contains piped data.
f_return_status f_pipe_exists() {
- struct stat st_info;
+ f_stat st_info;
if (fstat(fileno(f_pipe), &st_info) != 0) {
return f_error_set_error(f_file_stat_error);
/* FLL - Level 0
* Project: Pipe
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_pipe_
/* FLL - Level 0
* Project: Output
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_0/print.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_print_string_
- f_return_status f_print_string(f_file_type output, const f_string string, const f_string_length length) {
+ f_return_status f_print_string(f_file_p output, f_const f_string string, f_const f_string_length length) {
register f_string_length i = 0;
for (; i < length; i++) {
#endif // _di_f_print_string_
#ifndef _di_f_print_dynamic_string_
- f_return_status f_print_dynamic_string(f_file_type output, const f_dynamic_string buffer) {
+ f_return_status f_print_dynamic_string(f_file_p output, f_const f_dynamic_string buffer) {
#ifndef _di_level_0_parameter_checking_
if (buffer.used <= 0) return f_invalid_parameter;
#endif // _di_level_0_parameter_checking_
#endif // _di_f_print_dynamic_string_
#ifndef _di_f_print_partial_dynamic_string_
- f_return_status f_print_partial_dynamic_string(f_file_type output, const f_dynamic_string buffer, const f_string_location location) {
+ f_return_status f_print_partial_dynamic_string(f_file_p output, f_const f_dynamic_string buffer, f_const f_string_location location) {
#ifndef _di_level_0_parameter_checking_
if (location.start < 0) return f_error_set_error(f_invalid_parameter);
if (location.stop < location.start) return f_error_set_error(f_invalid_parameter);
/* FLL - Level 0
* Project: Output
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_print_string_
// will not stop at \0
// will not print \0
// This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability
- f_extern f_return_status f_print_string(f_file_type output, const f_string string, const f_string_length length);
+ f_extern f_return_status f_print_string(f_file_p output, f_const f_string string, f_const f_string_length length);
#endif // _di_f_print_string_
#ifndef _di_f_print_dynamic_string_
// will not print \0
// will print the entire dynamic string
// This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability
- f_extern f_return_status f_print_dynamic_string(f_file_type output, const f_dynamic_string buffer);
+ f_extern f_return_status f_print_dynamic_string(f_file_p output, f_const f_dynamic_string buffer);
#endif // _di_f_print_dynamic_string_
// will not print \0
// will print the only the buffer range specified by location
// This implementation will not proces special characters, such as %s in the same way as printf functions, I am undecided whether or not to add this capability
- f_extern f_return_status f_print_partial_dynamic_string(f_file_type output, const f_dynamic_string buffer, const f_string_location location);
+ f_extern f_return_status f_print_partial_dynamic_string(f_file_p output, f_const f_dynamic_string buffer, f_const f_string_location location);
#endif // _di_f_print_partial_dynamic_string_
#ifdef __cplusplus
/* FLL - Level 0
* Project: Serialized
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_serialized_splitters_
/* FLL - Level 0
* Project: Strings
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/memory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// BUG: for whatever reason strnlen is considered not included with -Wall, even with __USE_GNU defined
// therefore this gets defined here
#ifndef _di_BUG_strnlen_
- f_extern size_t strnlen (const char *string, size_t max_length);
+ f_extern size_t strnlen (f_const char *string, size_t max_length);
#endif // _di_BUG_strnlen_
// Define the end of string character
#define f_string_max_size f_unsigned_long_size
#define f_string_initialize f_eos
- #define f_new_string(status, string, length) status = f_new_array((void **) & string, sizeof(f_string), length)
- #define f_delete_string(status, string, size) status = f_delete((void **) & string, sizeof(f_string), size)
- #define f_destroy_string(status, string, size) status = f_destroy((void **) & string, sizeof(f_string), size)
+ #define f_new_string(status, string, length) status = f_new_array((f_void_p *) & string, sizeof(f_string), length)
+ #define f_delete_string(status, string, size) status = f_delete((f_void_p *) & string, sizeof(f_string), size)
+ #define f_destroy_string(status, string, size) status = f_destroy((f_void_p *) & string, sizeof(f_string), size)
#define f_resize_string(status, string, old_length, new_length) \
- status = f_resize((void **) & string, sizeof(f_string), old_length, new_length)
+ status = f_resize((f_void_p *) & string, sizeof(f_string), old_length, new_length)
#define f_adjust_string(status, string, old_length, new_length) \
- status = f_adjust((void **) & string, sizeof(f_string), old_length, new_length)
+ status = f_adjust((f_void_p *) & string, sizeof(f_string), old_length, new_length)
#endif // _di_f_have_string_
#ifndef _di_f_string_length_
#define f_string_length_printf string_format_long_unsigned
- #define f_new_string_length(status, string, length) status = f_new_array((void **) & string, sizeof(f_string_length), length)
- #define f_delete_string_length(status, string) status = f_delete((void **) & string)
- #define f_destroy_string_length(status, string, size) status = f_destroy((void **) & string, sizeof(f_string_length), size)
+ #define f_new_string_length(status, string, length) status = f_new_array((f_void_p *) & string, sizeof(f_string_length), length)
+ #define f_delete_string_length(status, string) status = f_delete((f_void_p *) & string)
+ #define f_destroy_string_length(status, string, size) status = f_destroy((f_void_p *) & string, sizeof(f_string_length), size)
#define f_resize_string_length(status, length, old_length, new_length) \
- status = f_resize((void **) & length, sizeof(f_string_length), old_length, new_length)
+ status = f_resize((f_void_p *) & length, sizeof(f_string_length), old_length, new_length)
#define f_adjust_string_length(status, length, old_length, new_length) \
- status = f_adjust((void **) & length, sizeof(f_string_length), old_length, new_length)
+ status = f_adjust((f_void_p *) & length, sizeof(f_string_length), old_length, new_length)
#endif // _di_f_string_length_
#ifndef _di_f_string_lengths_
#define f_string_location_initialize { 1, 0 }
- #define f_new_string_location(status, string_location, length) status = f_new_array((void **) & string_location, sizeof(f_string_location), length)
- #define f_delete_string_location(status, string_location, size) status = f_delete((void **) & string_location, sizeof(f_string_location), size)
- #define f_destroy_string_location(status, string_location, size) status = f_destroy((void **) & string_location, sizeof(f_string_location), size)
+ #define f_new_string_location(status, string_location, length) status = f_new_array((f_void_p *) & string_location, sizeof(f_string_location), length)
+ #define f_delete_string_location(status, string_location, size) status = f_delete((f_void_p *) & string_location, sizeof(f_string_location), size)
+ #define f_destroy_string_location(status, string_location, size) status = f_destroy((f_void_p *) & string_location, sizeof(f_string_location), size)
#define f_resize_string_location(status, string_location, old_length, new_length) \
- status = f_resize((void **) & string_location, sizeof(f_string_location), old_length, new_length)
+ status = f_resize((f_void_p *) & string_location, sizeof(f_string_location), old_length, new_length)
#define f_adjust_string_location(status, string_location, old_length, new_length) \
- status = f_adjust((void **) & string_location, sizeof(f_string_location), old_length, new_length)
+ status = f_adjust((f_void_p *) & string_location, sizeof(f_string_location), old_length, new_length)
#endif // _di_f_string_location_
// an array of string locations
#define f_dynamic_string_initialize { f_string_initialize, 0, 0 }
#define f_delete_dynamic_string(status, dynamic) \
- status = f_delete((void **) & dynamic.string, sizeof(f_string), dynamic.size); \
+ status = f_delete((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
#define f_destroy_dynamic_string(status, dynamic) \
- status = f_destroy((void **) & dynamic.string, sizeof(f_string), dynamic.size); \
+ status = f_destroy((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size); \
if (status == f_none) { \
dynamic.size = 0; \
dynamic.used = 0; \
}
#define f_resize_dynamic_string(status, dynamic, new_length) \
- status = f_resize((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
+ status = f_resize((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
if (dynamic.used > dynamic.size) dynamic.used = new_length; \
}
#define f_adjust_dynamic_string(status, dynamic, new_length) \
- status = f_adjust((void **) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
+ status = f_adjust((f_void_p *) & dynamic.string, sizeof(f_string), dynamic.size, new_length); \
if (status == f_none) { \
dynamic.size = new_length; \
if (dynamic.used > dynamic.size) dynamic.used = new_length; \
f_delete_dynamic_string(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
- if (status == f_none) status = f_delete((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
+ if (status == f_none) status = f_delete((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
if (status == f_none) dynamics.used = 0;
#define f_destroy_dynamic_strings(status, dynamics) \
f_destroy_dynamic_string(status, dynamics.array[dynamics.size]); \
if (status != f_none) break; \
} \
- if (status == f_none) status = f_destroy((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
+ if (status == f_none) status = f_destroy((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size); \
if (status == f_none) dynamics.used = 0;
#define f_resize_dynamic_strings(status, dynamics, new_length) \
if (status != f_none) break; \
} \
} \
- if (status == f_none) status = f_resize((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \
+ if (status == f_none) status = f_resize((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \
if (status == f_none) { \
if (new_length > dynamics.size) { \
f_string_length i = dynamics.size; \
if (status != f_none) break; \
} \
} \
- if (status == f_none) status = f_adjust((void **) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \
+ if (status == f_none) status = f_adjust((f_void_p *) & dynamics.array, sizeof(f_dynamic_string), dynamics.size, new_length); \
if (status == f_none) { \
if (new_length > dynamics.size) { \
f_string_length i = dynamics.size; \
/* FLL - Level 0
* Project: Types
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <stdint.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_types_normal
#define f_nlink_t nlink_t
#define f_off_t off_t
#define f_fpos_t fpos_t
- #define f_file_type FILE *
- #define f_null NULL
+ #define f_pid_t pid_t
+ #define f_sigset_t sigset_t
+ #define f_siginfo_t siginfo_t
+ #define f_file_t FILE
+ #define f_file_p FILE *
+ #define f_void_t void
+ #define f_void_p void *
#define f_extern extern
+ #define f_const f_const
+ #define f_stat struct stat
#endif // _di_f_types_normal
// The minimal types represent to the system admin or whomever else handles compilation that the data type should NOT be smaller than the specified size, but can be any size larger.
-// TODO: Should min_char be implemented?
#ifndef _di_f_types_min
#define f_min_s_int f_s_int
#define f_min_s_short f_s_short
#define f_min_s_long f_s_long
- #define f_min_s_short_short f_s_short_short
+ #define f_min_s_short_short f_t_s_short_short
#define f_min_s_long_long f_s_long_long
- #define f_min_s_double f_s_double
+ #define f_min_s_double f_t_s_double
#define f_min_s_long_double f_s_long_double
#define f_min_u_int f_u_int
- #define f_min_u_short f_u_short
+ #define f_min_u_short f_t_u_short
#define f_min_u_long f_u_long
- #define f_min_u_short_short f_u_short_short
+ #define f_min_u_short_short f_t_u_short_short
#define f_min_u_long_long f_u_long_long
- #define f_min_u_double f_u_double
+ #define f_min_u_double f_t_u_double
#define f_min_u_long_double f_u_long_double
+ #define f_min_char f_char
#endif // _di_f_types_min
// The maximum types represent to the system admin or whomever else handles compilation that the data type should NOT be larger than the specified size, but can be any size smaller.
-// TODO: Should max_char be implemented?
#ifndef _di_f_types_max
#define f_max_s_int f_s_int
#define f_max_s_short f_s_short
#define f_max_u_long_long f_u_long_long
#define f_max_u_double f_u_double
#define f_max_u_long_double f_u_long_double
+ #define f_max_char f_wchar
#endif // _di_f_types_max
#ifndef _di_f_status_
typedef uint16_t f_status;
// The c language gives warnings about return types of constants, I pretty much hate not being able to forcefully specify that these are not the be changed as that could be a security issue
- // Therefore, I need to remove the const for c, but keep it for c++, thus I define the type f_return_status, which is only for function call declarations & prototypes
+ // Therefore, I need to remove the f_const for c, but keep it for c++, thus I define the type f_return_status, which is only for function call declarations & prototypes
// DO NOT DECLARE THESE FOR THE RETURN DATA TYPES THEMSELVES, USE f_status. ONLY USE THESE FOR FUNCTION PROTOTYPES AND DECLARATIONS
#ifdef __cplusplus
- #define f_return_status const f_status
+ #define f_return_status f_const f_status
#else
#define f_return_status f_status
#endif // __cplusplus
// Defines a variable to be used by arrays.
#ifndef _di_f_array_length_
- typedef f_u_long f_array_length;
- typedef f_u_int f_array_length_short;
- typedef f_u_long_long f_array_length_long;
+ typedef f_u_long f_t_array_length;
+ typedef f_u_int f_t_array_length_short;
+ typedef f_u_long_long f_t_array_length_long;
#endif // _di_f_array_length_
+#ifndef _di_f_gcc_specific_
+#define f_gcc_attribute_visibility_internal __attribute__((visibility("internal")))
+#endif // _di_f_gcc_specific_
+
#ifdef __cplusplus
} // extern "C"
#endif
/* FLL - Level 0
* Project: Types Array
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/memory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_f_array_lengths_
/* FLL - Level 1
* Project: Colors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_set_color_
- f_return_status fl_set_color(f_file_type file, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5) {
+ f_return_status fl_set_color(f_file_p file, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5) {
#ifndef _di_level_1_parameter_checking_
- if (file == f_null) return f_error_set_error(f_invalid_parameter);
- if (color1 == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file == 0) return f_error_set_error(f_invalid_parameter);
+ if (color1 == 0) return f_error_set_error(f_invalid_parameter);
// make sure all data is in the proper order
- if (color2 == f_null && (color3 != f_null || color4 != f_null || color5 != f_null)) return f_invalid_parameter;
- if (color3 == f_null && (color4 != f_null || color5 != f_null)) return f_invalid_parameter;
- if (color4 == f_null && color5 != f_null) return f_invalid_parameter;
+ if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_invalid_parameter;
+ if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_invalid_parameter;
+ if (color4 == 0 && color5 != 0) return f_invalid_parameter;
#endif // _di_level_1_parameter_checking_
- if (color2 == f_null) fprintf(file, "%s%s%s", format.begin, color1, format.end);
- else if (color3 == f_null) fprintf(file, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end);
- else if (color4 == f_null) fprintf(file, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end);
- else if (color5 == f_null) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end);
- else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end);
+ if (color2 == 0) fprintf(file, "%s%s%s", format.begin, color1, format.end);
+ else if (color3 == 0) fprintf(file, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end);
+ else if (color4 == 0) fprintf(file, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end);
+ else if (color5 == 0) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end);
+ else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end);
return f_none;
}
#endif // _di_fl_set_color_
#ifndef _di_fl_save_color_
- f_return_status fl_save_color(f_dynamic_string *buffer, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5) {
+ f_return_status fl_save_color(f_dynamic_string *buffer, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (color1 == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (color1 == 0) return f_error_set_error(f_invalid_parameter);
// make sure all data is in the proper order
- if (color2 == f_null && (color3 != f_null || color4 != f_null || color5 != f_null)) return f_error_set_error(f_invalid_parameter);
- if (color3 == f_null && (color4 != f_null || color5 != f_null)) return f_error_set_error(f_invalid_parameter);
- if (color4 == f_null && color5 != f_null) return f_error_set_error(f_invalid_parameter);
+ if (color2 == 0 && (color3 != 0 || color4 != 0 || color5 != 0)) return f_error_set_error(f_invalid_parameter);
+ if (color3 == 0 && (color4 != 0 || color5 != 0)) return f_error_set_error(f_invalid_parameter);
+ if (color4 == 0 && color5 != 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_string_length string_size = strnlen(format.begin, f_color_max_size) + strnlen(format.end, f_color_max_size) + 1;
- if (color2 == f_null) string_size += strnlen(color1, f_color_max_size);
- else if (color3 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size);
- else if (color4 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size);
- else if (color5 == f_null) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size);
- else string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size) + strnlen(color5, f_color_max_size);
+ if (color2 == 0) string_size += strnlen(color1, f_color_max_size);
+ else if (color3 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size);
+ else if (color4 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size);
+ else if (color5 == 0) string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size);
+ else string_size += strnlen(color1, f_color_max_size) + strnlen(color2, f_color_max_size) + strnlen(color3, f_color_max_size) + strnlen(color4, f_color_max_size) + strnlen(color5, f_color_max_size);
// make sure there is enough allocated space, if not, then allocate some more
if (buffer->size - buffer->used - 1 < string_size) {
}
}
- if (color2 == f_null) {
+ if (color2 == 0) {
strncat(buffer->string, format.begin, f_color_max_size);
strncat(buffer->string, color1, f_color_max_size);
strncat(buffer->string, format.end, f_color_max_size);
- } else if (color3 == f_null) {
+ } else if (color3 == 0) {
strncat(buffer->string, format.begin, f_color_max_size);
strncat(buffer->string, color1, f_color_max_size);
strncat(buffer->string, format.medium, f_color_max_size);
strncat(buffer->string, color2, f_color_max_size);
strncat(buffer->string, format.end, f_color_max_size);
- } else if (color4 == f_null) {
+ } else if (color4 == 0) {
strncat(buffer->string, format.begin, f_color_max_size);
strncat(buffer->string, color1, f_color_max_size);
strncat(buffer->string, format.medium, f_color_max_size);
strncat(buffer->string, format.medium, f_color_max_size);
strncat(buffer->string, color3, f_color_max_size);
strncat(buffer->string, format.end, f_color_max_size);
- } else if (color5 == f_null) {
+ } else if (color5 == 0) {
strncat(buffer->string, format.begin, f_color_max_size);
strncat(buffer->string, color1, f_color_max_size);
strncat(buffer->string, format.medium, f_color_max_size);
#endif // _di_fl_save_color_
#ifndef _di_fl_print_color_
- f_return_status fl_print_color(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...) {
+ f_return_status fl_print_color(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...) {
#ifndef _di_level_1_parameter_checking_
- if (file == f_null) return f_error_set_error(f_invalid_parameter);
- if (string == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file == 0) return f_error_set_error(f_invalid_parameter);
+ if (string == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (start_color.used != 0) {
#endif // _di_fl_print_color_
#ifndef _di_fl_print_color_line_
- f_return_status fl_print_color_line(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...) {
+ f_return_status fl_print_color_line(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...) {
#ifndef _di_level_1_parameter_checking_
- if (file == f_null) return f_error_set_error(f_invalid_parameter);
- if (string == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file == 0) return f_error_set_error(f_invalid_parameter);
+ if (string == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (start_color.used != 0) {
#endif // _di_fl_print_color_line_
#ifndef _di_fl_print_color_code_
- f_return_status fl_print_color_code(f_file_type file, const f_dynamic_string color) {
+ f_return_status fl_print_color_code(f_file_p file, f_const f_dynamic_string color) {
if (color.used != 0) {
fprintf(file, "%s", color.string);
}
/* FLL - Level 1
* Project: Colors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_color_context_
#ifndef _di_fl_set_color_
// this will accept some file or standard io, and push color information to that file or standard io
- f_extern f_return_status fl_set_color(f_file_type file, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5);
+ f_extern f_return_status fl_set_color(f_file_p file, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5);
#define fl_set_color1(file, format, color1) fl_set_color(file, format, color1, 0, 0, 0, 0)
#define fl_set_color2(file, format, color1, color2) fl_set_color(file, format, color1, color2, 0, 0, 0)
#ifndef _di_fl_save_color_
// this will place all appropriate color effects into a string, handling any necessary allocations
- f_extern f_return_status fl_save_color(f_dynamic_string *buffer, const f_colors_format format, const f_autochar *color1, const f_autochar *color2, const f_autochar *color3, const f_autochar *color4, const f_autochar *color5);
+ f_extern f_return_status fl_save_color(f_dynamic_string *buffer, f_const f_colors_format format, f_const f_autochar *color1, f_const f_autochar *color2, f_const f_autochar *color3, f_const f_autochar *color4, f_const f_autochar *color5);
#define fl_save_color1(buffer, format, color1) fl_save_color(buffer, format, color1, 0, 0, 0, 0)
#define fl_save_color2(buffer, format, color1, color2) fl_save_color(buffer, format, color1, color2, 0, 0, 0)
// this will wrap the passed text in the passed start and end colors
// this will work like fprintf with the variable arguments
// if the colors strings have nothing used in them, then this will only print the string
- f_extern f_return_status fl_print_color(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...);
+ f_extern f_return_status fl_print_color(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...);
#endif // _di_fl_print_color_
#ifndef _di_fl_print_color_line_
// this is identical to fl_print_color, but also prints a trailing newline
- f_extern f_return_status fl_print_color_line(f_file_type file, const f_dynamic_string start_color, const f_dynamic_string end_color, const f_autochar *string, ...);
+ f_extern f_return_status fl_print_color_line(f_file_p file, f_const f_dynamic_string start_color, f_const f_dynamic_string end_color, f_const f_autochar *string, ...);
#endif // _di_fl_print_color_line_
#ifndef _di_fl_print_color_code_
// this will print a single color code so that all print commands following this command will print in color (or not..)
// do not forget to print the color reset when done
- f_extern f_return_status fl_print_color_code(f_file_type file, const f_dynamic_string color);
+ f_extern f_return_status fl_print_color_code(f_file_p file, f_const f_dynamic_string color);
#endif // _di_fl_print_color_code_
#ifdef __cplusplus
/* FLL - Level 1
* Project: Console
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/console.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_process_parameters_
- f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_array_length total_parameters, f_string_lengths *remaining) {
+ f_return_status fl_process_parameters(f_const f_array_length argc, f_const f_string argv[], f_console_parameter parameters[], f_const f_array_length total_parameters, f_string_lengths *remaining) {
#ifndef _di_level_1_parameter_checking_
- if (remaining == f_null) return f_error_set_error(f_invalid_parameter);
+ if (remaining == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
/* FLL - Level 1
* Project: Console
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/console.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_process_parameters_
- f_extern f_return_status fl_process_parameters(const f_array_length argc, const f_string argv[], f_console_parameter parameters[], const f_array_length total_parameters, f_string_lengths *remaining);
+ f_extern f_return_status fl_process_parameters(f_const f_array_length argc, f_const f_string argv[], f_console_parameter parameters[], f_const f_array_length total_parameters, f_string_lengths *remaining);
#endif // _di_fl_process_parameters_
#ifdef __cplusplus
/* FLL - Level 1
* Project: Directory
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/directory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_directory_list_
// put the names of each file and/or directory inside the names parameter
- f_return_status fl_directory_list(const f_string directory_path, f_dynamic_strings *names) {
+ f_return_status fl_directory_list(f_const f_string directory_path, f_dynamic_strings *names) {
#ifndef _di_level_1_parameter_checking_
- if (names == f_null) return f_error_set_error(f_invalid_parameter);
+ if (names == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
struct dirent **listing = 0;
}
// FIXME: the second and third paramater are probably wrong
- f_delete((void **) & listing[counter], sizeof(struct dirent), 0);
+ f_delete((f_void_p *) & listing[counter], sizeof(struct dirent), 0);
}
// FIXME: the second and third paramater are probably wrong
- f_delete((void **) & listing, sizeof(struct dirent *), 0);
+ f_delete((f_void_p *) & listing, sizeof(struct dirent *), 0);
if (length == 0) {
// an empty directory
/* FLL - Level 1
* Project: Directory
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/memory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_directory_limitations_
#ifndef _di_fl_directory_list_
// put the names of each file and/or directory inside the names parameter
- f_extern f_return_status fl_directory_list(const f_string directory_path, f_dynamic_strings *names);
+ f_extern f_return_status fl_directory_list(f_const f_string directory_path, f_dynamic_strings *names);
#endif // _di_fl_directory_list_
#ifdef __cplusplus
/* FLL - Level 1
* Project: Errors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_errors_to_string_
- f_return_status fl_errors_to_string(const f_status error, f_string *string) {
+ f_return_status fl_errors_to_string(f_const f_status error, f_string *string) {
#ifndef _di_level_1_parameter_checking_
- if (string == f_null) return f_error_set_error(f_invalid_parameter);
+ if (string == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status umasked_error = f_error_set_fine(error);
#endif // _di_fl_errors_non_
default:
- *string = f_null;
+ *string = 0;
return f_invalid_data;
}
#endif // _di_fl_errors_to_string_
#ifndef _di_fl_errors_is_error_
- f_return_status fl_errors_is_error(const f_status error) {
+ f_return_status fl_errors_is_error(f_const f_status error) {
if (fl_errors_is_fine(error) == f_true) {
return f_false;
} else if (fl_errors_is_warning(error) == f_true) {
#endif // _di_fl_errors_is_error_
#ifndef _di_fl_errors_is_warning_
- f_return_status fl_errors_is_warning(const f_status error) {
+ f_return_status fl_errors_is_warning(f_const f_status error) {
switch (error) {
#ifndef _di_fl_errors_basic_
case f_no_data:
#endif // _di_fl_errors_is_warning_
#ifndef _di_fl_errors_is_fine_
- f_return_status fl_errors_is_fine(const f_status error) {
+ f_return_status fl_errors_is_fine(f_const f_status error) {
switch (error) {
#ifndef _di_fl_errors_booleans_
case f_false:
/* FLL - Level 1
* Project: Errors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_errors_to_string_
// Convert error codes to their string equivalents.
- f_extern f_return_status fl_errors_to_string(const f_status error, f_string *string);
+ f_extern f_return_status fl_errors_to_string(f_const f_status error, f_string *string);
#endif // _di_fl_errors_to_string_
#ifndef _di_fl_errors_is_error_
// Returns true or false depending on whether the standard context of the error code represents an error.
// Keep in mind that many of the error codes are context-specific and may be reported as an error here when it is in fact not an error.
- f_extern f_return_status fl_errors_is_error(const f_status error);
+ f_extern f_return_status fl_errors_is_error(f_const f_status error);
#endif // _di_fl_errors_is_error_
#ifndef _di_fl_errors_is_warning_
// Returns true or false depending on whether the standard context of the error code represents a warning.
// Keep in mind that many of the error codes are context-specific and may be reported as a warning here when it is in fact not a warning.
- f_extern f_return_status fl_errors_is_warning(const f_status error);
+ f_extern f_return_status fl_errors_is_warning(f_const f_status error);
#endif // _di_fl_errors_is_warning_
#ifndef _di_fl_errors_is_fine_
// Returns true or false depending on whether the standard context of the error code represents an normal return status and not an error.
// Keep in mind that many of the error codes are context-specific and may be reported as an "fine" here when it is in fact not fine.
- f_extern f_return_status fl_errors_is_fine(const f_status error);
+ f_extern f_return_status fl_errors_is_fine(f_const f_status error);
#endif // _di_fl_errors_is_fine_
#ifdef __cplusplus
/* FLL - Level 1
* Project: File
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/file.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_file_read_
- f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer) {
+ f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
if (position.buffer_start < 0) return f_error_set_error(f_invalid_parameter);
if (position.file_start < 0) return f_error_set_error(f_invalid_parameter);
#ifndef _di_fl_file_read_fifo_
f_return_status fl_file_read_fifo(f_file file, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (file.file == 0) return f_error_set_warning(f_file_not_open);
#endif // _di_fl_file_read_fifo_
#ifndef _di_fl_file_write_
- f_return_status fl_file_write(f_file file, const f_dynamic_string buffer) {
+ f_return_status fl_file_write(f_file file, f_const f_dynamic_string buffer) {
if (file.file == 0) return f_error_set_error(f_file_not_open);
f_status status = f_none;
#endif // _di_fl_file_write_
#ifndef _di_fl_file_write_partial_
- f_return_status fl_file_write_partial(f_file file, const f_dynamic_string buffer, const f_string_location position) {
+ f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_const f_string_location position) {
#ifndef _di_level_1_parameter_checking_
if (position.start < position.stop) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
/* FLL - Level 1
* Project: File
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/file.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_file_read_
- f_extern f_return_status fl_file_read(f_file file, const f_file_position position, f_dynamic_string *buffer);
+ f_extern f_return_status fl_file_read(f_file file, f_const f_file_position position, f_dynamic_string *buffer);
#endif // _di_fl_file_read_
#ifndef _di_fl_file_read_fifo_
#endif // _di_fl_file_read_fifo_
#ifndef _di_fl_file_write_
- f_extern f_return_status fl_file_write(f_file file, const f_dynamic_string buffer);
+ f_extern f_return_status fl_file_write(f_file file, f_const f_dynamic_string buffer);
#endif // _di_fl_file_write_
#ifndef _di_fl_file_write_partial_
- f_extern f_return_status fl_file_write_partial(f_file file, const f_dynamic_string buffer, const f_string_location position);
+ f_extern f_return_status fl_file_write_partial(f_file file, f_const f_dynamic_string buffer, f_const f_string_location position);
#endif // _di_fl_file_write_partial_
#ifdef __cplusplus
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_identify_
- f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header) {
+ f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header) {
#ifndef _di_level_1_parameter_checking_
- if (header == f_null) return f_error_set_error(f_invalid_parameter);
+ if (header == 0) return f_error_set_error(f_invalid_parameter);
if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
#ifndef _di_fl_fss_identify_file_
f_return_status fl_fss_identify_file(f_file *file_information, f_fss_header *header) {
#ifndef _di_level_1_parameter_checking_
- if (file_information == f_null) return f_error_set_error(f_invalid_parameter);
- if (header == f_null) return f_error_set_error(f_invalid_parameter);
+ if (file_information == 0) return f_error_set_error(f_invalid_parameter);
+ if (header == 0) return f_error_set_error(f_invalid_parameter);
if (file_information->file == 0) return f_file_not_open;
if (ferror(file_information->file) != 0) return f_file_error;
#endif // _di_level_1_parameter_checking_
#endif // _di_fl_fss_identify_file_
#ifndef _di_fl_fss_shift_delimiters_
-f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, const f_string_location location) {
+f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_const f_string_location location) {
#ifndef _di_level_1_parameter_checking_
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
if (location.start < 0) return f_error_set_error(f_invalid_parameter);
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_identify_
- f_extern f_return_status fl_fss_identify(const f_dynamic_string buffer, f_fss_header *header);
+ f_extern f_return_status fl_fss_identify(f_const f_dynamic_string buffer, f_fss_header *header);
#endif // _di_fl_fss_identify_
#ifndef _di_fl_fss_identify_file_
// This provides a means to shift all of the delimiters to the end of the used buffer
// This allows one to do a printf on the dynamic string without the delimiters arbitrarily stopping the output
// No reallocations are performed, this will only shift characters
- f_extern f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, const f_string_location location);
+ f_extern f_return_status fl_fss_shift_delimiters(f_dynamic_string *buffer, f_const f_string_location location);
#endif // _di_fl_fss_shift_delimiters_
#ifdef __cplusplus
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/fss_basic.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_basic_object_read_
f_return_status fl_fss_basic_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#ifndef _di_fl_fss_basic_content_read_
f_return_status fl_fss_basic_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_fss_basic_content_read_
#ifndef _di_fl_fss_basic_object_write_
- f_return_status fl_fss_basic_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, f_const f_dynamic_string object, f_string_location *input) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
#endif // _di_fl_fss_basic_object_write_
#ifndef _di_fl_fss_basic_content_write_
- f_return_status fl_fss_basic_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_const f_dynamic_string content, f_string_location *input) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_basic_object_read_
#ifndef _di_fl_fss_basic_object_write_
// write an fss-0000 object
- f_extern f_return_status fl_fss_basic_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_basic_object_write(f_dynamic_string *buffer, f_const f_dynamic_string object, f_string_location *input);
#endif // _di_fl_fss_basic_object_write_
#ifndef _di_fl_fss_basic_content_write_
// write an fss-0000 content
- f_extern f_return_status fl_fss_basic_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_basic_content_write(f_dynamic_string *buffer, f_const f_dynamic_string content, f_string_location *input);
#endif // _di_fl_fss_basic_content_write_
#ifdef __cplusplus
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/fss_basic.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_basic_list_object_read_
f_return_status fl_fss_basic_list_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#ifndef _di_fl_fss_basic_list_content_read_
f_return_status fl_fss_basic_list_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_fss_basic_list_content_read_
#ifndef _di_fl_fss_basic_list_object_write_
- f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_basic_list_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
#endif // _di_fl_fss_basic_list_object_write_
#ifndef _di_fl_fss_basic_list_content_write_
- f_return_status fl_fss_basic_list_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_basic_list_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_basic_list_object_read_
#ifndef _di_fl_fss_basic_list_object_write_
// write an fss-0002 object
- f_extern f_return_status fl_fss_basic_list_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_basic_list_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer);
#endif // _di_fl_fss_basic_list_object_write_
#ifndef _di_fl_fss_basic_list_content_write_
// write an fss-0002 content
- f_extern f_return_status fl_fss_basic_list_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_basic_list_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer);
#endif // _di_fl_fss_basic_list_content_write_
#ifdef __cplusplus
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*
#include <level_0/errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_macro_test_for_fss_errors_
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/fss_extended.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_extended_object_read_
f_return_status fl_fss_extended_object_read(f_dynamic_string *buffer, f_string_location *input, f_fss_object *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#ifndef _di_fl_fss_extended_content_read_
f_return_status fl_fss_extended_content_read(f_dynamic_string *buffer, f_string_location *input, f_fss_content *found) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (input == f_null) return f_error_set_error(f_invalid_parameter);
- if (found == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (input == 0) return f_error_set_error(f_invalid_parameter);
+ if (found == 0) return f_error_set_error(f_invalid_parameter);
if (input->start < 0) return f_error_set_error(f_invalid_parameter);
if (input->stop < input->start) return f_error_set_error(f_invalid_parameter);
if (buffer->used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_fss_extended_content_read_
#ifndef _di_fl_fss_extended_object_write_
- f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_extended_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
#endif // _di_fl_fss_extended_object_write_
#ifndef _di_fl_fss_extended_content_write_
- f_return_status fl_fss_extended_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) {
+ f_return_status fl_fss_extended_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
f_status status = f_none;
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_fss_extended_object_read_
#ifndef _di_fl_fss_extended_object_write_
// write an fss-0001 object
- f_extern f_return_status fl_fss_extended_object_write(const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_extended_object_write(f_const f_dynamic_string object, f_string_location *input, f_dynamic_string *buffer);
#endif // _di_fl_fss_extended_object_write_
#ifndef _di_fl_fss_extended_content_write_
// write an fss-0001 content
- f_extern f_return_status fl_fss_extended_content_write(const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer);
+ f_extern f_return_status fl_fss_extended_content_write(f_const f_dynamic_string content, f_string_location *input, f_dynamic_string *buffer);
#endif // _di_fl_fss_extended_content_write_
#ifdef __cplusplus
/* FLL - Level 1
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#define _FL_fss_macro_h
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_macro_fss_apply_delimit_placeholders_
/* FLL - Level 1
* Project: Serialized
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#endif
#ifndef _di_fl_serialize_simple_
- f_return_status fl_serialize_simple(const f_dynamic_string value, f_dynamic_string *serialized) {
+ f_return_status fl_serialize_simple(f_const f_dynamic_string value, f_dynamic_string *serialized) {
#ifndef _di_level_0_parameter_checking_
- if (serialized == f_null) return f_error_set_error(f_invalid_parameter);
+ if (serialized == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
f_status status = f_none;
#endif // _di_fl_serialize_simple_
#ifndef _di_fl_unserialize_simple_
- f_return_status fl_unserialize_simple(const f_dynamic_string serialized, f_string_locations *locations) {
+ f_return_status fl_unserialize_simple(f_const f_dynamic_string serialized, f_string_locations *locations) {
#ifndef _di_level_0_parameter_checking_
- if (locations == f_null) return f_error_set_error(f_invalid_parameter);
+ if (locations == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
f_status status = f_none;
#endif // _di_fl_unserialize_simple_
#ifndef _di_fl_unserialize_simple_get_
- f_return_status fl_unserialize_simple_get(const f_dynamic_string serialized, const f_array_length index, f_string_location *location) {
+ f_return_status fl_unserialize_simple_get(f_const f_dynamic_string serialized, f_const f_array_length index, f_string_location *location) {
#ifndef _di_level_0_parameter_checking_
- if (location == f_null) return f_error_set_error(f_invalid_parameter);
+ if (location == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
f_status status = f_none;
/* FLL - Level 1
* Project: Serialized
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#ifndef _di_fl_serialize_simple_
// this function will append a string to the serialize.
- f_extern f_return_status fl_serialize_simple(const f_dynamic_string value, f_dynamic_string *serialized);
+ f_extern f_return_status fl_serialize_simple(f_const f_dynamic_string value, f_dynamic_string *serialized);
#endif // _di_fl_serialize_simple_
#ifndef _di_fl_unserialize_simple_
// this function will unserialize a serialized string and store the results in an array of strings.
- f_extern f_return_status fl_unserialize_simple(const f_dynamic_string serialized, f_string_locations *locations);
+ f_extern f_return_status fl_unserialize_simple(f_const f_dynamic_string serialized, f_string_locations *locations);
#endif // _di_fl_unserialize_
#ifndef _di_fl_unserialize_simple_get_
// this function will pull a single serialized value from the serialized string at the given index.
- f_extern f_return_status fl_unserialize_simple_get(const f_dynamic_string serialized, const f_array_length index, f_string_location *location);
+ f_extern f_return_status fl_unserialize_simple_get(f_const f_dynamic_string serialized, f_const f_array_length index, f_string_location *location);
#endif // _di_fl_unserialize_simple_get_
#ifdef __cplusplus
/* FLL - Level 1
* Project: Strings
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_1/strings.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_rip_string_
- f_return_status fl_rip_string(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results) {
+ f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_const f_string_location position, f_dynamic_string *results) {
#ifndef _di_level_1_parameter_checking_
- if (results == f_null) return f_error_set_error(f_invalid_parameter);
+ if (results == 0) return f_error_set_error(f_invalid_parameter);
if (position.start < 0) return f_error_set_error(f_invalid_parameter);
if (position.stop < position.start) return f_error_set_error(f_invalid_parameter);
if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_rip_string_
#ifndef _di_fl_seek_line_past_non_graph_
- f_return_status fl_seek_line_past_non_graph(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder) {
+ f_return_status fl_seek_line_past_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (position == f_null) return f_error_set_error(f_invalid_parameter);
+ if (position == 0) return f_error_set_error(f_invalid_parameter);
if (position->start < 0) return f_error_set_error(f_invalid_parameter);
if (position->stop < position->start) return f_error_set_error(f_invalid_parameter);
if (buffer.used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_seek_line_past_non_graph_
#ifndef _di_fl_seek_line_until_non_graph_
- f_return_status fl_seek_line_until_non_graph(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder) {
+ f_return_status fl_seek_line_until_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder) {
#ifndef _di_level_1_parameter_checking_
if (position->start < 0) return f_error_set_error(f_invalid_parameter);
if (position->stop < position->start) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_seek_line_until_non_graph_
#ifndef _di_fl_seek_to_
- f_return_status fl_seek_to(const f_dynamic_string buffer, f_string_location *position, const f_autochar seek_to_this) {
+ f_return_status fl_seek_to(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar seek_to_this) {
#ifndef _di_level_1_parameter_checking_
if (position->start < 0) return f_error_set_error(f_invalid_parameter);
if (position->stop < position->start) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_seek_to_
#ifndef _di_fl_compare_strings_
- f_return_status fl_compare_strings(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2) {
+ f_return_status fl_compare_strings(f_const f_string string1, f_const f_string string2, f_const f_string_length length1, f_const f_string_length length2) {
#ifndef _di_level_1_parameter_checking_
if (length1 <= 0) return f_error_set_error(f_invalid_parameter);
if (length2 <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_compare_strings_
#ifndef _di_fl_compare_dynamic_strings_
- f_return_status fl_compare_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2) {
+ f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_error_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_fl_compare_dynamic_strings_
#ifndef _di_fl_compare_partial_dynamic_strings_
- f_return_status fl_compare_partial_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2) {
+ f_return_status fl_compare_partial_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2, f_const f_string_location offset1, f_const f_string_location offset2) {
#ifndef _di_level_1_parameter_checking_
if (string1.used <= 0) return f_error_set_error(f_invalid_parameter);
if (string2.used <= 0) return f_error_set_error(f_invalid_parameter);
/* FLL - Level 1
* Project: Strings
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_0/memory.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fl_rip_string_
// given a start and stop position, this will return a new string based from the supplied buffer, based on the passed positions
// this will replace/overwrite existing information inside of the results variable
- f_extern f_return_status fl_rip_string(const f_dynamic_string buffer, const f_string_location position, f_dynamic_string *results);
+ f_extern f_return_status fl_rip_string(f_const f_dynamic_string buffer, f_const f_string_location position, f_dynamic_string *results);
#endif // _di_fl_rip_string_
#ifndef _di_fl_seek_line_past_non_graph_
// given a dynamic string and a string location, seek past all non-graph characters until a graph is reached
// will ignore the given placeholder
- f_extern f_return_status fl_seek_line_past_non_graph(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder);
+ f_extern f_return_status fl_seek_line_past_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder);
#endif // _di_fl_seek_line_past_non_graph_
#ifndef _di_fl_seek_line_until_non_graph_
// given a dynamic string and a string location, seek past all graph characters until a non-graph is reached
// will ignore the given placeholder
- f_extern f_return_status fl_seek_line_until_non_graph(const f_dynamic_string buffer, f_string_location *position, const f_autochar placeholder);
+ f_extern f_return_status fl_seek_line_until_non_graph(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar placeholder);
#endif // _di_fl_seek_line_until_non_graph_
#ifndef _di_fl_seek_to_
// given a dynamic string and a string location, seek past all characters until the given character is reached
- f_extern f_return_status fl_seek_to(const f_dynamic_string buffer, f_string_location *position, const f_autochar seek_to_this);
+ f_extern f_return_status fl_seek_to(f_const f_dynamic_string buffer, f_string_location *position, f_const f_autochar seek_to_this);
#endif // _di_fl_seek_to_
#ifndef _di_fl_compare_strings_
// this compares two strings and works similar to that of strncmp(..) but has significant differences to strncmp(..)
// given two strings, this will return either f_equal_to or f_not_equal_to
// this does not stop on f_eos and f_eos will be ignored as if it were not taking up any space, therefor a 5 character string could return f_equal_to if the 5 character string contains an f_eos anywhere within it
- f_extern f_return_status fl_compare_strings(const f_string string1, const f_string string2, const f_string_length length1, const f_string_length length2);
+ f_extern f_return_status fl_compare_strings(f_const f_string string1, f_const f_string string2, f_const f_string_length length1, f_const f_string_length length2);
#endif // _di_fl_compare_strings_
#ifndef _di_fl_compare_dynamic_strings_
// given two strings, this will return either f_equal_to or f_not_equal_to
// this is far safer than fl_compare_strings(..) as dynamic string contain size information within them
// this does not stop on f_eos and f_eos will be ignored as if it were not taking up any space, therefor a 5 character string could return f_equal_to if the 5 character string contains an f_eos anywhere within it
- f_extern f_return_status fl_compare_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2);
+ f_extern f_return_status fl_compare_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2);
#endif // _di_fl_compare_dynamic_strings_
#ifndef _di_fl_compare_partial_dynamic_strings_
// this functions identical to fl_compare_dynamic_strings, but uses offsets for both strings
- f_extern f_return_status fl_compare_partial_dynamic_strings(const f_dynamic_string string1, const f_dynamic_string string2, const f_string_location offset1, const f_string_location offset2);
+ f_extern f_return_status fl_compare_partial_dynamic_strings(f_const f_dynamic_string string1, f_const f_dynamic_string string2, f_const f_string_location offset1, f_const f_string_location offset2);
#endif // _di_fl_compare_partial_dynamic_strings_
#ifdef __cplusplus
/* FLL - Level 2
* Project: Colors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_2/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_colors_load_context_
/* FLL - Level 2
* Project: Colors
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_colors_load_context_
/* FLL - Level 2
* Project: Execute
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/execute.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_execute_path_
- f_return_status fll_execute_path(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results) {
+ f_return_status fll_execute_path(f_const f_string program_path, f_const f_dynamic_strings arguments, f_s_int *results) {
#ifndef _di_level_2_parameter_checking_
- if (results == f_null) return f_error_set_error(f_invalid_parameter);
+ if (results == 0) return f_error_set_error(f_invalid_parameter);
if (arguments.used < 0) return f_error_set_error(f_invalid_parameter);
if (arguments.used > arguments.size) return f_error_set_error(f_invalid_parameter);
last_slash = strrchr(program_path, '/');
- if (last_slash != f_null) {
+ if (last_slash != 0) {
name_size = strnlen(last_slash, PATH_MAX);
if (name_size > 1) {
}
}
- status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2);
+ status = f_new_array((f_void_p *) & arguments_array, sizeof(f_autochar **), arguments.used + 2);
if (f_error_is_error(status)) {
f_status tmp_status = f_none;
if (process_id < 0) {
if (name_size > 0) f_delete_string(status, program_name, name_size);
- f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2);
+ f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2);
return f_error_set_error(f_fork_failed);
}
waitpid(process_id, results, 0);
if (name_size > 0) f_delete_string(status, program_name, name_size);
- f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2);
+ f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2);
if (*results != 0) return f_error_set_error(f_failure);
#endif // _di_fll_execute_path_
#ifndef _di_fll_execute_program_
- f_return_status fll_execute_program(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results) {
+ f_return_status fll_execute_program(f_const f_string program_name, f_const f_dynamic_strings arguments, f_s_int *results) {
#ifndef _di_level_2_parameter_checking_
- if (results == f_null) return f_error_set_error(f_invalid_parameter);
+ if (results == 0) return f_error_set_error(f_invalid_parameter);
if (arguments.used < 0) return f_error_set_error(f_invalid_parameter);
if (arguments.used > arguments.size) return f_error_set_error(f_invalid_parameter);
f_status status = f_none;
f_autochar **arguments_array = 0;
- status = f_new_array((void **) & arguments_array, sizeof(f_autochar **), arguments.used + 2);
+ status = f_new_array((f_void_p *) & arguments_array, sizeof(f_autochar **), arguments.used + 2);
if (f_error_is_error(status)) return status;
process_id = vfork();
if (process_id < 0) {
- f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2);
+ f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2);
return f_error_set_error(f_fork_failed);
}
// have the parent wait for the child process to finish
waitpid(process_id, results, 0);
- f_delete((void **) & arguments_array, sizeof(f_autochar), arguments.used + 2);
+ f_delete((f_void_p *) & arguments_array, sizeof(f_autochar), arguments.used + 2);
if (*results != 0) return f_error_set_error(f_failure);
/* FLL - Level 2
* Project: Execute
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
// fll-1 includes
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_execute_path_
// This will execute a program given some path + program name (such as "/bin/bash")
- f_extern f_return_status fll_execute_path(const f_string program_path, const f_dynamic_strings arguments, f_s_int *results);
+ f_extern f_return_status fll_execute_path(f_const f_string program_path, f_const f_dynamic_strings arguments, f_s_int *results);
#endif // _di_fll_execute_path_
#ifndef _di_fll_execute_program_
// This will find the program based on PATH environment so that static paths do not have to be used as with f_execute_path
- f_extern f_return_status fll_execute_program(const f_string program_name, const f_dynamic_strings arguments, f_s_int *results);
+ f_extern f_return_status fll_execute_program(f_const f_string program_name, f_const f_dynamic_strings arguments, f_s_int *results);
#endif // _di_fll_execute_program_
#ifdef __cplusplus
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_2/fss_basic.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_basic_read_
f_return_status fll_fss_basic_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (objects == f_null) return f_error_set_error(f_invalid_parameter);
- if (contents == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (objects == 0) return f_error_set_error(f_invalid_parameter);
+ if (contents == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
f_status status = f_none;
#endif // _di_fll_fss_basic_read_
#ifndef _di_fll_fss_basic_write_
- f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) {
+ f_return_status fll_fss_basic_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
location.start = 0;
location.stop = object.used - 1;
- status = fl_fss_basic_object_write(object, &location, buffer);
+ status = fl_fss_basic_object_write(buffer, object, &location);
if (f_macro_test_for_no_data_errors(status)) {
return status;
if (contents.used > 0) {
location.start = 0;
location.stop = contents.array[0].used - 1;
- status = fl_fss_basic_content_write(contents.array[0], &location, buffer);
+ status = fl_fss_basic_content_write(buffer, contents.array[0], &location);
if (f_macro_test_for_no_data_errors(status)) {
return status;
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_basic.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_basic_read_
#ifndef _di_fll_fss_basic_write_
// write an fss-0000 object and then content
- f_extern f_return_status fll_fss_basic_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer);
+ f_extern f_return_status fll_fss_basic_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer);
#endif // _di_fll_fss_basic_write_
#ifdef __cplusplus
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_2/fss_basic_list.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_basic_list_read_
f_return_status fll_fss_basic_list_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (objects == f_null) return f_error_set_error(f_invalid_parameter);
- if (contents == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (objects == 0) return f_error_set_error(f_invalid_parameter);
+ if (contents == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
f_status status = f_none;
#endif // _di_fll_fss_basic_list_read_
#ifndef _di_fll_fss_basic_list_write_
- f_return_status fll_fss_basic_list_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) {
+ f_return_status fll_fss_basic_list_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_basic_list.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_basic_list_read_
#ifndef _di_fll_fss_basic_list_write_
// write an fss-0000 object and then content
- f_extern f_return_status fll_fss_basic_list_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer);
+ f_extern f_return_status fll_fss_basic_list_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer);
#endif // _di_fll_fss_basic_list_write_
#ifdef __cplusplus
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_2/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_errors_to_string_
- f_return_status fll_fss_errors_to_string(const f_status error, f_string *string) {
+ f_return_status fll_fss_errors_to_string(f_const f_status error, f_string *string) {
#ifndef _di_level_2_parameter_checking_
- if (string == f_null) return f_error_set_error(f_invalid_parameter);
+ if (string == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
f_status unmasked_error = f_error_set_fine(error);
#endif // _di_fll_errors_to_string_
#ifndef _di_fll_fss_errors_is_error_
- f_return_status fll_fss_errors_is_error(const f_status error) {
+ f_return_status fll_fss_errors_is_error(f_const f_status error) {
if (fll_fss_errors_is_fine(error) == f_true) {
return f_false;
} else if (fll_fss_errors_is_warning(error) == f_true) {
#endif // _di_fll_fss_errors_is_error_
#ifndef _di_fll_fss_errors_is_warning_
- f_return_status fll_fss_errors_is_warning(const f_status error) {
+ f_return_status fll_fss_errors_is_warning(f_const f_status error) {
switch (error) {
#ifndef _di_fll_fss_errors_basic_
case f_no_data:
#endif // _di_fll_fss_errors_is_warning_
#ifndef _di_fll_fss_errors_is_fine_
- f_return_status fll_fss_errors_is_fine(const f_status error) {
+ f_return_status fll_fss_errors_is_fine(f_const f_status error) {
switch (error) {
#ifndef _di_fll_fss_errors_booleans_
case f_false:
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_basic.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_errors_to_string_
// Convert error codes to their string equivalents.
- f_extern f_return_status fll_fss_errors_to_string(const f_status error, f_string *string);
+ f_extern f_return_status fll_fss_errors_to_string(f_const f_status error, f_string *string);
#endif // _di_fll_errors_to_string_
#ifndef _di_fll_fss_errors_is_error_
// Returns true or false depending on whether the standard context of the error code represents an error.
// Keep in mind that many of the error codes are context-specific and may be reported as an error here when it is in fact not an error.
- f_extern f_return_status fll_fss_errors_is_error(const f_status error);
+ f_extern f_return_status fll_fss_errors_is_error(f_const f_status error);
#endif // _di_fll_fss_errors_is_error_
#ifndef _di_fll_fss_errors_is_warning_
// Returns true or false depending on whether the standard context of the error code represents a warning.
// Keep in mind that many of the error codes are context-specific and may be reported as a warning here when it is in fact not a warning.
- f_extern f_return_status fll_fss_errors_is_warning(const f_status error);
+ f_extern f_return_status fll_fss_errors_is_warning(f_const f_status error);
#endif // _di_fll_fss_errors_is_warning_
#ifndef _di_fll_fss_errors_is_fine_
// Returns true or false depending on whether the standard context of the error code represents an normal return status and not an error.
// Keep in mind that many of the error codes are context-specific and may be reported as "fine" here when it is in fact not fine.
- f_extern f_return_status fll_fss_errors_is_fine(const f_status error);
+ f_extern f_return_status fll_fss_errors_is_fine(f_const f_status error);
#endif // _di_fll_fss_errors_is_fine_
#ifdef __cplusplus
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_2/fss_extended.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_extended_read_
f_return_status fll_fss_extended_read(f_dynamic_string *buffer, f_string_location *input, f_fss_objects *objects, f_fss_contents *contents) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
- if (objects == f_null) return f_error_set_error(f_invalid_parameter);
- if (contents == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
+ if (objects == 0) return f_error_set_error(f_invalid_parameter);
+ if (contents == 0) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
f_status status = f_none;
#endif // _di_fll_fss_extended_read_
#ifndef _di_fll_fss_extended_write_
- f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer) {
+ f_return_status fll_fss_extended_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer) {
#ifndef _di_level_2_parameter_checking_
- if (buffer == f_null) return f_error_set_error(f_invalid_parameter);
+ if (buffer == 0) return f_error_set_error(f_invalid_parameter);
if (contents.used > contents.size) return f_error_set_error(f_invalid_parameter);
#endif // _di_level_2_parameter_checking_
/* FLL - Level 2
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_1/fss_extended.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fll_fss_extended_read_
#ifndef _di_fll_fss_extended_write_
// write an fss-0000 object and then content
- f_extern f_return_status fll_fss_extended_write(const f_dynamic_string object, const f_dynamic_strings contents, f_dynamic_string *buffer);
+ f_extern f_return_status fll_fss_extended_write(f_const f_dynamic_string object, f_const f_dynamic_strings contents, f_dynamic_string *buffer);
#endif // _di_fll_fss_extended_write_
#ifdef __cplusplus
/* FLL - Level 3
* Project: Firewall
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include "private-firewall.h"
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_firewall_print_version_
- f_return_status firewall_print_version(const firewall_data data) {
+ f_return_status firewall_print_version(f_const firewall_data data) {
printf("%s\n", firewall_version);
return f_none;
#endif // _firewall_print_version_
#ifndef _di_firewall_print_help_
- f_return_status firewall_print_help(const firewall_data data) {
+ f_return_status firewall_print_help(f_const firewall_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", firewall_name_long);
#endif // _di_firewall_print_help_
#ifndef _di_firewall_main_
- f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data) {
+ f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: Firewall
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_firewall_version_
#define firewall_major_version "0"
- #define firewall_minor_version "4"
- #define firewall_micro_version "2"
+ #define firewall_minor_version "5"
+ #define firewall_micro_version "0"
#define firewall_version firewall_major_version "." firewall_minor_version "." firewall_micro_version
#endif // _di_firewall_version_
#endif // _di_firewall_data_
#ifndef _di_firewall_print_version_
- f_extern f_return_status firewall_print_version(const firewall_data data);
+ f_extern f_return_status firewall_print_version(f_const firewall_data data);
#endif // _di_firewall_print_version_
#ifndef _di_firewall_print_help_
- f_extern f_return_status firewall_print_help(const firewall_data data);
+ f_extern f_return_status firewall_print_help(f_const firewall_data data);
#endif // _di_firewall_print_help_
#ifndef _di_firewall_main_
- f_extern f_return_status firewall_main(const f_s_int argc, const f_string argv[], firewall_data *data);
+ f_extern f_return_status firewall_main(f_const f_s_int argc, f_const f_string argv[], firewall_data *data);
#endif // _di_firewall_main_
#ifndef _di_firewall_delete_data_
#include <level_3/firewall.h>
-int main(const f_s_int argc, const f_string argv[]) {
+int main(f_const f_s_int argc, f_const f_string argv[]) {
firewall_data data = firewall_data_initialize;
return firewall_main(argc, argv, &data);
#include "private-firewall.h"
#ifndef _di_firewall_perform_commands_
- f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) {
+ f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) {
f_status status = f_none;
f_status status2 = f_none;
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
arguments.array[arguments.used].size = argument.size;
arguments.array[arguments.used].used = argument.used;
arguments.used++;
- argument.string = f_null;
+ argument.string = 0;
argument.size = 0;
argument.used = 0;
}
}
// nullify the static string
- static_string.string = f_null;
+ static_string.string = 0;
static_string.used = 0;
if (new_chain) {
}
#endif // _di_firewall_create_custom_chains_
-#ifndef _di_firewall_process_rules_
- f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) {
+#ifndef _di_firewall_buffer_rules_
+ f_return_status firewall_buffer_rules(f_const f_string filename, f_const f_bool optional, firewall_local_data *local, firewall_data *data) {
f_file file = f_file_initialize;
f_status status = f_none;
#define _PRIVATE_firewall_h
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_firewall_local_data_
#endif // _di_firewall_macro_private_
#ifndef _di_firewall_perform_commands_
- f_return_status firewall_perform_commands(const firewall_local_data local, const firewall_data data) __attribute__((visibility("internal")));
+ f_return_status firewall_perform_commands(f_const firewall_local_data local, f_const firewall_data data) f_gcc_attribute_visibility_internal;
#endif // _di_firewall_perform_commands_
#ifndef _di_firewall_create_custom_chains_
- f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal")));
+ f_return_status firewall_create_custom_chains(firewall_reserved_chains *reserved, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal;
#endif // _di_firewall_create_custom_chains_
#ifndef _di_firewall_buffer_rules_
- f_return_status firewall_buffer_rules(const f_string filename, const f_bool optional, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal")));
+ f_return_status firewall_buffer_rules(f_const f_string filename, f_const f_bool optional, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal;
#endif // _di_firewall_buffer_rules_
#ifndef _di_firewall_process_rules_
- f_return_status firewall_process_rules(f_string_location *input, firewall_local_data *local, firewall_data *data) __attribute__((visibility("internal")));
+ f_return_status firewall_process_rules(f_string_location *input, firewall_local_data *local, firewall_data *data) f_gcc_attribute_visibility_internal;
#endif // _di_firewall_process_rules_
#ifndef _di_firewall_delete_local_data_
- f_return_status firewall_delete_local_data(firewall_local_data *local) __attribute__((visibility("internal")));
+ f_return_status firewall_delete_local_data(firewall_local_data *local) f_gcc_attribute_visibility_internal;
#endif // _di_firewall_delete_local_data_
#ifdef __cplusplus
# fss-0002
main:
- # initialize the firewall
- direction none
- action none
-
- rule -F
- rule -Z
-
- tool iptables
- rule -t nat -F
- rule -t mangle -F
- tool ip46tables
-
- # setup initial operations
- chain INPUT
- direction input
- action append
-
- # Enable ALL local connections (loopback)
- device lo
- chain OUTPUT
- direction output
- rule -j ACCEPT
-
- chain INPUT
- direction input
- rule -j ACCEPT
- device all
-
-
- # Drop all INVALID packets so they aren't even processed
- chain OUTPUT
- rule -m state --state INVALID -j DROP
-
- chain INPUT
- rule -m state --state INVALID -j DROP
-
-
- # Drop multicasts and broadcasts, they should not exist for a router and in most cases should be avoided.
- # unicasts are the normal behavior and blocking them would be very unusual.
- chain OUTPUT
- rule -m pkttype --pkt-type broadcast -j output-casting
- rule -m pkttype --pkt-type multicast -j output-casting
- #rule -m pkttype --pkt-type unicast -j output-casting
- chain INPUT
- rule -m pkttype --pkt-type broadcast -j input-casting
- rule -m pkttype --pkt-type multicast -j input-casting
- #rule -m pkttype --pkt-type unicast -j input-casting
-
-
- # Allow ALL input&output connections that have already been established by this host (using conntrack might be more efficient)
- chain OUTPUT
- rule -m state --state ESTABLISHED,RELATED -j ACCEPT
- #rule -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-
- chain INPUT
- rule -m state --state ESTABLISHED,RELATED -j ACCEPT
- #rule -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-
-
- # send all tcp packets to the tcp queue
- chain OUTPUT
- protocol tcp
- rule -m state --state NEW -j output-tcp
-
- chain INPUT
- rule -m state --state NEW -j input-tcp
-
-
- # send all udp packets to the udp queue
- chain OUTPUT
- protocol udp
- rule -m state --state NEW -j output-udp
-
- chain INPUT
- rule -m state --state NEW -j input-udp
-
-
- # send all ipv4 icmp packets to the icmp queue
- tool iptables
- chain OUTPUT
- protocol icmp
- rule -m state --state NEW -j output-icmp
-
- chain INPUT
- rule -m state --state NEW -j input-icmp
-
- # send all ipv6 icmp packets to the icmp queue (alternatively put this in its own chain, such as input-icmpv6 and output-icmpv6)
- tool ip6tables
- chain OUTPUT
- protocol icmpv6
- rule -m state --state NEW -j output-icmp
-
- chain INPUT
- rule -m state --state NEW -j input-icmp
-
-
-input-tcp:
- direction input
- protocol tcp
-
- # Prevent an XMAS attack
- rule --tcp-flags ALL ALL -j DROP
-
- # Prevent NULL attack
- rule --tcp-flags ALL NONE -j DROP
-
-
-input-udp:
- direction input
- protocol udp
-
- # Allow dhcp client renewals (from server to client). If these are blocked, you will not be able to renew easily
- tool iptables
- rule -s 0.0.0.0 --sport 67 -d 255.255.255.255 --dport 68 -j ACCEPT
- tool ip46tables
-
-
-input-icmp:
- direction input
- protocol icmp
-
-
-output-tcp:
- direction output
- protocol tcp
-
-
-output-udp:
- direction output
- protocol udp
-
-
-output-icmp:
- direction output
- protocol icmp
-
-
-input-casting:
- # pre-process broadcasts and multicasts.
- direction input
- protocol none
- tool ip46tables
-
- # do not auto-drop dhcp messages sent from a dhcp server to a local dhcp client.
- # dhcp offer/acknowledge (the source address must be the routers address, so do not allow 0.0.0.0/0)
- protocol udp
- tool iptables
- rule --sport 67 -d 255.255.255.255 --dport 68 -j RETURN
- protocol none
- tool ip46tables
-
- # drop all remaining broadcasts and multicasts
- rule -j DROP
-
-
-output-casting:
- # pre-process broadcasts and multicasts.
- direction output
- protocol none
- tool ip46tables
-
- # do not auto-drop dhcp client messages sent to a dhcp server.
- # dhcp discover/request (for the request, the dhcp server ip address is known but for some reason the dhcp standard states tat the src is 0.0.0.0.
- protocol udp
- tool iptables
- rule --sport 68 -d 255.255.255.255 --dport 67 -j RETURN
- protocol none
- tool ip46tables
-
- # drop all remaining broadcasts and multicasts
- rule -j DROP
+ rule tty
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_basic_list_read.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_basic_list_read_print_version_
- f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data) {
+ f_return_status fss_basic_list_read_print_version(f_const fss_basic_list_read_data data) {
printf("%s\n", fss_basic_list_read_version);
return f_none;
#endif // _fss_basic_list_read_print_version_
#ifndef _di_fss_basic_list_read_print_help_
- f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data) {
+ f_return_status fss_basic_list_read_print_help(f_const fss_basic_list_read_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_list_read_name_long);
#endif // _di_fss_basic_list_read_print_help_
#ifndef _di_fss_basic_list_read_main_
- f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility ("internal")));
+ f_return_status fss_basic_list_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data, f_const f_string filename, f_const f_string_length target) __attribute__((visibility ("internal")));
- f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data) {
+ f_return_status fss_basic_list_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data) {
f_status status = f_none;
f_status status2 = f_none;
return status;
}
- f_return_status fss_basic_list_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data, const f_string filename, const f_string_length target) {
+ f_return_status fss_basic_list_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data, f_const f_string filename, f_const f_string_length target) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/execute.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_basic_list_read_version_
#define fss_basic_list_read_major_version "0"
- #define fss_basic_list_read_minor_version "4"
- #define fss_basic_list_read_micro_version "2"
+ #define fss_basic_list_read_minor_version "5"
+ #define fss_basic_list_read_micro_version "0"
#define fss_basic_list_read_version fss_basic_list_read_major_version "." fss_basic_list_read_minor_version "." fss_basic_list_read_micro_version
#endif // _di_fss_basic_list_read_version_
#endif // _di_fss_basic_list_read_data_
#ifndef _di_fss_basic_list_read_print_version_
- f_extern f_return_status fss_basic_list_read_print_version(const fss_basic_list_read_data data);
+ f_extern f_return_status fss_basic_list_read_print_version(f_const fss_basic_list_read_data data);
#endif // _di_fss_basic_list_read_print_version_
#ifndef _di_fss_basic_list_read_print_help_
- f_extern f_return_status fss_basic_list_read_print_help(const fss_basic_list_read_data data);
+ f_extern f_return_status fss_basic_list_read_print_help(f_const fss_basic_list_read_data data);
#endif // _di_fss_basic_list_read_print_help_
#ifndef _di_fss_basic_list_read_main_
- f_extern f_return_status fss_basic_list_read_main(const f_array_length argc, const f_string argv[], fss_basic_list_read_data *data);
+ f_extern f_return_status fss_basic_list_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_read_data *data);
#endif // _di_fss_basic_list_read_main_
#ifndef _di_fss_basic_list_read_delete_data_
#include <level_3/fss_basic_list_read.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_basic_list_read_data data = fss_basic_list_read_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_basic_list_write.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_basic_list_write_print_version_
- f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data) {
+ f_return_status fss_basic_list_write_print_version(f_const fss_basic_list_write_data data) {
printf("%s\n", fss_basic_list_write_version);
return f_none;
#endif // _fss_basic_list_write_print_version_
#ifndef _di_fss_basic_list_write_print_help_
- f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data) {
+ f_return_status fss_basic_list_write_print_help(f_const fss_basic_list_write_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_list_write_name_long);
#endif // _di_fss_basic_list_write_print_help_
#ifndef _di_fss_basic_list_write_main_
- f_return_status fss_basic_list_write_main(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data) {
+ f_return_status fss_basic_list_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_write_data *data) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_basic_list_write_version_
#define fss_basic_list_write_major_version "0"
- #define fss_basic_list_write_minor_version "4"
- #define fss_basic_list_write_micro_version "2"
+ #define fss_basic_list_write_minor_version "5"
+ #define fss_basic_list_write_micro_version "0"
#define fss_basic_list_write_version fss_basic_list_write_major_version "." fss_basic_list_write_minor_version "." fss_basic_list_write_micro_version
#endif // _di_fss_basic_list_write_version_
#endif // _di_fss_basic_list_write_data_
#ifndef _di_fss_basic_list_write_print_version_
- f_extern f_return_status fss_basic_list_write_print_version(const fss_basic_list_write_data data);
+ f_extern f_return_status fss_basic_list_write_print_version(f_const fss_basic_list_write_data data);
#endif // _di_fss_basic_list_write_print_version_
#ifndef _di_fss_basic_list_write_print_help_
- f_extern f_return_status fss_basic_list_write_print_help(const fss_basic_list_write_data data);
+ f_extern f_return_status fss_basic_list_write_print_help(f_const fss_basic_list_write_data data);
#endif // _di_fss_basic_list_write_print_help_
#ifndef _di_fss_basic_list_write_main_
- f_extern f_return_status fss_basic_list_write_main(const f_array_length argc, const f_string argv[], fss_basic_list_write_data *data);
+ f_extern f_return_status fss_basic_list_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_list_write_data *data);
#endif // _di_fss_basic_list_write_main_
#ifndef _di_fss_basic_list_write_delete_data_
#include <level_3/fss_basic_list_write.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_basic_list_write_data data = fss_basic_list_write_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_basic_read.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_basic_read_print_version_
- f_return_status fss_basic_read_print_version(const fss_basic_read_data data) {
+ f_return_status fss_basic_read_print_version(f_const fss_basic_read_data data) {
printf("%s\n", fss_basic_read_version);
return f_none;
#endif // _fss_basic_read_print_version_
#ifndef _di_fss_basic_read_print_help_
- f_return_status fss_basic_read_print_help(const fss_basic_read_data data) {
+ f_return_status fss_basic_read_print_help(f_const fss_basic_read_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_read_name_long);
#endif // _di_fss_basic_read_print_help_
#ifndef _di_fss_basic_read_main_
- f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) __attribute__((visibility("internal")));
+ f_return_status fss_basic_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data, f_const f_string filename, f_const f_string_length target) f_gcc_attribute_visibility_internal;
- f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data) {
+ f_return_status fss_basic_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data) {
f_status status = f_none;
f_status status2 = f_none;
return status;
}
- f_return_status fss_basic_read_main_process_file(const f_array_length argc, const f_string argv[], fss_basic_read_data *data, const f_string filename, const f_string_length target) {
+ f_return_status fss_basic_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data, f_const f_string filename, f_const f_string_length target) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/execute.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_basic_read_version_
#define fss_basic_read_major_version "0"
- #define fss_basic_read_minor_version "4"
- #define fss_basic_read_micro_version "2"
+ #define fss_basic_read_minor_version "5"
+ #define fss_basic_read_micro_version "0"
#define fss_basic_read_version fss_basic_read_major_version "." fss_basic_read_minor_version "." fss_basic_read_micro_version
#endif // _di_fss_basic_read_version_
#endif // _di_fss_basic_read_data_
#ifndef _di_fss_basic_read_print_version_
- f_extern f_return_status fss_basic_read_print_version(const fss_basic_read_data data);
+ f_extern f_return_status fss_basic_read_print_version(f_const fss_basic_read_data data);
#endif // _di_fss_basic_read_print_version_
#ifndef _di_fss_basic_read_print_help_
- f_extern f_return_status fss_basic_read_print_help(const fss_basic_read_data data);
+ f_extern f_return_status fss_basic_read_print_help(f_const fss_basic_read_data data);
#endif // _di_fss_basic_read_print_help_
#ifndef _di_fss_basic_read_main_
- f_extern f_return_status fss_basic_read_main(const f_array_length argc, const f_string argv[], fss_basic_read_data *data);
+ f_extern f_return_status fss_basic_read_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_read_data *data);
#endif // _di_fss_basic_read_main_
#ifndef _di_fss_basic_read_delete_data_
#include <level_3/fss_basic_read.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_basic_read_data data = fss_basic_read_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_basic_write.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_basic_write_print_version_
- f_return_status fss_basic_write_print_version(const fss_basic_write_data data) {
+ f_return_status fss_basic_write_print_version(f_const fss_basic_write_data data) {
printf("%s\n", fss_basic_write_version);
return f_none;
#endif // _fss_basic_write_print_version_
#ifndef _di_fss_basic_write_print_help_
- f_return_status fss_basic_write_print_help(const fss_basic_write_data data) {
+ f_return_status fss_basic_write_print_help(f_const fss_basic_write_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_basic_write_name_long);
#endif // _di_fss_basic_write_print_help_
#ifndef _di_fss_basic_write_main_
- f_return_status fss_basic_write_main(const f_array_length argc, const f_string argv[], fss_basic_write_data *data) {
+ f_return_status fss_basic_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_write_data *data) {
f_status status = f_none;
f_status status2 = f_none;
location.stop = input.used - 1;
if (object) {
- status = fl_fss_basic_object_write(input, &location, &buffer);
+ status = fl_fss_basic_object_write(&buffer, input, &location);
if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
return f_error_set_error(status);
}
} else {
- status = fl_fss_basic_content_write(input, &location, &buffer);
+ status = fl_fss_basic_content_write(&buffer, input, &location);
if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
return f_error_set_error(status);
location.stop = input.used - 1;
if (object) {
- status = fl_fss_basic_object_write(input, &location, &buffer);
+ status = fl_fss_basic_object_write(&buffer, input, &location);
if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
return f_error_set_error(status);
}
} else {
- status = fl_fss_basic_content_write(input, &location, &buffer);
+ status = fl_fss_basic_content_write(&buffer, input, &location);
if (f_error_is_error(status) || f_macro_test_for_no_data_errors(status)) {
return f_error_set_error(status);
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_basic_write_version_
#define fss_basic_write_major_version "0"
- #define fss_basic_write_minor_version "4"
- #define fss_basic_write_micro_version "2"
+ #define fss_basic_write_minor_version "5"
+ #define fss_basic_write_micro_version "0"
#define fss_basic_write_version fss_basic_write_major_version "." fss_basic_write_minor_version "." fss_basic_write_micro_version
#endif // _di_fss_basic_write_version_
#endif // _di_fss_basic_write_data_
#ifndef _di_fss_basic_write_print_version_
- f_extern f_return_status fss_basic_write_print_version(const fss_basic_write_data data);
+ f_extern f_return_status fss_basic_write_print_version(f_const fss_basic_write_data data);
#endif // _di_fss_basic_write_print_version_
#ifndef _di_fss_basic_write_print_help_
- f_extern f_return_status fss_basic_write_print_help(const fss_basic_write_data data);
+ f_extern f_return_status fss_basic_write_print_help(f_const fss_basic_write_data data);
#endif // _di_fss_basic_write_print_help_
#ifndef _di_fss_basic_write_main_
- f_extern f_return_status fss_basic_write_main(const f_array_length argc, const f_string argv[], fss_basic_write_data *data);
+ f_extern f_return_status fss_basic_write_main(f_const f_array_length argc, f_const f_string argv[], fss_basic_write_data *data);
#endif // _di_fss_basic_write_main_
#ifndef _di_fss_basic_write_delete_data_
#include <level_3/fss_basic_write.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_basic_write_data data = fss_basic_write_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_extended_read.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_extended_read_print_version_
- f_return_status fss_extended_read_print_version(const fss_extended_read_data data) {
+ f_return_status fss_extended_read_print_version(f_const fss_extended_read_data data) {
printf("%s\n", fss_extended_read_version);
return f_none;
#endif // _fss_extended_read_print_version_
#ifndef _di_fss_extended_read_print_help_
- f_return_status fss_extended_read_print_help(const fss_extended_read_data data) {
+ f_return_status fss_extended_read_print_help(f_const fss_extended_read_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_extended_read_name_long);
#endif // _di_fss_extended_read_print_help_
#ifndef _di_fss_extended_read_main_
- f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) __attribute__((visibility("internal")));
+ f_return_status fss_extended_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data, f_const f_string filename, f_const f_string_length target, f_const f_string_length select) f_gcc_attribute_visibility_internal;
- f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data) {
+ f_return_status fss_extended_read_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data) {
f_status status = f_none;
f_status status2 = f_none;
return status;
}
- f_return_status fss_extended_read_main_process_file(const f_array_length argc, const f_string argv[], fss_extended_read_data *data, const f_string filename, const f_string_length target, const f_string_length select) {
+ f_return_status fss_extended_read_main_process_file(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data, f_const f_string filename, f_const f_string_length target, f_const f_string_length select) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/execute.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_extended_read_version_
#define fss_extended_read_major_version "0"
- #define fss_extended_read_minor_version "4"
- #define fss_extended_read_micro_version "2"
+ #define fss_extended_read_minor_version "5"
+ #define fss_extended_read_micro_version "0"
#define fss_extended_read_version fss_extended_read_major_version "." fss_extended_read_minor_version "." fss_extended_read_micro_version
#endif // _di_fss_extended_read_version_
#endif // _di_fss_extended_read_data_
#ifndef _di_fss_extended_read_print_version_
- f_extern f_return_status fss_extended_read_print_version(const fss_extended_read_data data);
+ f_extern f_return_status fss_extended_read_print_version(f_const fss_extended_read_data data);
#endif // _di_fss_extended_read_print_version_
#ifndef _di_fss_extended_read_print_help_
- f_extern f_return_status fss_extended_read_print_help(const fss_extended_read_data data);
+ f_extern f_return_status fss_extended_read_print_help(f_const fss_extended_read_data data);
#endif // _di_fss_extended_read_print_help_
#ifndef _di_fss_extended_read_main_
- f_extern f_return_status fss_extended_read_main(const f_array_length argc, const f_string argv[], fss_extended_read_data *data);
+ f_extern f_return_status fss_extended_read_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_read_data *data);
#endif // _di_fss_extended_read_main_
#ifndef _di_fss_extended_read_delete_data_
#include <level_3/fss_extended_read.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_extended_read_data data = fss_extended_read_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_extended_write.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_extended_write_print_version_
- f_return_status fss_extended_write_print_version(const fss_extended_write_data data) {
+ f_return_status fss_extended_write_print_version(f_const fss_extended_write_data data) {
printf("%s\n", fss_extended_write_version);
return f_none;
#endif // _fss_extended_write_print_version_
#ifndef _di_fss_extended_write_print_help_
- f_return_status fss_extended_write_print_help(const fss_extended_write_data data) {
+ f_return_status fss_extended_write_print_help(f_const fss_extended_write_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_extended_write_name_long);
#endif // _di_fss_extended_write_print_help_
#ifndef _di_fss_extended_write_main_
- f_return_status fss_extended_write_main(const f_array_length argc, const f_string argv[], fss_extended_write_data *data) {
+ f_return_status fss_extended_write_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_write_data *data) {
f_status status = f_none;
f_status status2 = f_none;
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_extended_write_version_
#define fss_extended_write_major_version "0"
- #define fss_extended_write_minor_version "4"
- #define fss_extended_write_micro_version "2"
+ #define fss_extended_write_minor_version "5"
+ #define fss_extended_write_micro_version "0"
#define fss_extended_write_version fss_extended_write_major_version "." fss_extended_write_minor_version "." fss_extended_write_micro_version
#endif // _di_fss_extended_write_version_
#endif // _di_fss_extended_write_data_
#ifndef _di_fss_extended_write_print_version_
- f_extern f_return_status fss_extended_write_print_version(const fss_extended_write_data data);
+ f_extern f_return_status fss_extended_write_print_version(f_const fss_extended_write_data data);
#endif // _di_fss_extended_write_print_version_
#ifndef _di_fss_extended_write_print_help_
- f_extern f_return_status fss_extended_write_print_help(const fss_extended_write_data data);
+ f_extern f_return_status fss_extended_write_print_help(f_const fss_extended_write_data data);
#endif // _di_fss_extended_write_print_help_
#ifndef _di_fss_extended_write_main_
- f_extern f_return_status fss_extended_write_main(const f_array_length argc, const f_string argv[], fss_extended_write_data *data);
+ f_extern f_return_status fss_extended_write_main(f_const f_array_length argc, f_const f_string argv[], fss_extended_write_data *data);
#endif // _di_fss_extended_write_main_
#ifndef _di_fss_extended_write_delete_data_
#include <level_3/fss_extended_write.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_extended_write_data data = fss_extended_write_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/fss_return_code.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_fss_return_code_print_version_
- f_return_status fss_return_code_print_version(const fss_return_code_data data) {
+ f_return_status fss_return_code_print_version(f_const fss_return_code_data data) {
printf("%s\n", fss_return_code_version);
return f_none;
#endif // _fss_return_code_print_version_
#ifndef _di_fss_return_code_print_help_
- f_return_status fss_return_code_print_help(const fss_return_code_data data) {
+ f_return_status fss_return_code_print_help(f_const fss_return_code_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", fss_return_code_name_long);
#endif // _di_fss_return_code_print_help_
#ifndef _di_fss_return_code_main_
- f_return_status fss_return_code_main(const f_array_length argc, const f_string argv[], fss_return_code_data *data) {
+ f_return_status fss_return_code_main(f_const f_array_length argc, f_const f_string argv[], fss_return_code_data *data) {
f_status status = f_none;
f_status allocation_status = f_none;
if (data->remaining.used > 0) {
for (; counter < data->remaining.used; counter++) {
f_status code = (f_status) atoll(argv[data->remaining.array[counter]]);
- f_string string = f_null;
+ f_string string = 0;
if (fll_fss_errors_to_string(code, &string) == f_none) {
printf("%s\n", string);
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/fss_errors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_fss_return_code_version_
#define fss_return_code_major_version "0"
- #define fss_return_code_minor_version "4"
- #define fss_return_code_micro_version "2"
+ #define fss_return_code_minor_version "5"
+ #define fss_return_code_micro_version "0"
#define fss_return_code_version fss_return_code_major_version "." fss_return_code_minor_version "." fss_return_code_micro_version
#endif // _di_fss_return_code_version_
#endif // _di_fss_return_code_data_
#ifndef _di_fss_return_code_print_version_
- f_extern f_return_status fss_return_code_print_version(const fss_return_code_data data);
+ f_extern f_return_status fss_return_code_print_version(f_const fss_return_code_data data);
#endif // _di_fss_return_code_print_version_
#ifndef _di_fss_return_code_print_help_
- f_extern f_return_status fss_return_code_print_help(const fss_return_code_data data);
+ f_extern f_return_status fss_return_code_print_help(f_const fss_return_code_data data);
#endif // _di_fss_return_code_print_help_
#ifndef _di_fss_return_code_main_
- f_extern f_return_status fss_return_code_main(const f_array_length argc, const f_string argv[], fss_return_code_data *data);
+ f_extern f_return_status fss_return_code_main(f_const f_array_length argc, f_const f_string argv[], fss_return_code_data *data);
#endif // _di_fss_return_code_main_
#ifndef _di_fss_return_code_delete_data_
#include <level_3/fss_return_code.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
fss_return_code_data data = fss_return_code_data_initialize;
if (f_pipe_exists()) {
#include <level_3/return_code.h>
-int main(const f_array_length argc, const f_string argv[]) {
+int main(f_const f_array_length argc, f_const f_string argv[]) {
return_code_data data = return_code_data_initialize;
if (f_pipe_exists()) {
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
*/
#include <level_3/return_code.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
// version printed may be used by scripts, so this will only print the version number and a newline, no extra information or colors
#ifndef _di_return_code_print_version_
- f_return_status return_code_print_version(const return_code_data data) {
+ f_return_status return_code_print_version(f_const return_code_data data) {
printf("%s\n", return_code_version);
return f_none;
#endif // _return_code_print_version_
#ifndef _di_return_code_print_help_
- f_return_status return_code_print_help(const return_code_data data) {
+ f_return_status return_code_print_help(f_const return_code_data data) {
printf("\n");
fl_print_color(f_standard_output, data.context.title, data.context.reset, " %s", return_code_name_long);
#endif // _di_return_code_print_help_
#ifndef _di_return_code_main_
- f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data) {
+ f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data) {
f_status status = f_none;
f_status allocation_status = f_none;
if (data->remaining.used > 0) {
for (; counter < data->remaining.used; counter++) {
f_status code = (f_status) atoll(argv[data->remaining.array[counter]]);
- f_string string = f_null;
+ f_string string = 0;
if (fl_errors_to_string(code, &string) == f_none) {
printf("%s\n", string);
/* FLL - Level 3
* Project: FSS
- * Version: 0.4.2
+ * Version: 0.5.0
* Licenses: lgplv2.1
* Programmers: Kevin Day
* Documentation:
#include <level_2/colors.h>
#ifdef __cplusplus
-extern "C"{
+extern "C" {
#endif
#ifndef _di_return_code_version_
#define return_code_major_version "0"
- #define return_code_minor_version "4"
- #define return_code_micro_version "2"
+ #define return_code_minor_version "5"
+ #define return_code_micro_version "0"
#define return_code_version return_code_major_version "." return_code_minor_version "." return_code_micro_version
#endif // _di_return_code_version_
#endif // _di_return_code_data_
#ifndef _di_return_code_print_version_
- f_extern f_return_status return_code_print_version(const return_code_data data);
+ f_extern f_return_status return_code_print_version(f_const return_code_data data);
#endif // _di_return_code_print_version_
#ifndef _di_return_code_print_help_
- f_extern f_return_status return_code_print_help(const return_code_data data);
+ f_extern f_return_status return_code_print_help(f_const return_code_data data);
#endif // _di_return_code_print_help_
#ifndef _di_return_code_main_
- f_extern f_return_status return_code_main(const f_array_length argc, const f_string argv[], return_code_data *data);
+ f_extern f_return_status return_code_main(f_const f_array_length argc, f_const f_string argv[], return_code_data *data);
#endif // _di_return_code_main_
#ifndef _di_return_code_delete_data_