if (main->setting.select < main->setting.contents.array[at].used && main->setting.contents.array[at].array[main->setting.select].start <= main->setting.contents.array[at].array[main->setting.select].stop) {
if (main->callback.print_content && main->callback.print_object_end_content) {
if (print_state & 0x1) {
- if (main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content) != F_output_not) {
+ if (F_status_set_fine(main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content)) != F_output_not) {
print_state |= 0x6;
}
}
else {
- if (main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content) != F_output_not) {
+ if (F_status_set_fine(main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[main->setting.select], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[main->setting.select] : 0, delimits_content)) != F_output_not) {
print_state |= 0x2;
}
}
print_state &= ~0x8;
if (print_state & 0x1) {
- if (main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content) != F_output_not) {
+ if (F_status_set_fine(main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content)) != F_output_not) {
print_state |= 0x6;
}
}
- else {if (main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content) != F_output_not) {
- print_state |= 0x2;
- }
+ else if (F_status_set_fine(main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].used ? main->setting.quotes_content.array[at].array[i] : 0, delimits_content)) != F_output_not) {
+ print_state |= 0x2;
}
++i;
fss_read_main_t * const main = (fss_read_main_t *) void_main;
+ // 0x1 = object printed, 0x2 = content printed, 0x4 = object end printed, 0x8 = content is empty, 0x10 = select is out of range.
+ uint8_t print_state = 0x0;
+
if (main->setting.flag & fss_read_main_flag_object_d) {
if (*line == main->setting.line) {
if (main->callback.print_object) {
- main->callback.print_object(&main->program.output, at, delimits_object);
- }
-
- if (main->callback.print_object_end) {
- main->callback.print_object_end(&main->program.output);
+ if (F_status_set_fine(main->callback.print_object(&main->program.output, at, delimits_object)) != F_output_not) {
+ print_state = 0x1;
+ }
}
if (!(main->setting.flag & fss_read_main_flag_content_d)) {
+ if (main->callback.print_object_end) {
+ main->callback.print_object_end(&main->program.output);
+ }
+
if (!(main->setting.flag & fss_read_main_flag_object_as_line_d)) {
if (main->callback.print_set_end) {
main->callback.print_set_end(&main->program.output);
return;
}
+
+ if (main->setting.flag & fss_read_main_flag_object_as_line_d && main->callback.print_object_end) {
+ if (F_status_set_fine(main->callback.print_object_end(&main->program.output)) != F_output_not) {
+ print_state = 0x4;
+ }
+ }
}
if ((main->setting.flag & fss_read_main_flag_object_as_line_d) || !(main->setting.flag & fss_read_main_flag_content_d)) {
if (main->setting.flag & fss_read_main_flag_line_single_d) {
if (*line == main->setting.line) {
- if (main->setting.contents.array[at].used) {
- for (;;) {
+ if (main->setting.contents.array[at].used && main->callback.print_content && main->callback.print_object_end_content) {
+ for (f_status_t printed = F_okay; ; ) {
+
+ if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) {
+ if ((print_state & 0x1) && !(print_state & 0x4)) {
+ printed = main->callback.print_object_end_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].array[i], delimits_content);
+
+ if (F_status_set_fine(printed) != F_output_not) {
+ print_state |= 0x6;
+ }
+ }
+ else {
+ printed = main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].array[i], delimits_content);
- if (main->callback.print_content) {
- main->callback.print_content(&main->program.output, main->setting.contents.array[at].array[i], main->setting.quotes_content.array[at].array[i], delimits_content);
+ if (F_status_set_fine(printed) != F_output_not) {
+ print_state |= 0x2;
+ }
+ }
+ }
+ else {
+ printed = F_output_not;
}
if (++i >= main->setting.contents.array[at].used) break;
- if (main->callback.print_content_next) {
+ if (F_status_set_fine(printed) != F_output_not && main->callback.print_content_next) {
main->callback.print_content_next(&main->program.output);
}
} // for
++(*line);
}
- else {
+ else if (main->callback.print_content && main->callback.print_object_end_content) {
f_number_unsigned_t j = 0;
f_number_unsigned_t k = 0;
if (*line == main->setting.line) {
main->setting.range.stop = j;
- if (main->callback.print_content) {
+ if ((print_state & 0x1) && !(print_state & 0x4)) {
+ main->callback.print_object_end_content(&main->program.output, main->setting.range, main->setting.quotes_content.array[at].array[i], delimits_content);
+ }
+ else {
main->callback.print_content(&main->program.output, main->setting.range, main->setting.quotes_content.array[at].array[i], delimits_content);
}