-
Notifications
You must be signed in to change notification settings - Fork 1
/
targets.h
42 lines (36 loc) · 1.05 KB
/
targets.h
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
39
40
41
42
/* CITS2002 Project 2018
* Names: Bruce How, Vincent Tian
* Student numbers: 22242664, 22262122
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/**
* LinkedList structure used to contain every target and their respective
* actions and dependecies
*/
typedef struct targetNode {
char *target;
char **dependencies;
char **actions;
int numDep; // Number of dependencies
int numAct; // Number of actions
struct targetNode *next;
} target;
// Global variables to allow access for other files
extern target *targetList;
extern target *currentTarget;
// Keep track of the last variable
target *lastTarget;
/**
* Adds every declaration if any to a particular target
* @param word The word or target that was just found
* @param dependencyLine The string containing the dependecies
*/
void processTargetDef(char *word, char *dependencyLine);
/**
* Adds every action if any to the target that was just processed
* @param actLine The string containing the actions
*/
void processActionDef(char *actLine);