The shellpool Reference Manual

This is the shellpool Reference Manual, version 0.0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 06:52:42 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 shellpool

A library for running external programs from Common Lisp. (https://github.org/jaredcdavis/shellpool)

Author

Jared Davis <>

License

An MIT/X11-style license; see the file LICENSE.

Version

0.0.3

Dependencies
  • trivial-features (system).
  • cl-fad (system).
  • bordeaux-threads (system).
  • bt-semaphore (system).
Source

shellpool.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 shellpool/shellpool.asd

Source

shellpool.asd.

Parent Component

shellpool (system).

ASDF Systems

shellpool.


3.1.2 shellpool/src/packages.lisp

Source

shellpool.asd.

Parent Component

shellpool (system).

Packages

shellpool.


3.1.3 shellpool/src/main.lisp

Dependency

src/packages.lisp (file).

Source

shellpool.asd.

Parent Component

shellpool (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 shellpool

Source

src/packages.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 Special variables

Special Variable: *debug*

Change to T for verbose debugging messages.

Package

shellpool.

Source

src/main.lisp.

Special Variable: *max-shells*

Purely a safety valve. We’ll cause an error if you try to start more than this many shells at once, since that would probably cause problems on your system. We make this a parameter so you can reconfigure it if you really need to create so many shells.

Package

shellpool.

Source

src/main.lisp.


5.1.2 Ordinary functions

Function: ensure (&optional n)

Ensure that at least n shells are running, starting up shells if needed.

Package

shellpool.

Source

src/main.lisp.

Function: run (script &key each-line)
Package

shellpool.

Source

src/main.lisp.

Function: run& (script)
Package

shellpool.

Source

src/main.lisp.

Function: start (&optional n)

Start some number of shells and ensure that the aux shell is running.

Package

shellpool.

Source

src/main.lisp.


5.2 Internals


5.2.1 Constants

Constant: +allkids+
Package

shellpool.

Source

src/main.lisp.

Constant: +death-line+
Package

shellpool.

Source

src/main.lisp.

Constant: +exit-line+
Package

shellpool.

Source

src/main.lisp.

Constant: +pid-line+
Package

shellpool.

Source

src/main.lisp.

Constant: +status-line+
Package

shellpool.

Source

src/main.lisp.

Constant: nl

Newline as a string. Convenient in string concatenations as a way to insert newlines without having to ruin your indenting.

Package

shellpool.

Source

src/main.lisp.


5.2.2 Special variables

Special Variable: *state*
Package

shellpool.

Source

src/main.lisp.


5.2.3 Macros

Macro: debug-msg (&rest args)

Like (format t ...) but only prints if debugging is enabled.

Package

shellpool.

Source

src/main.lisp.

Macro: define-constant (name value &optional doc)
Package

shellpool.

Source

src/main.lisp.

Macro: with-file-to-be-deleted (filename &rest forms)
Package

shellpool.

Source

src/main.lisp.

Macro: with-runner (name &rest forms)
Package

shellpool.

Source

src/main.lisp.

Macro: with-state-lock (&rest forms)
Package

shellpool.

Source

src/main.lisp.


5.2.4 Ordinary functions

Function: add-runners (n)
Package

shellpool.

Source

src/main.lisp.

Function: bash-alive-p (sh)
Package

shellpool.

Source

src/main.lisp.

Function: bash-err (sh)
Package

shellpool.

Source

src/main.lisp.

Function: bash-in (sh)
Package

shellpool.

Source

src/main.lisp.

Function: bash-out (sh)
Package

shellpool.

Source

src/main.lisp.

Function: copy-runner (instance)
Package

shellpool.

Source

src/main.lisp.

Function: copy-state (instance)
Package

shellpool.

Source

src/main.lisp.

Function: default-each-line (line type)
Package

shellpool.

Source

src/main.lisp.

Function: kill (pid)
Package

shellpool.

Source

src/main.lisp.

Function: make-bash ()
Package

shellpool.

Source

src/main.lisp.

Function: make-run-command-string (filename)
Package

shellpool.

Source

src/main.lisp.

Function: make-runner (&key err sh)
Package

shellpool.

Source

src/main.lisp.

Function: make-state (&key lock aux sem runners total)
Package

shellpool.

Source

src/main.lisp.

Function: parse-pid-line (line)
Package

shellpool.

Source

src/main.lisp.

Reader: runner-err (instance)
Writer: (setf runner-err) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

err.

Function: runner-p (object)
Package

shellpool.

Source

src/main.lisp.

Reader: runner-sh (instance)
Writer: (setf runner-sh) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

sh.

Reader: state-aux (instance)
Writer: (setf state-aux) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

aux.

Reader: state-lock (instance)
Writer: (setf state-lock) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

lock.

Function: state-p (object)
Package

shellpool.

Source

src/main.lisp.

Reader: state-runners (instance)
Writer: (setf state-runners) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

runners.

Reader: state-sem (instance)
Writer: (setf state-sem) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

sem.

Reader: state-total (instance)
Writer: (setf state-total) (instance)
Package

shellpool.

Source

src/main.lisp.

Target Slot

total.

Function: strpos (x y)

Determines the position of the first occurrence of the substring X in the string Y, or returns NIL if there is no such occurrence.

Package

shellpool.

Source

src/main.lisp.

Function: strpos-fast (x y n xlen ylen)
Package

shellpool.

Source

src/main.lisp.

Function: strprefixp (x y)

Determines if the string X comes at the start of the string Y. Example: (strprefixp "foo" "foobar") is true.

Package

shellpool.

Source

src/main.lisp.

Function: strprefixp-impl (x y xn yn xlen ylen)
Package

shellpool.

Source

src/main.lisp.

Function: strsuffixp (x y)

Determines if the string X comes at the end of the string Y. Example: (strsuffixp "bar" "foobar") is true.

Package

shellpool.

Source

src/main.lisp.


5.2.5 Structures

Structure: runner
Package

shellpool.

Source

src/main.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: err
Readers

runner-err.

Writers

(setf runner-err).

Slot: sh
Readers

runner-sh.

Writers

(setf runner-sh).

Structure: state
Package

shellpool.

Source

src/main.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: lock
Readers

state-lock.

Writers

(setf state-lock).

Slot: aux
Readers

state-aux.

Writers

(setf state-aux).

Slot: sem
Readers

state-sem.

Writers

(setf state-sem).

Slot: runners
Readers

state-runners.

Writers

(setf state-runners).

Slot: total
Readers

state-total.

Writers

(setf state-total).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   B   C   D   E   F   K   M   P   R   S   W  
Index Entry  Section

(
(setf runner-err): Private ordinary functions
(setf runner-sh): Private ordinary functions
(setf state-aux): Private ordinary functions
(setf state-lock): Private ordinary functions
(setf state-runners): Private ordinary functions
(setf state-sem): Private ordinary functions
(setf state-total): Private ordinary functions

A
add-runners: Private ordinary functions

B
bash-alive-p: Private ordinary functions
bash-err: Private ordinary functions
bash-in: Private ordinary functions
bash-out: Private ordinary functions

C
copy-runner: Private ordinary functions
copy-state: Private ordinary functions

D
debug-msg: Private macros
default-each-line: Private ordinary functions
define-constant: Private macros

E
ensure: Public ordinary functions

F
Function, (setf runner-err): Private ordinary functions
Function, (setf runner-sh): Private ordinary functions
Function, (setf state-aux): Private ordinary functions
Function, (setf state-lock): Private ordinary functions
Function, (setf state-runners): Private ordinary functions
Function, (setf state-sem): Private ordinary functions
Function, (setf state-total): Private ordinary functions
Function, add-runners: Private ordinary functions
Function, bash-alive-p: Private ordinary functions
Function, bash-err: Private ordinary functions
Function, bash-in: Private ordinary functions
Function, bash-out: Private ordinary functions
Function, copy-runner: Private ordinary functions
Function, copy-state: Private ordinary functions
Function, default-each-line: Private ordinary functions
Function, ensure: Public ordinary functions
Function, kill: Private ordinary functions
Function, make-bash: Private ordinary functions
Function, make-run-command-string: Private ordinary functions
Function, make-runner: Private ordinary functions
Function, make-state: Private ordinary functions
Function, parse-pid-line: Private ordinary functions
Function, run: Public ordinary functions
Function, run&: Public ordinary functions
Function, runner-err: Private ordinary functions
Function, runner-p: Private ordinary functions
Function, runner-sh: Private ordinary functions
Function, start: Public ordinary functions
Function, state-aux: Private ordinary functions
Function, state-lock: Private ordinary functions
Function, state-p: Private ordinary functions
Function, state-runners: Private ordinary functions
Function, state-sem: Private ordinary functions
Function, state-total: Private ordinary functions
Function, strpos: Private ordinary functions
Function, strpos-fast: Private ordinary functions
Function, strprefixp: Private ordinary functions
Function, strprefixp-impl: Private ordinary functions
Function, strsuffixp: Private ordinary functions

K
kill: Private ordinary functions

M
Macro, debug-msg: Private macros
Macro, define-constant: Private macros
Macro, with-file-to-be-deleted: Private macros
Macro, with-runner: Private macros
Macro, with-state-lock: Private macros
make-bash: Private ordinary functions
make-run-command-string: Private ordinary functions
make-runner: Private ordinary functions
make-state: Private ordinary functions

P
parse-pid-line: Private ordinary functions

R
run: Public ordinary functions
run&: Public ordinary functions
runner-err: Private ordinary functions
runner-p: Private ordinary functions
runner-sh: Private ordinary functions

S
start: Public ordinary functions
state-aux: Private ordinary functions
state-lock: Private ordinary functions
state-p: Private ordinary functions
state-runners: Private ordinary functions
state-sem: Private ordinary functions
state-total: Private ordinary functions
strpos: Private ordinary functions
strpos-fast: Private ordinary functions
strprefixp: Private ordinary functions
strprefixp-impl: Private ordinary functions
strsuffixp: Private ordinary functions

W
with-file-to-be-deleted: Private macros
with-runner: Private macros
with-state-lock: Private macros