You are looking at historical revision 2150 of this page. It may differ significantly from its current revision.


packedobjects is a data encoding tool based on the telecommunications standard Packed Encoding Rules (PER). An abstract syntax language is used to define a protocol specification. packedobjects uses the Scheme programming language to represent the protocol specification within a symbolic expression (s-expression).

For a more detailed introduction refer to the following short paper.

packedobjects is suitable for simple cross platform request/response protocols that require efficient encoding. So far packedobjects has been tested on the following platforms:


John P. T. Moore




(packedobjects <protocol> #!key <pdusize> <strsize>)

Creates a packedobject using the supplied protocol specification. Optional values for the PDU and string buffer sizes can be specified. They default to 5000 and 1000 respectively. Both the PDU buffer and string buffer are fixed in size. The string buffer must be large enough to handle any string used by the protocol. The PDU buffer must be manually freed.

(<packedobject> 'pack <values>)

Encodes a list of values and returns the number of bytes used.

(<packedobject> 'unpack)

Returns a list of values.

(<packedobject> 'read <fd> <size>)

Reads a number of bytes from a file descriptor into the PDU buffer.

(<packedobject> 'write <fd> <size>)

Writes a number of bytes from the PDU buffer to a file descriptor.

(<packedobject> 'dump-buffer <filename> <size>)

Dumps a number of bytes from the PDU buffer to a file.

(<packedobject> 'free)

Frees the PDU buffer.