/* $NetBSD: job.h,v 1.85 2025/07/06 07:11:31 rillig Exp $ */12/*3* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.4* All rights reserved.5*6* This code is derived from software contributed to Berkeley by7* Adam de Boor.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. Neither the name of the University nor the names of its contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*33* from: @(#)job.h 8.1 (Berkeley) 6/6/9334*/3536/*37* Copyright (c) 1988, 1989 by Adam de Boor38* Copyright (c) 1989 by Berkeley Softworks39* All rights reserved.40*41* This code is derived from software contributed to Berkeley by42* Adam de Boor.43*44* Redistribution and use in source and binary forms, with or without45* modification, are permitted provided that the following conditions46* are met:47* 1. Redistributions of source code must retain the above copyright48* notice, this list of conditions and the following disclaimer.49* 2. Redistributions in binary form must reproduce the above copyright50* notice, this list of conditions and the following disclaimer in the51* documentation and/or other materials provided with the distribution.52* 3. All advertising materials mentioning features or use of this software53* must display the following acknowledgement:54* This product includes software developed by the University of55* California, Berkeley and its contributors.56* 4. Neither the name of the University nor the names of its contributors57* may be used to endorse or promote products derived from this software58* without specific prior written permission.59*60* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND61* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE62* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE63* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE64* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL65* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS66* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)67* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT68* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY69* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF70* SUCH DAMAGE.71*72* from: @(#)job.h 8.1 (Berkeley) 6/6/9373*/7475/* Run jobs in parallel mode. */7677#ifndef MAKE_JOB_H78#define MAKE_JOB_H7980typedef struct Job Job;8182extern char *shellPath;83extern const char *shellName;84extern char *shellErrFlag;8586extern int jobTokensRunning; /* tokens currently "out" */8788void Shell_Init(void);89const char *Shell_GetNewline(void) MAKE_ATTR_USE;9091void TokenPool_Init(int, int, int);92bool TokenPool_Take(void) MAKE_ATTR_USE;93void TokenPool_Return(void);9495void Job_Touch(GNode *, bool);96bool Job_CheckCommands(GNode *, void (*abortProc)(const char *, ...))97MAKE_ATTR_USE;98void Job_CatchChildren(void);99void Job_CatchOutput(void);100void Job_Make(GNode *);101void Job_Init(void);102bool Job_ParseShell(char *) MAKE_ATTR_USE;103int Job_MakeDotEnd(void);104#ifdef CLEANUP105void Job_End(void);106#endif107void Job_Wait(void);108void Job_AbortAll(void);109void Job_SetPrefix(void);110bool Job_RunTarget(const char *, const char *);111void Job_FlagsToString(const Job *, char *, size_t);112int Job_TempFile(const char *, char *, size_t) MAKE_ATTR_USE;113#ifdef USE_META114struct BuildMon *Job_BuildMon(Job *) MAKE_ATTR_USE;115#endif116GNode *Job_Node(Job *) MAKE_ATTR_USE;117int Job_Pid(Job *) MAKE_ATTR_USE;118119#endif120121122