Annotation of src/usr.bin/make/job.h, Revision 1.35
1.10 espie 1: #ifndef _JOB_H_
2: #define _JOB_H_
3:
1.35 ! espie 4: /* $OpenBSD: job.h,v 1.34 2020/01/13 15:24:31 espie Exp $ */
1.9 espie 5: /* $NetBSD: job.h,v 1.5 1996/11/06 17:59:10 christos Exp $ */
1.1 deraadt 6:
7: /*
8: * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
9: * Copyright (c) 1988, 1989 by Adam de Boor
10: * Copyright (c) 1989 by Berkeley Softworks
11: * All rights reserved.
12: *
13: * This code is derived from software contributed to Berkeley by
14: * Adam de Boor.
15: *
16: * Redistribution and use in source and binary forms, with or without
17: * modification, are permitted provided that the following conditions
18: * are met:
19: * 1. Redistributions of source code must retain the above copyright
20: * notice, this list of conditions and the following disclaimer.
21: * 2. Redistributions in binary form must reproduce the above copyright
22: * notice, this list of conditions and the following disclaimer in the
23: * documentation and/or other materials provided with the distribution.
1.14 millert 24: * 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 25: * may be used to endorse or promote products derived from this software
26: * without specific prior written permission.
27: *
28: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38: * SUCH DAMAGE.
39: *
1.9 espie 40: * from: @(#)job.h 8.1 (Berkeley) 6/6/93
1.1 deraadt 41: */
42:
43: /*-
44: * job.h --
1.29 espie 45: * Definitions pertaining to the running of jobs.
1.1 deraadt 46: */
47:
1.30 espie 48: /* Job_Make(gn);
49: * register a new job running commands associated with building gn.
50: */
1.9 espie 51: extern void Job_Make(GNode *);
1.35 ! espie 52: /* Job_Init(maxproc);
1.30 espie 53: * setup job handling framework
54: */
1.35 ! espie 55: extern void Job_Init(int);
1.30 espie 56:
57: /* interface with the normal build in make.c */
58: /* okay = can_start_job();
59: * can we run new jobs right now ?
60: */
1.23 espie 61: extern bool can_start_job(void);
1.30 espie 62:
63: /* finished = Job_Empty();
64: * wait until all jobs are finished after we build everything.
65: */
1.10 espie 66: extern bool Job_Empty(void);
1.30 espie 67:
1.35 ! espie 68: /* Job_End();
! 69: * run .END target at end.
1.30 espie 70: */
1.35 ! espie 71: extern void Job_End(void);
1.30 espie 72:
73: /* Job_Begin();
1.35 ! espie 74: * similarly, run .BEGIN job at start.
1.30 espie 75: */
1.26 espie 76: extern void Job_Begin(void);
77:
1.9 espie 78: extern void Job_Wait(void);
79: extern void Job_AbortAll(void);
1.21 espie 80: extern void print_errors(void);
1.31 espie 81:
82: /* handle_running_jobs();
83: * wait until something happens, like a job finishing running a command
84: * or a signal coming in.
85: */
1.22 espie 86: extern void handle_running_jobs(void);
1.34 espie 87: /* loop_handle_running_jobs();
88: * handle running jobs until they're finished.
89: */
90: extern void loop_handle_running_jobs(void);
1.31 espie 91:
92: /* handle_all_signals();
93: * if a signal was received, react accordingly.
94: * By displaying STATUS info, or by aborting running jobs for a fatal
95: * signals. Relies on Job_Init() for setting up handlers.
96: */
1.26 espie 97: extern void handle_all_signals(void);
1.1 deraadt 98:
1.26 espie 99: extern void determine_expensive_job(Job *);
1.32 espie 100: extern Job *runningJobs, *errorJobs, *availableJobs;
1.26 espie 101: extern void debug_job_printf(const char *, ...);
102: extern void handle_one_job(Job *);
1.28 espie 103: extern int check_dying_signal(void);
104:
105: extern const char *basedirectory;
1.32 espie 106:
107: extern bool sequential; /* True if we are running one single-job */
1.28 espie 108:
1.1 deraadt 109: #endif /* _JOB_H_ */