2014-07-13 00:24:25 -07:00
|
|
|
// ************************************************************
|
|
|
|
// This file is automatically generated by genxdr. Do not edit.
|
|
|
|
// ************************************************************
|
|
|
|
|
2015-01-12 06:50:30 -07:00
|
|
|
package db
|
2014-07-06 05:46:48 -07:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"io"
|
|
|
|
|
2014-08-01 04:12:54 -07:00
|
|
|
"github.com/calmh/xdr"
|
2014-07-06 05:46:48 -07:00
|
|
|
)
|
|
|
|
|
2014-07-13 00:24:25 -07:00
|
|
|
/*
|
|
|
|
|
|
|
|
fileVersion Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| |
|
|
|
|
+ version (64 bits) +
|
|
|
|
| |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
2014-09-28 04:00:38 -07:00
|
|
|
| Length of device |
|
2014-07-13 00:24:25 -07:00
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
2014-09-28 04:00:38 -07:00
|
|
|
\ device (variable length) \
|
2014-07-13 00:24:25 -07:00
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct fileVersion {
|
2015-01-17 18:12:06 -07:00
|
|
|
hyper version;
|
2014-09-28 04:00:38 -07:00
|
|
|
opaque device<>;
|
2014-07-13 00:24:25 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2014-07-06 05:46:48 -07:00
|
|
|
func (o fileVersion) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.encodeXDR(xw)
|
|
|
|
}
|
|
|
|
|
2014-10-20 23:40:05 -07:00
|
|
|
func (o fileVersion) MarshalXDR() ([]byte, error) {
|
2014-07-06 10:21:37 -07:00
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
2014-10-20 23:40:05 -07:00
|
|
|
func (o fileVersion) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o fileVersion) AppendXDR(bs []byte) ([]byte, error) {
|
2014-07-06 10:21:37 -07:00
|
|
|
var aw = xdr.AppendWriter(bs)
|
2014-07-06 05:46:48 -07:00
|
|
|
var xw = xdr.NewWriter(&aw)
|
2014-10-20 23:40:05 -07:00
|
|
|
_, err := o.encodeXDR(xw)
|
|
|
|
return []byte(aw), err
|
2014-07-06 05:46:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o fileVersion) encodeXDR(xw *xdr.Writer) (int, error) {
|
2015-01-17 18:12:06 -07:00
|
|
|
xw.WriteUint64(uint64(o.version))
|
2014-09-28 04:00:38 -07:00
|
|
|
xw.WriteBytes(o.device)
|
2014-07-06 05:46:48 -07:00
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *fileVersion) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *fileVersion) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *fileVersion) decodeXDR(xr *xdr.Reader) error {
|
2015-01-17 18:12:06 -07:00
|
|
|
o.version = int64(xr.ReadUint64())
|
2014-09-28 04:00:38 -07:00
|
|
|
o.device = xr.ReadBytes()
|
2014-07-06 05:46:48 -07:00
|
|
|
return xr.Error()
|
|
|
|
}
|
|
|
|
|
2014-07-13 00:24:25 -07:00
|
|
|
/*
|
|
|
|
|
|
|
|
versionList Structure:
|
|
|
|
|
|
|
|
0 1 2 3
|
|
|
|
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
| Number of versions |
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
/ /
|
|
|
|
\ Zero or more fileVersion Structures \
|
|
|
|
/ /
|
|
|
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
|
|
|
|
|
|
|
|
|
|
|
struct versionList {
|
|
|
|
fileVersion versions<>;
|
|
|
|
}
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2014-07-06 05:46:48 -07:00
|
|
|
func (o versionList) EncodeXDR(w io.Writer) (int, error) {
|
|
|
|
var xw = xdr.NewWriter(w)
|
|
|
|
return o.encodeXDR(xw)
|
|
|
|
}
|
|
|
|
|
2014-10-20 23:40:05 -07:00
|
|
|
func (o versionList) MarshalXDR() ([]byte, error) {
|
2014-07-06 10:21:37 -07:00
|
|
|
return o.AppendXDR(make([]byte, 0, 128))
|
|
|
|
}
|
|
|
|
|
2014-10-20 23:40:05 -07:00
|
|
|
func (o versionList) MustMarshalXDR() []byte {
|
|
|
|
bs, err := o.MarshalXDR()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return bs
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o versionList) AppendXDR(bs []byte) ([]byte, error) {
|
2014-07-06 10:21:37 -07:00
|
|
|
var aw = xdr.AppendWriter(bs)
|
2014-07-06 05:46:48 -07:00
|
|
|
var xw = xdr.NewWriter(&aw)
|
2014-10-20 23:40:05 -07:00
|
|
|
_, err := o.encodeXDR(xw)
|
|
|
|
return []byte(aw), err
|
2014-07-06 05:46:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func (o versionList) encodeXDR(xw *xdr.Writer) (int, error) {
|
|
|
|
xw.WriteUint32(uint32(len(o.versions)))
|
|
|
|
for i := range o.versions {
|
2014-07-31 06:21:33 -07:00
|
|
|
_, err := o.versions[i].encodeXDR(xw)
|
|
|
|
if err != nil {
|
|
|
|
return xw.Tot(), err
|
|
|
|
}
|
2014-07-06 05:46:48 -07:00
|
|
|
}
|
|
|
|
return xw.Tot(), xw.Error()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *versionList) DecodeXDR(r io.Reader) error {
|
|
|
|
xr := xdr.NewReader(r)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *versionList) UnmarshalXDR(bs []byte) error {
|
|
|
|
var br = bytes.NewReader(bs)
|
|
|
|
var xr = xdr.NewReader(br)
|
|
|
|
return o.decodeXDR(xr)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *versionList) decodeXDR(xr *xdr.Reader) error {
|
|
|
|
_versionsSize := int(xr.ReadUint32())
|
|
|
|
o.versions = make([]fileVersion, _versionsSize)
|
|
|
|
for i := range o.versions {
|
|
|
|
(&o.versions[i]).decodeXDR(xr)
|
|
|
|
}
|
|
|
|
return xr.Error()
|
|
|
|
}
|