nonints.h revision 240330
1240330Smarcel/*	$NetBSD: nonints.h,v 1.65 2012/08/30 21:17:05 sjg Exp $	*/
2236769Sobrien
3236769Sobrien/*-
4236769Sobrien * Copyright (c) 1988, 1989, 1990, 1993
5236769Sobrien *	The Regents of the University of California.  All rights reserved.
6236769Sobrien *
7236769Sobrien * This code is derived from software contributed to Berkeley by
8236769Sobrien * Adam de Boor.
9236769Sobrien *
10236769Sobrien * Redistribution and use in source and binary forms, with or without
11236769Sobrien * modification, are permitted provided that the following conditions
12236769Sobrien * are met:
13236769Sobrien * 1. Redistributions of source code must retain the above copyright
14236769Sobrien *    notice, this list of conditions and the following disclaimer.
15236769Sobrien * 2. Redistributions in binary form must reproduce the above copyright
16236769Sobrien *    notice, this list of conditions and the following disclaimer in the
17236769Sobrien *    documentation and/or other materials provided with the distribution.
18236769Sobrien * 3. Neither the name of the University nor the names of its contributors
19236769Sobrien *    may be used to endorse or promote products derived from this software
20236769Sobrien *    without specific prior written permission.
21236769Sobrien *
22236769Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23236769Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24236769Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25236769Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26236769Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27236769Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28236769Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29236769Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30236769Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31236769Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32236769Sobrien * SUCH DAMAGE.
33236769Sobrien *
34236769Sobrien *	from: @(#)nonints.h	8.3 (Berkeley) 3/19/94
35236769Sobrien */
36236769Sobrien
37236769Sobrien/*-
38236769Sobrien * Copyright (c) 1989 by Berkeley Softworks
39236769Sobrien * All rights reserved.
40236769Sobrien *
41236769Sobrien * This code is derived from software contributed to Berkeley by
42236769Sobrien * Adam de Boor.
43236769Sobrien *
44236769Sobrien * Redistribution and use in source and binary forms, with or without
45236769Sobrien * modification, are permitted provided that the following conditions
46236769Sobrien * are met:
47236769Sobrien * 1. Redistributions of source code must retain the above copyright
48236769Sobrien *    notice, this list of conditions and the following disclaimer.
49236769Sobrien * 2. Redistributions in binary form must reproduce the above copyright
50236769Sobrien *    notice, this list of conditions and the following disclaimer in the
51236769Sobrien *    documentation and/or other materials provided with the distribution.
52236769Sobrien * 3. All advertising materials mentioning features or use of this software
53236769Sobrien *    must display the following acknowledgement:
54236769Sobrien *	This product includes software developed by the University of
55236769Sobrien *	California, Berkeley and its contributors.
56236769Sobrien * 4. Neither the name of the University nor the names of its contributors
57236769Sobrien *    may be used to endorse or promote products derived from this software
58236769Sobrien *    without specific prior written permission.
59236769Sobrien *
60236769Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
61236769Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
62236769Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
63236769Sobrien * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
64236769Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65236769Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66236769Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67236769Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68236769Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69236769Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70236769Sobrien * SUCH DAMAGE.
71236769Sobrien *
72236769Sobrien *	from: @(#)nonints.h	8.3 (Berkeley) 3/19/94
73236769Sobrien */
74236769Sobrien
75236769Sobrien/* arch.c */
76236769SobrienReturnStatus Arch_ParseArchive(char **, Lst, GNode *);
77236769Sobrienvoid Arch_Touch(GNode *);
78236769Sobrienvoid Arch_TouchLib(GNode *);
79236769Sobrientime_t Arch_MTime(GNode *);
80236769Sobrientime_t Arch_MemMTime(GNode *);
81236769Sobrienvoid Arch_FindLib(GNode *, Lst);
82236769SobrienBoolean Arch_LibOODate(GNode *);
83236769Sobrienvoid Arch_Init(void);
84236769Sobrienvoid Arch_End(void);
85236769Sobrienint Arch_IsLib(GNode *);
86236769Sobrien
87236769Sobrien/* compat.c */
88236769Sobrienint CompatRunCommand(void *, void *);
89236769Sobrienvoid Compat_Run(Lst);
90236769Sobrienint Compat_Make(void *, void *);
91236769Sobrien
92236769Sobrien/* cond.c */
93236769Sobrienstruct If;
94236769Sobrienint Cond_EvalExpression(const struct If *, char *, Boolean *, int);
95236769Sobrienint Cond_Eval(char *);
96236769Sobrienvoid Cond_restore_depth(unsigned int);
97236769Sobrienunsigned int Cond_save_depth(void);
98236769Sobrien
99236769Sobrien/* for.c */
100236769Sobrienint For_Eval(char *);
101236769Sobrienint For_Accum(char *);
102236769Sobrienvoid For_Run(int);
103236769Sobrien
104236769Sobrien/* job.c */
105236769Sobrien#ifdef WAIT_T
106236769Sobrienvoid JobReapChild(pid_t, WAIT_T, Boolean);
107236769Sobrien#endif
108236769Sobrien
109236769Sobrien/* main.c */
110236769Sobrienvoid Main_ParseArgLine(const char *);
111236769Sobrienvoid MakeMode(const char *);
112236769Sobrienint main(int, char **);
113236769Sobrienchar *Cmd_Exec(const char *, const char **);
114237578Sobrienvoid Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
115237578Sobrienvoid Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
116237578Sobrienvoid Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
117237578Sobrienvoid DieHorribly(void) MAKE_ATTR_DEAD;
118236769Sobrienint PrintAddr(void *, void *);
119237578Sobrienvoid Finish(int) MAKE_ATTR_DEAD;
120236769Sobrienint eunlink(const char *);
121236769Sobrienvoid execError(const char *, const char *);
122236769Sobrienchar *getTmpdir(void);
123240330SmarcelBoolean getBoolean(const char *, Boolean);
124236769Sobrien
125236769Sobrien/* parse.c */
126237578Sobrienvoid Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
127236769SobrienBoolean Parse_AnyExport(void);
128236769SobrienBoolean Parse_IsVar(char *);
129236769Sobrienvoid Parse_DoVar(char *, GNode *);
130236769Sobrienvoid Parse_AddIncludeDir(char *);
131236769Sobrienvoid Parse_File(const char *, int);
132236769Sobrienvoid Parse_Init(void);
133236769Sobrienvoid Parse_End(void);
134236769Sobrienvoid Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *);
135236769SobrienLst Parse_MainName(void);
136236769Sobrien
137236769Sobrien/* str.c */
138236769Sobrienchar *str_concat(const char *, const char *, int);
139236769Sobrienchar **brk_string(const char *, int *, Boolean, char **);
140236769Sobrienchar *Str_FindSubstring(const char *, const char *);
141236769Sobrienint Str_Match(const char *, const char *);
142236769Sobrienchar *Str_SYSVMatch(const char *, const char *, int *len);
143236769Sobrienvoid Str_SYSVSubst(Buffer *, char *, char *, int);
144236769Sobrien
145236769Sobrien/* suff.c */
146236769Sobrienvoid Suff_ClearSuffixes(void);
147236769SobrienBoolean Suff_IsTransform(char *);
148236769SobrienGNode *Suff_AddTransform(char *);
149236769Sobrienint Suff_EndTransform(void *, void *);
150236769Sobrienvoid Suff_AddSuffix(char *, GNode **);
151236769SobrienLst Suff_GetPath(char *);
152236769Sobrienvoid Suff_DoPaths(void);
153236769Sobrienvoid Suff_AddInclude(char *);
154236769Sobrienvoid Suff_AddLib(char *);
155236769Sobrienvoid Suff_FindDeps(GNode *);
156236769SobrienLst Suff_FindPath(GNode *);
157236769Sobrienvoid Suff_SetNull(char *);
158236769Sobrienvoid Suff_Init(void);
159236769Sobrienvoid Suff_End(void);
160236769Sobrienvoid Suff_PrintAll(void);
161236769Sobrien
162236769Sobrien/* targ.c */
163236769Sobrienvoid Targ_Init(void);
164236769Sobrienvoid Targ_End(void);
165236769SobrienLst Targ_List(void);
166236769SobrienGNode *Targ_NewGN(const char *);
167236769SobrienGNode *Targ_FindNode(const char *, int);
168236769SobrienLst Targ_FindList(Lst, int);
169236769SobrienBoolean Targ_Ignore(GNode *);
170236769SobrienBoolean Targ_Silent(GNode *);
171236769SobrienBoolean Targ_Precious(GNode *);
172236769Sobrienvoid Targ_SetMain(GNode *);
173236769Sobrienint Targ_PrintCmd(void *, void *);
174236769Sobrienint Targ_PrintNode(void *, void *);
175236769Sobrienchar *Targ_FmtTime(time_t);
176236769Sobrienvoid Targ_PrintType(int);
177236769Sobrienvoid Targ_PrintGraph(int);
178236769Sobrienvoid Targ_Propagate(void);
179236769Sobrienvoid Targ_Propagate_Wait(void);
180236769Sobrien
181236769Sobrien/* var.c */
182236769Sobrienvoid Var_Delete(const char *, GNode *);
183236769Sobrienvoid Var_Set(const char *, const char *, GNode *, int);
184236769Sobrienvoid Var_Append(const char *, const char *, GNode *);
185236769SobrienBoolean Var_Exists(const char *, GNode *);
186236769Sobrienchar *Var_Value(const char *, GNode *, char **);
187236769Sobrienchar *Var_Parse(const char *, GNode *, Boolean, int *, void **);
188236769Sobrienchar *Var_Subst(const char *, const char *, GNode *, Boolean);
189236769Sobrienchar *Var_GetTail(const char *);
190236769Sobrienchar *Var_GetHead(const char *);
191236769Sobrienvoid Var_Init(void);
192236769Sobrienvoid Var_End(void);
193236769Sobrienvoid Var_Dump(GNode *);
194236769Sobrienvoid Var_ExportVars(void);
195236769Sobrienvoid Var_Export(char *, int);
196236769Sobrienvoid Var_UnExport(char *);
197236769Sobrien
198236769Sobrien/* util.c */
199236769Sobrienvoid (*bmake_signal(int, void (*)(int)))(int);
200