Some printing and output interface functions.
int apop_prep_output |
( |
char const * |
output_name, |
|
|
FILE ** |
output_pipe, |
|
|
char * |
output_type, |
|
|
char * |
output_append |
|
) |
| |
If you're reading this, it is probably because you were referred by another function that uses this internally. You should never call this function directly, but do read this documentation.
There are four settings that affect how output happens, which can be set when you call the function that sent you to this documentation, e.g:
1 apop_data_print(your_data, .output_type ='f', .output_append = 'w');
- Parameters
-
output_name | The name of the output file, if any. For a database, the table to write. |
output_pipe | If you have already opened a file and have a FILE* on hand, use this instead of giving the file name. |
output_type | 'p' = pipe, 'f'= file, 'd' = database, 's' = stdout |
output_append | 'a' = append (default), 'w' = write over. |
At the end, output_name
, output_pipe
, and output_type
are all set. Notably, the local output_pipe
will have the correct location for the calling function to fprintf
to.
- Tip: if writing to the database, you can get a major speed boost by wrapping the call in a begin/commit wrapper:
2 apop_data_print(your_data, .output_name="dbtab", .output_type='d');