summaryrefslogtreecommitdiffhomepage
path: root/ir/ir/irprintf.c
blob: 5829939c5726000d4614cd4073edd14fe64b949f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * This file is part of libFirm.
 * Copyright (C) 2012 University of Karlsruhe.
 */

/**
 * @file
 * @brief   A little printf helper understanding firm types
 * @author  Sebastian Hack
 * @date    29.11.2004
 */
#include "irprintf.h"

#include "dbginfo_t.h"
#include "entity_t.h"
#include "ident.h"
#include "irargs_t.h"
#include "irmode_t.h"
#include "irnode_t.h"
#include "obst.h"
#include "tv_t.h"
#include "type_t.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

int ir_printf(const char *fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	int res = lc_evprintf(firm_get_arg_env(), fmt, args);
	va_end(args);
	return res;
}

int ir_fprintf(FILE *f, const char *fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	int res = lc_evfprintf(firm_get_arg_env(), f, fmt, args);
	va_end(args);
	return res;
}

int ir_snprintf(char *buf, size_t n, const char *fmt, ...)
{
	va_list args;
	va_start(args, fmt);
	int res = lc_evsnprintf(firm_get_arg_env(), buf, n, fmt, args);
	va_end(args);
	return res;
}

int ir_vprintf(const char *fmt, va_list args)
{
	return lc_evprintf(firm_get_arg_env(), fmt, args);
}

int ir_vfprintf(FILE *f, const char *fmt, va_list args)
{
	return lc_evfprintf(firm_get_arg_env(), f, fmt, args);
}

int ir_vsnprintf(char *buf, size_t len, const char *fmt, va_list args)
{
	return lc_evsnprintf(firm_get_arg_env(), buf, len, fmt, args);
}

int ir_obst_vprintf(struct obstack *obst, const char *fmt, va_list args)
{
	return lc_evoprintf(firm_get_arg_env(), obst, fmt, args);
}