xref: /minix3/usr.bin/make/nonints.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: nonints.h,v 1.68 2015/05/05 21:51:09 sjg Exp $	*/
22e2caf59SThomas Veerman 
32e2caf59SThomas Veerman /*-
42e2caf59SThomas Veerman  * Copyright (c) 1988, 1989, 1990, 1993
52e2caf59SThomas Veerman  *	The Regents of the University of California.  All rights reserved.
62e2caf59SThomas Veerman  *
72e2caf59SThomas Veerman  * This code is derived from software contributed to Berkeley by
82e2caf59SThomas Veerman  * Adam de Boor.
92e2caf59SThomas Veerman  *
102e2caf59SThomas Veerman  * Redistribution and use in source and binary forms, with or without
112e2caf59SThomas Veerman  * modification, are permitted provided that the following conditions
122e2caf59SThomas Veerman  * are met:
132e2caf59SThomas Veerman  * 1. Redistributions of source code must retain the above copyright
142e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer.
152e2caf59SThomas Veerman  * 2. Redistributions in binary form must reproduce the above copyright
162e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer in the
172e2caf59SThomas Veerman  *    documentation and/or other materials provided with the distribution.
182e2caf59SThomas Veerman  * 3. Neither the name of the University nor the names of its contributors
192e2caf59SThomas Veerman  *    may be used to endorse or promote products derived from this software
202e2caf59SThomas Veerman  *    without specific prior written permission.
212e2caf59SThomas Veerman  *
222e2caf59SThomas Veerman  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
232e2caf59SThomas Veerman  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
242e2caf59SThomas Veerman  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
252e2caf59SThomas Veerman  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
262e2caf59SThomas Veerman  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
272e2caf59SThomas Veerman  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
282e2caf59SThomas Veerman  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
292e2caf59SThomas Veerman  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
302e2caf59SThomas Veerman  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
312e2caf59SThomas Veerman  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
322e2caf59SThomas Veerman  * SUCH DAMAGE.
332e2caf59SThomas Veerman  *
342e2caf59SThomas Veerman  *	from: @(#)nonints.h	8.3 (Berkeley) 3/19/94
352e2caf59SThomas Veerman  */
362e2caf59SThomas Veerman 
372e2caf59SThomas Veerman /*-
382e2caf59SThomas Veerman  * Copyright (c) 1989 by Berkeley Softworks
392e2caf59SThomas Veerman  * All rights reserved.
402e2caf59SThomas Veerman  *
412e2caf59SThomas Veerman  * This code is derived from software contributed to Berkeley by
422e2caf59SThomas Veerman  * Adam de Boor.
432e2caf59SThomas Veerman  *
442e2caf59SThomas Veerman  * Redistribution and use in source and binary forms, with or without
452e2caf59SThomas Veerman  * modification, are permitted provided that the following conditions
462e2caf59SThomas Veerman  * are met:
472e2caf59SThomas Veerman  * 1. Redistributions of source code must retain the above copyright
482e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer.
492e2caf59SThomas Veerman  * 2. Redistributions in binary form must reproduce the above copyright
502e2caf59SThomas Veerman  *    notice, this list of conditions and the following disclaimer in the
512e2caf59SThomas Veerman  *    documentation and/or other materials provided with the distribution.
522e2caf59SThomas Veerman  * 3. All advertising materials mentioning features or use of this software
532e2caf59SThomas Veerman  *    must display the following acknowledgement:
542e2caf59SThomas Veerman  *	This product includes software developed by the University of
552e2caf59SThomas Veerman  *	California, Berkeley and its contributors.
562e2caf59SThomas Veerman  * 4. Neither the name of the University nor the names of its contributors
572e2caf59SThomas Veerman  *    may be used to endorse or promote products derived from this software
582e2caf59SThomas Veerman  *    without specific prior written permission.
592e2caf59SThomas Veerman  *
602e2caf59SThomas Veerman  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
612e2caf59SThomas Veerman  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
622e2caf59SThomas Veerman  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
632e2caf59SThomas Veerman  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
642e2caf59SThomas Veerman  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
652e2caf59SThomas Veerman  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
662e2caf59SThomas Veerman  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
672e2caf59SThomas Veerman  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
682e2caf59SThomas Veerman  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
692e2caf59SThomas Veerman  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
702e2caf59SThomas Veerman  * SUCH DAMAGE.
712e2caf59SThomas Veerman  *
722e2caf59SThomas Veerman  *	from: @(#)nonints.h	8.3 (Berkeley) 3/19/94
732e2caf59SThomas Veerman  */
742e2caf59SThomas Veerman 
752e2caf59SThomas Veerman /* arch.c */
762e2caf59SThomas Veerman ReturnStatus Arch_ParseArchive(char **, Lst, GNode *);
772e2caf59SThomas Veerman void Arch_Touch(GNode *);
782e2caf59SThomas Veerman void Arch_TouchLib(GNode *);
792e2caf59SThomas Veerman time_t Arch_MTime(GNode *);
802e2caf59SThomas Veerman time_t Arch_MemMTime(GNode *);
812e2caf59SThomas Veerman void Arch_FindLib(GNode *, Lst);
822e2caf59SThomas Veerman Boolean Arch_LibOODate(GNode *);
832e2caf59SThomas Veerman void Arch_Init(void);
842e2caf59SThomas Veerman void Arch_End(void);
852e2caf59SThomas Veerman int Arch_IsLib(GNode *);
862e2caf59SThomas Veerman 
872e2caf59SThomas Veerman /* compat.c */
882e2caf59SThomas Veerman int CompatRunCommand(void *, void *);
892e2caf59SThomas Veerman void Compat_Run(Lst);
902e2caf59SThomas Veerman int Compat_Make(void *, void *);
912e2caf59SThomas Veerman 
922e2caf59SThomas Veerman /* cond.c */
932e2caf59SThomas Veerman struct If;
94*0a6a1f1dSLionel Sambuc int Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean);
952e2caf59SThomas Veerman int Cond_Eval(char *);
962e2caf59SThomas Veerman void Cond_restore_depth(unsigned int);
972e2caf59SThomas Veerman unsigned int Cond_save_depth(void);
982e2caf59SThomas Veerman 
992e2caf59SThomas Veerman /* for.c */
1002e2caf59SThomas Veerman int For_Eval(char *);
1012e2caf59SThomas Veerman int For_Accum(char *);
1022e2caf59SThomas Veerman void For_Run(int);
1032e2caf59SThomas Veerman 
1042e2caf59SThomas Veerman /* job.c */
1052e2caf59SThomas Veerman void JobReapChild(pid_t, int, Boolean);
1062e2caf59SThomas Veerman 
1072e2caf59SThomas Veerman /* main.c */
1082e2caf59SThomas Veerman void Main_ParseArgLine(const char *);
1092e2caf59SThomas Veerman void MakeMode(const char *);
1102e2caf59SThomas Veerman int main(int, char **);
1112e2caf59SThomas Veerman char *Cmd_Exec(const char *, const char **);
1122bc7c627SLionel Sambuc void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
1132bc7c627SLionel Sambuc void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
1142bc7c627SLionel Sambuc void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD;
1152bc7c627SLionel Sambuc void DieHorribly(void) MAKE_ATTR_DEAD;
1162e2caf59SThomas Veerman int PrintAddr(void *, void *);
1172bc7c627SLionel Sambuc void Finish(int) MAKE_ATTR_DEAD;
1182e2caf59SThomas Veerman int eunlink(const char *);
1192e2caf59SThomas Veerman void execError(const char *, const char *);
1202e2caf59SThomas Veerman char *getTmpdir(void);
1212bc7c627SLionel Sambuc Boolean getBoolean(const char *, Boolean);
1222e2caf59SThomas Veerman 
1232e2caf59SThomas Veerman /* parse.c */
1242bc7c627SLionel Sambuc void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3);
1252e2caf59SThomas Veerman Boolean Parse_AnyExport(void);
1262e2caf59SThomas Veerman Boolean Parse_IsVar(char *);
1272e2caf59SThomas Veerman void Parse_DoVar(char *, GNode *);
1282e2caf59SThomas Veerman void Parse_AddIncludeDir(char *);
1292e2caf59SThomas Veerman void Parse_File(const char *, int);
1302e2caf59SThomas Veerman void Parse_Init(void);
1312e2caf59SThomas Veerman void Parse_End(void);
1322e2caf59SThomas Veerman void Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *);
1332e2caf59SThomas Veerman Lst Parse_MainName(void);
1342e2caf59SThomas Veerman 
1352e2caf59SThomas Veerman /* str.c */
1362e2caf59SThomas Veerman char *str_concat(const char *, const char *, int);
1372e2caf59SThomas Veerman char **brk_string(const char *, int *, Boolean, char **);
1382e2caf59SThomas Veerman char *Str_FindSubstring(const char *, const char *);
1392e2caf59SThomas Veerman int Str_Match(const char *, const char *);
1402e2caf59SThomas Veerman char *Str_SYSVMatch(const char *, const char *, int *len);
1412e2caf59SThomas Veerman void Str_SYSVSubst(Buffer *, char *, char *, int);
1422e2caf59SThomas Veerman 
1432e2caf59SThomas Veerman /* suff.c */
1442e2caf59SThomas Veerman void Suff_ClearSuffixes(void);
1452e2caf59SThomas Veerman Boolean Suff_IsTransform(char *);
1462e2caf59SThomas Veerman GNode *Suff_AddTransform(char *);
1472e2caf59SThomas Veerman int Suff_EndTransform(void *, void *);
1482e2caf59SThomas Veerman void Suff_AddSuffix(char *, GNode **);
1492e2caf59SThomas Veerman Lst Suff_GetPath(char *);
1502e2caf59SThomas Veerman void Suff_DoPaths(void);
1512e2caf59SThomas Veerman void Suff_AddInclude(char *);
1522e2caf59SThomas Veerman void Suff_AddLib(char *);
1532e2caf59SThomas Veerman void Suff_FindDeps(GNode *);
1542e2caf59SThomas Veerman Lst Suff_FindPath(GNode *);
1552e2caf59SThomas Veerman void Suff_SetNull(char *);
1562e2caf59SThomas Veerman void Suff_Init(void);
1572e2caf59SThomas Veerman void Suff_End(void);
1582e2caf59SThomas Veerman void Suff_PrintAll(void);
1592e2caf59SThomas Veerman 
1602e2caf59SThomas Veerman /* targ.c */
1612e2caf59SThomas Veerman void Targ_Init(void);
1622e2caf59SThomas Veerman void Targ_End(void);
1632e2caf59SThomas Veerman Lst Targ_List(void);
1642e2caf59SThomas Veerman GNode *Targ_NewGN(const char *);
1652e2caf59SThomas Veerman GNode *Targ_FindNode(const char *, int);
1662e2caf59SThomas Veerman Lst Targ_FindList(Lst, int);
1672e2caf59SThomas Veerman Boolean Targ_Ignore(GNode *);
1682e2caf59SThomas Veerman Boolean Targ_Silent(GNode *);
1692e2caf59SThomas Veerman Boolean Targ_Precious(GNode *);
1702e2caf59SThomas Veerman void Targ_SetMain(GNode *);
1712e2caf59SThomas Veerman int Targ_PrintCmd(void *, void *);
1722e2caf59SThomas Veerman int Targ_PrintNode(void *, void *);
1732e2caf59SThomas Veerman char *Targ_FmtTime(time_t);
1742e2caf59SThomas Veerman void Targ_PrintType(int);
1752e2caf59SThomas Veerman void Targ_PrintGraph(int);
1762e2caf59SThomas Veerman void Targ_Propagate(void);
1772e2caf59SThomas Veerman void Targ_Propagate_Wait(void);
1782e2caf59SThomas Veerman 
1792e2caf59SThomas Veerman /* var.c */
1802e2caf59SThomas Veerman void Var_Delete(const char *, GNode *);
1812e2caf59SThomas Veerman void Var_Set(const char *, const char *, GNode *, int);
1822e2caf59SThomas Veerman void Var_Append(const char *, const char *, GNode *);
1832e2caf59SThomas Veerman Boolean Var_Exists(const char *, GNode *);
1842e2caf59SThomas Veerman char *Var_Value(const char *, GNode *, char **);
1852e2caf59SThomas Veerman char *Var_Parse(const char *, GNode *, Boolean, int *, void **);
1862e2caf59SThomas Veerman char *Var_Subst(const char *, const char *, GNode *, Boolean);
1872e2caf59SThomas Veerman char *Var_GetTail(const char *);
1882e2caf59SThomas Veerman char *Var_GetHead(const char *);
1892e2caf59SThomas Veerman void Var_Init(void);
1902e2caf59SThomas Veerman void Var_End(void);
1912e2caf59SThomas Veerman void Var_Dump(GNode *);
1922e2caf59SThomas Veerman void Var_ExportVars(void);
1932e2caf59SThomas Veerman void Var_Export(char *, int);
1942e2caf59SThomas Veerman void Var_UnExport(char *);
1952e2caf59SThomas Veerman 
1962e2caf59SThomas Veerman /* util.c */
1972e2caf59SThomas Veerman void (*bmake_signal(int, void (*)(int)))(int);
198