1319884Ssjg/* $NetBSD: nonints.h,v 1.74 2016/09/05 00:40:29 sevan 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; 94282740Ssjgint Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean); 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 *); 112236769Sobrienchar *Cmd_Exec(const char *, const char **); 113237578Sobrienvoid Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); 114237578Sobrienvoid Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; 115237578Sobrienvoid Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; 116237578Sobrienvoid DieHorribly(void) MAKE_ATTR_DEAD; 117236769Sobrienint PrintAddr(void *, void *); 118237578Sobrienvoid Finish(int) MAKE_ATTR_DEAD; 119236769Sobrienint eunlink(const char *); 120236769Sobrienvoid execError(const char *, const char *); 121236769Sobrienchar *getTmpdir(void); 122296637SsjgBoolean s2Boolean(const char *, Boolean); 123240330SmarcelBoolean getBoolean(const char *, Boolean); 124301462Ssjgchar *cached_realpath(const char *, char *); 125236769Sobrien 126236769Sobrien/* parse.c */ 127237578Sobrienvoid Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); 128236769SobrienBoolean Parse_AnyExport(void); 129236769SobrienBoolean Parse_IsVar(char *); 130236769Sobrienvoid Parse_DoVar(char *, GNode *); 131236769Sobrienvoid Parse_AddIncludeDir(char *); 132236769Sobrienvoid Parse_File(const char *, int); 133236769Sobrienvoid Parse_Init(void); 134236769Sobrienvoid Parse_End(void); 135236769Sobrienvoid Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *); 136236769SobrienLst Parse_MainName(void); 137236769Sobrien 138236769Sobrien/* str.c */ 139236769Sobrienchar *str_concat(const char *, const char *, int); 140236769Sobrienchar **brk_string(const char *, int *, Boolean, char **); 141236769Sobrienchar *Str_FindSubstring(const char *, const char *); 142236769Sobrienint Str_Match(const char *, const char *); 143236769Sobrienchar *Str_SYSVMatch(const char *, const char *, int *len); 144236769Sobrienvoid Str_SYSVSubst(Buffer *, char *, char *, int); 145236769Sobrien 146321653Ssjg#ifndef HAVE_STRLCPY 147321653Ssjg/* strlcpy.c */ 148321653Ssjgsize_t strlcpy(char *, const char *, size_t); 149321653Ssjg#endif 150321653Ssjg 151236769Sobrien/* suff.c */ 152236769Sobrienvoid Suff_ClearSuffixes(void); 153236769SobrienBoolean Suff_IsTransform(char *); 154236769SobrienGNode *Suff_AddTransform(char *); 155236769Sobrienint Suff_EndTransform(void *, void *); 156236769Sobrienvoid Suff_AddSuffix(char *, GNode **); 157236769SobrienLst Suff_GetPath(char *); 158236769Sobrienvoid Suff_DoPaths(void); 159236769Sobrienvoid Suff_AddInclude(char *); 160236769Sobrienvoid Suff_AddLib(char *); 161236769Sobrienvoid Suff_FindDeps(GNode *); 162236769SobrienLst Suff_FindPath(GNode *); 163236769Sobrienvoid Suff_SetNull(char *); 164236769Sobrienvoid Suff_Init(void); 165236769Sobrienvoid Suff_End(void); 166236769Sobrienvoid Suff_PrintAll(void); 167236769Sobrien 168236769Sobrien/* targ.c */ 169236769Sobrienvoid Targ_Init(void); 170236769Sobrienvoid Targ_End(void); 171236769SobrienLst Targ_List(void); 172236769SobrienGNode *Targ_NewGN(const char *); 173236769SobrienGNode *Targ_FindNode(const char *, int); 174236769SobrienLst Targ_FindList(Lst, int); 175236769SobrienBoolean Targ_Ignore(GNode *); 176236769SobrienBoolean Targ_Silent(GNode *); 177236769SobrienBoolean Targ_Precious(GNode *); 178236769Sobrienvoid Targ_SetMain(GNode *); 179236769Sobrienint Targ_PrintCmd(void *, void *); 180236769Sobrienint Targ_PrintNode(void *, void *); 181236769Sobrienchar *Targ_FmtTime(time_t); 182236769Sobrienvoid Targ_PrintType(int); 183236769Sobrienvoid Targ_PrintGraph(int); 184236769Sobrienvoid Targ_Propagate(void); 185236769Sobrienvoid Targ_Propagate_Wait(void); 186236769Sobrien 187236769Sobrien/* var.c */ 188236769Sobrienvoid Var_Delete(const char *, GNode *); 189236769Sobrienvoid Var_Set(const char *, const char *, GNode *, int); 190236769Sobrienvoid Var_Append(const char *, const char *, GNode *); 191236769SobrienBoolean Var_Exists(const char *, GNode *); 192236769Sobrienchar *Var_Value(const char *, GNode *, char **); 193296637Ssjgchar *Var_Parse(const char *, GNode *, int, int *, void **); 194296637Ssjgchar *Var_Subst(const char *, const char *, GNode *, int); 195236769Sobrienchar *Var_GetTail(const char *); 196236769Sobrienchar *Var_GetHead(const char *); 197236769Sobrienvoid Var_Init(void); 198236769Sobrienvoid Var_End(void); 199236769Sobrienvoid Var_Dump(GNode *); 200236769Sobrienvoid Var_ExportVars(void); 201236769Sobrienvoid Var_Export(char *, int); 202236769Sobrienvoid Var_UnExport(char *); 203236769Sobrien 204236769Sobrien/* util.c */ 205236769Sobrienvoid (*bmake_signal(int, void (*)(int)))(int); 206