Lines Matching refs:action
18 self->list = calloc(self->size, sizeof(struct action)); in actions_init()
35 for (struct action *action = self->list; action < self->list + self->len; action++) { in actions_destroy() local
36 if (action->type == ACTION_SHELL) in actions_destroy()
37 free(action->command); in actions_destroy()
38 if (action->type == ACTION_TRACE_OUTPUT) in actions_destroy()
39 free(action->trace_output); in actions_destroy()
49 static struct action *
54 self->list = realloc(self->list, self->size * sizeof(struct action)); in actions_new()
66 struct action *action = actions_new(self); in actions_add_trace_output() local
69 action->type = ACTION_TRACE_OUTPUT; in actions_add_trace_output()
70 action->trace_output = calloc(strlen(trace_output) + 1, sizeof(char)); in actions_add_trace_output()
71 if (!action->trace_output) in actions_add_trace_output()
73 strcpy(action->trace_output, trace_output); in actions_add_trace_output()
84 struct action *action = actions_new(self); in actions_add_signal() local
87 action->type = ACTION_SIGNAL; in actions_add_signal()
88 action->signal = signal; in actions_add_signal()
89 action->pid = pid; in actions_add_signal()
100 struct action *action = actions_new(self); in actions_add_shell() local
103 action->type = ACTION_SHELL; in actions_add_shell()
104 action->command = calloc(strlen(command) + 1, sizeof(char)); in actions_add_shell()
105 if (!action->command) in actions_add_shell()
107 strcpy(action->command, command); in actions_add_shell()
118 struct action *action = actions_new(self); in actions_add_continue() local
121 action->type = ACTION_CONTINUE; in actions_add_continue()
224 const struct action *action; in actions_perform() local
226 for (action = self->list; action < self->list + self->len; action++) { in actions_perform()
227 switch (action->type) { in actions_perform()
229 retval = save_trace_to_file(self->trace_output_inst, action->trace_output); in actions_perform()
236 if (action->pid == -1) in actions_perform()
239 pid = action->pid; in actions_perform()
240 retval = kill(pid, action->signal); in actions_perform()
247 retval = system(action->command); in actions_perform()