Functions so marked in this documentation use standard C designated initializers and compound literals to allow you to omit, call by name, or change the order of inputs. The following examples are all equivalent.
The standard format:
int apop_text_to_db(char const *text_file, char *tabname, int has_row_names, int has_col_names, char **field_names, int const *field_ends, apop_data *field_params, char *table_params, char const *delimiters, char if_table_exists)
Definition apop_conversions.c:1168
Omitted arguments are left at their default vaules:
You can use the variable's name, if you forget its ordering:
apop_text_to_db(
"infile.txt",
"intable", .has_col_name=1, .has_row_name=0);
If an un-named element follows a named element, then that value is given to the next variable in the standard ordering:
- There may be cases where you can not use this form (it relies on a macro, which may not be available). You can always call the underlying function directly, by adding
_base
to the name and giving all arguments:
apop_text_to_db_base("infile.txt", "intable", 0, 1, NULL);
- If one of the optional elements is an RNG and you do not provide one, I use one from apop_rng_get_thread.