#include "ifprintf.h"
Go to the source code of this file.
Functions | |
void | set_indent (const char *s) |
void | indent () |
void | outdent () |
void | ifprintf (FILE *f, const char *c,...) |
Variables | |
char * | indent_current = 0 |
char * | indent_amount = 0 |
int | indentLevel = 0 |
int | maxIndentLevel = 256 |
|
Definition at line 28 of file ifprintf.cc. References indent_current. Referenced by AST::Node::toASTFile(). 00028 { 00029 fprintf(f, indent_current); 00030 va_list valist; 00031 va_start(valist, c); 00032 vfprintf(f, c, valist); 00033 va_end(valist); 00034 }
|
|
Definition at line 14 of file ifprintf.cc. References indent_amount, indent_current, indentLevel, and maxIndentLevel. Referenced by AST::Node::toASTFile(). 00014 { 00015 indentLevel++; 00016 assert(indentLevel < maxIndentLevel); 00017 strcat(indent_current, indent_amount); 00018 assert(strlen(indent_current) == strlen(indent_amount) * indentLevel); 00019 }
|
|
Definition at line 21 of file ifprintf.cc. References indent_amount, indent_current, and indentLevel. Referenced by AST::Node::toASTFile(). 00021 { 00022 indentLevel--; 00023 assert(indentLevel >= 0 && "unindented too many times"); 00024 indent_current[indentLevel * strlen(indent_amount)] = '\0'; 00025 assert(strlen(indent_current) == strlen(indent_amount) * indentLevel); 00026 }
|
|
Definition at line 7 of file ifprintf.cc. References indent_amount, indent_current, indentLevel, and maxIndentLevel. Referenced by main(). 00007 { 00008 assert(indent_current == 0 && "I am to lazy to allow changing of this"); 00009 indent_amount = strdup(s); 00010 indent_current = new char[strlen(indent_amount) * maxIndentLevel]; 00011 indentLevel = 0; 00012 }
|
|
Definition at line 3 of file ifprintf.cc. Referenced by indent(), outdent(), and set_indent(). |
|
Definition at line 2 of file ifprintf.cc. Referenced by ifprintf(), indent(), outdent(), and set_indent(). |
|
Definition at line 4 of file ifprintf.cc. Referenced by indent(), outdent(), and set_indent(). |
|
Definition at line 5 of file ifprintf.cc. Referenced by indent(), and set_indent(). |