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