-
Notifications
You must be signed in to change notification settings - Fork 47
/
context.h
78 lines (61 loc) · 2.02 KB
/
context.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <time.h>
#include "support.h"
struct CONTEXT;
struct DEFERRED
{
struct DEFERRED *next;
struct NODE *node;
int (*run)(struct CONTEXT *context, struct DEFERRED *info);
void *user;
hash_t depcontext;
};
struct DEFERRED_CSCAN
{
struct DEFERRED_CSCAN *next;
struct DEFERRED *first;
hash_t includepaths_hash;
};
#define CSCAN_HASHSIZE 256 /* must be power of 2 */
struct CONTEXT
{
/* lua state */
struct lua_State *lua;
/* general script information */
const char *filename;
char script_directory[512];
struct HEAP *graphheap;
struct GRAPH *graph;
struct DEPCACHE *depcache;
struct OUTPUTCACHE *outputcache;
struct SCANCACHE *scancache;
struct STATCACHE *statcache;
/* targets */
struct NODE *defaulttarget; /* default target if no targets are specified */
struct NODE *target; /* target to build */
/* list of jobs that we must build */
struct JOB **joblist;
unsigned num_jobs; /* number of jobs in the joblist */
unsigned first_undone_job; /* index to first job in the joblist that is undone */
unsigned current_job_num; /* current job we are building, not an index, just a count */
/* this heap is used for dependency lookups that has to happen after we
parsed the whole file */
struct HEAP *deferredheap;
struct DEFERRED *firstdeferred_cpp;
struct DEFERRED *firstdeferred_search;
struct DEFERRED_CSCAN *firstcscans[CSCAN_HASHSIZE];
time_t globaltimestamp; /* timestamp of the script files */
time_t buildtime; /* timestamp when the build started */
time_t postsetuptime; /* timestamp after the setup when script has run to completion etc */
/* debugging */
struct VERIFY_STATE *verifystate;
/* exit related */
int forced;
int exit_on_error;
int errorcode;
};
int context_default_target(struct CONTEXT *context, struct NODE *node);
int context_build_prepare(struct CONTEXT *context);
int context_build_prioritize(struct CONTEXT *context);
int context_build_clean(struct CONTEXT *context);
int context_build_make(struct CONTEXT *context);
void context_dump_joblist(struct CONTEXT *context);