f_number_unsigned_t matches = 0;
uint8_t matched = 0x0; // 0x0 = unmatched, 0x1 = matched.
- for (i = 0; i < data->vocabulary.used; ++i) {
-
- if (iki_read_signal_check(main)) return;
+ // Only the last name parameter is valid for use.
+ if (main->setting.names.used) {
+ j = main->setting.names.used - 1;
- for (j = 0; j < main->setting.names.used; ++j) {
+ for (i = 0; i < data->vocabulary.used; ++i) {
if (iki_read_signal_check(main)) return;
}
}
} // for
- } // for
+ }
if (main->setting.flag & iki_read_main_flag_line_d) {
if (main->setting.flag & iki_read_main_flag_total_d) {
else {
iki_read_print_data_total(&main->program.output, matches);
}
-
- main->setting.state.status = matched ? F_okay : F_data_not;
-
- return;
}
main->setting.state.status = matched ? F_okay : F_data_not;
iki_read_main_t * const main = (iki_read_main_t *) print->custom;
- if (F_status_is_error(main->setting.state.status) || !main->cache.expand.used) return;
+ if (F_status_is_error(main->setting.state.status)) return;
+
+ if (!main->cache.expand.used) {
+ main->setting.state.status = F_data_not;
+
+ return;
+ }
f_number_unsigned_t i = 0;
f_range_t range = macro_f_range_t_initialize_2(main->cache.expand.used);
- f_status_t status;
for (f_number_unsigned_t first = 0; range.start <= range.stop && range.start < main->cache.expand.used; ) {
- status = f_string_dynamic_seek_line(main->cache.expand, &range);
- if (F_status_is_error(status)) return;
+ if (iki_read_signal_check(main)) return;
+
+ main->setting.state.status = f_string_dynamic_seek_line(main->cache.expand, &range);
+ if (F_status_is_error(main->setting.state.status)) return;
- if (status == F_okay) {
+ if (main->setting.state.status == F_okay) {
if (i == main->setting.line) {
range.stop = range.start;
range.start = first;
- f_print_dynamic_partial(main->cache.expand, range, main->program.output.to);
+ f_print_dynamic_partial(main->cache.expand, range, print->to);
break;
}
range.stop = range.start;
range.start = first;
- f_print_dynamic_partial(main->cache.expand, range, main->program.output.to);
- f_print_dynamic(f_string_eol_s, main->program.output.to);
+ f_print_dynamic_partial(main->cache.expand, range, print->to);
+ f_print_dynamic(f_string_eol_s, print->to);
}
break;
}
} // for
+
+ main->setting.state.status = F_okay;
}
#endif // _di_iki_read_print_data_line_
for (f_number_unsigned_t i = 0; i < main->setting.map_wrapss.array[index].used; ++i) {
if (array[i] < main->setting.wrap.used && main->setting.wrap.array[array[i]].c.used) {
- f_print_dynamic(main->setting.wrap.array[array[i]].c, main->program.output.to);
+ f_print_dynamic(main->setting.wrap.array[array[i]].c, print->to);
}
} // for
}
for (f_number_unsigned_t i = 0; i < main->setting.map_wrapss.array[index].used; ++i) {
if (array[i] < main->setting.wrap.used && main->setting.wrap.array[array[i]].b.used) {
- f_print_dynamic(main->setting.wrap.array[array[i]].b, main->program.output.to);
+ f_print_dynamic(main->setting.wrap.array[array[i]].b, print->to);
}
} // for
}
* @param print
* The output structure to print to.
*
- * This does not alter print.custom.setting.state.status.
+ * This alters print.custom.setting.state.status:
+ * F_okay on success.
+ * F_data_not on success, but total is 0 or line is out of range.
+ *
+ * Error (with error bit set) from f_string_dynamic_seek_line().
+ * Error (with error bit set) from iki_read_signal_check().
+ *
+ * Error (with error bit) if status already has an error before start of function.
*/
#ifndef _di_iki_read_print_data_line_
extern void iki_read_print_data_line(fl_print_t * const print);
* @param print
* The output structure to print to.
*
- * This does not alter print.custom.setting.state.status.
+ * This alters print.custom.setting.state.status:
+ * F_okay on success.
+ * F_data_not on success, but total is 0 or line is out of range.
+ *
+ * Error (with error bit set) from f_string_dynamic_seek_line().
+ * Error (with error bit set) from iki_read_signal_check().
+ *
+ * Error (with error bit) if status already has an error before start of function.
+ *
+ * @see f_string_dynamic_seek_line()
+ * @see iki_read_signal_check()
*/
#ifndef _di_iki_read_print_data_line_total_expand_
extern void iki_read_print_data_total_expand(fl_print_t * const print);