16 #define CRINIT_TASK_OPT_RESPAWN (1 << 0)
17 #define CRINIT_TASK_OPT_RESPAWN_DEFAULT false
19 #define CRINIT_TASK_EVENT_RUNNING "spawn"
20 #define CRINIT_TASK_EVENT_DONE "wait"
21 #define CRINIT_TASK_EVENT_FAILED "fail"
22 #define CRINIT_TASK_EVENT_NOTIFY_SUFFIX \
81 #define crinitTaskForEachDep(task, dep) for ((dep) = (task)->deps; (dep) != (task)->deps + (task)->depsSize; (dep)++)
Header related to the Config Parser.
Definitions shared between crinit's public and internal APIs.
unsigned long crinitTaskState_t
Type to store Task state bitmask.
Definition: crinit-sdefs.h:17
Header defining data types and functions to work with sets of environment variables.
Header related to IO redirection types and functions.
Definition: confparse.h:96
int argc
Number of arguments within argv.
Definition: task.h:31
char ** argv
String array containing the program arguments, argv[0] contains absolute path to executable.
Definition: task.h:32
char * event
Dependency event.
Definition: task.h:40
char * name
Dependency name.
Definition: task.h:39
char * name
Name of the provided feature.
Definition: task.h:47
crinitTaskState_t stateReq
The task state required to be reached to provide the feature.
Definition: task.h:48
crinitTaskPrv_t * prv
Dynamic array of provided features, corresponds to PROVIDES in the config file.
Definition: task.h:62
crinitEnvSet_t elosFilters
Elos filter definitions valid for use in dependencies of this task.
Definition: task.h:59
int failCount
Definition: task.h:71
int maxRetries
Definition: task.h:69
char * name
Name of the task, corresponds to NAME in the config file.
Definition: task.h:55
crinitTaskCmd_t * cmds
Dynamic array of commands, corresponds to COMMAND[N] in the config file.
Definition: task.h:56
size_t redirsSize
Number of IO redirections.
Definition: task.h:68
size_t depsSize
Number of dependencies in deps array.
Definition: task.h:61
size_t prvSize
Number of provided features in prv array.
Definition: task.h:63
size_t cmdsSize
Number of commands in cmds array.
Definition: task.h:57
crinitIoRedir_t * redirs
IO redirection descriptions.
Definition: task.h:67
crinitEnvSet_t taskEnv
Environment variables valid for each COMMAND in this task.
Definition: task.h:58
crinitTaskOpts_t opts
Task options.
Definition: task.h:64
pid_t pid
PID of currently running process subordinate to the task, if any.
Definition: task.h:66
crinitTaskState_t state
Task state.
Definition: task.h:65
crinitTaskDep_t * deps
Dynamic array of dependencies, corresponds to DEPENDS in the config file.
Definition: task.h:60
int crinitTaskCopy(crinitTask_t *out, const crinitTask_t *orig)
Definition: task.c:77
void crinitDestroyTask(crinitTask_t *t)
Definition: task.c:240
struct crinitTaskCmd_t crinitTaskCmd_t
unsigned long crinitTaskOpts_t
Type to store Task option bitmask.
Definition: task.h:14
crinitTaskType_t
Definition: task.h:25
@ CRINIT_TASK_TYPE_INCLUDE
Definition: task.h:25
@ CRINIT_TASK_TYPE_STANDARD
Definition: task.h:25
void crinitFreeTask(crinitTask_t *t)
Definition: task.c:232
struct crinitTaskPrv_t crinitTaskPrv_t
int crinitTaskCreateFromConfKvList(crinitTask_t **out, const crinitConfKvList_t *in)
Definition: task.c:32
struct crinitTaskDep_t crinitTaskDep_t
int crinitTaskMergeInclude(crinitTask_t *tgt, const char *src, char *importList)
Definition: task.c:271
int crinitTaskDup(crinitTask_t **out, const crinitTask_t *orig)
Definition: task.c:215
struct crinitTask_t crinitTask_t