Annotation of src/usr.bin/make/targ.h, Revision 1.11
1.1 espie 1: #ifndef TARG_H
2: #define TARG_H
1.11 ! espie 3: /* $OpenBSD: targ.h,v 1.10 2012/08/20 09:51:05 jsg Exp $ */
1.1 espie 4:
5: /*
6: * Copyright (c) 2001 Marc Espie.
7: *
8: * Redistribution and use in source and binary forms, with or without
9: * modification, are permitted provided that the following conditions
10: * are met:
11: * 1. Redistributions of source code must retain the above copyright
12: * notice, this list of conditions and the following disclaimer.
13: * 2. Redistributions in binary form must reproduce the above copyright
14: * notice, this list of conditions and the following disclaimer in the
15: * documentation and/or other materials provided with the distribution.
16: *
17: * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
18: * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBSD
21: * PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: */
29:
30: #ifndef TIMESTAMP_TYPE
31: #include "timestamp_t.h"
32: #endif
33: /*
34: * The TARG_ constants are used when calling the Targ_FindNode functions.
35: * They simply tell the function what to do if the desired node is not found.
36: * If the TARG_CREATE constant is given, a new, empty node will be created
37: * for the target, placed in the table of all targets and its address returned.
38: * If TARG_NOCREATE is given, a NULL pointer will be returned.
39: */
40: #define TARG_CREATE 0x01 /* create node if not found */
41: #define TARG_NOCREATE 0x00 /* don't create it */
42:
43: extern void Targ_Init(void);
44: extern GNode *Targ_NewGNi(const char *, const char *);
45: #define Targ_NewGN(n) Targ_NewGNi(n, NULL);
46: extern GNode *Targ_FindNodei(const char *, const char *, int);
47: #define Targ_FindNode(n, i) Targ_FindNodei(n, NULL, i)
1.3 espie 48:
49:
50:
51: /* set of helpers for constant nodes */
52: extern GNode *Targ_FindNodeih(const char *, const char *, uint32_t, int);
1.11 ! espie 53:
! 54: __only_inline GNode *
! 55: Targ_FindNodeh(const char *, size_t, uint32_t, int);
1.3 espie 56:
1.10 jsg 57: __only_inline GNode *
1.3 espie 58: Targ_FindNodeh(const char *name, size_t n, uint32_t hv, int flags)
59: {
60: return Targ_FindNodeih(name, name + n - 1, hv, flags);
61: }
1.1 espie 62: extern void Targ_FindList(Lst, Lst);
63: extern bool Targ_Ignore(GNode *);
64: extern bool Targ_Silent(GNode *);
65: extern bool Targ_Precious(GNode *);
66: extern void Targ_PrintCmd(void *);
67: extern void Targ_PrintType(int);
68: extern void Targ_PrintGraph(int);
69:
1.3 espie 70: extern GNode *begin_node, *end_node, *interrupt_node, *DEFAULT;
71: struct ohash_info;
72:
73: extern struct ohash_info gnode_info;
1.1 espie 74:
1.5 espie 75: extern void Targ_setdirs(const char *, const char *);
1.6 espie 76: const char *status_to_string(GNode *);
1.7 espie 77: struct ohash *targets_hash(void);
1.1 espie 78: #endif