X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firprintf.c;h=860caac9e09e50287ca5aa5e14908dfc0204c00f;hb=6be797281b157f8f71b9c47d28b3d09f2a7918cc;hp=6dd688f221b77cd239519ad2fff2efaef0e45f4c;hpb=05ea88e192e74d381d74c6336e36fd972d7d728e;p=libfirm diff --git a/ir/ir/irprintf.c b/ir/ir/irprintf.c index 6dd688f22..860caac9e 100644 --- a/ir/ir/irprintf.c +++ b/ir/ir/irprintf.c @@ -22,18 +22,10 @@ * @brief A little printf helper unterstanding firm types * @author Sebastian Hack * @date 29.11.2004 - * @version $Id$ */ -#ifdef HAVE_CONFIG_H #include "config.h" -#endif -#ifdef HAVE_STRING_H #include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif #include #include @@ -50,127 +42,8 @@ #include "irprintf.h" #include "obst.h" #include "pset.h" -#include "iterator.h" #include "bitset.h" #include "dbginfo_t.h" - -#define STRNIL "(nil)" - -/** - * Init the string. - */ -static void str_init(void *object, size_t n) -{ - (void) n; - strcpy(object, ""); -} - -/** - * append a char to a string buffer. - */ -static void str_append_char(void *object, size_t n, char ch) -{ - char buf[2]; - - buf[0] = ch; - buf[1] = 0; - - strncat(object, buf, n); -} - -/** - * append a string to a string buffer. - */ -static void str_append_str(void *object, size_t n, const char *str) -{ - strncat(object, str, n); -} - - -/** - * Init the file. i.e. do nothing. - */ -static void file_init(void *object, size_t n) -{ - (void) object; - (void) n; -} - -/** - * append a char to a file. - */ -static void file_append_char(void *object, size_t n, char ch) -{ - (void) n; - fputc(ch, object); -} - -/** - * append a string to a file. - */ -static void file_append_str(void *object, size_t n, const char *str) -{ - (void) n; - fputs(str, object); -} - -/** - * Init the obstack. i.e. do nothing. - */ -static void obst_init(void *object, size_t n) -{ - (void) object; - (void) n; -} - -/** - * append a char to a obstack. - */ -static void obst_append_char(void *object, size_t n, char ch) -{ - struct obstack *obst = object; - (void) n; - obstack_1grow(obst, ch); -} - -/** - * append a string to a obstack. - */ -static void obst_append_str(void *object, size_t n, const char *str) -{ - struct obstack *obst = object; - (void) n; - obstack_grow(obst, str, strlen(str)); -} - - -/** - * the file appender - */ -static const appender_t file_appender = { - file_init, - file_append_char, - file_append_str -}; - -/** - * the string buffer appender - */ -static const appender_t str_appender = { - str_init, - str_append_char, - str_append_str -}; - -/** - * the obstack appender. - */ -static const appender_t obst_appender = { - obst_init, - obst_append_char, - obst_append_str -}; - #include "irargs_t.h" void ir_printf(const char *fmt, ...)