Added %> for indenting
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 14 Feb 2005 10:20:13 +0000 (10:20 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 14 Feb 2005 10:20:13 +0000 (10:20 +0000)
[r5110]

ir/ir/irprintf.c
ir/ir/irprintf.h

index f744eee..5e1f23b 100644 (file)
@@ -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';
index 9abd396..fd2b509 100644 (file)
@@ -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.