Commit | Line | Data |
---|---|---|
a2907882 KM |
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 and use in source and binary forms are permitted | |
9 | * provided that the above copyright notice and this paragraph are | |
10 | * duplicated in all such forms and that any documentation, | |
11 | * advertising materials, and other materials related to such | |
12 | * distribution and use acknowledge that the software was developed | |
13 | * by the University of California, Berkeley. The name of the | |
14 | * University may not be used to endorse or promote products derived | |
15 | * from this software without specific prior written permission. | |
16 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
17 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
19 | * | |
9238aa59 | 20 | * @(#)xdr_subs.h 7.2 (Berkeley) %G% |
a2907882 KM |
21 | */ |
22 | ||
23 | /* | |
24 | * Macros used for conversion to/from xdr representation by nfs... | |
25 | * These use the MACHINE DEPENDENT routines ntohl, htonl | |
26 | */ | |
27 | /* From xdr to machine */ | |
28 | #define fxdr_unsigned(t, v) ((t)ntohl((long)(v))) | |
29 | #define fxdr_time(f, t) {((struct timeval *)(t))->tv_sec=ntohl( \ | |
30 | ((struct timeval *)(f))->tv_sec); \ | |
31 | ((struct timeval *)(t))->tv_usec=ntohl( \ | |
32 | ((struct timeval *)(f))->tv_usec);} | |
33 | ||
34 | /* from machine to xdr */ | |
35 | #define txdr_unsigned(v) (htonl((long)(v))) | |
36 | #define txdr_time(f, t) {((struct timeval *)(t))->tv_sec=htonl( \ | |
37 | ((struct timeval *)(f))->tv_sec); \ | |
38 | ((struct timeval *)(t))->tv_usec=htonl( \ | |
39 | ((struct timeval *)(f))->tv_usec);} | |
40 |