The external-program Reference Manual

This is the external-program Reference Manual, version 0.0.6, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:22:57 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 external-program

Author

Greg Pfeil <>

License

LLGPL

Version

0.0.6

Dependency

trivial-features (system).

Source

external-program.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 external-program/external-program.asd

Source

external-program.asd.

Parent Component

external-program (system).

ASDF Systems

external-program.

Packages

external-program-system.


3.1.2 external-program/external-program.lisp

Source

external-program.asd.

Parent Component

external-program (system).

Packages

external-program.

Public Interface
Internals

*signal-mapping* (special variable).


3.1.3 external-program/utilities.lisp

Dependency

external-program.lisp (file).

Source

external-program.asd.

Parent Component

external-program (system).

Internals

3.1.4 external-program/sbcl.lisp

Dependency

utilities.lisp (file).

Source

external-program.asd.

Parent Component

external-program (system).

Public Interface
Internals

convert-environment (function).


4 Packages

Packages are listed by definition order.


4.1 external-program-system

Source

external-program.asd.

Use List
  • asdf/interface.
  • common-lisp.

4.2 external-program

Source

external-program.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Generic functions

Generic Function: process-error-stream (process)

Returns the stream created when the error argument to ‘START‘ is specified as ‘:STREAM‘.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-error-stream (process)
Source

sbcl.lisp.

Generic Function: process-id (process)

Returns the process id assigned to the external
process by the operating system. This is typically a positive, 16-bit number.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-id (process)
Source

sbcl.lisp.

Generic Function: process-input-stream (process)

Returns the stream created when the input argument to ‘START‘ is specified as ‘:STREAM‘.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-input-stream (process)
Source

sbcl.lisp.

Generic Function: process-output-stream (process)

Returns the stream created when the output argument to ‘START‘ is specified as ‘:STREAM‘.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-output-stream (process)
Source

sbcl.lisp.

Generic Function: process-p (process)

‘T‘ if object is a process, ‘NIL‘ otherwise.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-p (process)
Source

sbcl.lisp.

Generic Function: process-status (process)

Returns, as multiple values, a keyword denoting the
status of the external process (one of ‘:RUNNING‘, ‘:STOPPED‘, ‘:SIGNALED‘, or ‘:EXITED‘), and the exit code or terminating signal if the first value is other than ‘:RUNNING‘.

Package

external-program.

Source

external-program.lisp.

Methods
Method: process-status (process)
Source

sbcl.lisp.

Generic Function: run (program args &key input if-input-does-not-exist output if-output-exists error if-error-exists environment replace-environment-p &allow-other-keys)

Runs the specified program similarly to ‘START‘,
however it blocks and returns the external process status once the
program exits.

‘:STREAM‘ is not a valid argument to ‘INPUT‘, ‘OUTPUT‘, or ‘ERROR‘ for this function.

Package

external-program.

Source

external-program.lisp.

Methods
Method: run (program args &rest rest &key environment replace-environment-p &allow-other-keys)
Source

sbcl.lisp.

Method: run ((program pathname) args &rest rest)
Generic Function: signal-process (process signal)

Sends the specified unix signal to the specified
external process. Signals an error if unsuccessful. The signal may be either an integer, or one of the keywords in ‘EXTERNAL-PROGRAM::*SIGNAL-MAPPING*‘.

Package

external-program.

Source

external-program.lisp.

Methods
Method: signal-process (process (signal integer))
Source

sbcl.lisp.

Method: signal-process (process (signal symbol))
Source

sbcl.lisp.

Method: signal-process (process signal)
Generic Function: start (program args &key input if-input-does-not-exist output if-output-exists error if-error-exists environment replace-environment-p status-hook &allow-other-keys)

Runs the specified program in an external (Unix) process,
returning a process object if successful.

‘INPUT‘, ‘OUTPUT‘, and ‘ERROR‘ all behave similarly, accepting one of
the following values:

