| 1 | #ifndef _USTCMD_H |
| 2 | #define _USTCMD_H |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <unistd.h> |
| 6 | #include <getopt.h> |
| 7 | #include <stdlib.h> |
| 8 | #include <fcntl.h> |
| 9 | |
| 10 | #include "ustcomm.h" |
| 11 | #include "ustcmd.h" |
| 12 | |
| 13 | #define USTCMD_ERR_CONN 1 // Process connection error |
| 14 | #define USTCMD_ERR_ARG 2 // Invalid function argument |
| 15 | #define USTCMD_ERR_GEN 3 // General ustcmd error |
| 16 | |
| 17 | #define USTCMD_MS_CHR_OFF '0' // Marker state 'on' character |
| 18 | #define USTCMD_MS_CHR_ON '1' // Marker state 'on' character |
| 19 | #define USTCMD_MS_OFF 0 // Marker state 'on' value |
| 20 | #define USTCMD_MS_ON 1 // Marker state 'on' value |
| 21 | |
| 22 | #define USTCMD_SOCK_PATH "/tmp/socks/" // UST sockets directory |
| 23 | |
| 24 | // Channel/marker/state/format string (cmsf) info. structure |
| 25 | struct USTcmd_cmsf { |
| 26 | char* channel; // Channel name (end of USTcmd_cmsf array if NULL) |
| 27 | char* marker; // Marker name (end of USTcmd_cmsf array if NULL) |
| 28 | int state; // State (0 := marker disabled, 1 := marker enabled) |
| 29 | char* fs; // Format string (end of USTcmd_cmsf array if NULL) |
| 30 | }; |
| 31 | |
| 32 | pid_t* ustcmd_get_online_pids(void); |
| 33 | int ustcmd_set_marker_state(const char*, int, pid_t); |
| 34 | int ustcmd_destroy_trace(pid_t); |
| 35 | int ustcmd_setup_and_start(pid_t); |
| 36 | int ustcmd_stop_trace(pid_t); |
| 37 | int ustcmd_start_trace(pid_t); |
| 38 | int ustcmd_free_cmsf(struct USTcmd_cmsf*); |
| 39 | unsigned int ustcmd_count_nl(const char*); |
| 40 | int ustcmd_shoot(const char*, pid_t, char**); |
| 41 | int ustcmd_get_cmsf(struct USTcmd_cmsf**, pid_t); |
| 42 | |
| 43 | #endif // _USTCMD_H |