protobuf

API Reference

protobuf

Protocol buffer code

PROTOCOL-BUFFER

Machine generated protocol buffers.
  • Class PROTOCOL-BUFFER
    Superclass of all protocol buffer classes.
    No slots.
  • Generic-Function CLEAR (protocol-buffer)
    Sets the slots of PROTOCOL-BUFFER to their default values.
  • Generic-Function IS-INITIALIZED (protocol-buffer)
    Are all the slots of PROTOCOL-BUFFER initialized?
  • Generic-Function OCTET-SIZE (protocol-buffer)
    Returns the number of octets required to represent PROTOCOL-BUFFER when it is encoded.
  • Generic-Function SERIALIZE (protocol-buffer buffer index limit)
    Serializes PROTOCOL-BUFFER into BUFFER. Starts writing at position INDEX of BUFFER, but does not write into position LIMIT or higher. If serialization demands writing past LIMIT, then signals PROTOCOL-BUFFER-WRITE-ERROR. OCTET-SIZE must be called immediately before SERIALIZE because PROTOCOL-BUFFER instances cache size information.
  • Generic-Function MERGE-FROM-ARRAY (protocol-buffer buffer start limit)
    Merges the contents of the encoded protocol buffer stored in BUFFER into PROTOCOL-BUFFER. When reading from BUFFER, begins at position START and does not read from position LIMIT or higher. If deserialization demands reading beyond LIMIT, then signals PROTOCOL-BUFFER-READ-ERROR.
  • Generic-Function MERGE-FROM-MESSAGE (protocol-buffer source-protocol-buffer)
    Merges the contents of SOURCE-PROTOCOL-BUFFER into PROTOCOL-BUFFER.
  • Function STRING-FIELD (value)
    Returns a new %SF% instance initialized to hold VALUE, which much be either a Lisp string or a vector of UTF-8 encoded octets.
  • Function STRING-VALUE (string-field)
    Returns STRING-FIELD's value as a Lisp string.
  • Function UTF8-STRING-VALUE (string-field)
    Returns STRING-FIELD's value as a UTF-8 encoded vector of octets.

WIRE-FORMAT

Wire format for protocol buffers.
  • Condition PROTOCOL-ERROR  (ERROR)
    Superclass of all PROTOCOL-BUFFER conditions.
  • Condition ENCODING-ERROR  (PROTOCOL-ERROR)
    Superclass of conditions signalled while encoding values.
  • Condition BUFFER-OVERFLOW  (ENCODING-ERROR)
    Buffer space exhausted while encoding a value.
  • Condition PARSING-ERROR  (PROTOCOL-ERROR)
    Superclass of conditions signalled while decoding values.
  • Condition DATA-EXHAUSTED  (PARSING-ERROR)
    Decoding a value requires more data than is available.
  • Condition VALUE-OUT-OF-RANGE  (PARSING-ERROR)
    Value decoded is outside the range of the return type.
  • Condition ALIGNMENT  (PARSING-ERROR)
    Bad data encountered while skipping a field.
  • Function SKIP-FIELD (buffer index limit start-tag)
  • Function WRITE-BOOLEAN-CAREFULLY (buffer index limit value)
  • Function READ-BOOLEAN-CAREFULLY (buffer index limit)
  • Function WRITE-INT32-CAREFULLY (buffer index limit value)
  • Function WRITE-UINT32-CAREFULLY (buffer index limit value)
  • Function WRITE-INT64-CAREFULLY (buffer index limit value)
  • Function WRITE-UINT64-CAREFULLY (buffer index limit value)
  • Function READ-UINT32-CAREFULLY (buffer index limit)
  • Function READ-INT32-CAREFULLY (buffer index limit)
  • Function READ-UINT64-CAREFULLY (buffer index limit)
  • Function READ-INT64-CAREFULLY (buffer index limit)
  • Function WRITE-SINGLE-FLOAT-CAREFULLY (buffer index limit float)
    Write the little-endian IEEE binary representation of double precision FLOAT to BUFFER starting at INDEX. Return the index value of the first octet following FLOAT. If encoding FLOAT requires space in BUFFER past LIMIT, then signal ENCODE-OVERFLOW.
  • Function WRITE-DOUBLE-FLOAT-CAREFULLY (buffer index limit float)
    Write the little-endian IEEE binary representation of single precision FLOAT to BUFFER starting at INDEX. Return the index value of the first octet following FLOAT. If encoding FLOAT requires space in BUFFER past LIMIT, then signal ENCODE-OVERFLOW.
  • Function READ-SINGLE-FLOAT-CAREFULLY (buffer index limit)
    Read a SINGLE-FLOAT from BUFFER starting at INDEX. The float is stored in BUFFER as a 4-octet little-endian IEEE single precision value. Both the float and the index of the first octet following it are returned. If reading the float would require octets beyond LIMIT, then signal PARSE-OVERFLOW.
  • Function READ-DOUBLE-FLOAT-CAREFULLY (buffer index limit)
    Read a DOUBLE-FLOAT from BUFFER starting at INDEX. The float is stored in BUFFER as an 8-octet little-endian IEEE double precision value. Both the float and the index of the first octet following it are returned. If reading the float would require octets beyond LIMIT, then signal PARSE-OVERFLOW.
  • Function WRITE-OCTETS-CAREFULLY (buffer index limit octets)
  • Function READ-OCTETS-CAREFULLY (buffer index limit)
  • Function ZIG-ZAG-ENCODE32 (v)
  • Function ZIG-ZAG-DECODE32 (v)
  • Function ZIG-ZAG-ENCODE64 (v)
  • Function ZIG-ZAG-DECODE64 (v)

