-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.h
More file actions
35 lines (30 loc) · 893 Bytes
/
Copy pathrules.h
File metadata and controls
35 lines (30 loc) · 893 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
typedef struct List {
char *name;
struct List *next;
} Dep, Action;
typedef struct ActionList {
Action *head;
} ActionList;
typedef struct Rule {
char *target;
Dep *deproot;
ActionList *actroot;
struct Rule *next;
} Rule;
Rule *createRule(char *t, Dep *root);
ActionList* addAction(ActionList *lst, char *act);
Dep * getDependencies(char *d);
Rule *findRuleFromTarget(Rule *root, char *targName);
int fileExists(char *fName);
int isUpdated(char *target, char *dependency);
Dep *reverseDepList(Dep *root);
Rule *reverseLinkedList(Rule *root);
int validateDependency(Rule *root, Dep *dptr);
Rule *findRule(Rule *root, char *depName);
void executeActions(ActionList *ptr);
int traverseRules(Rule *root, Rule *trav);
void printRules(Rule *trav);
void freeAction(struct List *root);
void freeDep(struct List *root);
void freeRules(Rule *root);
char *trim(char *s);