/* Generated from fs.xg */
#include <fs.h>

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <netinet/in.h>
#ifndef HAVE_BCOPY
#define bcopy(a,b,c) memcpy((b),(a),(c))
#endif /* !HAVE_BCOPY */

char *ydr_encode_AFSFid(AFSFid *o, char *ptr)
{
{ int32_t tmp = htonl((*o).Volume); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Vnode); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Unique); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_AFSFid(AFSFid *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Volume = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Vnode = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Unique = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_VenusFid(VenusFid *o, char *ptr)
{
{ int32_t tmp = htonl((*o).Cell); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).fid.Volume); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).fid.Vnode); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).fid.Unique); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_VenusFid(VenusFid *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Cell = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).fid.Volume = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).fid.Vnode = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).fid.Unique = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_AFSCallBack(AFSCallBack *o, char *ptr)
{
{ int32_t tmp = htonl((*o).CallBackVersion); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ExpirationTime); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).CallBackType); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_AFSCallBack(AFSCallBack *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).CallBackVersion = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ExpirationTime = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).CallBackType = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_CallBackType(CallBackType *o, char *ptr)
{
{ int32_t tmp = htonl((int)(*o)); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_CallBackType(CallBackType *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (int)(*o) = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_AFSVolSync(AFSVolSync *o, char *ptr)
{
{ int32_t tmp = htonl((*o).spare1); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare2); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare3); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare4); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare5); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare6); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_AFSVolSync(AFSVolSync *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare1 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare2 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare3 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare4 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare5 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare6 = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_AFSFetchStatus(AFSFetchStatus *o, char *ptr)
{
{ int32_t tmp = htonl((*o).InterfaceVersion); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).FileType); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).LinkCount); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Length); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).DataVersion); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Author); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Owner); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).CallerAccess); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).AnonymousAccess); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).UnixModeBits); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ParentVnode); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ParentUnique); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).SegSize); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ClientModTime); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ServerModTime); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Group); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).SyncCount); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare1); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare2); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare3); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).spare4); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_AFSFetchStatus(AFSFetchStatus *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).InterfaceVersion = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).FileType = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).LinkCount = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Length = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).DataVersion = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Author = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Owner = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).CallerAccess = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).AnonymousAccess = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).UnixModeBits = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ParentVnode = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ParentUnique = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).SegSize = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ClientModTime = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ServerModTime = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Group = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).SyncCount = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare1 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare2 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare3 = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).spare4 = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_AFSStoreStatus(AFSStoreStatus *o, char *ptr)
{
{ int32_t tmp = htonl((*o).Mask); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).ClientModTime); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Owner); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).Group); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).UnixModeBits); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).SegSize); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
return ptr;
}
char *ydr_decode_AFSStoreStatus(AFSStoreStatus *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Mask = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).ClientModTime = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Owner = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).Group = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).UnixModeBits = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).SegSize = ntohl(tmp); ptr += sizeof(int);}
return ptr;
}
char *ydr_encode_AFSOpaque(AFSOpaque *o, char *ptr)
{
{ int32_t tmp = htonl((*o).len); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp = htonl((*o).val[i0]); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
}
}
return ptr;
}
char *ydr_decode_AFSOpaque(AFSOpaque *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).len = ntohl(tmp); ptr += sizeof(int);}
(*o).val = (char *)malloc(sizeof(char ) * (*o).len);
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0] = ntohl(tmp); ptr += sizeof(int);}
}
}
return ptr;
}
char *ydr_encode_AFSCBs(AFSCBs *o, char *ptr)
{
{ int32_t tmp = htonl((*o).len); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp = htonl((*o).val[i0].CallBackVersion); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).val[i0].ExpirationTime); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).val[i0].CallBackType); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
}
}
return ptr;
}
char *ydr_decode_AFSCBs(AFSCBs *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).len = ntohl(tmp); ptr += sizeof(int);}
(*o).val = (struct AFSCallBack *)malloc(sizeof(struct AFSCallBack ) * (*o).len);
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].CallBackVersion = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].ExpirationTime = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].CallBackType = ntohl(tmp); ptr += sizeof(int);}
}
}
return ptr;
}
char *ydr_encode_AFSCBFids(AFSCBFids *o, char *ptr)
{
{ int32_t tmp = htonl((*o).len); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp = htonl((*o).val[i0].Volume); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).val[i0].Vnode); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
{ int32_t tmp = htonl((*o).val[i0].Unique); bcopy ((char*)&tmp, ptr, sizeof(int)); ptr += sizeof(int);}
}
}
return ptr;
}
char *ydr_decode_AFSCBFids(AFSCBFids *o, char *ptr)
{
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).len = ntohl(tmp); ptr += sizeof(int);}
(*o).val = (struct AFSFid *)malloc(sizeof(struct AFSFid ) * (*o).len);
{
int i0;
for(i0 = 0; i0 < (*o).len;++i0){
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].Volume = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].Vnode = ntohl(tmp); ptr += sizeof(int);}
{ int32_t tmp; bcopy (ptr, (char *)&tmp, sizeof(int)); (*o).val[i0].Unique = ntohl(tmp); ptr += sizeof(int);}
}
}
return ptr;
}
