Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / xdr / xdr.c
blob075093014c1739f75c38bec357a133ace7136731
1 /*
2 * Copyright (c) 2009, Sun Microsystems, Inc.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
30 * xdr.c, Generic XDR routines implementation.
32 * Copyright (C) 1986, Sun Microsystems, Inc.
34 * These are the "generic" xdr routines used to serialize and de-serialize
35 * most common data items. See xdr.h for more info on the interface to
36 * xdr.
39 #include <stdlib.h>
40 #include <string.h>
41 #include <errno.h>
43 #include <rpc/types.h>
44 #include <rpc/xdr.h>
46 #include "xdr_private.h"
49 * constants specific to the xdr "protocol"
51 #define XDR_FALSE ((long) 0)
52 #define XDR_TRUE ((long) 1)
53 #define LASTUNSIGNED ((u_int) 0-1)
56 * for unit alignment
58 static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 };
61 * Free a data structure using XDR
62 * Not a filter, but a convenient utility nonetheless
64 void
65 xdr_free (xdrproc_t proc,
66 void * objp)
68 XDR x;
70 x.x_op = XDR_FREE;
71 (*proc) (&x, objp);
75 * XDR nothing
77 bool_t
78 xdr_void (void)
80 return TRUE;
85 * XDR integers
87 bool_t
88 xdr_int (XDR * xdrs,
89 int * ip)
91 #if INT_MAX < LONG_MAX
92 long l;
93 switch (xdrs->x_op)
95 case XDR_ENCODE:
96 l = (long) *ip;
97 return (XDR_PUTLONG (xdrs, &l));
99 case XDR_DECODE:
100 if (!XDR_GETLONG (xdrs, &l))
102 return FALSE;
104 *ip = (int) l;
105 return TRUE;
107 case XDR_FREE:
108 return TRUE;
110 return FALSE;
111 #elif INT_MAX == LONG_MAX
112 return xdr_long (xdrs, (long *) ip);
113 #else
114 # error Unexpected integer sizes in xdr_int()
115 #endif
119 * XDR unsigned integers
121 bool_t
122 xdr_u_int (XDR * xdrs,
123 u_int * up)
125 #if UINT_MAX < ULONG_MAX
126 u_long l;
127 switch (xdrs->x_op)
129 case XDR_ENCODE:
130 l = (u_long) * up;
131 return (XDR_PUTLONG (xdrs, (long *) &l));
133 case XDR_DECODE:
134 if (!XDR_GETLONG (xdrs, (long *) &l))
136 return FALSE;
138 *up = (u_int) (u_long) l;
139 return TRUE;
141 case XDR_FREE:
142 return TRUE;
144 return FALSE;
145 #elif UINT_MAX == ULONG_MAX
146 return xdr_u_long (xdrs, (u_long *) up);
147 #else
148 # error Unexpected integer sizes in xdr_int()
149 #endif
153 * XDR long integers
155 bool_t
156 xdr_long (XDR * xdrs,
157 long * lp)
159 if ((xdrs->x_op == XDR_ENCODE)
160 && ((sizeof (int32_t) == sizeof (long)) || ((int32_t) *lp == *lp)))
161 return XDR_PUTLONG (xdrs, lp);
163 if (xdrs->x_op == XDR_DECODE)
164 return XDR_GETLONG (xdrs, lp);
166 if (xdrs->x_op == XDR_FREE)
167 return TRUE;
169 return FALSE;
173 * XDR unsigned long integers
175 bool_t
176 xdr_u_long (XDR * xdrs,
177 u_long * ulp)
179 switch (xdrs->x_op)
181 case XDR_ENCODE:
182 if ((sizeof (uint32_t) != sizeof (u_long)) && ((uint32_t) *ulp != *ulp))
183 return FALSE;
184 return (XDR_PUTLONG (xdrs, (long *) ulp));
186 case XDR_DECODE:
188 long int tmp;
189 if (XDR_GETLONG (xdrs, &tmp) == FALSE)
190 return FALSE;
191 *ulp = (u_long) (uint32_t) tmp;
192 return TRUE;
195 case XDR_FREE:
196 return TRUE;
198 return FALSE;
203 * XDR 32-bit integers
205 bool_t
206 xdr_int32_t (XDR * xdrs,
207 int32_t * int32_p)
209 switch (xdrs->x_op)
211 case XDR_ENCODE:
212 return XDR_PUTINT32 (xdrs, int32_p);
214 case XDR_DECODE:
215 return XDR_GETINT32(xdrs, int32_p);
217 case XDR_FREE:
218 return TRUE;
220 return FALSE;
224 * XDR unsigned 32-bit integers
226 bool_t
227 xdr_u_int32_t (XDR * xdrs,
228 u_int32_t * u_int32_p)
230 switch (xdrs->x_op)
232 case XDR_ENCODE:
233 return XDR_PUTINT32 (xdrs, (int32_t *)u_int32_p);
235 case XDR_DECODE:
236 return XDR_GETINT32 (xdrs, (int32_t *)u_int32_p);
238 case XDR_FREE:
239 return TRUE;
241 return FALSE;
245 * XDR unsigned 32-bit integers
247 bool_t
248 xdr_uint32_t (XDR * xdrs,
249 uint32_t * uint32_p)
251 switch (xdrs->x_op)
253 case XDR_ENCODE:
254 return XDR_PUTINT32 (xdrs, (int32_t *)uint32_p);
256 case XDR_DECODE:
257 return XDR_GETINT32 (xdrs, (int32_t *)uint32_p);
259 case XDR_FREE:
260 return TRUE;
262 return FALSE;
266 * XDR short integers
268 bool_t
269 xdr_short (XDR * xdrs,
270 short * sp)
272 long l;
274 switch (xdrs->x_op)
276 case XDR_ENCODE:
277 l = (long) *sp;
278 return (XDR_PUTLONG (xdrs, &l));
280 case XDR_DECODE:
281 if (!XDR_GETLONG (xdrs, &l))
282 return FALSE;
283 *sp = (short) l;
284 return TRUE;
286 case XDR_FREE:
287 return TRUE;
289 return FALSE;
293 * XDR unsigned short integers
295 bool_t
296 xdr_u_short (XDR * xdrs,
297 u_short * usp)
299 long l;
301 switch (xdrs->x_op)
303 case XDR_ENCODE:
304 l = (u_long) * usp;
305 return XDR_PUTLONG (xdrs, &l);
307 case XDR_DECODE:
308 if (!XDR_GETLONG (xdrs, &l))
309 return FALSE;
310 *usp = (u_short) (u_long) l;
311 return TRUE;
313 case XDR_FREE:
314 return TRUE;
316 return FALSE;
321 * XDR 16-bit integers
323 bool_t
324 xdr_int16_t (XDR * xdrs,
325 int16_t * int16_p)
327 int32_t t;
329 switch (xdrs->x_op)
331 case XDR_ENCODE:
332 t = (int32_t) *int16_p;
333 return XDR_PUTINT32 (xdrs, &t);
335 case XDR_DECODE:
336 if (!XDR_GETINT32 (xdrs, &t))
337 return FALSE;
338 *int16_p = (int16_t) t;
339 return TRUE;
341 case XDR_FREE:
342 return TRUE;
344 return FALSE;
348 * XDR unsigned 16-bit integers
350 bool_t
351 xdr_u_int16_t (XDR * xdrs,
352 u_int16_t * u_int16_p)
354 uint32_t ut;
356 switch (xdrs->x_op)
358 case XDR_ENCODE:
359 ut = (uint32_t) *u_int16_p;
360 return XDR_PUTINT32 (xdrs, (int32_t *)&ut);
362 case XDR_DECODE:
363 if (!XDR_GETINT32 (xdrs, (int32_t *)&ut))
364 return FALSE;
365 *u_int16_p = (u_int16_t) ut;
366 return TRUE;
368 case XDR_FREE:
369 return TRUE;
371 return FALSE;
375 * XDR unsigned 16-bit integers
377 bool_t
378 xdr_uint16_t (XDR * xdrs,
379 uint16_t * uint16_p)
381 uint32_t ut;
383 switch (xdrs->x_op)
385 case XDR_ENCODE:
386 ut = (uint32_t) *uint16_p;
387 return XDR_PUTINT32 (xdrs, (int32_t *)&ut);
389 case XDR_DECODE:
390 if (!XDR_GETINT32 (xdrs, (int32_t *)&ut))
391 return FALSE;
392 *uint16_p = (uint16_t) ut;
393 return TRUE;
395 case XDR_FREE:
396 return TRUE;
398 return FALSE;
402 * XDR 8-bit integers
404 bool_t
405 xdr_int8_t (XDR * xdrs,
406 int8_t * int8_p)
408 int32_t t;
410 switch (xdrs->x_op)
412 case XDR_ENCODE:
413 t = (int32_t) *int8_p;
414 return XDR_PUTINT32 (xdrs, &t);
416 case XDR_DECODE:
417 if (!XDR_GETINT32 (xdrs, &t))
418 return FALSE;
419 *int8_p = (int8_t) t;
420 return TRUE;
422 case XDR_FREE:
423 return TRUE;
425 return FALSE;
429 * XDR unsigned 8-bit integers
431 bool_t
432 xdr_u_int8_t (XDR * xdrs,
433 u_int8_t * u_int8_p)
435 uint32_t ut;
437 switch (xdrs->x_op)
439 case XDR_ENCODE:
440 ut = (uint32_t) *u_int8_p;
441 return XDR_PUTINT32 (xdrs, (int32_t *)&ut);
443 case XDR_DECODE:
444 if (!XDR_GETINT32 (xdrs, (int32_t *)&ut))
445 return FALSE;
446 *u_int8_p = (u_int8_t) ut;
447 return TRUE;
449 case XDR_FREE:
450 return TRUE;
452 return FALSE;
456 * XDR unsigned 8-bit integers
458 bool_t
459 xdr_uint8_t (XDR * xdrs,
460 uint8_t * uint8_p)
462 uint32_t ut;
464 switch (xdrs->x_op)
466 case XDR_ENCODE:
467 ut = (uint32_t) *uint8_p;
468 return XDR_PUTINT32 (xdrs, (int32_t *)&ut);
470 case XDR_DECODE:
471 if (!XDR_GETINT32 (xdrs, (int32_t *)&ut))
472 return FALSE;
473 *uint8_p = (uint8_t) ut;
474 return TRUE;
476 case XDR_FREE:
477 return TRUE;
479 return FALSE;
485 * XDR a char
487 bool_t
488 xdr_char (XDR * xdrs,
489 char * cp)
491 int i;
493 i = (*cp);
494 if (!xdr_int (xdrs, &i))
495 return FALSE;
496 *cp = (char) i;
497 return TRUE;
501 * XDR an unsigned char
503 bool_t
504 xdr_u_char (XDR * xdrs,
505 u_char * ucp)
507 u_int u;
509 u = (*ucp);
510 if (!xdr_u_int (xdrs, &u))
511 return FALSE;
512 *ucp = (u_char) u;
513 return TRUE;
517 * XDR booleans
519 bool_t
520 xdr_bool (XDR * xdrs,
521 bool_t * bp)
523 long lb;
525 switch (xdrs->x_op)
527 case XDR_ENCODE:
528 lb = *bp ? XDR_TRUE : XDR_FALSE;
529 return XDR_PUTLONG (xdrs, &lb);
531 case XDR_DECODE:
532 if (!XDR_GETLONG (xdrs, &lb))
533 return FALSE;
534 *bp = (lb == XDR_FALSE) ? FALSE : TRUE;
535 return TRUE;
537 case XDR_FREE:
538 return TRUE;
540 return FALSE;
544 * XDR enumerations
546 bool_t
547 xdr_enum (XDR * xdrs,
548 enum_t * ep)
550 enum sizecheck
551 { SIZEVAL }; /* used to find the size of an enum */
554 * enums are treated as ints
556 /* LINTED */ if (sizeof (enum sizecheck) == 4)
558 #if INT_MAX < LONG_MAX
559 long l;
560 switch (xdrs->x_op)
562 case XDR_ENCODE:
563 l = (long) *ep;
564 return XDR_PUTLONG (xdrs, &l);
566 case XDR_DECODE:
567 if (!XDR_GETLONG (xdrs, &l))
568 return FALSE;
569 *ep = l;
570 case XDR_FREE:
571 return TRUE;
573 #else
574 return xdr_long (xdrs, (long *) (void *) ep);
575 #endif
577 else /* LINTED */ if (sizeof (enum sizecheck) == sizeof (short))
579 return (xdr_short (xdrs, (short *) (void *) ep));
581 return FALSE;
585 * XDR opaque data
586 * Allows the specification of a fixed size sequence of opaque bytes.
587 * cp points to the opaque object and cnt gives the byte length.
589 bool_t
590 xdr_opaque (XDR * xdrs,
591 caddr_t cp,
592 u_int cnt)
594 u_int rndup;
595 static char crud[BYTES_PER_XDR_UNIT];
598 * if no data we are done
600 if (cnt == 0)
601 return TRUE;
604 * round byte count to full xdr units
606 rndup = cnt % BYTES_PER_XDR_UNIT;
607 if (rndup > 0)
608 rndup = BYTES_PER_XDR_UNIT - rndup;
610 switch (xdrs->x_op)
612 case XDR_DECODE:
613 if (!XDR_GETBYTES (xdrs, cp, cnt))
614 return FALSE;
615 if (rndup == 0)
616 return TRUE;
617 return XDR_GETBYTES (xdrs, (caddr_t) crud, rndup);
619 case XDR_ENCODE:
620 if (!XDR_PUTBYTES (xdrs, cp, cnt))
621 return FALSE;
622 if (rndup == 0)
623 return TRUE;
624 return (XDR_PUTBYTES (xdrs, xdr_zero, rndup));
626 case XDR_FREE:
627 return TRUE;
629 return FALSE;
633 * XDR counted bytes
634 * *cpp is a pointer to the bytes, *sizep is the count.
635 * If *cpp is NULL maxsize bytes are allocated
637 bool_t
638 xdr_bytes (XDR * xdrs,
639 char ** cpp,
640 u_int * sizep,
641 u_int maxsize)
643 char *sp = *cpp; /* sp is the actual string pointer */
644 u_int nodesize;
647 * first deal with the length since xdr bytes are counted
649 if (!xdr_u_int (xdrs, sizep))
650 return FALSE;
652 nodesize = *sizep;
653 if ((nodesize > maxsize) && (xdrs->x_op != XDR_FREE))
654 return FALSE;
657 * now deal with the actual bytes
659 switch (xdrs->x_op)
661 case XDR_DECODE:
662 if (nodesize == 0)
663 return TRUE;
664 if (sp == NULL)
665 *cpp = sp = mem_alloc (nodesize);
666 if (sp == NULL)
668 xdr_warnx ("xdr_bytes: out of memory");
669 errno = ENOMEM;
670 return FALSE;
672 /* FALLTHROUGH */
674 case XDR_ENCODE:
675 return xdr_opaque (xdrs, sp, nodesize);
677 case XDR_FREE:
678 if (sp != NULL)
680 mem_free (sp, nodesize);
681 *cpp = NULL;
683 return TRUE;
685 return FALSE;
689 * Implemented here due to commonality of the object.
691 bool_t
692 xdr_netobj (XDR * xdrs,
693 struct netobj * np)
695 return (xdr_bytes (xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ));
699 * XDR a descriminated union
700 * Support routine for discriminated unions.
701 * You create an array of xdrdiscrim structures, terminated with
702 * an entry with a null procedure pointer. The routine gets
703 * the discriminant value and then searches the array of xdrdiscrims
704 * looking for that value. It calls the procedure given in the xdrdiscrim
705 * to handle the discriminant. If there is no specific routine a default
706 * routine may be called.
707 * If there is no specific or default routine an error is returned.
708 * dscmp: enum to decide which arm to work on
709 * unp: ptr to the union itself
710 * choices: ptr to array of [value, xdr proc] for each arm
711 * dfault: default xdr routine
713 bool_t
714 xdr_union (XDR * xdrs,
715 enum_t * dscmp,
716 char * unp,
717 const struct xdr_discrim * choices,
718 xdrproc_t dfault)
720 enum_t dscm;
723 * we deal with the discriminator; it's an enum
725 if (!xdr_enum (xdrs, dscmp))
726 return FALSE;
728 dscm = *dscmp;
731 * search choices for a value that matches the discriminator.
732 * if we find one, execute the xdr routine for that value.
734 for (; choices->proc != NULL_xdrproc_t; choices++)
736 if (choices->value == dscm)
737 return ((*(choices->proc)) (xdrs, unp, LASTUNSIGNED));
741 * no match - execute the default xdr routine if there is one
743 return ((dfault == NULL_xdrproc_t) ? FALSE : (*dfault) (xdrs, unp, LASTUNSIGNED));
748 * Non-portable xdr primitives.
749 * Care should be taken when moving these routines to new architectures.
754 * XDR null terminated ASCII strings
755 * xdr_string deals with "C strings" - arrays of bytes that are
756 * terminated by a NULL character. The parameter cpp references a
757 * pointer to storage; If the pointer is null, then the necessary
758 * storage is allocated. The last parameter is the max allowed length
759 * of the string as specified by a protocol.
761 bool_t
762 xdr_string (XDR * xdrs,
763 char ** cpp,
764 u_int maxsize)
766 char *sp = *cpp; /* sp is the actual string pointer */
767 u_int size;
768 u_int nodesize;
771 * first deal with the length since xdr strings are counted-strings
773 switch (xdrs->x_op)
775 case XDR_FREE:
776 if (sp == NULL)
777 return TRUE; /* already free */
779 /* FALLTHROUGH */
780 case XDR_ENCODE:
781 if (sp == NULL)
782 return FALSE;
784 size = strlen (sp);
785 break;
786 case XDR_DECODE:
787 break;
789 if (!xdr_u_int (xdrs, &size))
790 return FALSE;
792 if (size > maxsize)
793 return FALSE;
795 nodesize = size + 1;
796 if (nodesize == 0)
798 /* This means an overflow. It a bug in the caller which
799 * provided a too large maxsize but nevertheless catch it
800 * here.
802 return FALSE;
806 * now deal with the actual bytes
808 switch (xdrs->x_op)
811 case XDR_DECODE:
812 if (sp == NULL)
813 *cpp = sp = mem_alloc (nodesize);
814 if (sp == NULL)
816 xdr_warnx ("xdr_string: out of memory");
817 errno = ENOMEM;
818 return FALSE;
820 sp[size] = 0;
821 /* FALLTHROUGH */
823 case XDR_ENCODE:
824 return xdr_opaque (xdrs, sp, size);
826 case XDR_FREE:
827 mem_free (sp, nodesize);
828 *cpp = NULL;
829 return TRUE;
831 return FALSE;
835 * Wrapper for xdr_string that can be called directly from
836 * routines like clnt_call
838 bool_t
839 xdr_wrapstring (XDR * xdrs,
840 char ** cpp)
842 return xdr_string (xdrs, cpp, LASTUNSIGNED);
846 #if defined(___int64_t_defined)
848 * NOTE: xdr_hyper(), xdr_u_hyper(), xdr_longlong_t(), and xdr_u_longlong_t()
849 * are in the "non-portable" section because they require that a `long long'
850 * be a 64-bit type.
852 * --thorpej@netbsd.org, November 30, 1999
856 * XDR 64-bit integers
858 bool_t
859 xdr_int64_t (XDR * xdrs,
860 int64_t * llp)
862 int32_t t1, t2;
864 switch (xdrs->x_op)
866 case XDR_ENCODE:
867 t1 = (int32_t) ((*llp) >> 32);
868 t2 = (int32_t) (*llp);
869 return (XDR_PUTINT32 (xdrs, &t1) && XDR_PUTINT32 (xdrs, &t2));
871 case XDR_DECODE:
872 if (!XDR_GETINT32 (xdrs, &t1) || !XDR_GETINT32 (xdrs, &t2))
873 return FALSE;
874 *llp = ((int64_t) t1) << 32;
875 *llp |= (uint32_t) t2;
876 return TRUE;
878 case XDR_FREE:
879 return TRUE;
881 return FALSE;
886 * XDR unsigned 64-bit integers
888 bool_t
889 xdr_u_int64_t (XDR * xdrs,
890 u_int64_t * ullp)
892 uint32_t t1, t2;
894 switch (xdrs->x_op)
896 case XDR_ENCODE:
897 t1 = (uint32_t) ((*ullp) >> 32);
898 t2 = (uint32_t) (*ullp);
899 return (XDR_PUTINT32 (xdrs, (int32_t *)&t1) &&
900 XDR_PUTINT32 (xdrs, (int32_t *)&t2));
902 case XDR_DECODE:
903 if (!XDR_GETINT32 (xdrs, (int32_t *)&t1) ||
904 !XDR_GETINT32 (xdrs, (int32_t *)&t2))
905 return FALSE;
906 *ullp = ((u_int64_t) t1) << 32;
907 *ullp |= t2;
908 return TRUE;
910 case XDR_FREE:
911 return TRUE;
913 return FALSE;
917 * XDR unsigned 64-bit integers
919 bool_t
920 xdr_uint64_t (XDR * xdrs,
921 uint64_t * ullp)
923 uint32_t t1, t2;
925 switch (xdrs->x_op)
927 case XDR_ENCODE:
928 t1 = (uint32_t) ((*ullp) >> 32);
929 t2 = (uint32_t) (*ullp);
930 return (XDR_PUTINT32 (xdrs, (int32_t *)&t1) &&
931 XDR_PUTINT32 (xdrs, (int32_t *)&t2));
933 case XDR_DECODE:
934 if (!XDR_GETINT32 (xdrs, (int32_t *)&t1) ||
935 !XDR_GETINT32 (xdrs, (int32_t *)&t2))
936 return FALSE;
937 *ullp = ((uint64_t) t1) << 32;
938 *ullp |= t2;
939 return TRUE;
941 case XDR_FREE:
942 return TRUE;
944 return FALSE;
949 * XDR hypers
951 bool_t
952 xdr_hyper (XDR * xdrs,
953 quad_t * llp)
956 * Don't bother open-coding this; it's a fair amount of code. Just
957 * call xdr_int64_t().
959 return (xdr_int64_t (xdrs, (int64_t *) llp));
964 * XDR unsigned hypers
966 bool_t
967 xdr_u_hyper (XDR * xdrs,
968 u_quad_t * ullp)
971 * Don't bother open-coding this; it's a fair amount of code. Just
972 * call xdr_uint64_t().
974 return (xdr_uint64_t (xdrs, (uint64_t *) ullp));
979 * XDR longlong_t's
981 bool_t
982 xdr_longlong_t (XDR * xdrs,
983 quad_t * llp)
986 * Don't bother open-coding this; it's a fair amount of code. Just
987 * call xdr_int64_t().
989 return (xdr_int64_t (xdrs, (int64_t *) llp));
994 * XDR u_longlong_t's
996 bool_t
997 xdr_u_longlong_t (XDR * xdrs,
998 u_quad_t *ullp)
1001 * Don't bother open-coding this; it's a fair amount of code. Just
1002 * call xdr_u_int64_t().
1004 return (xdr_uint64_t (xdrs, (uint64_t *) ullp));
1007 #endif /* ___int64_t_defined */