blob: f4173a38d967607ad9f594f45007c755163ead01 [file] [log] [blame]
Juan Cespedes3268a161997-08-25 16:45:22 +02001#include <stdio.h>
Juan Cespedes5e4455b1997-08-24 01:48:26 +02002#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);
Juan Cespedes5e4455b1997-08-24 01:48:26 +020028 vfprintf(output, fmt, args);
Juan Cespedes3268a161997-08-25 16:45:22 +020029 fprintf(output, "\n");
Juan Cespedes5e4455b1997-08-24 01:48:26 +020030 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);
Juan Cespedes3268a161997-08-25 16:45:22 +020044 fprintf(output, "\n");
Juan Cespedes5e4455b1997-08-24 01:48:26 +020045 va_end(args);
46 new_line=1;
47}