/** * Opens a file for writing text format * @param fn File name * @return number of regular files */ int output_text_open(char *fn) { assert(fn); f = fopen(fn, "w"); if (!f) { error("Could not open output file '%s'.", fn); return FALSE; } /* Write sally header */ sally_version(f, "# ", "Output module for text format"); return TRUE; }
/** * Opens a file for writing stdout format * @param fn File name * @return number of regular files */ int output_stdout_open(char *fn) { assert(fn); if (!stdout) { error("Could not open <stdout>"); return FALSE; } config_lookup_bool(&cfg, "output.skip_null", &skip_null); /* Write sally header */ sally_version(stdout, "# ", "Output module for stdout format"); return TRUE; }
/** * Print configuration * @param msg Text to add to output */ static void print_config(char *msg) { sally_version(stdout, "# ", msg); config_print(&cfg); }