| Line |  | 
|---|
| 1 | /* | 
|---|
| 2 | * Copyright 1993, 1995 Christopher Seiwald. | 
|---|
| 3 | * | 
|---|
| 4 | * This file is part of Jam - see jam.c for Copyright information. | 
|---|
| 5 | */ | 
|---|
| 6 |  | 
|---|
| 7 | # include "jam.h" | 
|---|
| 8 | # include "lists.h" | 
|---|
| 9 | # include "execcmd.h" | 
|---|
| 10 | # include <errno.h> | 
|---|
| 11 |  | 
|---|
| 12 | # ifdef OS_MAC | 
|---|
| 13 |  | 
|---|
| 14 | /* | 
|---|
| 15 | * execunix.c - execute a shell script on UNIX | 
|---|
| 16 | * | 
|---|
| 17 | * If $(JAMSHELL) is defined, uses that to formulate execvp(). | 
|---|
| 18 | * The default is: | 
|---|
| 19 | * | 
|---|
| 20 | *      /bin/sh -c % | 
|---|
| 21 | * | 
|---|
| 22 | * Each word must be an individual element in a jam variable value. | 
|---|
| 23 | * | 
|---|
| 24 | * In $(JAMSHELL), % expands to the command string and ! expands to | 
|---|
| 25 | * the slot number (starting at 1) for multiprocess (-j) invocations. | 
|---|
| 26 | * If $(JAMSHELL) doesn't include a %, it is tacked on as the last | 
|---|
| 27 | * argument. | 
|---|
| 28 | * | 
|---|
| 29 | * Don't just set JAMSHELL to /bin/sh - it won't work! | 
|---|
| 30 | * | 
|---|
| 31 | * External routines: | 
|---|
| 32 | *      execcmd() - launch an async command execution | 
|---|
| 33 | *      execwait() - wait and drive at most one execution completion | 
|---|
| 34 | * | 
|---|
| 35 | * Internal routines: | 
|---|
| 36 | *      onintr() - bump intr to note command interruption | 
|---|
| 37 | * | 
|---|
| 38 | * 04/08/94 (seiwald) - Coherent/386 support added. | 
|---|
| 39 | * 05/04/94 (seiwald) - async multiprocess interface | 
|---|
| 40 | * 01/22/95 (seiwald) - $(JAMSHELL) support | 
|---|
| 41 | */ | 
|---|
| 42 |  | 
|---|
| 43 | /* | 
|---|
| 44 | * execcmd() - launch an async command execution | 
|---|
| 45 | */ | 
|---|
| 46 |  | 
|---|
| 47 | void | 
|---|
| 48 | execcmd( | 
|---|
| 49 | char *string, | 
|---|
| 50 | void (*func)( void *closure, int status ), | 
|---|
| 51 | void *closure, | 
|---|
| 52 | LIST *shell ) | 
|---|
| 53 | { | 
|---|
| 54 |  | 
|---|
| 55 | printf( "%s", string ); | 
|---|
| 56 | (*func)( closure, EXEC_CMD_OK ); | 
|---|
| 57 | } | 
|---|
| 58 |  | 
|---|
| 59 | /* | 
|---|
| 60 | * execwait() - wait and drive at most one execution completion | 
|---|
| 61 | */ | 
|---|
| 62 |  | 
|---|
| 63 | int | 
|---|
| 64 | execwait() | 
|---|
| 65 | { | 
|---|
| 66 | return 0; | 
|---|
| 67 | } | 
|---|
| 68 |  | 
|---|
| 69 | # endif /* OS_MAC */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.