xdr_subs.h (36541) | xdr_subs.h (47751) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)xdr_subs.h 8.3 (Berkeley) 3/30/95 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. 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, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)xdr_subs.h 8.3 (Berkeley) 3/30/95 |
37 * $Id: xdr_subs.h,v 1.9 1997/02/22 09:42:53 peter Exp $ | 37 * $Id: xdr_subs.h,v 1.10 1998/05/31 20:09:01 peter Exp $ |
38 */ 39 40 41#ifndef _NFS_XDR_SUBS_H_ 42#define _NFS_XDR_SUBS_H_ 43 44/* 45 * Macros used for conversion to/from xdr representation by nfs... --- 28 unchanged lines hidden (view full) --- 74 (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \ 75 (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ 76} 77#define txdr_nfsv3time(f, t) { \ 78 ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \ 79 ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ 80} 81 | 38 */ 39 40 41#ifndef _NFS_XDR_SUBS_H_ 42#define _NFS_XDR_SUBS_H_ 43 44/* 45 * Macros used for conversion to/from xdr representation by nfs... --- 28 unchanged lines hidden (view full) --- 74 (t)->tv_sec = ntohl(((struct nfsv3_time *)(f))->nfsv3_sec); \ 75 (t)->tv_nsec = ntohl(((struct nfsv3_time *)(f))->nfsv3_nsec); \ 76} 77#define txdr_nfsv3time(f, t) { \ 78 ((struct nfsv3_time *)(t))->nfsv3_sec = htonl((f)->tv_sec); \ 79 ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ 80} 81 |
82#define fxdr_hyper(f, t) { \ 83 ((int32_t *)(t))[_QUAD_HIGHWORD] = ntohl(((int32_t *)(f))[0]); \ 84 ((int32_t *)(t))[_QUAD_LOWWORD] = ntohl(((int32_t *)(f))[1]); \ 85} | 82#define fxdr_hyper(f) \ 83 ((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ 84 (u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) |
86#define txdr_hyper(f, t) { \ | 85#define txdr_hyper(f, t) { \ |
87 ((int32_t *)(t))[0] = htonl(((int32_t *)(f))[_QUAD_HIGHWORD]); \ 88 ((int32_t *)(t))[1] = htonl(((int32_t *)(f))[_QUAD_LOWWORD]); \ | 86 ((u_int32_t *)(t))[0] = htonl((u_int32_t)((f) >> 32)); \ 87 ((u_int32_t *)(t))[1] = htonl((u_int32_t)((f) & 0xffffffff)); \ |
89} 90 91#endif | 88} 89 90#endif |