* ‘NIL‘, specifying that a null stream (e.g., ‘/dev/null‘) should be used;
* ‘T‘, specifying that the ‘EXTERNAL-PROCESS‘ should use the source or destination with which the Lisp was invoked;
* a stream;
* a pathname designator, to redirect to/from a file;
* ‘:STREAM‘, which creates a new stream opened for character input or output (accessible via the ‘EXTERNAL-PROCESS-*-STREAM‘ functions);
or
* ‘:OUTPUT‘, (only available for ‘ERROR‘) which directs the error
output to the same destination as the standard output.

‘ENVIRONMENT‘ contains an alist mapping vars to values.

‘REPLACE-ENVIRONMENT-P‘ indicates whether the argument passed as ‘ENVIRONMENT‘ should replace or extend the current environment. The default is ‘NIL‘ (to extend the environment).

‘STATUS-HOOK‘ is a function the system calls whenever the status of
the process changes. The function takes the process as an argument.

Package

external-program.

Source

external-program.lisp.

Methods
Method: start (program args &rest rest &key environment replace-environment-p &allow-other-keys)
Source

sbcl.lisp.

Method: start ((program pathname) args &rest rest)

5.2 Internals


5.2.1 Special variables

Special Variable: *signal-mapping*
Package

external-program.

Source

external-program.lisp.


5.2.2 Ordinary functions

Function: convert-environment (rest environment replace-environment-p)
Package

external-program.

Source

sbcl.lisp.

Function: embed-environment (program args environment replace-environment-p)
Package

external-program.

Source

utilities.lisp.

Function: make-shell-string (program args environment replace-environment-p)
Package

external-program.

Source

utilities.lisp.

Function: reformat-environment (environment)

SBCL accepts vars as either ("FOO=meh" ...) or ((:foo . "meh") ...), but not (("FOO" . "meh") ...), so we build up the first kind (since the second kind is potentially lossy).

Package

external-program.

Source

utilities.lisp.

Function: rename-parameter (from-name to-name rest)
Package

external-program.

Source

utilities.lisp.

Function: stringify-args (args)
Package

external-program.

Source

utilities.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   E   F   G   M   P   R   S  
Index Entry  Section

C
convert-environment: Private ordinary functions

E
embed-environment: Private ordinary functions

F
Function, convert-environment: Private ordinary functions
Function, embed-environment: Private ordinary functions
Function, make-shell-string: Private ordinary functions
Function, reformat-environment: Private ordinary functions
Function, rename-parameter: Private ordinary functions
Function, stringify-args: Private ordinary functions

G
Generic Function, process-error-stream: Public generic functions
Generic Function, process-id: Public generic functions
Generic Function, process-input-stream: Public generic functions
Generic Function, process-output-stream: Public generic functions
Generic Function, process-p: Public generic functions
Generic Function, process-status: Public generic functions
Generic Function, run: Public generic functions
Generic Function, signal-process: Public generic functions
Generic Function, start: Public generic functions

M
make-shell-string: Private ordinary functions
Method, process-error-stream: Public generic functions
Method, process-id: Public generic functions
Method, process-input-stream: Public generic functions
Method, process-output-stream: Public generic functions
Method, process-p: Public generic functions
Method, process-status: Public generic functions
Method, run: Public generic functions
Method, run: Public generic functions
Method, signal-process: Public generic functions
Method, signal-process: Public generic functions
Method, signal-process: Public generic functions
Method, start: Public generic functions
Method, start: Public generic functions

P
process-error-stream: Public generic functions
process-error-stream: Public generic functions
process-id: Public generic functions
process-id: Public generic functions
process-input-stream: Public generic functions
process-input-stream: Public generic functions
process-output-stream: Public generic functions
process-output-stream: Public generic functions
process-p: Public generic functions
process-p: Public generic functions
process-status: Public generic functions
process-status: Public generic functions

R
reformat-environment: Private ordinary functions
rename-parameter: Private ordinary functions
run: Public generic functions
run: Public generic functions
run: Public generic functions

S
signal-process: Public generic functions
signal-process: Public generic functions
signal-process: Public generic functions
signal-process: Public generic functions
start: Public generic functions
start: Public generic functions
start: Public generic functions
stringify-args: Private ordinary functions


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*signal-mapping*: Private special variables

S
Special Variable, *signal-mapping*: Private special variables