The plump-bundle Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

The plump-bundle Reference Manual

This is the plump-bundle Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:36:04 2022 GMT+0.

Table of Contents


1 Introduction

About Plump-Bundle

This is an implementation and specification of a binary file format to store Plump documents.

How To

Storing happens through output, parsing through input.

(plump-bundle:input (plump-bundle:output :vector (plump:parse "<test>Hey!</test>")))

They both accept namestrings, pathnames, vectors (:vector for ouput), or a fast-io buffer. The format handles all node-types defined in Plump-DOM 1.2 .

Format Specification (v1)

The following primitive types are declared:

chunk     ::= type *
children  ::= count chunk{count}
map       ::= count pair{count}
pair      ::= string string
string    ::= count character{count}
type      ::= integer
count     ::= integer
character --- A character encoded in utf-8.
integer   --- Corresponds to (unsigned-byte 32), stored in big-endian.
byte      --- Corresponds to (unsigned-byte 8)

The file header looks as follows:

-------------------------------------------------------
POS HEX THING
-------------------------------------------------------
00  89  
01  50  ASCII P
02  4c  ASCII L
03  55  ASCII U
04  4d  ASCII M
05  50  ASCII P
06  0d  ASCII CR
07  0a  ASCII LF
08  1a  DOS EOF
09  0a  ASCII LF
0a  01  ASCII SOH
0b      1-byte version number
0c      4-byte timestamp
..      ..
10  02  ASCII STX
-------------------------------------------------------

Following the header is a single chunk. Chunks are generally composed of a type header, followed by the content as specified by the chunk type. The type header is given here in the form of four ASCII characters, which are then byte-composed into a single (unsigned-byte 32) integer.

-------------------------------------------------------
TYPE  LISP-TYPE               LAYOUT
-------------------------------------------------------
NULL  NULL                    type 
NODE  NODE                    type 
NEST  NESTING-NODE            type children
CHLD  CHILD-NODE              type
TXND  TEXTUAL-NODE            type string
ROOT  ROOT                    type children
TEXT  TEXT-NODE               type string
COMM  COMMENT                 type string
DOCT  DOCTYPE                 type string
ELEM  ELEMENT                 type string map children
FTXT  FULLTEXT-ELEMENT        type string map children
XMLH  XML-HEADER              type map
CDAT  CDATA                   type string
PROC  PROCESSING-INSTRUCTION  type string string
-------------------------------------------------------

The footer looks like so:

-------------------------------------------------------
POS HEX THING
-------------------------------------------------------
00  04  ASCII ETX
-------------------------------------------------------

Thus, a sample document as denoted in standard XML syntax

<start><foo bar="baz">Hello!</foo></start>

