GNUnet  0.10.x
Macros
gauger.h File Reference
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
Include dependency graph for gauger.h:

Go to the source code of this file.

Macros

#define GAUGER(category, counter, value, unit)
 
#define GAUGER_ID(category, counter, value, unit, id)
 

Macro Definition Documentation

◆ GAUGER

#define GAUGER (   category,
  counter,
  value,
  unit 
)
Value:
{ \
char* __gauger_v[10]; \
char __gauger_s[32]; \
pid_t __gauger_p; \
if (!(__gauger_p = fork())) { \
close(1); \
close(2); \
if (!fork()) { \
sprintf(__gauger_s, "%Lf", (long double)(value)); \
__gauger_v[0] = "gauger"; \
__gauger_v[1] = "-n"; \
__gauger_v[2] = (char*)(counter); \
__gauger_v[3] = "-d"; \
__gauger_v[4] = __gauger_s; \
__gauger_v[5] = "-u"; \
__gauger_v[6] = (char*)(unit); \
__gauger_v[7] = "-c"; \
__gauger_v[8] = (char*)(category); \
__gauger_v[9] = (char*)NULL; \
execvp("gauger", __gauger_v); \
_exit(1); \
}else{ \
_exit(0); \
} \
}else{ \
waitpid(__gauger_p, NULL, 0); \
} \
}
static char * value
Value of the record to add/remove.

Definition at line 18 of file gauger.h.

Referenced by GNUNET_SERVICE_run_(), LEGACY_SERVICE_run(), and LEGACY_SERVICE_stop().

◆ GAUGER_ID

#define GAUGER_ID (   category,
  counter,
  value,
  unit,
  id 
)
Value:
{ \
char* __gauger_v[12]; \
char __gauger_s[32]; \
pid_t __gauger_p; \
if (!(__gauger_p = fork())) { \
close(1); \
close(2); \
if (!fork()) { \
sprintf(__gauger_s, "%Lf", (long double)(value)); \
__gauger_v[0] = "gauger"; \
__gauger_v[1] = "-n"; \
__gauger_v[2] = (char*)(counter); \
__gauger_v[3] = "-d"; \
__gauger_v[4] = __gauger_s; \
__gauger_v[5] = "-u"; \
__gauger_v[6] = (char*)(unit); \
__gauger_v[7] = "-i"; \
__gauger_v[8] = id; \
__gauger_v[9] = "-c"; \
__gauger_v[10] = (char *)(category); \
__gauger_v[11] = (char *)NULL; \
execvp("gauger", __gauger_v); \
_exit(1); \
}else{ \
_exit(0); \
} \
}else{ \
waitpid(__gauger_p, NULL, 0); \
} \
}
static struct GNUNET_IDENTITY_Handle * id
Handle to identity service.
static char * value
Value of the record to add/remove.

Definition at line 48 of file gauger.h.