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 * -------------------------------------------------------------------------*/
18 #define GAUGER(category, counter, value, unit)\
20 char* __gauger_v[10];\
23 if(!(__gauger_p=fork())){\
25 sprintf(__gauger_s,"%Lf", (long double) (value));\
26 __gauger_v[0] = "gauger-cli.py";\
27 __gauger_v[1] = "-n";\
28 __gauger_v[2] = counter;\
29 __gauger_v[3] = "-d";\
30 __gauger_v[4] = __gauger_s;\
31 __gauger_v[5] = "-u";\
32 __gauger_v[6] = unit;\
33 __gauger_v[7] = "-c";\
34 __gauger_v[8] = category;\
35 __gauger_v[9] = (char *)NULL;\
36 execvp("gauger-cli.py",__gauger_v);\
43 waitpid(__gauger_p,NULL,0);\
47 #define GAUGER_ID(category, counter, value, unit, id)\
49 char* __gauger_v[12];\
52 if(!(__gauger_p=fork())){\
54 sprintf(__gauger_s,"%Lf", (long double) (value));\
55 __gauger_v[0] = "gauger-cli.py";\
56 __gauger_v[1] = "-n";\
57 __gauger_v[2] = counter;\
58 __gauger_v[3] = "-d";\
59 __gauger_v[4] = __gauger_s;\
60 __gauger_v[5] = "-u";\
61 __gauger_v[6] = unit;\
62 __gauger_v[7] = "-i";\
64 __gauger_v[9] = "-c";\
65 __gauger_v[10] = category;\
66 __gauger_v[11] = (char *)NULL;\
67 execvp("gauger-cli.py",__gauger_v);\
74 waitpid(__gauger_p,NULL,0);\