2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Input/Output textual representation of firm.
11 #ifndef FIRM_IR_IRIO_H
12 #define FIRM_IR_IRIO_H
16 #include "firm_types.h"
20 * @defgroup irio Input and Output
21 * @note The file format is not considered stable yet. So expect
22 * incompatibilities between file formats of different libfirm versions.
27 * Exports the whole irp to the given file in a textual form.
28 * Exports all types, all ir graphs, and the constant graph.
30 * @param filename the name of the resulting file
31 * @return 0 if no errors occured, other values in case of errors
33 FIRM_API int ir_export(const char *filename);
36 * same as ir_export but writes to a FILE*
37 * @note As with any FILE* errors are indicated by ferror(output)
39 FIRM_API void ir_export_file(FILE *output);
42 * Imports the data stored in the given file.
43 * Imports any type graphs and ir graphs contained in the file.
45 * @param filename the name of the file
46 * @returns 0 if no errors occured, other values in case of errors
48 FIRM_API int ir_import(const char *filename);
51 * same as ir_import but imports from a FILE*
53 FIRM_API int ir_import_file(FILE *input, const char *inputname);