aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnettrace/fnettrace.h
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-01-04 10:42:51 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2022-01-04 10:42:51 -0500
commit1000c238d5299a7fe3fc54a0d7001f8ce8979df8 (patch)
treee95d9d61070965bd5fe61523177268206939c04f /src/fnettrace/fnettrace.h
parentMerge pull request #4807 from WhyNotHugo/skype-config (diff)
downloadfirejail-1000c238d5299a7fe3fc54a0d7001f8ce8979df8.tar.gz
firejail-1000c238d5299a7fe3fc54a0d7001f8ce8979df8.tar.zst
firejail-1000c238d5299a7fe3fc54a0d7001f8ce8979df8.zip
nettrace/netlock
Diffstat (limited to 'src/fnettrace/fnettrace.h')
-rw-r--r--src/fnettrace/fnettrace.h37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/fnettrace/fnettrace.h b/src/fnettrace/fnettrace.h
index 699382838..93c9613ab 100644
--- a/src/fnettrace/fnettrace.h
+++ b/src/fnettrace/fnettrace.h
@@ -28,47 +28,22 @@
28#include <time.h> 28#include <time.h>
29#include <stdarg.h> 29#include <stdarg.h>
30 30
31//#define NETLOCK_INTERVAL 60 31//#define NETLOCK_INTERVAL 15
32#define NETLOCK_INTERVAL 60 32#define NETLOCK_INTERVAL 60
33#define DISPLAY_INTERVAL 3 33#define DISPLAY_INTERVAL 3
34 34
35void logprintf(char* fmt, ...); 35void logprintf(char* fmt, ...);
36 36
37static inline void ansi_topleft(int tolog) { 37static inline void ansi_topleft(void) {
38 char str[] = {0x1b, '[', '1', ';', '1', 'H', '\0'}; 38 char str[] = {0x1b, '[', '1', ';', '1', 'H', '\0'};
39 if (tolog) 39 printf("%s", str);
40 logprintf("%s", str);
41 else
42 printf("%s", str);
43 fflush(0); 40 fflush(0);
44} 41}
45 42
46static inline void ansi_clrscr(int tolog) { 43static inline void ansi_clrscr(void) {
47 ansi_topleft(tolog); 44 ansi_topleft();
48 char str[] = {0x1b, '[', '0', 'J', '\0'}; 45 char str[] = {0x1b, '[', '0', 'J', '\0'};
49 if (tolog) 46 printf("%s", str);
50 logprintf("%s", str);
51 else
52 printf("%s", str);
53 fflush(0);
54}
55
56static inline void ansi_linestart(int tolog) {
57 char str[] = {0x1b, '[', '0', 'G', '\0'};
58 if (tolog)
59 logprintf("%s", str);
60 else
61 printf("%s", str);
62 fflush(0);
63}
64
65static inline void ansi_clrline(int tolog) {
66 ansi_linestart(tolog);
67 char str[] = {0x1b, '[', '0', 'K', '\0'};
68 if (tolog)
69 logprintf("%s", str);
70 else
71 printf("%s", str);
72 fflush(0); 47 fflush(0);
73} 48}
74 49