output.c revision 5e4455bffd7cd5c4a948ce7f7f4be9da55c67fb4
1#include <stdarg.h> 2 3#include "ltrace.h" 4#include "process.h" 5 6static int new_line=1; 7 8void send_left(const char * fmt, ...) 9{ 10 va_list args; 11 12 va_start(args, fmt); 13 if (opt_i) { 14 fprintf(output, "[%08x] ", instruction_pointer); 15 } 16 vfprintf(output, fmt, args); 17 va_end(args); 18 new_line=0; 19} 20 21void send_right(const char * fmt, ...) 22{ 23 va_list args; 24 25 if (new_line==0) { 26 va_start(args, fmt); 27 if (opt_i) { 28 fprintf(output, "[%08x] ", instruction_pointer); 29 } 30 vfprintf(output, fmt, args); 31 va_end(args); 32 } 33 new_line=1; 34} 35 36void send_line(const char * fmt, ...) 37{ 38 va_list args; 39 40 va_start(args, fmt); 41 if (opt_i) { 42 fprintf(output, "[%08x] ", instruction_pointer); 43 } 44 vfprintf(output, fmt, args); 45 va_end(args); 46 new_line=1; 47} 48