]> begriffs open source - ai-pg/blob - full-docs/txt/protocol-message-types.txt
Convert HTML docs to more streamlined TXT
[ai-pg] / full-docs / txt / protocol-message-types.txt
1
2 54.6. Message Data Types #
3
4    This section describes the base data types used in messages.
5
6    Intn(i)
7           An n-bit integer in network byte order (most significant byte
8           first). If i is specified it is the exact value that will
9           appear, otherwise the value is variable. Eg. Int16, Int32(42).
10
11    Intn[k]
12           An array of k n-bit integers, each in network byte order. The
13           array length k is always determined by an earlier field in the
14           message. Eg. Int16[M].
15
16    String(s)
17           A null-terminated string (C-style string). There is no specific
18           length limitation on strings. If s is specified it is the exact
19           value that will appear, otherwise the value is variable. Eg.
20           String, String("user").
21
22 Note
23
24           There is no predefined limit on the length of a string that can
25           be returned by the backend. Good coding strategy for a frontend
26           is to use an expandable buffer so that anything that fits in
27           memory can be accepted. If that's not feasible, read the full
28           string and discard trailing characters that don't fit into your
29           fixed-size buffer.
30
31    Byten(c)
32           Exactly n bytes. If the field width n is not a constant, it is
33           always determinable from an earlier field in the message. If c
34           is specified it is the exact value. Eg. Byte2, Byte1('\n').