4c02f4720ed29dc2a6a6f8e25fae60c2e4ce230e
[platform/upstream/bash.git] / examples / loadables / README
1 Some examples of ready-to-dynamic-load builtins.  Most of the
2 examples given are reimplementations of standard commands whose
3 execution time is dominated by process startup time.  The
4 exceptions are sleep, which allows you to sleep for fractions
5 of a second, finfo, which provides access to the rest of the
6 elements of the `stat' structure that `test' doesn't let you
7 see, and pushd/popd/dirs, which allows you to compile them out
8 of the shell.
9
10 All of the new builtins in ksh93 that bash didn't already have
11 are included here, as is the ksh `print' builtin.
12
13 Compile with cc and whatever pic options you need (look in the
14 Makefile for a few common settings)
15
16 load with ld and whatever shared object options you need (again,
17 look in the Makefile)
18
19 then enable -f filename builtin-name
20
21 enable uses a simple reference-counting scheme to avoid unloading a
22 shared object that implements more than one loadable builtin before
23 all loadable builtins implemented in the object are removed.
24
25 Many of the details needed by builtin writers are found in hello.c,
26 the canonical example.  There is no real `builtin writers' programming
27 guide'.