[go: up one dir, main page]

File: flag.h

package info (click to toggle)
cook 2.29-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,656 kB
  • ctags: 4,083
  • sloc: ansic: 47,636; sh: 14,376; makefile: 4,656; yacc: 3,166; perl: 224; awk: 219
file content (133 lines) | stat: -rw-r--r-- 3,916 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
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
 *      cook - file construction tool
 *      Copyright (C) 1997-1999, 2001, 2003, 2006, 2007 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/flag.c
 *
 *
 * If you are going to add a new recipe flag (set by the "set" statement,
 * or the "set" clause of a recipe) you need to change all of the
 * following places:
 *
 * cook/option.h
 *     to define the OPTION_ value
 * cook/option.c
 *     option_tidyup()
 *         if the option defaults to true
 *     option_set_errors()
 *         if the option should be turned off once cookbook errors
 *         are encountered.
 *     option_number_name()
 *         for the name of the option
 * cook/flag.h
 *     to define the RF_ values (RF stands for Recipe Flag)
 * cook/flag.c
 *     to define the RF_ names
 * langu.flags.so
 *     to document the recipe flag
 *
 * If you choose to make it a command line option,
 * you must also update these files:
 *
 * cook/main.c
 *     to define the new command line option and process it
 *     (only if it should also be a command line option)
 * cook/builtin/options.c
 *     to access the option from within the cookbook (typically used
 *     for recursive cook invokations)
 * lib/en/man1/cook.1
 *     to document it, if you added a new command line option
 */

#ifndef COOK_FLAG_H
#define COOK_FLAG_H

#include <common/main.h>

struct expr_position_ty; /* existence */
struct string_list_ty; /* existence */

enum flag_value_ty
{
        RF_CASCADE,
        RF_CASCADE_OFF,
        RF_CLEARSTAT,
        RF_CLEARSTAT_OFF,
        RF_DEFAULT,
        RF_DEFAULT_OFF,
        RF_ERROK,
        RF_ERROK_OFF,
        RF_FINGERPRINT,
        RF_FINGERPRINT_NOWRITE,
        RF_FINGERPRINT_OFF,
        RF_FORCE,
        RF_FORCE_OFF,
        RF_GATEFIRST,
        RF_GATEFIRST_OFF,
        RF_IMPLICIT_ALLOWED,
        RF_IMPLICIT_ALLOWED_OFF,
        RF_INCLUDE_COOKED_WARNING,
        RF_INCLUDE_COOKED_WARNING_OFF,
        RF_INGREDIENTS_FINGERPRINT,
        RF_INGREDIENTS_FINGERPRINT_OFF,
        RF_MATCH_MODE_COOK,
        RF_MATCH_MODE_REGEX,
        RF_METER,
        RF_METER_OFF,
        RF_MKDIR,
        RF_MKDIR_OFF,
        RF_PRECIOUS,
        RF_PRECIOUS_OFF,
        RF_RECURSE,
        RF_RECURSE_OFF,
        RF_SHALLOW,
        RF_SHALLOW_OFF,
        RF_SILENT,
        RF_SILENT_OFF,
        RF_STRIPDOT,
        RF_STRIPDOT_OFF,
        RF_SYMLINK_INGREDIENTS,
        RF_SYMLINK_INGREDIENTS_OFF,
        RF_TELL_POSITION,
        RF_TELL_POSITION_OFF,
        RF_UNLINK,
        RF_UNLINK_OFF,
        RF_UPDATE,
        RF_UPDATE_MAX,
        RF_UPDATE_OFF,
        RF_max  /* MUST be last */
};
typedef enum flag_value_ty flag_value_ty;

typedef struct flag_ty flag_ty;
struct flag_ty
{
        unsigned char flag[RF_max];
};


flag_ty *flag_new(void);
flag_ty *flag_copy(const flag_ty *);
void flag_delete(flag_ty *);
void flag_union(flag_ty *, const flag_ty *);
flag_ty *flag_recognize(const struct string_list_ty *,
        const struct expr_position_ty *);
void flag_set_options(const flag_ty *, int);
int flag_query(const flag_ty *, flag_value_ty);

#endif /* COOK_FLAG_H */