Go to the first, previous, next, last section, table of contents.


Flatfile Save/Restore

In a production setting, it is occasionally very useful to be able to convert the binary database into a simple textfile. This can be useful for debugging, for transporting a db between machines with incompatible architectures (different byte-sex or floating-point representations, say), or for converting a database to a new revision of the server, should an incompatible change of database format prove necessary.

Such a facility has been implemented and tested, based on the xxx_import() and xxx_export() functions in each module xxx, but has not been actively maintained during recent changes and is likely thoroughly crippled by bitrot.

The general scheme used is to represent immediate values such as integers and floats by lines like

i:1534
f:45.5

while representing, for example, a three-slot vector containing the above two numbers plus a pointer to itself, as

V:15a9f:3
i:1535
f:45.5
r:15a9f

The general format, then, is to delimit records by newlines and fields within a record by colons, and to represent a value by a record containing a type field, followed by any immediate value, followed in the case of composite objects by records representing the contained values.

Addressable objects are assigned unique hex identifiers, which are stored in the second field in their record, and are referred to using records consiting of the r type field followed by a field containing the desired hex identifier.

As a general convention, hardwired classes have three-character type fields matching their source filename, and other hardwired types have one- or two-character type fields. As a further convention, the latter are lower-case for immediate values and upper-case for composite values.

The defined type fields are:

asm
Assembler class.
a
Top-of-stack-block delimiters.
u
Bottom-of-stack value. (Not normally user-visible.)
cdf
Class definitions.
cdt
Events.
cfg
Configuration objects. (/config.)
PT
Compiled-functions.
c
Characters.
f
Floats.
fun
Functions.
i
Integers.
jbs
Job-sets.
job
Jobs.
joq
Job-queues.
lok
Locks. (Binary semaphores.)
L
Cons cells. (Lists.)
mrk
Markers in text buffers. (Unimplemented.)
mss
Message streams.
mss
Message streams.
muq
Muq server interface objects. (/muq.)
obj
Muq index objects. (As created by makeIndex.)
pkg
Package objects. (As created by makePackage.)
prx
Proxy objects. (Unimplemented.)
sdf
Structure definition objects.
skt
Socket objects.
s
Special values. (OBJ_NOT_FOUND and such. Not normally user-visible.)
ssn
Session objects.
C
Structure instances.
EC
Ephemeral structure instances.
EN
Ephemeral cons cell instances.
t
Strings. ("Text".)
stk
Vanilla stacks.
lst
Loop stacks. (Specialized to hold call/return &tc info for jobs.)
dst
Data stacks. (Specialized to hold expression values for jobs.)
stm
Vanilla streams.
S
Symbols.
sys
System. (Interface to host OS.)
tbf
Text buffers. (Modelled on those of emacs. Unimplemented.)
usq
User queues. (Used internally by inserver job-scheduler.)
rot
Users with root privileges.
usr
Vanilla users.
V
Vectors.
EV
Ephemeral vectors.
EO
Ephemeral objects. (Unimplemented.)
wrm
Wormholes. (Unimplemented, likely to be removed.)
x??
Various X Window System classes. (Unimplemented, likely to be removed.)


Go to the first, previous, next, last section, table of contents.