becopyheur2: Remove unnecessary indirection.
[libfirm] / include / libfirm / irprintf.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief    A little printf understanding some firm types.
9  * @author   Sebastian Hack
10  * @date     29.11.2004
11  */
12 #ifndef FIRM_IR_IRPRINTF_H
13 #define FIRM_IR_IRPRINTF_H
14
15 #include <stddef.h>
16 #include <stdarg.h>
17 #include <stdio.h>
18 #include "begin.h"
19
20 /* forward definition */
21 struct obstack;
22
23 /**
24  * A string formatting routine for ir objects.
25  *
26  * @param fmt  The format string.
27  *
28  * This function rudimentary implements a kind of printf(3) for ir
29  * nodes and adds the following additional conversion specifiers.
30  * - @%t A type name.
31  * - @%e An entity name.
32  * - @%E An entity ld name.
33  * - @%T A tarval.
34  * - @%n A full description of a node.
35  * - @%O The opcode name of an ir node.
36  * - @%N The node number of an ir node.
37  * - @%m The mode name of an ir mode.
38  * - @%B The block node number of the nodes block.
39  * - @%I An ident.
40  * - @%D Print as many white spaces as given in the parameter.
41  * - @%G A debug info (if available) from the given ir node.
42  * - @%B A bitset.
43  * - @%F A Firm object (automatically detected).
44  *
45  * Note that some of the standard format capabilities are not available
46  * due to this new conversion specifiers, use lc_printf() if needed.
47  */
48 FIRM_API void ir_printf(const char *fmt, ...);
49
50 /**
51  * @see ir_printf.
52  */
53 FIRM_API void ir_fprintf(FILE *f, const char *fmt, ...);
54
55 /**
56  * @see ir_printf.
57  */
58 FIRM_API void ir_snprintf(char *buf, size_t n, const char *fmt, ...);
59
60 /**
61  * @see ir_printf.
62  */
63 FIRM_API void ir_vprintf(const char *fmt, va_list args);
64
65 /**
66  * @see ir_printf.
67  */
68 FIRM_API void ir_vfprintf(FILE *f, const char *fmt, va_list args);
69
70 /**
71  * @see ir_printf.
72  */
73 FIRM_API void ir_vsnprintf(char *buf, size_t len, const char *fmt,
74                            va_list args);
75
76 /**
77  * @see ir_printf.
78  */
79 FIRM_API void ir_obst_vprintf(struct obstack *obst, const char *fmt,
80                               va_list args);
81
82 #include "end.h"
83
84 #endif