[go: up one dir, main page]

File: option.h

package info (click to toggle)
cook 2.10-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,856 kB
  • ctags: 3,842
  • sloc: ansic: 47,714; sh: 12,150; makefile: 4,317; yacc: 3,104; awk: 154
file content (120 lines) | stat: -rw-r--r-- 4,080 bytes parent folder | download
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
 *	cook - file construction tool
 *	Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999 Peter Miller;
 *	All rights reserved.
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; either version 2 of the License, or
 *	(at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with this program; if not, write to the Free Software
 *	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 *
 * MANIFEST: interface definition for cook/option.c
 */

#ifndef OPTION_H
#define OPTION_H

#include <main.h>

#include <str.h>
#include <str_list.h>

/*
 * option levels, highest to lowest
 * (room for 16 levels in a 32 bit unsigned)
 */
enum option_level_ty
{
	OPTION_LEVEL_ERROR,
	OPTION_LEVEL_AUTO,
	OPTION_LEVEL_COMMAND_LINE,
	OPTION_LEVEL_EXECUTE,
	OPTION_LEVEL_RECIPE,
	OPTION_LEVEL_COOKBOOK,
	OPTION_LEVEL_ENVIRONMENT,
	OPTION_LEVEL_DEFAULT
};
typedef enum option_level_ty option_level_ty;

enum option_number_ty
{
	OPTION_ACTION,		/* do not execute the command */
	OPTION_BOOK,
	OPTION_CASCADE,		/* do (not) cascade ingredients */
	OPTION_CMDFILE,		/* generate a command file */
	OPTION_DISASSEMBLE,	/* undocumented: disassemble opcode lists after compilation */
	OPTION_ERROK,		/* ignore error returns from commands */
	OPTION_FINGERPRINT,	/* remember file fingerprints */
	OPTION_FINGERPRINT_WRITE, /* preserve fingerprints if taken */
	OPTION_FORCE,		/* always execute the commands */
	OPTION_GATEFIRST,	/* check the gate conditions on a recipe before evaluating the ingredients */
	OPTION_IMPLICIT_ALLOWED, /* implicit recipes may be used */
	OPTION_INCLUDE_COOKED,	/* cook the include-cooked include files */
	OPTION_INCLUDE_COOKED_WARNING,	/* warn of include-cooked problems */
	OPTION_INVALIDATE_STAT_CACHE,
	OPTION_LOGGING,
	OPTION_METER,		/* meter each command */
	OPTION_MKDIR,		/* make directories of targets */
	OPTION_PERSEVERE,	/* keep trying if have errors */
	OPTION_PRECIOUS,	/* do not delete failed targets */
	OPTION_REASON,		/* emit inference debugging commentary */
	OPTION_RECURSE,		/* allow target recursion loops */
	OPTION_SHALLOW,		/* recipe targets are to be shallow on search_list */
	OPTION_SILENT,		/* do not echo any command */
	OPTION_STAR,		/* emit progress stars */
	OPTION_STRIP_DOT,	/* strip leading ./ from paths */
	OPTION_TERMINAL,	/* enable tty output when logging */
	OPTION_TOUCH,		/* do not execute the command, just touch */
	OPTION_UNLINK,		/* remove targets before running rule body */
	OPTION_UPDATE,		/* update utime for consistency */
	OPTION_UPDATE_MAX,	/* update utime for consistency - backwards! */
	OPTION_MATCH_MODE_REGEX, /* regex pattern matching (as opp native) */

	/*
	 * If you add to this list, make sure you also add the option to
	 * the list in cook/builtin/options.c
	 */
	OPTION_max
};
typedef enum option_number_ty option_number_ty;

typedef struct option_ty option_ty;
struct option_ty
{
	string_list_ty	o_target;
	string_ty	*o_book;
	string_ty	*o_logfile;
	string_list_ty	o_search_path;
	string_list_ty	o_vardef;
	int		pairs;
	int		script;
	int		web;
	int		fingerprint_update;
};

extern	option_ty	option;

int option_already _((option_number_ty, option_level_ty));
int option_test _((option_number_ty));
void option_set _((option_number_ty, option_level_ty, int));
void option_undo _((option_number_ty, option_level_ty));
void option_undo_level _((option_level_ty));
void option_set_errors _((void));
void option_tidy_up _((void));

void *option_flag_state_get _((void));
void option_flag_state_set _((void *));

const char *option_number_name _((option_number_ty));
const char *option_level_name _((option_level_ty));

#endif /* OPTION_H */