]> cvs.zerfleddert.de Git - proxmark3-svn/blame - linux/gui.c
Further additions to tidemod to differentiate between ro and rw tags and check crc...
[proxmark3-svn] / linux / gui.c
CommitLineData
6658905f 1#include <stdarg.h>
2#include <stdio.h>
3#include <time.h>
4
5#include "proxgui.h"
6#include "translate.h"
7#include "../winsrc/prox.h"
8
9int GraphBuffer[MAX_GRAPH_TRACE_LEN];
10int GraphTraceLen;
11double CursorScaleFactor;
f4434ad2 12int PlotGridX, PlotGridY;
6658905f 13int CommandFinished;
d722c4ce 14int offline;
6658905f 15
16static char *logfilename = "proxmark3.log";
17
18void PrintToScrollback(char *fmt, ...) {
5aad6db0 19 va_list argptr, argptr2;
6658905f 20 static FILE *logfile = NULL;
21 static int logging=1;
22
23 if (logging && !logfile) {
24 logfile=fopen(logfilename, "a");
25 if (!logfile) {
26 fprintf(stderr, "Can't open logfile, logging disabled!\n");
27 logging=0;
28 }
29 }
30
31 va_start(argptr, fmt);
5aad6db0 32 va_copy(argptr2, argptr);
6658905f 33 vprintf(fmt, argptr);
5aad6db0 34 va_end(argptr);
6658905f 35 printf("\n");
36 if (logging && logfile) {
37#if 0
38 char zeit[25];
39 time_t jetzt_t;
40 struct tm *jetzt;
41
42 jetzt_t = time(NULL);
43 jetzt = localtime(&jetzt_t);
44 strftime(zeit, 25, "%b %e %T", jetzt);
45
46 fprintf(logfile,"%s ", zeit);
47#endif
5aad6db0 48 vfprintf(logfile, fmt, argptr2);
6658905f 49 fprintf(logfile,"\n");
50 fflush(logfile);
51 }
5aad6db0 52 va_end(argptr2);
6658905f 53}
54
55void setlogfilename(char *fn)
56{
57 logfilename = fn;
58}
Impressum, Datenschutz