21 #include "../build/browse_py.h"
24 const char* initial_target) {
28 if (pipe(pipefd) < 0) {
29 perror(
"ninja: pipe");
35 perror(
"ninja: fork");
42 if (dup2(pipefd[0], 0) < 0) {
43 perror(
"ninja: dup2");
48 const char* command[] = {
49 NINJA_PYTHON,
"-", ninja_command, initial_target, NULL
51 execvp(command[0], (
char**)command);
52 perror(
"ninja: execvp");
59 ssize_t len = write(pipefd[1], kBrowsePy,
sizeof(kBrowsePy));
60 if (len < (ssize_t)
sizeof(kBrowsePy))
61 perror(
"ninja: write");
void RunBrowsePython(State *state, const char *ninja_command, const char *initial_target)
Run in "browse" mode, which execs a Python webserver.
Global state (file status, loaded rules) for a single run.