sources reformated
[k8jam.git] / execmac.c
blob9e89e27571424e3586e4f12984e627a23fda8ae7
1 /*
2 * Copyright 1993, 1995 Christopher Seiwald.
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
7 /*
8 * execunix.c - execute a shell script on UNIX
10 * If $(JAMSHELL) is defined, uses that to formulate execvp().
11 * The default is:
13 * /bin/sh -c %
15 * Each word must be an individual element in a jam variable value.
17 * In $(JAMSHELL), % expands to the command string and ! expands to
18 * the slot number (starting at 1) for multiprocess (-j) invocations.
19 * If $(JAMSHELL) doesn't include a %, it is tacked on as the last
20 * argument.
22 * Don't just set JAMSHELL to /bin/sh - it won't work!
24 * External routines:
25 * execcmd() - launch an async command execution
26 * execwait() - wait and drive at most one execution completion
28 * Internal routines:
29 * onintr() - bump intr to note command interruption
31 * 04/08/94 (seiwald) - Coherent/386 support added.
32 * 05/04/94 (seiwald) - async multiprocess interface
33 * 01/22/95 (seiwald) - $(JAMSHELL) support
34 * 01/20/00 (seiwald) - Upgraded from K&R to ANSI C
37 # include "jam.h"
38 # include "lists.h"
39 # include "execcmd.h"
40 # include <errno.h>
42 # ifdef OS_MAC
45 * execcmd() - launch an async command execution
47 void execcmd (
48 char *string,
49 void (*func)(void *closure, int status),
50 void *closure,
51 LIST *shell
52 ) {
53 printf("%s", string);
54 (*func)(closure, EXEC_CMD_OK);
59 * execwait() - wait and drive at most one execution completion
61 int execwait(void) {
62 return 0;
65 # endif /* OS_MAC */