irprintf.h 2.59 KB
Newer Older
Christian Würdig's avatar
Christian Würdig committed
1
/*
Michael Beck's avatar
Michael Beck committed
2
 * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
Christian Würdig's avatar
Christian Würdig committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
 */

20
/**
Matthias Braun's avatar
Matthias Braun committed
21
22
23
24
25
 * @file
 * @brief    A little printf understanding some firm types.
 * @author   Sebastian Hack
 * @date     29.11.2004
 * @version  $Id$
26
 */
Matthias Braun's avatar
Matthias Braun committed
27
28
#ifndef FIRM_IR_IRPRINTF_H
#define FIRM_IR_IRPRINTF_H
29

Sebastian Hack's avatar
Sebastian Hack committed
30
#include <stddef.h>
31
#include <stdarg.h>
Sebastian Hack's avatar
Sebastian Hack committed
32
#include <stdio.h>
33
#include "begin.h"
34
35
36

/* forward definition */
struct obstack;
Sebastian Hack's avatar
Sebastian Hack committed
37

38
/**
Michael Beck's avatar
Michael Beck committed
39
 * A string formatting routine for ir objects.
40
41
42
 *
 * @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.
45
 * - @%t A type name.
Michael Beck's avatar
Michael Beck committed
46
 * - @%e An entity name.
47
 * - @%E An entity ld name.
48
 * - @%T A tarval.
Michael Beck's avatar
Michael Beck committed
49
 * - @%n A full description of a node.
50
 * - @%O The opcode name of an ir node.
Michael Beck's avatar
Michael Beck committed
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
55
56
57
58
59
 * - @%P A compound graph path.
 * - @%I An ident.
 * - @%D Print as many white spaces as given in the parameter.
 * - @%G A debug info (if available) from the given ir node.
 * - @%B A bitset.
 * - @%F A Firm object (automatically detected).
60
 *
61
62
 * Note that some of the standard format capabilities are not available
 * due to this new conversion specifiers, use lc_printf() if needed.
63
 */
64
FIRM_API void ir_printf(const char *fmt, ...);
65
66

/**
67
 * @see ir_printf.
68
 */
69
FIRM_API void ir_fprintf(FILE *f, const char *fmt, ...);
70
71

/**
72
 * @see ir_printf.
73
 */
74
FIRM_API void ir_snprintf(char *buf, size_t n, const char *fmt, ...);
75

76
/**
77
 * @see ir_printf.
78
 */
Michael Beck's avatar
Michael Beck committed
79
FIRM_API void ir_vprintf(const char *fmt, va_list args);
80
81

/**
82
 * @see ir_printf.
83
 */
Michael Beck's avatar
Michael Beck committed
84
FIRM_API void ir_vfprintf(FILE *f, const char *fmt, va_list args);
85
86

/**
87
 * @see ir_printf.
88
 */
Michael Beck's avatar
Michael Beck committed
89
FIRM_API void ir_vsnprintf(char *buf, size_t len, const char *fmt,
90
                           va_list args);
91
92

/**
93
 * @see ir_printf.
94
 */
Michael Beck's avatar
Michael Beck committed
95
FIRM_API void ir_obst_vprintf(struct obstack *obst, const char *fmt,
96
97
98
                              va_list args);

#include "end.h"
99

Matthias Braun's avatar
Matthias Braun committed
100
#endif