varint

VARINT

Variable-size encoding and decoding of integers and floats
  • Variable +MAX-OCTETS-32+
    #:g0
    Maximum number of octets needed to encode a 32-bit integer.
  • Variable +MAX-OCTETS-32+
    #:g0
    Maximum number of octets needed to encode a 32-bit integer.
  • Variable +MAX-OCTETS-64+
    #:g1
    Maximum number of octets needed to encode a 64-bit integer.
  • Variable +MAX-OCTETS-64+
    #:g1
    Maximum number of octets needed to encode a 64-bit integer.
  • Condition VARINT-ERROR  (ERROR)
    Superclass of all VARINT conditions.
  • Condition ENCODING-ERROR  (VARINT-ERROR)
    Superclass of all VARINT encoding conditions.
  • Condition BUFFER-OVERFLOW  (ENCODING-ERROR)
    Buffer space exhausted while encoding a value.
  • Condition PARSING-ERROR  (VARINT-ERROR)
    Superclass of all VARINT decoding conditions.
  • Condition DATA-EXHAUSTED  (PARSING-ERROR)
    Decoding a value requires more data than is available.
  • Condition VALUE-OUT-OF-RANGE  (PARSING-ERROR)
    Value decoded is outside the range of the return type.
  • Condition ALIGNMENT  (PARSING-ERROR)
    Data buffer does not contain the type of value we have been asked to skip over or parse backwards.
  • Function ENCODE-UINT32 (buffer index v)
    Encode V, an unsigned 32-bit integer, into BUFFER at INDEX.
  • Function ENCODE-UINT32-CAREFULLY (buffer index limit v)
    Encode V, an unsigned 32-bit integer, into BUFFER at INDEX, taking care to never write past position LIMIT. If writing past LIMIT is required to encode V, then raise ENCODE-OVERFLOW.
  • Function ENCODE-UINT64 (buffer index v)
    Encode V, an unsigned 64-bit integer, into BUFFER at INDEX.
  • Function ENCODE-UINT64-CAREFULLY (buffer index limit v)
    Encode V, an unsigned 64-bit integer, into BUFFER at INDEX, taking care to never write past position LIMIT. If writing past LIMIT is required to encode V, then raise BUFFER-OVERFLOW.
  • Function PARSE-UINT32 (buffer index)
  • Function PARSE-UINT32-CAREFULLY (buffer index limit)
  • Function PARSE-UINT31-CAREFULLY (buffer index limit)
  • Function PARSE-UINT64 (buffer index)
  • Function PARSE-UINT64-CAREFULLY (buffer index limit)
  • Function PARSE-INT64-CAREFULLY (buffer index limit)
  • Function PARSE-INT32-CAREFULLY (buffer index limit)
  • Function SKIP32-CAREFULLY (buffer index limit)
  • Function SKIP64-CAREFULLY (buffer index limit)
  • Function SKIP32-BACKWARD-SLOW (buffer index base)
  • Function SKIP64-BACKWARD-SLOW (buffer index base)
  • Function SKIP32-BACKWARD (buffer index base)
  • Function SKIP64-BACKWARD (buffer index base)
  • Function PARSE32-BACKWARD-SLOW (buffer index base)
  • Function PARSE64-BACKWARD-SLOW (buffer index base)
  • Function PARSE32-BACKWARD (buffer index base)
  • Function PARSE64-BACKWARD (buffer index base)
  • Function LENGTH32 (v)
  • Function LENGTH64 (v)