Is transformed into the following bundle (as displayed by Emacs' hexl-mode)

00000000: 8950 4c55 4d50 0d0a 1a0a 0101 d8a4 84c2  .PLUMP..........
00000010: 0252 4f4f 5400 0000 0145 4c45 4d00 0000  .ROOT....ELEM...
00000020: 0573 7461 7274 0000 0000 0000 0001 454c  .start........EL
00000030: 454d 0000 0003 666f 6f00 0000 0100 0000  EM....foo.......
00000040: 0362 6172 0000 0003 6261 7a00 0000 0154  .bar....baz....T
00000050: 4558 5400 0000 0648 656c 6c6f 2104       EXT....Hello!.

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 plump-bundle

A binary storage format for Plump documents.

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://Shinmera.github.io/plump-bundle/

Source Control

(GIT https://github.com/Shinmera/plump-bundle.git)

Bug Tracker

https://github.com/Shinmera/plump-bundle/issues

License

zlib

Version

0.1.0

Dependencies
  • plump-dom (system).
  • babel (system).
  • fast-io (system).
  • closer-mop (system).
Source

plump-bundle.asd.

Child Components

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp   [Contents][Index]

3.1.1 plump-bundle/plump-bundle.asd

Source

plump-bundle.asd.

Parent Component

plump-bundle (system).

ASDF Systems

plump-bundle.


3.1.2 plump-bundle/package.lisp

Source

plump-bundle.asd.

Parent Component

plump-bundle (system).

Packages

3.1.3 plump-bundle/machinery.lisp

Dependency

package.lisp (file).

Source

plump-bundle.asd.

Parent Component

plump-bundle (system).

Internals

3.1.4 plump-bundle/definitions.lisp

Dependency

machinery.lisp (file).

Source

plump-bundle.asd.

Parent Component

plump-bundle (system).

Public Interface

*format-version* (special variable).

Internals

3.1.5 plump-bundle/frontend.lisp

Dependency

definitions.lisp (file).

Source

plump-bundle.asd.

Parent Component

plump-bundle (system).

Public Interface

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 plump-bundle

Source

package.lisp.

Nickname

org.shirakumo.plump.bundle

Use List
  • common-lisp.
  • plump-dom.
Public Interface
Internals

4.2 plump-bundle-writers

Source

package.lisp.

Internals

4.3 plump-bundle-readers

Source

package.lisp.

Internals

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Public Interface


5.1.1 Special variables

Special Variable: *format-version*
Package

plump-bundle.

Source

definitions.lisp.


5.1.2 Ordinary functions

Function: output-to-file (pathname root &key if-exists if-does-not-exist)

A wrapper around OUTPUT to allow specifying of IF-EXISTS and IF-DOES-NOT-EXIST.

Package

plump-bundle.

Source

frontend.lisp.


5.1.3 Generic functions

Generic Function: input (input)

Parse INPUT to a Plump document. Methods are defined for FAST-IO::INPUT-BUFFER
STREAM (unsigned-byte 8) element-type PATHNAME
STRING treated as namestring VECTOR (unsigned-byte 8) element-type

Package

plump-bundle.

Source

frontend.lisp.

Methods
Method: input ((input input-buffer))
Method: input ((input stream))
Method: input ((input pathname))
Method: input ((input string))
Method: input ((input vector))
Generic Function: output (target root)

Turn ROOT into a bundle and store it in TARGET. Methods are definted for FAST-IO::OUTPUT-BUFFER
STREAM (unsigned-byte 8) element-type PATHNAME
STRING treated as namestring
:VECTOR

Package

plump-bundle.

Source

frontend.lisp.

Methods
Method: output ((output output-buffer) root)
Method: output ((output stream) root)
Method: output ((output pathname) root)
Method: output ((output string) root)
Method: output ((output (eql :vector)) root)

5.2 Internals


Next: , Previous: , Up: Internals   [Contents][Index]

5.2.1 Special variables

Special Variable: *buffer*
Package

plump-bundle.

Source

machinery.lisp.

Special Variable: *chunk-translations*
Package

plump-bundle.

Source

machinery.lisp.

Special Variable: *parent*
Package

plump-bundle.

Source

machinery.lisp.


5.2.2 Macros

Macro: check-equal (part reader type-format)
Package

plump-bundle.

Source

machinery.lisp.

Macro: define-chunk ((type class-name) initargs &body body)
Package

plump-bundle.

Source

machinery.lisp.

Macro: define-chunk-translator ()
Package

plump-bundle.

Source

machinery.lisp.

Macro: define-reader (name args &body body)
Package

plump-bundle.

Source

machinery.lisp.

Macro: define-section (name &body parts)
Package

plump-bundle.

Source

machinery.lisp.

Macro: define-writer (name args &body body)
Package

plump-bundle.

Source

machinery.lisp.

Macro: read! (reader &rest args)
Package

plump-bundle.

Source

machinery.lisp.

Macro: write! (writer &rest args)
Package

plump-bundle.

Source

machinery.lisp.


Previous: , Up: Internals   [Contents][Index]

5.2.3 Ordinary functions

Function: body ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: body ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: byte (byte)
Package

plump-bundle-writers.

Source

machinery.lisp.

Function: byte ()
Package

plump-bundle-readers.

Source

machinery.lisp.

Function: cdata (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: cdata ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: char (char)
Package

plump-bundle-writers.

Source

machinery.lisp.

Function: char ()
Package

plump-bundle-readers.

Source

machinery.lisp.

Function: child-node (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: child-node ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: children (&optional node)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: children ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: chunk (chunk1)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: chunk ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: chunk-translation (type)
Package

plump-bundle.

Source

machinery.lisp.

Function: (setf chunk-translation) (type)
Package

plump-bundle.

Source

machinery.lisp.

Function: comment (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: comment ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: doctype (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: doctype ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: element (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: element ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: end-file ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: end-file ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: file ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: file ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: find-accessor-for-initarg (class initarg)
Package

plump-bundle.

Source

machinery.lisp.

Package

plump-bundle-writers.

Source

definitions.lisp.

Package

plump-bundle-readers.

Source

definitions.lisp.

Function: fulltext-element (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: fulltext-element ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: header ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: header ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: integer (int)
Package

plump-bundle-writers.

Source

machinery.lisp.

Function: integer ()
Package

plump-bundle-readers.

Source

machinery.lisp.

Function: map (map)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: map ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: nesting-node (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: nesting-node ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: node (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: node ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: null (instance)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: null ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: parent (arg)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: parent ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: processing-instruction (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: processing-instruction ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: reader-name (name)
Package

plump-bundle.

Source

machinery.lisp.

Function: root (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: root ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: string (string)
Package

plump-bundle-writers.

Source

machinery.lisp.

Function: string (&optional length)
Package

plump-bundle-readers.

Source

machinery.lisp.

Function: text-node (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: text-node ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: textual-node (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: textual-node ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: timestamp ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: timestamp ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: transform-reader-part (part)
Package

plump-bundle.

Source

machinery.lisp.

Function: transform-writer-part (part)
Package

plump-bundle.

Source

machinery.lisp.

Function: type (type)
Package

plump-bundle-writers.

Source

machinery.lisp.

Function: type ()
Package

plump-bundle-readers.

Source

machinery.lisp.

Function: type= (a b)
Package

plump-bundle.

Source

machinery.lisp.

Function: version ()
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: version ()
Package

plump-bundle-readers.

Source

definitions.lisp.

Function: writer-name (name)
Package

plump-bundle.

Source

machinery.lisp.

Function: xml-header (&optional instance0)
Package

plump-bundle-writers.

Source

definitions.lisp.

Function: xml-header ()
Package

plump-bundle-readers.

Source

definitions.lisp.


Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts


Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
B   C   D   E   F   G   H   I   M   N   O   P   R   S   T   V   W   X  
Index Entry  Section

(
(setf chunk-translation): Private ordinary functions

B
body: Private ordinary functions
body: Private ordinary functions
byte: Private ordinary functions
byte: Private ordinary functions

C
cdata: Private ordinary functions
cdata: Private ordinary functions
char: Private ordinary functions
char: Private ordinary functions
check-equal: Private macros
child-node: Private ordinary functions
child-node: Private ordinary functions
children: Private ordinary functions
children: Private ordinary functions
chunk: Private ordinary functions
chunk: Private ordinary functions
chunk-translation: Private ordinary functions
comment: Private ordinary functions
comment: Private ordinary functions

D
define-chunk: Private macros
define-chunk-translator: Private macros
define-reader: Private macros
define-section: Private macros
define-writer: Private macros
doctype: Private ordinary functions
doctype: Private ordinary functions

E
element: Private ordinary functions
element: Private ordinary functions
end-file: Private ordinary functions
end-file: Private ordinary functions

F
file: Private ordinary functions
file: Private ordinary functions
find-accessor-for-initarg: Private ordinary functions
footer: Private ordinary functions
footer: Private ordinary functions
fulltext-element: Private ordinary functions
fulltext-element: Private ordinary functions
Function, (setf chunk-translation): Private ordinary functions
Function, body: Private ordinary functions
Function, body: Private ordinary functions
Function, byte: Private ordinary functions
Function, byte: Private ordinary functions
Function, cdata: Private ordinary functions
Function, cdata: Private ordinary functions
Function, char: Private ordinary functions
Function, char: Private ordinary functions
Function, child-node: Private ordinary functions
Function, child-node: Private ordinary functions
Function, children: Private ordinary functions
Function, children: Private ordinary functions
Function, chunk: Private ordinary functions
Function, chunk: Private ordinary functions
Function, chunk-translation: Private ordinary functions
Function, comment: Private ordinary functions
Function, comment: Private ordinary functions
Function, doctype: Private ordinary functions
Function, doctype: Private ordinary functions
Function, element: Private ordinary functions
Function, element: Private ordinary functions
Function, end-file: Private ordinary functions
Function, end-file: Private ordinary functions
Function, file: Private ordinary functions
Function, file: Private ordinary functions
Function, find-accessor-for-initarg: Private ordinary functions
Function, footer: Private ordinary functions
Function, footer: Private ordinary functions
Function, fulltext-element: Private ordinary functions
Function, fulltext-element: Private ordinary functions
Function, header: Private ordinary functions
Function, header: Private ordinary functions
Function, integer: Private ordinary functions
Function, integer: Private ordinary functions
Function, map: Private ordinary functions
Function, map: Private ordinary functions
Function, nesting-node: Private ordinary functions
Function, nesting-node: Private ordinary functions
Function, node: Private ordinary functions
Function, node: Private ordinary functions
Function, null: Private ordinary functions
Function, null: Private ordinary functions
Function, output-to-file: Public ordinary functions
Function, parent: Private ordinary functions
Function, parent: Private ordinary functions
Function, processing-instruction: Private ordinary functions
Function, processing-instruction: Private ordinary functions
Function, reader-name: Private ordinary functions
Function, root: Private ordinary functions
Function, root: Private ordinary functions
Function, string: Private ordinary functions
Function, string: Private ordinary functions
Function, text-node: Private ordinary functions
Function, text-node: Private ordinary functions
Function, textual-node: Private ordinary functions
Function, textual-node: Private ordinary functions
Function, timestamp: Private ordinary functions
Function, timestamp: Private ordinary functions
Function, transform-reader-part: Private ordinary functions
Function, transform-writer-part: Private ordinary functions
Function, type: Private ordinary functions
Function, type: Private ordinary functions
Function, type=: Private ordinary functions
Function, version: Private ordinary functions
Function, version: Private ordinary functions
Function, writer-name: Private ordinary functions
Function, xml-header: Private ordinary functions
Function, xml-header: Private ordinary functions

G
Generic Function, input: Public generic functions
Generic Function, output: Public generic functions

H
header: Private ordinary functions
header: Private ordinary functions

I
input: Public generic functions
input: Public generic functions
input: Public generic functions
input: Public generic functions
input: Public generic functions
input: Public generic functions
integer: Private ordinary functions
integer: Private ordinary functions

M
Macro, check-equal: Private macros
Macro, define-chunk: Private macros
Macro, define-chunk-translator: Private macros
Macro, define-reader: Private macros
Macro, define-section: Private macros
Macro, define-writer: Private macros
Macro, read!: Private macros
Macro, write!: Private macros
map: Private ordinary functions
map: Private ordinary functions
Method, input: Public generic functions
Method, input: Public generic functions
Method, input: Public generic functions
Method, input: Public generic functions
Method, input: Public generic functions
Method, output: Public generic functions
Method, output: Public generic functions
Method, output: Public generic functions
Method, output: Public generic functions
Method, output: Public generic functions

N
nesting-node: Private ordinary functions
nesting-node: Private ordinary functions
node: Private ordinary functions
node: Private ordinary functions
null: Private ordinary functions
null: Private ordinary functions

O
output: Public generic functions
output: Public generic functions
output: Public generic functions
output: Public generic functions
output: Public generic functions
output: Public generic functions
output-to-file: Public ordinary functions

P
parent: Private ordinary functions
parent: Private ordinary functions
processing-instruction: Private ordinary functions
processing-instruction: Private ordinary functions

R
read!: Private macros
reader-name: Private ordinary functions
root: Private ordinary functions
root: Private ordinary functions

S
string: Private ordinary functions
string: Private ordinary functions

T
text-node: Private ordinary functions
text-node: Private ordinary functions
textual-node: Private ordinary functions
textual-node: Private ordinary functions
timestamp: Private ordinary functions
timestamp: Private ordinary functions
transform-reader-part: Private ordinary functions
transform-writer-part: Private ordinary functions
type: Private ordinary functions
type: Private ordinary functions
type=: Private ordinary functions

V
version: Private ordinary functions
version: Private ordinary functions

W
write!: Private macros
writer-name: Private ordinary functions

X
xml-header: Private ordinary functions
xml-header: Private ordinary functions

Jump to:   (  
B   C   D   E   F   G   H   I   M   N   O   P   R   S   T   V   W   X