Remove the unused files.
Simplify the processing callbacks using ternary operators.
Resolve the void_setting to the specific setting for easier to read code at the cost of allocation more memory (1 memory address variable per function).
Implement the ignore functionality.
Make sure the multiple Content is supported where appropriate.
The flags must not be reset at the start of the setting load so that main.c programs can pre-fill the flags.
Add all of the supported write program setting files.
Other miscellaneous changes and fixes.
The pipe data is lacking and will need future reviews and probably will need fixes.
The original fss_*_write pipe data is also lacking so I feel that it is fine to leave it alone for now to be addressed later on.
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#include "../main/fss_write.h"
#ifdef __cplusplus
#endif
#ifndef _di_fss_write_basic_process_content_
- void fss_write_basic_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
- *macro_fss_write_setting(setting)->content,
- f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_basic_content_write(
- *macro_fss_write_setting(setting)->content,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
+ void fss_write_basic_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_basic_content_write(
+ *setting->content,
+ (setting->flag & fss_write_flag_partial_e)
+ ? f_fss_complete_partial_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_content_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_basic_content_write");
return;
}
#ifndef _di_fss_write_basic_process_help_
void fss_write_basic_process_help(fll_program_data_t * const main, void * const setting) {
- fss_write_basic_print_help(macro_fss_write_setting(setting), main->message);
+ fss_write_basic_print_help(setting, main->message);
}
#endif // _di_fss_write_basic_process_help_
#ifndef _di_fss_write_basic_process_object_
- void fss_write_basic_process_object(fll_program_data_t * const main, void * const setting) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
- *macro_fss_write_setting(setting)->object,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- f_fss_complete_none_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_basic_object_write(
- *macro_fss_write_setting(setting)->object,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_basic_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_basic_object_write(
+ *setting->object,
+ setting->quote.used
+ ? setting->quote.string[0]
+ : f_fss_quote_double_s.string[0],
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_object_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_basic_object_write");
}
}
#endif // _di_fss_write_basic_process_object_
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_basic_standard_s;
setting.program_name = &fss_write_basic_program_name_s;
setting.program_name_long = &fss_write_basic_program_name_long_s;
setting.process_content = &fss_write_basic_process_content;
setting.process_help = &fss_write_basic_process_help;
- setting.process_normal = &fss_write_basic_process_normal;
+ setting.process_normal = &fss_write_process_normal;
setting.process_object = &fss_write_basic_process_object;
setting.process_pipe = &fss_write_process_pipe;
- setting.process_set = &fss_write_process_normal;
+ setting.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
fss_write_setting_load(arguments, &data, &setting, 0);
}
- fss_write_basic_main(&data, &setting);
+ fss_write_main(&data, &setting);
fss_write_setting_unload(&data, &setting);
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_common_h
-#define _PRIVATE_fss_write_basic_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_print_h
-#define _PRIVATE_fss_write_basic_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_write_h
-#define _PRIVATE_fss_write_basic_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_write_h
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#include "../main/fss_write.h"
#ifdef __cplusplus
#endif
#ifndef _di_fss_write_basic_list_process_content_
- void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
- *macro_fss_write_setting(setting)->content,
- f_fss_complete_none_e,
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_basic_list_content_write(
- *macro_fss_write_setting(setting)->content,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_basic_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_basic_list_content_write(
+ *setting->content,
+ (setting->flag & fss_write_flag_partial_e)
+ ? f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ &setting->prepend,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_list_content_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_basic_list_content_write");
return;
}
#ifndef _di_fss_write_basic_list_process_help_
void fss_write_basic_list_process_help(fll_program_data_t * const main, void * const setting) {
- fss_write_basic_list_print_help(macro_fss_write_setting(setting), main->message);
+ fss_write_basic_list_print_help(setting, main->message);
}
#endif // _di_fss_write_basic_list_process_help_
#ifndef _di_fss_write_basic_list_process_object_
- void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const setting) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
- *macro_fss_write_setting(setting)->object,
- f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_basic_list_object_write(
- *macro_fss_write_setting(setting)->object,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_basic_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_basic_list_object_write(
+ *setting->object,
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_basic_list_object_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_basic_list_object_write");
}
}
#endif // _di_fss_write_basic_list_process_object_
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_basic_list_standard_s;
setting.program_name = &fss_write_basic_list_program_name_s;
setting.program_name_long = &fss_write_basic_list_program_name_long_s;
setting.process_content = &fss_write_basic_list_process_content;
setting.process_help = &fss_write_basic_list_process_help;
- setting.process_normal = &fss_write_basic_list_process_normal;
+ setting.process_normal = &fss_write_process_normal;
setting.process_object = &fss_write_basic_list_process_object;
- setting.process_pipe = &fss_write_basic_list_process_pipe;
- setting.process_set = &fss_write_process_normal;
+ setting.process_pipe = &fss_write_process_pipe;
+ setting.process_set = &fss_write_process_set;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
fss_write_setting_load(arguments, &data, &setting, 0);
}
- fss_write_basic_list_main(&data, &setting);
+ fss_write_main(&data, &setting);
fss_write_setting_unload(&data, &setting);
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_common_h
-#define _PRIVATE_fss_write_basic_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_print_h
-#define _PRIVATE_fss_write_basic_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_basic_list_write_h
-#define _PRIVATE_fss_write_basic_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_basic_list_write_h
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#include "../main/fss_write.h"
#ifdef __cplusplus
#endif
#ifndef _di_fss_write_embedded_list_process_content_
- void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
- *macro_fss_write_setting(setting)->content,
- f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->ignores,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_embedded_list_content_write(
- *macro_fss_write_setting(setting)->content,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->ignores,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_embedded_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_embedded_list_content_write(
+ *setting->content,
+ (setting->flag & fss_write_flag_partial_e)
+ ? f_fss_complete_partial_e
+ : last
+ ? f_fss_complete_end_e
+ : f_fss_complete_next_e,
+ &setting->prepend,
+ setting->ignores,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_embedded_list_content_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_embedded_list_content_write");
return;
}
#ifndef _di_fss_write_embedded_list_process_help_
void fss_write_embedded_list_process_help(fll_program_data_t * const main, void * const setting) {
- fss_write_embedded_list_print_help(macro_fss_write_setting(setting), main->message);
+ fss_write_embedded_list_print_help(setting, main->message);
}
#endif // _di_fss_write_embedded_list_process_help_
#ifndef _di_fss_write_embedded_list_process_object_
- void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const setting) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
- *macro_fss_write_setting(setting)->object,
- f_fss_complete_none_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_embedded_list_object_write(
- *macro_fss_write_setting(setting)->object,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_embedded_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_embedded_list_object_write(
+ *setting->object,
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_embedded_list_object_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_embedded_list_object_write");
}
}
#endif // _di_fss_write_embedded_list_process_object_
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_embedded_list_standard_s;
setting.program_name = &fss_write_embedded_list_program_name_s;
setting.program_name_long = &fss_write_embedded_list_program_name_long_s;
setting.process_content = &fss_write_embedded_list_process_content;
setting.process_help = &fss_write_embedded_list_process_help;
- setting.process_normal = &fss_write_embedded_list_process_normal;
+ setting.process_normal = &fss_write_process_normal;
setting.process_object = &fss_write_embedded_list_process_object;
- setting.process_pipe = &fss_write_embedded_list_process_pipe;
- setting.process_set = &fss_write_process_normal;
+ setting.process_pipe = &fss_write_process_pipe;
+ setting.process_set = &fss_write_process_set;
setting.flag |= fss_write_flag_ignore_e;
+ setting.flag |= fss_write_flag_content_multiple_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
fss_write_setting_load(arguments, &data, &setting, 0);
}
- fss_write_embedded_list_main(&data, &setting);
+ fss_write_main(&data, &setting);
fss_write_setting_unload(&data, &setting);
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_common_h
-#define _PRIVATE_fss_write_embedded_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_print_h
-#define _PRIVATE_fss_write_embedded_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_embedded_list_write_h
-#define _PRIVATE_fss_write_embedded_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_embedded_list_write_h
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#include "../main/fss_write.h"
#ifdef __cplusplus
#endif
#ifndef _di_fss_write_extended_process_content_
- void fss_write_extended_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
- *macro_fss_write_setting(setting)->content,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- f_fss_complete_none_e, // @fixme each of these needs to have "partial", "trim", etc..
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_extended_content_write(
- *macro_fss_write_setting(setting)->content,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_extended_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_extended_content_write(
+ *setting->content,
+ setting->quote.used
+ ? setting->quote.string[0]
+ : f_fss_quote_double_s.string[0],
+ (setting->flag & fss_write_flag_partial_e)
+ ? f_fss_complete_partial_e
+ : last
+ ? f_fss_complete_end_e
+ : f_fss_complete_next_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_content_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_extended_content_write");
return;
}
#ifndef _di_fss_write_extended_process_help_
void fss_write_extended_process_help(fll_program_data_t * const main, void * const setting) {
- fss_write_extended_print_help(macro_fss_write_setting(setting), main->message);
+ fss_write_extended_print_help(setting, main->message);
}
#endif // _di_fss_write_extended_process_help_
#ifndef _di_fss_write_extended_process_object_
- void fss_write_extended_process_object(fll_program_data_t * const main, void * const setting) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
- *macro_fss_write_setting(setting)->object,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- f_fss_complete_none_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_extended_object_write(
- *macro_fss_write_setting(setting)->object,
- macro_fss_write_setting(setting)->quote.used
- ? macro_fss_write_setting(setting)->quote.string[0]
- : f_fss_quote_double_s.string[0],
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_extended_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_extended_object_write(
+ *setting->object,
+ setting->quote.used
+ ? setting->quote.string[0]
+ : f_fss_quote_double_s.string[0],
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_object_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_extended_object_write");
}
}
#endif // _di_fss_write_extended_process_object_
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_extended_standard_s;
setting.program_name = &fss_write_extended_program_name_s;
setting.program_name_long = &fss_write_extended_program_name_long_s;
- setting.process_content = &fss_write_exended_process_content;
+ setting.process_content = &fss_write_extended_process_content;
setting.process_help = &fss_write_extended_process_help;
- setting.process_normal = &fss_write_extended_process_normal;
- setting.process_object = &fss_write_exended_process_object;
- setting.process_pipe = &fss_write_extended_process_pipe;
- setting.process_set = &fss_write_process_normal;
+ setting.process_normal = &fss_write_process_normal;
+ setting.process_object = &fss_write_extended_process_object;
+ setting.process_pipe = &fss_write_process_pipe;
+ setting.process_set = &fss_write_process_set;
+ setting.flag |= fss_write_flag_content_multiple_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
data.parameters.array = parameters;
fss_write_setting_load(arguments, &data, &setting, 0);
}
- fss_write_extended_main(&data, &setting);
+ fss_write_main(&data, &setting);
fss_write_setting_unload(&data, &setting);
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_common_h
-#define _PRIVATE_fss_write_extended_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_print_h
-#define _PRIVATE_fss_write_extended_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_write_h
-#define _PRIVATE_fss_write_extended_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_write_h
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#include "../main/fss_write.h"
#ifdef __cplusplus
#endif
#ifndef _di_fss_write_extended_list_process_content_
- void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const setting, const bool last) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
- *macro_fss_write_setting(setting)->content,
- last ? f_fss_complete_partial_e : f_fss_complete_partial_trim_e, // @fixme each of these needs to have "partial", "trim", etc..
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->ignores,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_extended_list_content_write(
- *macro_fss_write_setting(setting)->content,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- ¯o_fss_write_setting(setting)->prepend,
- macro_fss_write_setting(setting)->ignores,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
-
- if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
- macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
-
- fss_write_print_line_first_locked(macro_fss_write_setting(setting), main->error);
- fss_write_print_error_unsupported_eol(macro_fss_write_setting(setting), main->error);
- fss_write_print_line_last_locked(macro_fss_write_setting(setting), main->error);
+ void fss_write_extended_list_process_content(fll_program_data_t * const main, void * const void_setting, const bool last) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_extended_list_content_write(
+ *setting->content,
+ (setting->flag & fss_write_flag_partial_e)
+ ? last
+ ? f_fss_complete_none_e
+ : f_fss_complete_partial_e
+ : f_fss_complete_full_e,
+ &setting->prepend,
+ setting->ignores,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
+
+ if (F_status_set_fine(setting->status) == F_none_eol) {
+ setting->status = F_status_set_error(F_support_not);
+
+ fss_write_print_line_first_locked(setting, main->error);
+ fss_write_print_error_unsupported_eol(setting, main->error);
+ fss_write_print_line_last_locked(setting, main->error);
return;
}
- if (F_status_is_error(macro_fss_write_setting(setting)->status)) {
- fss_write_print_error(macro_fss_write_setting(setting), main->error, "fl_fss_extended_list_content_write");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "fl_fss_extended_list_content_write");
return;
}
#endif // _di_fss_write_extended_list_process_help_
#ifndef _di_fss_write_extended_list_process_object_
- void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const setting) {
-
- if (macro_fss_write_setting(setting)->flag & fss_write_flag_partial_e) {
- macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
- *macro_fss_write_setting(setting)->object,
- f_fss_complete_none_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
- else {
- macro_fss_write_setting(setting)->status = fl_fss_extended_list_object_write(
- *macro_fss_write_setting(setting)->object,
- (macro_fss_write_setting(setting)->flag & fss_write_flag_trim_e) ? f_fss_complete_full_trim_e : f_fss_complete_full_e,
- macro_fss_write_setting(setting)->state,
- ¯o_fss_write_setting(setting)->range,
- ¯o_fss_write_setting(setting)->buffer
- );
- }
+ void fss_write_extended_list_process_object(fll_program_data_t * const main, void * const void_setting) {
+
+ fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
+
+ setting->status = fl_fss_extended_list_object_write(
+ *setting->object,
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
if (F_status_set_fine(macro_fss_write_setting(setting)->status) == F_none_eol) {
macro_fss_write_setting(setting)->status = F_status_set_error(F_support_not);
#include "fss_write.h"
+#include "../main/fss_write.h"
int main(const int argc, const f_string_t *argv, const f_string_t *envp) {
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_extended_list_standard_s;
setting.program_name = &fss_write_extended_list_program_name_s;
setting.program_name_long = &fss_write_extended_list_program_name_long_s;
- setting.process_content = &fss_write_exended_list_process_content;
+ setting.process_content = &fss_write_extended_list_process_content;
setting.process_help = &fss_write_extended_list_process_help;
- setting.process_normal = &fss_write_extended_list_process_normal;
- setting.process_object = &fss_write_exended_list_process_object;
- setting.process_pipe = &fss_write_extended_list_process_pipe;
- setting.process_set = &fss_write_process_normal;
+ setting.process_normal = &fss_write_process_normal;
+ setting.process_object = &fss_write_extended_list_process_object;
+ setting.process_pipe = &fss_write_process_pipe;
+ setting.process_set = &fss_write_process_set;
setting.flag |= fss_write_flag_ignore_e;
f_console_parameter_t parameters[] = fss_write_console_parameter_t_initialize;
fss_write_setting_load(arguments, &data, &setting, 0);
}
- fss_write_extended_list_main(&data, &setting);
+ fss_write_main(&data, &setting);
fss_write_setting_unload(&data, &setting);
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_common_h
-#define _PRIVATE_fss_write_extended_list_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_print_h
-#define _PRIVATE_fss_write_extended_list_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_extended_list_write_h
-#define _PRIVATE_fss_write_extended_list_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_extended_list_write_h
if (!main || !setting) return;
- setting->flag = 0;
-
// Load parameters.
setting->status = f_console_parameter_process(arguments, &main->parameters);
if ((main->parameters.array[fss_write_parameter_content_e].result & f_console_result_value_e) && main->parameters.array[fss_write_parameter_content_e].values.used) {
- if (setting->flag & fss_write_flag_object_e) {
+ if (setting->flag & fss_write_flag_object_e) {
if (!(setting->flag & fss_write_flag_content_multiple_e)) {
if (main->parameters.array[fss_write_parameter_content_e].values.used > main->parameters.array[fss_write_parameter_object_e].values.used) {
setting->status = F_status_set_error(F_support_not);
extern const f_string_static_t fss_write_pipe_content_end_s;
extern const f_string_static_t fss_write_pipe_content_ignore_s;
extern const f_string_static_t fss_write_pipe_content_start_s;
-
- #define macro_fss_write_setting(setting) ((fss_write_setting_t *) setting)
#endif // _di_fss_write_pipe_s_
/**
* content: A pointer to a specific Content used during processing.
* contents: A pointer to a specific set of Content used during processing.
*
- * content_separator: A standard format specific string used to separate Content.
* program_name: The short name of the program.
* program_name_long: The human friendly name of the program.
*
f_string_static_t *content;
f_string_statics_t *contents;
- const f_string_static_t *content_separator;
const f_string_static_t *program_name;
const f_string_static_t *program_name_long;
0, \
0, \
0, \
- 0, \
}
#endif // _di_fss_write_setting_t_
#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#ifdef __cplusplus
extern "C" {
f_array_length_t total = 0;
f_array_length_t length = 0;
- f_array_length_t ignore_start = 0;
+ f_array_length_t ignore = 0;
f_string_range_t range = f_string_range_t_initialize;
const f_array_length_t used_objects = setting->objects.used;
const f_array_length_t used_contentss = setting->contentss.used;
const f_array_length_t used_ignoress = setting->ignoress.used;
+ setting->object = &setting->objects.array[used_objects];
+ setting->contents = &setting->contentss.array[used_contentss];
+ setting->ignores = &setting->ignoress.array[used_ignoress];
+
// 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object.
uint8_t flag = 0;
return;
}
- // This is processed in a single set, so there is only ever one Ignores added.
- setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+ setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
if (F_status_is_error(setting->status)) {
- fss_write_print_error(setting, main->error, "f_string_rangess_increase");
+ fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
return;
}
- setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+ // This is processed in a single set, so there is only ever one Ignores added.
+ setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
if (F_status_is_error(setting->status)) {
- fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
+ fss_write_print_error(setting, main->error, "f_string_rangess_increase");
return;
}
+ // Reset all of the used data before starting the loop.
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
+
for (;;) {
if (!((++main->signal_check) % fss_write_signal_check_d)) {
// Start Object.
if (!state || state == 0x1) {
if (!state) {
- setting->objects.array[used_objects].used = 0;
+ setting->object->used = 0;
state = 0x1;
}
// Reset the "has Content for Object" flag and associated contents array used length.
flag -= flag | 0x4;
- setting->contentss.array[used_contentss].used = 0;
+ setting->contents->used = 0;
- if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
- setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
+ setting->status = f_string_dynamic_increase_by(setting->block.used, setting->object);
- if (F_status_is_error(setting->status)) {
- fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
- break;
- }
+ break;
}
for (; range.start <= range.stop; ++range.start) {
- if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
- state = 0x2;
- ++range.start;
+ // Do not handle start/end while inside an ignore set.
+ if (!(flag & 0x2)) {
+ if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+ state = 0x2;
+ ++range.start;
- break;
- }
+ break;
+ }
- if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
- state = 0x3;
- ++range.start;
+ if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+ state = 0x3;
+ ++range.start;
- break;
+ break;
+ }
}
+ // There currently is no support for "ignore" in Objects, but the Ignore should still be processed.
if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
- // @todo implement this, populating the ignores array, continue until no ignores is found, so set a new state to represent this.
+ // Ignore is enabled.
+ if (flag & 0x2) {
+ flag -= 0x2;
+ }
+ else {
+ flag |= 0x2;
+ }
+
continue;
}
- setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
+ setting->object->string[setting->object->used++] = setting->block.string[range.start];
} // for
if (F_status_is_error(setting->status)) break;
break;
}
- setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+ setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
}
if (total) {
- setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used]);
+ setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
for (; range.start <= range.stop; ++range.start) {
- if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
- setting->status = F_status_set_error(F_support_not);
+ // Do not handle start/end while inside an ignore set.
+ if (!(flag & 0x2)) {
+ if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+ if (!(setting->flag & fss_write_flag_content_multiple_e)) {
+ setting->status = F_status_set_error(F_support_not);
- fss_write_print_error_one_content_only(setting, main->error);
+ fss_write_print_error_one_content_only(setting, main->error);
- break;
- }
+ break;
+ }
+ }
- if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
- state = 0x3;
- ++range.start;
+ if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+ state = 0x3;
+ ++range.start;
- break;
+ break;
+ }
}
if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
- // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
+ // Ignore is enabled.
+ if (flag & 0x2) {
+ setting->status = f_string_ranges_increase(setting->state.step_small, setting->ignores);
+
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "f_string_ranges_increase");
+
+ break;
+ }
+
+ setting->ignores->array[setting->ignores->used].start = setting->contents->array[setting->contents->used].used;
+ setting->ignores->array[setting->ignores->used].stop = range.start;
+
+ flag -= 0x2;
+ }
+ else {
+ ignore = setting->contents->array[setting->contents->used].used;
+
+ flag |= 0x2;
+ }
+
continue;
}
- setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].string[setting->contentss.array[used_contentss].array[setting->contentss.array[used_contentss].used].used++] = setting->block.string[range.start];
+ setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
} // for
if (F_status_is_error(setting->status)) break;
- ++setting->contentss.array[used_contentss].used;
+ ++setting->contents->used;
flag |= 0x4;
}
else {
// End Object or Content set.
if (state == 0x3) {
- if (setting->flag & fss_write_flag_partial_e) {
- if (setting->flag & fss_write_flag_content_e) {
- setting->object = 0;
- setting->contents = &setting->contentss.array[used_contentss];
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = 0;
- }
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = &setting->contentss.array[used_contentss];
- }
-
- setting->ignores = &setting->ignoress.array[used_contentss];
-
setting->process_set(main, void_setting);
if (F_status_is_error(setting->status)) break;
state = 0;
flag |= 0x1;
+ // Reset all of the used data for next set.
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
+
continue;
}
} // for
// If the pipe ended before finishing, then attempt to wrap up.
if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
- if (setting->flag & fss_write_flag_partial_e) {
- if (setting->flag & fss_write_flag_content_e) {
- setting->object = 0;
- setting->contents = &setting->contentss.array[used_contentss];
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = 0;
- }
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = &setting->contentss.array[used_contentss];
- }
-
- setting->ignores = &setting->ignoress.array[used_contentss];
-
setting->process_set(main, void_setting);
flag |= 0x1;
setting->block.used = 0;
setting->buffer.used = 0;
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
setting->ignoress.used = used_ignoress;
setting->objects.used = used_objects;
setting->contentss.used = used_contentss;
if (F_status_is_error_not(setting->status)) {
setting->status = (flag & 0x1) ? F_none : F_data_not;
-
- // Print newline character to separate data printed from pipe.
- if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
- fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
- }
}
}
#endif // _di_fss_write_process_pipe_
setting->buffer.used = 0;
- if (setting->object) {
+ if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object) {
if (setting->object->used) {
setting->range.start = 0;
setting->range.stop = setting->object->used - 1;
if (F_status_is_error(setting->status)) return;
}
- if (setting->contents) {
+ if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_content_e)) && setting->contents) {
for (f_array_length_t i = 0; i < setting->contents->used; ++i) {
if (setting->contents->array[i].used) {
* The main program settings.
* Must be of type (fss_write_setting_t *).
*
- * Set setting.object to 0 to not use an Object.
- * Set setting.contents to 0 to not use an Content set.
- *
* This alters setting.status:
* F_none on success.
* F_interrupt on (exit) signal received.
*
* F_parameter (with error bit) if main is NULL or setting is NULL.
- * @param object
- * The object to validate and print.
- * Set to setting.objects.used to not use.
- * @param content
- * The content to escape and print.
- * Set start to 1 and stop to 0 to not use.
*/
#ifndef _di_fss_write_process_set_
extern void fss_write_process_set(fll_program_data_t * const main, void * const setting);
setting->program_name_long = &fss_write_program_name_long_s;
setting->process_content = &fss_write_basic_process_content;
setting->process_help = &fss_write_main_process_help;
+ setting->process_normal = &fss_write_process_normal;
setting->process_object = &fss_write_basic_process_object;
setting->process_pipe = &fss_write_process_pipe;
- setting->process_normal = &fss_write_process_normal;
setting->process_set = &fss_write_process_set;
if (main->parameters.array[fss_write_parameter_as_e].result & f_console_result_value_e && main->parameters.array[fss_write_parameter_as_e].values.used) {
fl_string_dynamic_compare(argv[index], fss_write_format_code_human_0001_s) == F_equal_to) {
setting->standard = fss_write_extended_standard_s;
- setting->content_separator = 0; // Not used by extended.
setting->program_name = &fss_write_extended_program_name_s;
setting->program_name_long = &fss_write_extended_program_name_long_s;
setting->process_content = &fss_write_extended_process_content;
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_common_h
-#define _PRIVATE_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_write_h
-#define _PRIVATE_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_write_h
#include "fss_write.h"
#include "../main/fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
#ifdef __cplusplus
extern "C" {
const f_array_length_t used_contentss = setting->contentss.used;
const f_array_length_t used_ignoress = setting->ignoress.used;
+ setting->object = &setting->objects.array[used_objects];
+ setting->contents = &setting->contentss.array[used_contentss];
+ setting->ignores = &setting->ignoress.array[used_ignoress];
+
// 0x0 = nothing printed, 0x1 = something printed, 0x2 = ignore enabled, 0x4 = added Content for Object, 0x8 = "payload" matched.
uint8_t flag = 0;
// 0x0 = start new object/content set, 0x1 = processing object, 0x2 = processing content, 0x3 = end object/content set, 0x4 = processing payload content.
uint8_t state = 0;
- setting->objects.used = 0;
- setting->contentss.used = 0;
-
- // This is processed in a set, so there is only ever one Object.
+ // This is processed in a single set, so there is only ever one Object added.
setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->objects);
if (F_status_is_error(setting->status)) {
return;
}
- // This is processed in a set, so there is only ever one Content set.
+ // This is processed in a single set, so there is only ever one Content added.
setting->status = f_string_dynamicss_increase(setting->state.step_small, &setting->contentss);
if (F_status_is_error(setting->status)) {
return;
}
- setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[0]);
+ setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
return;
}
+ // This is processed in a single set, so there is only ever one Ignores added.
+ setting->status = f_string_rangess_increase(setting->state.step_small, &setting->ignoress);
+
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "f_string_rangess_increase");
+
+ return;
+ }
+
+ // Reset all of the used data before starting the loop.
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
+
for (;;) {
if (!((++main->signal_check) % fss_write_signal_check_d)) {
range.stop = setting->block.used - 1;
}
- // Begin Object.
+ // Start Object.
if (!state || state == 0x1) {
if (!state) {
- setting->objects.array[used_objects].used = 0;
+ setting->object->used = 0;
state = 0x1;
}
// Reset the "has Content for Object" flag and associated contents array used length.
flag -= flag | 0x4;
- setting->contentss.array[used_contentss].used = 0;
+ setting->contents->used = 0;
- if (setting->objects.array[used_objects].used + setting->block.used > setting->objects.array[used_objects].size) {
- setting->status = f_string_dynamic_increase_by(setting->block.used, &setting->objects.array[used_objects]);
+ setting->status = f_string_dynamic_increase_by(setting->block.used, setting->object);
- if (F_status_is_error(setting->status)) {
- fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
+ if (F_status_is_error(setting->status)) {
+ fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
- break;
- }
+ break;
}
for (; range.start <= range.stop; ++range.start) {
- if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
- state = 0x2;
- ++range.start;
+ // Do not handle start/end while inside an ignore set.
+ if (!(flag & 0x2)) {
+ if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+ state = 0x2;
+ ++range.start;
- break;
- }
+ break;
+ }
- if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
- state = 0x3;
- ++range.start;
+ if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+ state = 0x3;
+ ++range.start;
- break;
+ break;
+ }
}
+ // There currently is no support for "ignore" in Objects, but the Ignore should still be processed.
if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
- // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit). (also consider delimits for other special escapes as well.)
+ // Ignore is enabled.
+ if (flag & 0x2) {
+ flag -= 0x2;
+ }
+ else {
+ flag |= 0x2;
+ }
+
continue;
}
- setting->objects.array[used_objects].string[setting->objects.array[used_objects].used++] = setting->block.string[range.start];
+ setting->object->string[setting->object->used++] = setting->block.string[range.start];
} // for
if (F_status_is_error(setting->status)) break;
break;
}
- setting->status = f_string_dynamics_increase(setting->state.step_small, &setting->contentss.array[used_contentss]);
+ setting->status = f_string_dynamics_increase(setting->state.step_small, setting->contents);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamics_increase");
}
// When payload is provided, all data at this point is part of the payload until the end of the pipe.
- if (fl_string_dynamic_compare(f_fss_payload_s, setting->objects.array[used_objects]) == F_equal_to) {
+ if (fl_string_dynamic_compare(f_fss_payload_s, *setting->object) == F_equal_to) {
if (total > 1) {
- setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
+ setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
- memcpy(setting->contentss.array[used_contentss].array[0].string, setting->block.string + range.start, sizeof(f_char_t) * total);
+ memcpy(setting->contents->array[setting->contents->used].string, setting->block.string + range.start, sizeof(f_char_t) * total);
- setting->contentss.array[used_contentss].array[0].used += total;
+ setting->contents->array[setting->contents->used].used += total;
}
state = 0x4;
}
if (total) {
- setting->status = f_string_dynamic_increase_by(total, &setting->contentss.array[used_contentss].array[0]);
+ setting->status = f_string_dynamic_increase_by(total, &setting->contents->array[setting->contents->used]);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
for (; range.start <= range.stop; ++range.start) {
- if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
- setting->status = F_status_set_error(F_support_not);
+ // Do not handle start/end while inside an ignore set.
+ if (!(flag & 0x2)) {
+ if (setting->block.string[range.start] == fss_write_pipe_content_start_s.string[0]) {
+ setting->status = F_status_set_error(F_support_not);
- fss_write_print_error_one_content_only(setting, main->error);
+ fss_write_print_error_one_content_only(setting, main->error);
- break;
- }
+ break;
+ }
- if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
- state = 0x3;
- ++range.start;
+ if (setting->block.string[range.start] == fss_write_pipe_content_end_s.string[0]) {
+ state = 0x3;
+ ++range.start;
- break;
+ break;
+ }
}
+ // There currently is no support for "ignore" in Contents, but the Ignore should still be processed.
if (setting->block.string[range.start] == fss_write_pipe_content_ignore_s.string[0]) {
- // @todo implement this (a single fss_write_pipe_content_ignore_s followed by another fss_write_pipe_content_ignore_s should act as a delimit).
+ // Ignore is enabled.
+ if (flag & 0x2) {
+ flag -= 0x2;
+ }
+ else {
+ flag |= 0x2;
+ }
+
continue;
}
- setting->contentss.array[used_contentss].array[0].string[setting->contentss.array[used_contentss].array[0].used++] = setting->block.string[range.start];
+ setting->contents->array[setting->contents->used].string[setting->contents->array[setting->contents->used].used++] = setting->block.string[range.start];
} // for
if (F_status_is_error(setting->status)) break;
- ++setting->contentss.array[used_contentss].used;
+ ++setting->contents->used;
flag |= 0x4;
}
else {
// End Object or Content set.
if (state == 0x3) {
- if (setting->flag & fss_write_flag_partial_e) {
- if (setting->flag & fss_write_flag_content_e) {
- setting->object = 0;
- setting->contents = &setting->contentss.array[used_contentss];
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = 0;
- }
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = &setting->contentss.array[used_contentss];
- }
-
- setting->ignores = &setting->ignoress.array[used_ignoress];
-
fss_write_payload_process_set(main, void_setting);
if (F_status_is_error(setting->status)) break;
state = 0;
flag |= 0x1;
+ // Reset all of the used data for next set.
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
+
continue;
}
if (setting->block.used && range.start <= range.stop) {
length = (range.stop - range.start) + 1;
- setting->status = f_string_dynamic_increase_by(length + 1, &setting->contentss.array[used_contentss].array[0]);
+ setting->status = f_string_dynamic_increase_by(length + 1, &setting->contents->array[setting->contents->used]);
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "f_string_dynamic_increase_by");
break;
}
- memcpy(setting->contentss.array[used_contentss].array[0].string + range.start, setting->block.string, sizeof(f_char_t) * length);
+ memcpy(setting->contents->array[setting->contents->used].string + range.start, setting->block.string, sizeof(f_char_t) * length);
- setting->contentss.array[used_contentss].array[0].used += length;
+ setting->contents->array[setting->contents->used].used += length;
}
// Designate to read next block from pipe.
range.start = 1;
range.stop = 0;
+
+ // Reset all of the used data for next set.
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
}
} // for
// If the pipe ended before finishing, then attempt to wrap up.
if (F_status_is_error_not(setting->status) && status_pipe == F_none_eof && state) {
- if (setting->flag & fss_write_flag_partial_e) {
- if (setting->flag & fss_write_flag_content_e) {
- setting->object = 0;
- setting->contents = &setting->contentss.array[used_contentss];
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = 0;
- }
- }
- else {
- setting->object = &setting->objects.array[used_objects];
- setting->contents = &setting->contentss.array[used_contentss];
- }
-
- setting->ignores = &setting->ignoress.array[used_ignoress];
-
fss_write_payload_process_set(main, void_setting);
flag |= 0x1;
setting->block.used = 0;
setting->buffer.used = 0;
+ setting->object->used = 0;
+ setting->contents->used = 0;
+ setting->ignores->used = 0;
setting->objects.used = used_objects;
setting->contentss.used = used_contentss;
setting->ignoress.used = used_ignoress;
setting->status = F_data_not;
}
- // Print newline character to separate data printed from pipe.
- if ((setting->flag & fss_write_flag_partial_e) && setting->objects.used) {
- fll_print_dynamic(f_string_eol_s, main->output.to); // @fixme review this, should this be sending to message or not at all?
- }
- else if (setting->contentss.used) {
- if (flag & 0x8) {
- fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
- }
+ // Payload.
+ if (setting->contentss.used && (flag & 0x8)) {
+ fll_print_dynamic(f_fss_payload_header_close_s, main->output.to);
}
}
}
fss_write_setting_t * const setting = macro_fss_write_setting(void_setting);
- if (setting->object) {
- if (setting->contents && setting->contents->used) {
+ if ((!(setting->flag & fss_write_flag_partial_e) || (setting->flag & fss_write_flag_partial_e) && (setting->flag & fss_write_flag_object_e)) && setting->object) {
+ if (!(setting->flag & fss_write_flag_partial_e) && setting->contents && setting->contents->used) {
if (setting->object->used) {
setting->range.start = 0;
setting->range.stop = setting->object->used - 1;
setting->range.stop = 0;
}
- setting->status = fll_fss_payload_write(*setting->object, setting->contents->array[0], setting->flag & fss_write_flag_trim_e, setting->flag & fss_write_flag_prepend_e ? &setting->prepend : 0, setting->state, &setting->buffer);
+ setting->status = fll_fss_payload_write(
+ *setting->object,
+ setting->contents->array[0],
+ (setting->flag & fss_write_flag_trim_e),
+ (setting->flag & fss_write_flag_prepend_e)
+ ? &setting->prepend
+ : 0,
+ setting->state,
+ &setting->buffer
+ );
if (F_status_set_fine(setting->status) == F_none_eol) {
setting->status = F_status_set_error(F_support_not);
}
}
else {
- bool complete = f_fss_complete_none_e;
-
if (setting->object->used) {
setting->range.start = 0;
setting->range.stop = setting->object->used - 1;
setting->range.stop = 0;
}
- if (setting->contents && setting->contents->used) {
- if (main->parameters.array[fss_write_parameter_trim_e].result & f_console_result_found_e) {
- complete = f_fss_complete_full_trim_e;
- }
- else {
- complete = f_fss_complete_full_e;
- }
- }
-
- setting->status = fl_fss_basic_list_object_write(*setting->object, complete, setting->state, &setting->range, &setting->buffer);
+ setting->status = fl_fss_basic_list_object_write(
+ *setting->object,
+ (setting->flag & fss_write_flag_partial_e)
+ ? (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_partial_trim_e
+ : f_fss_complete_partial_e
+ : (setting->flag & fss_write_flag_trim_e)
+ ? f_fss_complete_full_trim_e
+ : f_fss_complete_full_e,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
if (F_status_set_fine(setting->status) == F_none_eol) {
setting->status = F_status_set_error(F_support_not);
prepend = &main->parameters.arguments.array[index];
}
- setting->status = fl_fss_basic_list_content_write(setting->contents->array[0], setting->object ? f_fss_complete_full_e : f_fss_complete_none_e, prepend, setting->state, &setting->range, &setting->buffer);
+ setting->status = fl_fss_basic_list_content_write(
+ setting->contents->array[0],
+ setting->object
+ ? f_fss_complete_full_e
+ : f_fss_complete_none_e,
+ prepend,
+ setting->state,
+ &setting->range,
+ &setting->buffer
+ );
if (F_status_is_error(setting->status)) {
fss_write_print_error(setting, main->error, "fl_fss_payload_content_write");
* The main program settings.
* Must be of type (fss_write_setting_t *).
*
- * Set setting.object to 0 to not use an Object.
- * Set setting.contents to 0 to not use an Content set.
- *
* This standard only supports a single Content per Object.
* The setting.contents.array[0] must exist (settings.contents.used == 1), or it is treated as if (settings.contents == 0).
*
fll_program_data_t data = fll_program_data_t_initialize;
fss_write_setting_t setting = fss_write_setting_t_initialize;
setting.state.data = (void *) &data;
+ setting.standard = fss_write_payload_standard_s;
setting.program_name = &fss_write_payload_program_name_s;
setting.program_name_long = &fss_write_payload_program_name_long_s;
setting.process_content = 0; // Not used by payload.
#include "fss_write.h"
-#include "private-common.h"
#ifdef __cplusplus
extern "C" {
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_common_h
-#define _PRIVATE_fss_write_payload_common_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_common_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-print.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_print_h
-#define _PRIVATE_fss_write_payload_print_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_print_h
+++ /dev/null
-#include "fss_write.h"
-#include "private-common.h"
-#include "private-write.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
+++ /dev/null
-/**
- * FLL - Level 3
- *
- * Project: FSS Write
- * API Version: 0.7
- * Licenses: lgpl-2.1-or-later
- */
-#ifndef _PRIVATE_fss_write_payload_write_h
-#define _PRIVATE_fss_write_payload_write_h
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#endif // _PRIVATE_fss_write_payload_write_h
using_default:
build settings
build settings.main
- #build settings.basic
- #build settings.basic_list
- #build settings.extended
- #build settings.extended_list
- #build settings.embedded_list
+ build settings.basic
+ build settings.basic_list
+ build settings.extended
+ build settings.extended_list
+ build settings.embedded_list
build settings.payload
using_mode:
build settings parameter:'mode:value'
build settings.main parameter:'mode:value'
- #build settings.basic parameter:'mode:value'
- #build settings.basic_list parameter:'mode:value'
- #build settings.extended parameter:'mode:value'
- #build settings.extended_list parameter:'mode:value'
- #build settings.embedded_list parameter:'mode:value'
+ build settings.basic parameter:'mode:value'
+ build settings.basic_list parameter:'mode:value'
+ build settings.extended parameter:'mode:value'
+ build settings.extended_list parameter:'mode:value'
+ build settings.embedded_list parameter:'mode:value'
build settings.payload parameter:'mode:value'
install:
shell ./install.sh parameter:'work'
- #shell ./install.sh parameter:'work' -s data/build/settings.main
- #shell ./install.sh parameter:'work' -s data/build/settings.basic
- #shell ./install.sh parameter:'work' -s data/build/settings.basic_list
- #shell ./install.sh parameter:'work' -s data/build/settings.extended
- #shell ./install.sh parameter:'work' -s data/build/settings.extended_list
- #shell ./install.sh parameter:'work' -s data/build/settings.embedded_list
+ shell ./install.sh parameter:'work' -s data/build/settings.main
+ shell ./install.sh parameter:'work' -s data/build/settings.basic
+ shell ./install.sh parameter:'work' -s data/build/settings.basic_list
+ shell ./install.sh parameter:'work' -s data/build/settings.extended
+ shell ./install.sh parameter:'work' -s data/build/settings.extended_list
+ shell ./install.sh parameter:'work' -s data/build/settings.embedded_list
shell ./install.sh parameter:'work' -s data/build/settings.payload
build_libraries-level -lfll_2 -lfll_1 -lfll_0
build_libraries-monolithic -lfll
-build_sources_library main/fss_write.c main/common.c main/print.c main/private-common.c main/private-write.c
-build_sources_library basic/fss_write.c basic/common.c basic/print.c basic/private-common.c basic/private-write.c basic/private-print.c
-build_sources_library basic_list/fss_write.c basic_list/common.c basic_list/print.c basic_list/private-common.c basic_list/private-write.c basic_list/private-print.c
-build_sources_library embedded_list/fss_write.c embedded_list/common.c embedded_list/print.c embedded_list/private-common.c embedded_list/private-write.c embedded_list/private-print.c
-build_sources_library extended/fss_write.c extended/common.c extended/print.c extended/private-common.c extended/private-write.c extended/private-print.c
-build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c extended_list/private-common.c extended_list/private-write.c extended_list/private-print.c
-build_sources_library payload/fss_write.c payload/common.c payload/print.c payload/private-common.c payload/private-write.c payload/private-print.c
+build_sources_library main/fss_write.c main/common.c main/print.c
+build_sources_library basic/fss_write.c basic/common.c basic/print.c
+build_sources_library basic_list/fss_write.c basic_list/common.c basic_list/print.c
+build_sources_library embedded_list/fss_write.c embedded_list/common.c embedded_list/print.c
+build_sources_library extended/fss_write.c extended/common.c extended/print.c
+build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c
+build_sources_library payload/fss_write.c payload/common.c payload/print.c
-build_sources_headers main/fss_write.h main/common.h main/print.h main/private-common.h main/private-write.h
-build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h basic/private-write.h basic/private-print.h
-build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h basic_list/private-common.h basic_list/private-write.h basic_list/private-print.h
-build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h embedded_list/private-common.h embedded_list/private-write.h embedded_list/private-print.h
-build_sources_headers extended/fss_write.h extended/common.h extended/print.h extended/private-common.h extended/private-write.h extended/private-print.h
-build_sources_headers extended_list/fss_write.h extended_list/common.h extended_list/print.h extended_list/private-common.h extended_list/private-write.h extended_list/private-print.h
-build_sources_headers payload/fss_write.h payload/common.h payload/print.h payload/private-common.h payload/private-write.h payload/private-print.h
+build_sources_headers main/fss_write.h main/common.h main/print.h main/private-common.h
+build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h
+build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h
+build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h
+build_sources_headers extended/fss_write.h extended/common.h extended/print.h
+build_sources_headers extended_list/fss_write.h extended_list/common.h extended_list/print.h
+build_sources_headers payload/fss_write.h payload/common.h payload/print.h
build_script yes
build_shared yes
--- /dev/null
+# fss-0001
+#
+# Builds the "basic" program (fss_basic_write).
+# This must be called after the "setting".
+#
+
+build_name fss_basic_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program basic/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
--- /dev/null
+# fss-0001
+#
+# Builds the "basic_list" program (fss_basic_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_basic_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program basic_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
--- /dev/null
+# fss-0001
+#
+# Builds the "embedded_list" program (fss_embedded_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_embedded_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program embedded_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
--- /dev/null
+# fss-0001
+#
+# Builds the "extended" program (fss_extended_write).
+# This must be called after the "setting".
+#
+
+build_name fss_extended_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program extended/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE
--- /dev/null
+# fss-0001
+#
+# Builds the "extended_list" program (fss_extended_list_write).
+# This must be called after the "setting".
+#
+
+build_name fss_extended_list_write
+
+version_major 0
+version_minor 7
+version_micro 0
+version_file micro
+version_target minor
+
+modes individual level monolithic clang test
+modes_default monolithic
+
+build_compiler gcc
+build_compiler-clang clang
+build_indexer ar
+build_indexer_arguments rcs
+build_language c
+
+build_libraries -lc -lfss_write
+build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_string -lf_color -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_path -lf_pipe -lf_print -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf
+build_libraries-level -lfll_2 -lfll_1 -lfll_0
+build_libraries-monolithic -lfll
+
+build_sources_program extended_list/main.c
+
+build_script yes
+build_shared yes
+build_static no
+
+path_headers program/fss_write
+
+has_path_standard yes
+preserve_path_headers yes
+
+search_exclusive yes
+search_shared yes
+search_static yes
+
+environment PATH LD_LIBRARY_PATH
+
+#defines -D_di_libcap_ -D_di_thread_support_
+defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_
+
+flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
+flags-clang -Wno-logical-op-parentheses
+flags-test -O0 -fstack-protector -Wall
+flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
+
+flags_library -fPIC
+flags_object -fPIC
+flags_program -fPIE