2020-08-22 02:28:11 +03:00
|
|
|
/* $NetBSD: nonints.h,v 1.95 2020/08/21 23:28:11 rillig Exp $ */
|
1995-06-14 19:18:37 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*-
|
1996-11-06 20:58:58 +03:00
|
|
|
* Copyright (c) 1988, 1989, 1990, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
2003-08-07 15:13:06 +04:00
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Adam de Boor.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* from: @(#)nonints.h 8.3 (Berkeley) 3/19/94
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*-
|
1993-03-21 12:45:37 +03:00
|
|
|
* Copyright (c) 1989 by Berkeley Softworks
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Adam de Boor.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1996-11-06 20:58:58 +03:00
|
|
|
* from: @(#)nonints.h 8.3 (Berkeley) 3/19/94
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
/* arch.c */
|
2002-06-15 22:24:55 +04:00
|
|
|
ReturnStatus Arch_ParseArchive(char **, Lst, GNode *);
|
|
|
|
void Arch_Touch(GNode *);
|
|
|
|
void Arch_TouchLib(GNode *);
|
|
|
|
time_t Arch_MTime(GNode *);
|
|
|
|
time_t Arch_MemMTime(GNode *);
|
|
|
|
void Arch_FindLib(GNode *, Lst);
|
|
|
|
Boolean Arch_LibOODate(GNode *);
|
|
|
|
void Arch_Init(void);
|
|
|
|
void Arch_End(void);
|
|
|
|
int Arch_IsLib(GNode *);
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
/* compat.c */
|
2009-01-24 00:26:30 +03:00
|
|
|
int CompatRunCommand(void *, void *);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Compat_Run(Lst);
|
2009-01-24 00:26:30 +03:00
|
|
|
int Compat_Make(void *, void *);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* cond.c */
|
2009-01-29 00:38:12 +03:00
|
|
|
struct If;
|
2020-08-01 21:02:37 +03:00
|
|
|
CondEvalResult Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean);
|
|
|
|
CondEvalResult Cond_Eval(char *);
|
2007-02-04 22:23:49 +03:00
|
|
|
void Cond_restore_depth(unsigned int);
|
|
|
|
unsigned int Cond_save_depth(void);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* for.c */
|
2002-06-15 22:24:55 +04:00
|
|
|
int For_Eval(char *);
|
2008-11-29 20:50:11 +03:00
|
|
|
int For_Accum(char *);
|
2004-03-06 06:57:07 +03:00
|
|
|
void For_Run(int);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
2010-08-07 10:44:08 +04:00
|
|
|
/* job.c */
|
|
|
|
void JobReapChild(pid_t, int, Boolean);
|
|
|
|
|
1994-03-05 03:34:29 +03:00
|
|
|
/* main.c */
|
2009-01-13 21:22:34 +03:00
|
|
|
void Main_ParseArgLine(const char *);
|
2010-04-07 04:11:27 +04:00
|
|
|
void MakeMode(const char *);
|
2003-07-14 22:19:11 +04:00
|
|
|
char *Cmd_Exec(const char *, const char **);
|
2012-06-12 23:21:50 +04:00
|
|
|
void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
|
|
|
|
void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
|
|
|
|
void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
|
|
|
|
void DieHorribly(void) MAKE_ATTR_DEAD;
|
2009-01-24 00:26:30 +03:00
|
|
|
int PrintAddr(void *, void *);
|
2012-06-12 23:21:50 +04:00
|
|
|
void Finish(int) MAKE_ATTR_DEAD;
|
2002-06-15 22:24:55 +04:00
|
|
|
int eunlink(const char *);
|
|
|
|
void execError(const char *, const char *);
|
2010-12-10 01:30:16 +03:00
|
|
|
char *getTmpdir(void);
|
2016-02-18 23:25:08 +03:00
|
|
|
Boolean s2Boolean(const char *, Boolean);
|
2012-08-31 01:17:05 +04:00
|
|
|
Boolean getBoolean(const char *, Boolean);
|
2016-06-03 04:21:59 +03:00
|
|
|
char *cached_realpath(const char *, char *);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* parse.c */
|
2012-06-12 23:21:50 +04:00
|
|
|
void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
|
2002-06-15 22:24:55 +04:00
|
|
|
Boolean Parse_IsVar(char *);
|
|
|
|
void Parse_DoVar(char *, GNode *);
|
|
|
|
void Parse_AddIncludeDir(char *);
|
2006-12-16 11:59:29 +03:00
|
|
|
void Parse_File(const char *, int);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Parse_Init(void);
|
|
|
|
void Parse_End(void);
|
2010-12-25 07:57:07 +03:00
|
|
|
void Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *);
|
2002-06-15 22:24:55 +04:00
|
|
|
Lst Parse_MainName(void);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* str.c */
|
2020-08-10 22:53:19 +03:00
|
|
|
char *str_concat2(const char *, const char *);
|
|
|
|
char *str_concat3(const char *, const char *, const char *);
|
2020-08-11 21:41:46 +03:00
|
|
|
char *str_concat4(const char *, const char *, const char *, const char *);
|
2008-02-16 00:29:50 +03:00
|
|
|
char **brk_string(const char *, int *, Boolean, char **);
|
2003-07-14 22:19:11 +04:00
|
|
|
char *Str_FindSubstring(const char *, const char *);
|
2020-07-03 10:40:13 +03:00
|
|
|
Boolean Str_Match(const char *, const char *);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* suff.c */
|
2002-06-15 22:24:55 +04:00
|
|
|
void Suff_ClearSuffixes(void);
|
2014-09-08 00:55:34 +04:00
|
|
|
Boolean Suff_IsTransform(char *);
|
|
|
|
GNode *Suff_AddTransform(char *);
|
2009-01-24 00:26:30 +03:00
|
|
|
int Suff_EndTransform(void *, void *);
|
2014-09-08 00:55:34 +04:00
|
|
|
void Suff_AddSuffix(char *, GNode **);
|
2002-06-15 22:24:55 +04:00
|
|
|
Lst Suff_GetPath(char *);
|
|
|
|
void Suff_DoPaths(void);
|
|
|
|
void Suff_AddInclude(char *);
|
|
|
|
void Suff_AddLib(char *);
|
|
|
|
void Suff_FindDeps(GNode *);
|
2004-12-29 03:43:02 +03:00
|
|
|
Lst Suff_FindPath(GNode *);
|
2014-09-08 00:55:34 +04:00
|
|
|
void Suff_SetNull(char *);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Suff_Init(void);
|
|
|
|
void Suff_End(void);
|
|
|
|
void Suff_PrintAll(void);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* targ.c */
|
2002-06-15 22:24:55 +04:00
|
|
|
void Targ_Init(void);
|
|
|
|
void Targ_End(void);
|
2020-07-20 21:12:48 +03:00
|
|
|
void Targ_Stats(void);
|
2002-06-15 22:24:55 +04:00
|
|
|
Lst Targ_List(void);
|
2003-07-14 22:19:11 +04:00
|
|
|
GNode *Targ_NewGN(const char *);
|
|
|
|
GNode *Targ_FindNode(const char *, int);
|
2002-06-15 22:24:55 +04:00
|
|
|
Lst Targ_FindList(Lst, int);
|
|
|
|
Boolean Targ_Ignore(GNode *);
|
|
|
|
Boolean Targ_Silent(GNode *);
|
|
|
|
Boolean Targ_Precious(GNode *);
|
|
|
|
void Targ_SetMain(GNode *);
|
2009-01-24 00:26:30 +03:00
|
|
|
int Targ_PrintCmd(void *, void *);
|
|
|
|
int Targ_PrintNode(void *, void *);
|
2002-06-15 22:24:55 +04:00
|
|
|
char *Targ_FmtTime(time_t);
|
2008-02-16 00:29:50 +03:00
|
|
|
void Targ_PrintType(int);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Targ_PrintGraph(int);
|
|
|
|
void Targ_Propagate(void);
|
1994-03-05 03:34:29 +03:00
|
|
|
|
|
|
|
/* var.c */
|
2020-07-02 18:14:38 +03:00
|
|
|
|
|
|
|
typedef enum {
|
2020-07-20 22:53:40 +03:00
|
|
|
/* Treat undefined variables as errors. */
|
|
|
|
VARE_UNDEFERR = 0x01,
|
2020-07-26 21:11:12 +03:00
|
|
|
/* Expand and evaluate variables during parsing. */
|
2020-07-20 22:53:40 +03:00
|
|
|
VARE_WANTRES = 0x02,
|
2020-07-26 21:11:12 +03:00
|
|
|
VARE_ASSIGN = 0x04
|
2020-07-19 15:26:17 +03:00
|
|
|
} VarEvalFlags;
|
2020-07-02 18:14:38 +03:00
|
|
|
|
2003-07-14 22:19:11 +04:00
|
|
|
void Var_Delete(const char *, GNode *);
|
2020-07-02 18:47:38 +03:00
|
|
|
void Var_Set(const char *, const char *, GNode *);
|
2003-07-14 22:19:11 +04:00
|
|
|
void Var_Append(const char *, const char *, GNode *);
|
|
|
|
Boolean Var_Exists(const char *, GNode *);
|
2020-08-01 12:25:36 +03:00
|
|
|
const char *Var_Value(const char *, GNode *, char **);
|
2020-07-26 23:21:31 +03:00
|
|
|
const char *Var_Parse(const char *, GNode *, VarEvalFlags, int *, void **);
|
2020-07-28 19:42:22 +03:00
|
|
|
char *Var_Subst(const char *, GNode *, VarEvalFlags);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Var_Init(void);
|
|
|
|
void Var_End(void);
|
2020-07-20 21:12:48 +03:00
|
|
|
void Var_Stats(void);
|
2002-06-15 22:24:55 +04:00
|
|
|
void Var_Dump(GNode *);
|
2007-10-05 19:27:45 +04:00
|
|
|
void Var_ExportVars(void);
|
2020-08-09 16:05:04 +03:00
|
|
|
void Var_Export(const char *, Boolean);
|
2020-08-08 16:00:07 +03:00
|
|
|
void Var_UnExport(const char *);
|
2010-06-03 19:40:15 +04:00
|
|
|
|
|
|
|
/* util.c */
|
|
|
|
void (*bmake_signal(int, void (*)(int)))(int);
|