2 * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief A little printf understanding some firm types.
23 * @author Sebastian Hack
27 #ifndef FIRM_IR_IRPRINTF_H
28 #define FIRM_IR_IRPRINTF_H
35 /* forward definition */
39 * A string formatting routine for ir objects.
41 * @param fmt The format string.
43 * This function rudimentary implements a kind of printf(3) for ir
44 * nodes and adds the following additional conversion specifiers.
46 * - @%e An entity name.
47 * - @%E An entity ld name.
49 * - @%n A full description of a node.
50 * - @%O The opcode name of an ir node.
51 * - @%N The node number of an ir node.
52 * - @%m The mode name of an ir mode.
53 * - @%B The block node number of the nodes block.
54 * - @%P A compound graph path.
56 * - @%D Print as many white spaces as given in the parameter.
57 * - @%G A debug info (if available) from the given ir node.
59 * - @%F A Firm object (automatically detected).
61 * Note that some of the standard format capabilities are not available
62 * due to this new conversion specifiers, use lc_printf() if needed.
64 FIRM_API void ir_printf(const char *fmt, ...) FIRM_PRINTF(1,2);
69 FIRM_API void ir_fprintf(FILE *f, const char *fmt, ...) FIRM_PRINTF(2,3);
74 FIRM_API void ir_snprintf(char *buf, size_t n, const char *fmt, ...) FIRM_PRINTF(3,4);
79 FIRM_API void ir_vprintf(const char *fmt, va_list args);
84 FIRM_API void ir_vfprintf(FILE *f, const char *fmt, va_list args);
89 FIRM_API void ir_vsnprintf(char *buf, size_t len, const char *fmt,
95 FIRM_API void ir_obst_vprintf(struct obstack *obst, const char *fmt,