File: ccontrol.h

package info (click to toggle)
ccontrol 0.9.1+20060806-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 440 kB
  • ctags: 188
  • sloc: ansic: 1,478; sh: 302; makefile: 142; python: 141; xml: 64
file content (82 lines) | stat: -rw-r--r-- 1,566 bytes parent folder | download | duplicates (2)
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
79
80
81
82
/* Ccontrol goodness. */
#ifndef _CCONTROL_H
#define _CCONTROL_H
#include <stdbool.h>

struct string
{
	/* Start and end of this string, initial is pointer to beginning. */
	char *start, *end;
	char *start_of_file;
};

enum type
{
	TYPE_CC,
	TYPE_CPLUSPLUS,
	TYPE_LD,
	TYPE_MAKE,
	LAST_TYPE = TYPE_MAKE,
};

struct add
{
	struct add *next;
	char *arg;
};

struct section
{
	struct string name;

	/* Run verbose (debugging) */
	bool verbose;

	/* Priority level */
	int nice;

	/* How many in parallel? */
	unsigned int cpus;

	/* What (if any) targets do we suppress parallel make? */
	char *no_parallel;

	/* Name of CC, C++, LD and MAKE replacements. */
	char *names[LAST_TYPE + 1];

	/* Path of ccache, distcc */
	char *ccache, *distcc;

	/* Distcc hosts. */
	char *distcc_hosts;
	bool distcplusplus_hosts_set;
	char *distcplusplus_hosts;

	/* Things to add to make line. */
	struct add *make_add;

	/* Things to add to environment. */
	struct add *env_add;
	
	/* lock file */
	int lock_fd;	   
	char *lock_file;	   
};

/* ccontrol.c */
#define verbose(v, fmt, ...) \
	do { if (v) __verbose((fmt), ## __VA_ARGS__, NULL); } while(0) 
void __verbose(const char *fmt, ...) __attribute__((sentinel));

/* ccontrol-parse.c */
struct section read_config(const char *configname, const char *dir, int fd);

/* ccontrol-lock.c */
typedef void (*undofn_t)(void);
undofn_t grab_lock(int fd, struct section sec, enum type type);
void drop_slow_lock(void);

/* ccontrol-identify.c */
enum type what_am_i(char *argv[]);
bool can_distcc(char *argv[]);
#endif /* _CCONTROL_H */