|
3.
|
|
|
Banana is an efficient, extendable protocol for sending and receiving s-expressions. A s-expression in this context is a list composed of byte strings, integers, large integers, floats and/or s-expressions.
|
|
|
type: Content of: <html><body><p>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:16
|
|
4.
|
|
|
Banana Encodings
|
|
|
type: Content of: <html><body><h2>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:21
|
|
5.
|
|
|
The banana protocol is a stream of data composed of elements. Each element has the following general structure - first, the length of element encoded in base-128, least signficant bit first. For example length 4674 will be sent as <code>0x42 0x24</code>. For certain element types the length will be omitted (e.g. float) or have a different meaning (it is the actual value of integer elements).
|
|
|
type: Content of: <html><body><p>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:24
|
|
6.
|
|
|
Following the length is a delimiter byte, which tells us what kind of element this is. Depending on the element type, there will then follow the number of bytes specified in the length. The byte's high-bit will always be set, so that we can differentiate between it and the length (since the length bytes use 128-base, their high bit will never be set).
|
|
|
type: Content of: <html><body><p>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:32
|
|
7.
|
|
|
Element Types
|
|
|
type: Content of: <html><body><h2>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:39
|
|
8.
|
|
|
Given a series of bytes that gave us length N, these are the different delimiter bytes:
|
|
|
type: Content of: <html><body><p>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:42
|
|
9.
|
|
|
List -- 0x80
|
|
|
type: Content of: <html><body><dl><dt>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:46
|
|
10.
|
|
|
The following bytes are a list of N elements. Lists may be nested, and a child list counts as only one element to its parent (regardless of how many elements the child list contains).
|
|
|
type: Content of: <html><body><dl><dd>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:48
|
|
11.
|
|
|
Integer -- 0x81
|
|
|
type: Content of: <html><body><dl><dt>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:52
|
|
12.
|
|
|
The value of this element is the positive integer N. Following bytes are not part of this element. Integers can have values of 0 <= N <= 2147483647.
|
|
|
type: Content of: <html><body><dl><dd>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
specifications/banana.xhtml:53
|