Add handling of tar archives. Improved documentation.
[rrq/newlisp/packnl.git] / incore.lsp.8.adoc
1 = incore.lsp(8)
2 :doctype: manpage
3 :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"}
4
5 == NAME
6
7 incore.lsp - module for wrapping newlisp's load and read-file
8 functions to handle both in-core and external "ar" or "tar" archives
9 as local files.
10
11 == SYNOPSIS
12
13 _embedding directive in Makefile_
14
15 [pass]
16 ----
17 _binary_: _main.lsp_ _other.lsp*_
18         newlisp -x incore.lsp $@
19         chmod a+x $@
20         echo 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' >> $@
21         for F in $^ ; do \
22             echo "$$F\n$$(stat -c %s $$F)" ; cat $$F ; \
23         done >> $@
24 ----
25
26 == DESCRIPTION
27
28 *incore.lsp* is a newlisp module intended to be used for application
29 embedding into self-contained script collections.
30
31 *incore.lsp* is the main scripting that locates application scripts
32 appended to the running binary and sets these up as in-core archive
33 files. It wraps the newlisp functions +load+, +read-file+ and +file?+
34 so as to locate local files via the archives paths first. It will thus
35 locate any self-contained files first, before trying to find them as
36 external files.
37
38 When the binary has files appended, the very first file is processed
39 as the application main script.
40
41 === newlisp API
42
43 (*archives*)::
44
45 *archives* is a hashtable of known "local" files associated with
46 archiving details. These local files are associate with in-core access
47 details or with external archive pathname, which is an external
48 directory path, and +ar+ archive file (ending with ".a") or a +tar+
49 archive file (detemined via the +file+ command).
50
51 (*archive* _PATH_)::
52
53 *archive* is a context for the archive handling support functions,
54 including the "context function" to register archive accesible files
55 with the given _PATH_ as an external archive path. The given path is
56 processed and all content files are added to the *archives* hashtable
57 with the given access path. Note that the any current access
58 assignment will be overwritten.
59 +
60 .Loading from known tar archive file.
61 ====
62 ----
63 (archive "/usr/share/myapp/utilities-version-2.5.tgz")
64 (load "framework.lsp")
65 ----
66 This example illustrates how to make the files of a tar archive file
67 available for loading as if local files.
68 ====
69
70 == SEE ALSO
71
72 *newlisp*, *ar*, *tar*, *packnl*
73
74 == AUTHOR
75
76 Ralph Ronnquist <ralph.ronnwuidt@gmail.com>