]> cvs.zerfleddert.de Git - proxmark3-svn/blame - linux/gui.c
Added LF frequency adjustments from d18c7db, cleaned up code,
[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;
12int CommandFinished;
13
14static char *logfilename = "proxmark3.log";
15
16void PrintToScrollback(char *fmt, ...) {
17 va_list argptr;
18 static FILE *logfile = NULL;
19 static int logging=1;
20
21 if (logging && !logfile) {
22 logfile=fopen(logfilename, "a");
23 if (!logfile) {
24 fprintf(stderr, "Can't open logfile, logging disabled!\n");
25 logging=0;
26 }
27 }
28
29 va_start(argptr, fmt);
30 vprintf(fmt, argptr);
31 printf("\n");
32 if (logging && logfile) {
33#if 0
34 char zeit[25];
35 time_t jetzt_t;
36 struct tm *jetzt;
37
38 jetzt_t = time(NULL);
39 jetzt = localtime(&jetzt_t);
40 strftime(zeit, 25, "%b %e %T", jetzt);
41
42 fprintf(logfile,"%s ", zeit);
43#endif
44 vfprintf(logfile, fmt, argptr);
45 fprintf(logfile,"\n");
46 fflush(logfile);
47 }
48 va_end(argptr);
49}
50
51void setlogfilename(char *fn)
52{
53 logfilename = fn;
54}
Impressum, Datenschutz