|
|
1.1 root 1: /*
2: * Copyright (c) 1989 The Regents of the University of California.
3: * All rights reserved.
4: *
5: * This code is derived from software contributed to Berkeley by
6: * Rick Macklem at The University of Guelph.
7: *
8: * Redistribution is only permitted until one year after the first shipment
9: * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
10: * binary forms are permitted provided that: (1) source distributions retain
11: * this entire copyright notice and comment, and (2) distributions including
12: * binaries display the following acknowledgement: This product includes
13: * software developed by the University of California, Berkeley and its
14: * contributors'' in the documentation or other materials provided with the
15: * distribution and in all advertising materials mentioning features or use
16: * of this software. Neither the name of the University nor the names of
17: * its contributors may be used to endorse or promote products derived from
18: * this software without specific prior written permission.
19: * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21: * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22: *
23: * @(#)xdr_subs.h 7.3 (Berkeley) 6/28/90
24: */
25:
26: /*
27: * Macros used for conversion to/from xdr representation by nfs...
28: * These use the MACHINE DEPENDENT routines ntohl, htonl
29: * As defined by "XDR: External Data Representation Standard" RFC1014
30: */
31: /* From xdr to machine */
32: #define fxdr_unsigned(t, v) ((t)ntohl((long)(v)))
33: #define fxdr_time(f, t) {((struct timeval *)(t))->tv_sec=ntohl( \
34: ((struct timeval *)(f))->tv_sec); \
35: ((struct timeval *)(t))->tv_usec=ntohl( \
36: ((struct timeval *)(f))->tv_usec);}
37:
38: /* from machine to xdr */
39: #define txdr_unsigned(v) (htonl((long)(v)))
40: #define txdr_time(f, t) {((struct timeval *)(t))->tv_sec=htonl( \
41: ((struct timeval *)(f))->tv_sec); \
42: ((struct timeval *)(t))->tv_usec=htonl( \
43: ((struct timeval *)(f))->tv_usec);}
44:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.