3 VtEntry, VtFcall, VtRoot,
17 vtscorefmt \- venti data formats
39 typedef struct VtEntry
41 ulong gen; /* generation number */
42 ushort psize; /* pointer block size */
43 ushort dsize; /* data block size */
47 uchar score[VtScoreSize];
56 uchar score[VtScoreSize]; /* to a Dir block */
57 ushort blocksize; /* maximum block size */
58 uchar prev[VtScoreSize]; /* previous root block */
63 void vtentrypack(VtEntry *e, uchar *buf, int index)
66 int vtentryunpack(VtEntry *e, uchar *buf, int index)
69 Packet* vtfcallpack(VtFcall *f)
72 int vtfcallunpack(VtFcall *f, Packet *p)
75 void vtfcallclear(VtFcall *f)
78 uint vttodisktype(uint type)
81 uint vtfromdisktype(uint type)
84 int vtputstring(Packet *p, char *s)
87 int vtgetstring(Packet *p, char **s)
90 void vtrootpack(VtRoot *r, uchar *buf)
93 int vtrootunpack(VtRoot *r, uchar *buf)
96 int vtparsescore(char *s, char **prefix, uchar score[VtScoreSize])
99 int vtfcallfmt(Fmt *fmt)
101 int vtscorefmt(Fmt *fmt)
103 These routines convert between C representations of Venti
104 structures and serialized representations used on disk and
110 structure describing a Venti file
116 .IB buf + index *40 \fR.
118 does the reverse conversion.
123 structure describing a Venti protocol message
128 does the reverse conversion.
132 are named after the protocol fields described in
140 field holds the one-byte message type:
158 The block type enumeration defined in
162 differs from the one used on disk and in the network
164 The disk and network representation uses different
165 constants and does not distinguish between
173 enumeration value to the disk value;
175 converts a disk value to the enumeration value,
183 is an enumeration value
187 convert to and from the disk values used in packets
189 so most programs will not need to call these functions.
192 appends the Venti protocol representation of the string
197 reads a string from the packet, returning a pointer to a copy
200 The copy must be freed by the caller.
201 These functions are used by
205 most programs will not need to call them directly.
210 structure describing a Venti file tree
215 .I Vtrootunpack does the reverse conversion.
218 parses the 40-digit hexadecimal string
223 If the hexadecimal string is prefixed with
224 a text label followed by a colon, a copy of that
229 is nil, the label is ignored.
238 structures and scores.
264 return 0 on success, \-1 on error.
267 returns a packet on success, nil on error.
275 when presented with invalid input.