aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl/gauger.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl/gauger.h')
-rw-r--r--src/testcurl/gauger.h114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/testcurl/gauger.h b/src/testcurl/gauger.h
index 6698f5d5..d00839c1 100644
--- a/src/testcurl/gauger.h
+++ b/src/testcurl/gauger.h
@@ -17,64 +17,64 @@
17#include <stdio.h> 17#include <stdio.h>
18#include <sys/wait.h> 18#include <sys/wait.h>
19 19
20#define GAUGER(category, counter, value, unit)\ 20#define GAUGER(category, counter, value, unit) \
21{\ 21 { \
22 const char * __gauger_v[10]; \ 22 const char *__gauger_v[10]; \
23 char __gauger_s[32];\ 23 char __gauger_s[32]; \
24 pid_t __gauger_p;\ 24 pid_t __gauger_p; \
25 if(!(__gauger_p=fork())){\ 25 if (! (__gauger_p = fork ())) { \
26 if(!fork()){ \ 26 if (! fork ()) { \
27 sprintf(__gauger_s,"%Lf", (long double) (value));\ 27 sprintf (__gauger_s,"%Lf", (long double) (value)); \
28 __gauger_v[0] = "gauger";\ 28 __gauger_v[0] = "gauger"; \
29 __gauger_v[1] = "-n";\ 29 __gauger_v[1] = "-n"; \
30 __gauger_v[2] = counter; \ 30 __gauger_v[2] = counter; \
31 __gauger_v[3] = "-d";\ 31 __gauger_v[3] = "-d"; \
32 __gauger_v[4] = __gauger_s;\ 32 __gauger_v[4] = __gauger_s; \
33 __gauger_v[5] = "-u";\ 33 __gauger_v[5] = "-u"; \
34 __gauger_v[6] = unit; \ 34 __gauger_v[6] = unit; \
35 __gauger_v[7] = "-c";\ 35 __gauger_v[7] = "-c"; \
36 __gauger_v[8] = category; \ 36 __gauger_v[8] = category; \
37 __gauger_v[9] = (char *)NULL;\ 37 __gauger_v[9] = (char *) NULL; \
38 execvp("gauger", (char*const*) __gauger_v); \ 38 execvp ("gauger", (char*const*) __gauger_v); \
39 _exit(1);\ 39 _exit (1); \
40 }else{\ 40 }else{ \
41 _exit(0);\ 41 _exit (0); \
42 }\ 42 } \
43 }else{\ 43 }else{ \
44 waitpid(__gauger_p,NULL,0);\ 44 waitpid (__gauger_p,NULL,0); \
45 }\ 45 } \
46} 46 }
47 47
48#define GAUGER_ID(category, counter, value, unit, id)\ 48#define GAUGER_ID(category, counter, value, unit, id) \
49{\ 49 { \
50 char* __gauger_v[12];\ 50 char*__gauger_v[12]; \
51 char __gauger_s[32];\ 51 char __gauger_s[32]; \
52 pid_t __gauger_p;\ 52 pid_t __gauger_p; \
53 if(!(__gauger_p=fork())){\ 53 if (! (__gauger_p = fork ())) { \
54 if(!fork()){\ 54 if (! fork ()) { \
55 sprintf(__gauger_s,"%Lf", (long double) (value));\ 55 sprintf (__gauger_s,"%Lf", (long double) (value)); \
56 __gauger_v[0] = "gauger";\ 56 __gauger_v[0] = "gauger"; \
57 __gauger_v[1] = "-n";\ 57 __gauger_v[1] = "-n"; \
58 __gauger_v[2] = counter;\ 58 __gauger_v[2] = counter; \
59 __gauger_v[3] = "-d";\ 59 __gauger_v[3] = "-d"; \
60 __gauger_v[4] = __gauger_s;\ 60 __gauger_v[4] = __gauger_s; \
61 __gauger_v[5] = "-u";\ 61 __gauger_v[5] = "-u"; \
62 __gauger_v[6] = unit;\ 62 __gauger_v[6] = unit; \
63 __gauger_v[7] = "-i";\ 63 __gauger_v[7] = "-i"; \
64 __gauger_v[8] = id;\ 64 __gauger_v[8] = id; \
65 __gauger_v[9] = "-c";\ 65 __gauger_v[9] = "-c"; \
66 __gauger_v[10] = category;\ 66 __gauger_v[10] = category; \
67 __gauger_v[11] = (char *)NULL;\ 67 __gauger_v[11] = (char *) NULL; \
68 execvp("gauger",__gauger_v);\ 68 execvp ("gauger",__gauger_v); \
69 perror("gauger");\ 69 perror ("gauger"); \
70 _exit(1);\ 70 _exit (1); \
71 }else{\ 71 }else{ \
72 _exit(0);\ 72 _exit (0); \
73 }\ 73 } \
74 }else{\ 74 }else{ \
75 waitpid(__gauger_p,NULL,0);\ 75 waitpid (__gauger_p,NULL,0); \
76 }\ 76 } \
77} 77 }
78 78
79#else 79#else
80 80