1 /** ---------------------------------------------------------------------------
2 * This software is in the public domain, furnished "as is", without technical
3 * support, and with no warranty, express or implied, as to its usefulness for
7 * Interface for C programs to log remotely to a gauger server
9 * Author: Bartlomiej Polot
10 * -------------------------------------------------------------------------*/
20 #define GAUGER(category, counter, value, unit)\
22 char* __gauger_v[10];\
25 if(!(__gauger_p=fork())){\
29 sprintf(__gauger_s,"%Lf", (long double) (value));\
30 __gauger_v[0] = "gauger-cli.py";\
31 __gauger_v[1] = "-n";\
32 __gauger_v[2] = counter;\
33 __gauger_v[3] = "-d";\
34 __gauger_v[4] = __gauger_s;\
35 __gauger_v[5] = "-u";\
36 __gauger_v[6] = unit;\
37 __gauger_v[7] = "-c";\
38 __gauger_v[8] = category;\
39 __gauger_v[9] = (char *)NULL;\
40 execvp("gauger-cli.py",__gauger_v);\
46 waitpid(__gauger_p,NULL,0);\
50 #define GAUGER_ID(category, counter, value, unit, id)\
52 char* __gauger_v[12];\
55 if(!(__gauger_p=fork())){\
59 sprintf(__gauger_s,"%Lf", (long double) (value));\
60 __gauger_v[0] = "gauger-cli.py";\
61 __gauger_v[1] = "-n";\
62 __gauger_v[2] = counter;\
63 __gauger_v[3] = "-d";\
64 __gauger_v[4] = __gauger_s;\
65 __gauger_v[5] = "-u";\
66 __gauger_v[6] = unit;\
67 __gauger_v[7] = "-i";\
69 __gauger_v[9] = "-c";\
70 __gauger_v[10] = category;\
71 __gauger_v[11] = (char *)NULL;\
72 execvp("gauger-cli.py",__gauger_v);\
78 waitpid(__gauger_p,NULL,0);\
84 #define GAUGER_ID(category, counter, value, unit, id) {}
85 #define GAUGER(category, counter, value, unit) {}