-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.c
More file actions
38 lines (35 loc) · 665 Bytes
/
Copy pathtask.c
File metadata and controls
38 lines (35 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
#include <standardloop/logger.h>
#include "./do.h"
extern DoTask *InitDoTask(char *name)
{
if (name == NULL)
{
return NULL;
}
DoTask *task = malloc(sizeof(DoTask));
task->name = name;
task->cmds = NULL;
task->check_cmds = NULL;
return task;
}
extern void FreeDoTask(DoTask *task)
{
if (task != NULL)
{
if (task->name != NULL)
{
free(task->name);
}
if (task->cmds != NULL)
{
// FIXME
free(task->cmds);
}
free(task);
}
}