4 static void *execute_parse(char **);
5 static void execute_destroy(void *);
6 static int execute_send(void *, ipmon_msg_t *);
7 static void execute_print(void *);
9 typedef struct execute_opts_s {
13 ipmon_saver_t executesaver = {
25 execute_parse(char **strings)
29 ctx = calloc(1, sizeof(*ctx));
31 if (ctx != NULL && strings[0] != NULL && strings[0][0] != '\0') {
32 ctx->path = strdup(strings[0]);
44 execute_print(void *ctx)
46 execute_opts_t *exe = ctx;
48 printf("%s", exe->path);
53 execute_destroy(void *ctx)
55 execute_opts_t *exe = ctx;
64 execute_send(void *ctx, ipmon_msg_t *msg)
66 execute_opts_t *exe = ctx;
69 fp = popen(exe->path, "w");
71 fwrite(msg->imm_msg, msg->imm_msglen, 1, fp);