From: Sebastian Hack Date: Mon, 14 Feb 2005 10:20:13 +0000 (+0000) Subject: Added %> for indenting X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=343fd418cd891d102882b5f9efe2ce179f61f6cd;p=libfirm Added %> for indenting [r5110] --- diff --git a/ir/ir/irprintf.c b/ir/ir/irprintf.c index f744eeecb..5e1f23b02 100644 --- a/ir/ir/irprintf.c +++ b/ir/ir/irprintf.c @@ -362,6 +362,17 @@ static void ir_common_vprintf(const appender_t *app, void *object, buf[1] = '\0'; break; + /* Indent */ + case '>': + { + int i, n = va_arg(args, int); + for(i = 0; i < n && i < sizeof(buf) - 1; ++i) + buf[i] = ' '; + + buf[i] = '\0'; + } + break; + case 'c': buf[0] = va_arg(args, int); buf[1] = '\0'; diff --git a/ir/ir/irprintf.h b/ir/ir/irprintf.h index 9abd396a1..fd2b5094c 100644 --- a/ir/ir/irprintf.h +++ b/ir/ir/irprintf.h @@ -51,6 +51,7 @@ typedef void (ir_printf_cb_t)(const appender_t *app, void *object, size_t limit, * This function rudimentarily implements a kind of printf(3) for ir * nodes. Following conversion specifiers. No length, special or field * width specifiers are accepted. + * - @%> Print as many white spaces as given in the parameter. * - @%p A pointer. * - @%s A string. * - @%I An ident.