xref: /freebsd/contrib/bmake/meta.h (revision 9093286b)
19093286bSSimon J. Gerraty /*      $NetBSD: meta.h,v 1.11 2021/12/15 09:53:41 rillig Exp $ */
23955d011SMarcel Moolenaar 
33955d011SMarcel Moolenaar /*
43955d011SMarcel Moolenaar  * Things needed for 'meta' mode.
53955d011SMarcel Moolenaar  */
63955d011SMarcel Moolenaar /*
73955d011SMarcel Moolenaar  * Copyright (c) 2009-2010, Juniper Networks, Inc.
83955d011SMarcel Moolenaar  *
93955d011SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
103955d011SMarcel Moolenaar  * modification, are permitted provided that the following conditions
113955d011SMarcel Moolenaar  * are met:
123955d011SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
133955d011SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
143955d011SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
153955d011SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
163955d011SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
173955d011SMarcel Moolenaar  * 3. Neither the name of the copyright holders nor the names of its
183955d011SMarcel Moolenaar  *    contributors may be used to endorse or promote products derived
193955d011SMarcel Moolenaar  *    from this software without specific prior written permission.
203955d011SMarcel Moolenaar  *
213955d011SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
223955d011SMarcel Moolenaar  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
233955d011SMarcel Moolenaar  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
243955d011SMarcel Moolenaar  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
253955d011SMarcel Moolenaar  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
263955d011SMarcel Moolenaar  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
273955d011SMarcel Moolenaar  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
283955d011SMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
293955d011SMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
303955d011SMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
313955d011SMarcel Moolenaar  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
323955d011SMarcel Moolenaar  */
333955d011SMarcel Moolenaar 
343955d011SMarcel Moolenaar typedef struct BuildMon {
353955d011SMarcel Moolenaar     char	meta_fname[MAXPATHLEN];
3649caa483SSimon J. Gerraty     struct filemon *filemon;
373955d011SMarcel Moolenaar     int		mon_fd;
383955d011SMarcel Moolenaar     FILE	*mfp;
393955d011SMarcel Moolenaar } BuildMon;
403955d011SMarcel Moolenaar 
413955d011SMarcel Moolenaar struct Job;
423955d011SMarcel Moolenaar 
433955d011SMarcel Moolenaar void meta_init(void);
441748de26SSimon J. Gerraty void meta_finish(void);
45be19d90bSSimon J. Gerraty void meta_mode_init(const char *);
461748de26SSimon J. Gerraty void meta_job_start(struct Job *, GNode *);
473955d011SMarcel Moolenaar void meta_job_child(struct Job *);
483955d011SMarcel Moolenaar void meta_job_parent(struct Job *, pid_t);
4949caa483SSimon J. Gerraty int  meta_job_fd(struct Job *) MAKE_ATTR_USE;
5049caa483SSimon J. Gerraty int  meta_job_event(struct Job *) MAKE_ATTR_USE;
5149caa483SSimon J. Gerraty void meta_job_error(struct Job *, GNode *, bool, int);
523955d011SMarcel Moolenaar void meta_job_output(struct Job *, char *, const char *);
533955d011SMarcel Moolenaar int  meta_cmd_finish(void *);
54e48f47ddSSimon J. Gerraty int  meta_job_finish(struct Job *);
55e48f47ddSSimon J. Gerraty bool meta_oodate(GNode *, bool) MAKE_ATTR_USE;
563955d011SMarcel Moolenaar void meta_compat_start(void);
573955d011SMarcel Moolenaar void meta_compat_child(void);
583955d011SMarcel Moolenaar void meta_compat_parent(pid_t);
5949caa483SSimon J. Gerraty 
60 extern bool useMeta;
61