1 /* job-server.c -- declarations of list-based job-server routines.
3 Copyright (C) 2022 Sergey Sushilin <sergeysushilin@protonmail.com>
5 This file is part of Build.
7 Build is free software: you can redistribute it and/or
8 modify it under the terms of either the GNU General Public License
9 as published by the Free Software Foundation;
10 either version 2 of the License, or version 3 of the License,
11 or both in parallel, as here.
13 Build is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received copies of the GNU General Public License
19 version 2 and 3 along with this program.
20 If not, see http://www.gnu.org/licenses/. */
28 struct build_tree_branch
*branch
;
45 typedef bool (*build_target_t
) (const struct build_tree_branch
*branch
,
47 struct quoting_slots
*qs
,
49 const Hash
*tracked_files
,
54 struct job_list job_list
;
56 struct thread
*threads
;
57 build_target_t routine
;
59 const Hash
*tracked_files
;
65 extern NODISCARD
bool job_list_create_from_build_tree (struct job_list
*job_list
,
66 struct build_tree
*tree
)
68 extern NODISCARD
bool job_server_initialize (struct job_server
*job_server
,
69 build_target_t routine
,
71 const Hash
*restrict rules
,
73 const Hash
*restrict tracked_files
,
75 NONNULL (1, 2, 4, 5) ACCESS (write_only
, 1);
76 extern NODISCARD
bool job_server_start (struct job_server
*job_server
)
78 extern NODISCARD
bool job_server_finalize (struct job_server
*job_server
)