home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume13 / rpc3.9 / part05 < prev    next >
SHell self-extracting ARchive  |  1988-02-27  |  60.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: SHell self-extracting ARchive (archive/shar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 53 75 62 6a 65 63 74 3a | 20 20 76 31 33 69 30 38 |Subject:| v13i08|
|00000010| 32 3a 20 20 53 75 6e 20 | 52 50 43 2c 20 72 65 6c |2: Sun |RPC, rel|
|00000020| 65 61 73 65 20 33 2e 39 | 2c 20 50 61 72 74 30 35 |ease 3.9|, Part05|
|00000030| 2f 31 35 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |/15.News|groups: |
|00000040| 63 6f 6d 70 2e 73 6f 75 | 72 63 65 73 2e 75 6e 69 |comp.sou|rces.uni|
|00000050| 78 0a 53 65 6e 64 65 72 | 3a 20 73 6f 75 72 63 65 |x.Sender|: source|
|00000060| 73 0a 41 70 70 72 6f 76 | 65 64 3a 20 72 73 61 6c |s.Approv|ed: rsal|
|00000070| 7a 40 75 75 6e 65 74 2e | 55 55 2e 4e 45 54 0a 0a |z@uunet.|UU.NET..|
|00000080| 53 75 62 6d 69 74 74 65 | 64 2d 62 79 3a 20 53 74 |Submitte|d-by: St|
|00000090| 65 70 68 65 6e 20 58 2e | 20 4e 61 68 6d 20 3c 73 |ephen X.| Nahm <s|
|000000a0| 78 6e 40 53 75 6e 2e 43 | 4f 4d 3e 0a 50 6f 73 74 |xn@Sun.C|OM>.Post|
|000000b0| 69 6e 67 2d 6e 75 6d 62 | 65 72 3a 20 56 6f 6c 75 |ing-numb|er: Volu|
|000000c0| 6d 65 20 31 33 2c 20 49 | 73 73 75 65 20 38 32 0a |me 13, I|ssue 82.|
|000000d0| 41 72 63 68 69 76 65 2d | 6e 61 6d 65 3a 20 72 70 |Archive-|name: rp|
|000000e0| 63 33 2e 39 2f 70 61 72 | 74 30 35 0a 0a 23 21 20 |c3.9/par|t05..#! |
|000000f0| 2f 62 69 6e 2f 73 68 0a | 23 20 54 68 69 73 20 69 |/bin/sh.|# This i|
|00000100| 73 20 61 20 73 68 65 6c | 6c 20 61 72 63 68 69 76 |s a shel|l archiv|
|00000110| 65 2e 20 54 6f 20 65 78 | 74 72 61 63 74 2c 20 72 |e. To ex|tract, r|
|00000120| 65 6d 6f 76 65 20 74 68 | 65 20 68 65 61 64 65 72 |emove th|e header|
|00000130| 20 61 6e 64 20 74 79 70 | 65 20 22 73 68 20 66 69 | and typ|e "sh fi|
|00000140| 6c 65 6e 61 6d 65 22 0a | 23 0a 63 64 20 72 70 63 |lename".|#.cd rpc|
|00000150| 0a 65 63 68 6f 20 78 20 | 2d 20 78 64 72 2e 63 0a |.echo x |- xdr.c.|
|00000160| 63 61 74 20 3e 20 78 64 | 72 2e 63 20 3c 3c 27 46 |cat > xd|r.c <<'F|
|00000170| 75 6e 6b 79 5f 53 74 75 | 66 66 27 0a 2f 2a 20 40 |unky_Stu|ff'./* @|
|00000180| 28 23 29 78 64 72 2e 63 | 09 31 2e 31 20 38 37 2f |(#)xdr.c|.1.1 87/|
|00000190| 31 31 2f 30 34 20 33 2e | 39 20 52 50 43 53 52 43 |11/04 3.|9 RPCSRC|
|000001a0| 20 2a 2f 0a 2f 2a 0a 20 | 2a 20 53 75 6e 20 52 50 | */./*. |* Sun RP|
|000001b0| 43 20 69 73 20 61 20 70 | 72 6f 64 75 63 74 20 6f |C is a p|roduct o|
|000001c0| 66 20 53 75 6e 20 4d 69 | 63 72 6f 73 79 73 74 65 |f Sun Mi|crosyste|
|000001d0| 6d 73 2c 20 49 6e 63 2e | 20 61 6e 64 20 69 73 20 |ms, Inc.| and is |
|000001e0| 70 72 6f 76 69 64 65 64 | 20 66 6f 72 0a 20 2a 20 |provided| for. * |
|000001f0| 75 6e 72 65 73 74 72 69 | 63 74 65 64 20 75 73 65 |unrestri|cted use|
|00000200| 20 70 72 6f 76 69 64 65 | 64 20 74 68 61 74 20 74 | provide|d that t|
|00000210| 68 69 73 20 6c 65 67 65 | 6e 64 20 69 73 20 69 6e |his lege|nd is in|
|00000220| 63 6c 75 64 65 64 20 6f | 6e 20 61 6c 6c 20 74 61 |cluded o|n all ta|
|00000230| 70 65 0a 20 2a 20 6d 65 | 64 69 61 20 61 6e 64 20 |pe. * me|dia and |
|00000240| 61 73 20 61 20 70 61 72 | 74 20 6f 66 20 74 68 65 |as a par|t of the|
|00000250| 20 73 6f 66 74 77 61 72 | 65 20 70 72 6f 67 72 61 | softwar|e progra|
|00000260| 6d 20 69 6e 20 77 68 6f | 6c 65 20 6f 72 20 70 61 |m in who|le or pa|
|00000270| 72 74 2e 20 20 55 73 65 | 72 73 0a 20 2a 20 6d 61 |rt. Use|rs. * ma|
|00000280| 79 20 63 6f 70 79 20 6f | 72 20 6d 6f 64 69 66 79 |y copy o|r modify|
|00000290| 20 53 75 6e 20 52 50 43 | 20 77 69 74 68 6f 75 74 | Sun RPC| without|
|000002a0| 20 63 68 61 72 67 65 2c | 20 62 75 74 20 61 72 65 | charge,| but are|
|000002b0| 20 6e 6f 74 20 61 75 74 | 68 6f 72 69 7a 65 64 0a | not aut|horized.|
|000002c0| 20 2a 20 74 6f 20 6c 69 | 63 65 6e 73 65 20 6f 72 | * to li|cense or|
|000002d0| 20 64 69 73 74 72 69 62 | 75 74 65 20 69 74 20 74 | distrib|ute it t|
|000002e0| 6f 20 61 6e 79 6f 6e 65 | 20 65 6c 73 65 20 65 78 |o anyone| else ex|
|000002f0| 63 65 70 74 20 61 73 20 | 70 61 72 74 20 6f 66 20 |cept as |part of |
|00000300| 61 20 70 72 6f 64 75 63 | 74 20 6f 72 0a 20 2a 20 |a produc|t or. * |
|00000310| 70 72 6f 67 72 61 6d 20 | 64 65 76 65 6c 6f 70 65 |program |develope|
|00000320| 64 20 62 79 20 74 68 65 | 20 75 73 65 72 2e 0a 20 |d by the| user.. |
|00000330| 2a 20 0a 20 2a 20 53 55 | 4e 20 52 50 43 20 49 53 |* . * SU|N RPC IS|
|00000340| 20 50 52 4f 56 49 44 45 | 44 20 41 53 20 49 53 20 | PROVIDE|D AS IS |
|00000350| 57 49 54 48 20 4e 4f 20 | 57 41 52 52 41 4e 54 49 |WITH NO |WARRANTI|
|00000360| 45 53 20 4f 46 20 41 4e | 59 20 4b 49 4e 44 20 49 |ES OF AN|Y KIND I|
|00000370| 4e 43 4c 55 44 49 4e 47 | 20 54 48 45 0a 20 2a 20 |NCLUDING| THE. * |
|00000380| 57 41 52 52 41 4e 54 49 | 45 53 20 4f 46 20 44 45 |WARRANTI|ES OF DE|
|00000390| 53 49 47 4e 2c 20 4d 45 | 52 43 48 41 4e 54 49 42 |SIGN, ME|RCHANTIB|
|000003a0| 49 4c 49 54 59 20 41 4e | 44 20 46 49 54 4e 45 53 |ILITY AN|D FITNES|
|000003b0| 53 20 46 4f 52 20 41 20 | 50 41 52 54 49 43 55 4c |S FOR A |PARTICUL|
|000003c0| 41 52 0a 20 2a 20 50 55 | 52 50 4f 53 45 2c 20 4f |AR. * PU|RPOSE, O|
|000003d0| 52 20 41 52 49 53 49 4e | 47 20 46 52 4f 4d 20 41 |R ARISIN|G FROM A|
|000003e0| 20 43 4f 55 52 53 45 20 | 4f 46 20 44 45 41 4c 49 | COURSE |OF DEALI|
|000003f0| 4e 47 2c 20 55 53 41 47 | 45 20 4f 52 20 54 52 41 |NG, USAG|E OR TRA|
|00000400| 44 45 20 50 52 41 43 54 | 49 43 45 2e 0a 20 2a 20 |DE PRACT|ICE.. * |
|00000410| 0a 20 2a 20 53 75 6e 20 | 52 50 43 20 69 73 20 70 |. * Sun |RPC is p|
|00000420| 72 6f 76 69 64 65 64 20 | 77 69 74 68 20 6e 6f 20 |rovided |with no |
|00000430| 73 75 70 70 6f 72 74 20 | 61 6e 64 20 77 69 74 68 |support |and with|
|00000440| 6f 75 74 20 61 6e 79 20 | 6f 62 6c 69 67 61 74 69 |out any |obligati|
|00000450| 6f 6e 20 6f 6e 20 74 68 | 65 0a 20 2a 20 70 61 72 |on on th|e. * par|
|00000460| 74 20 6f 66 20 53 75 6e | 20 4d 69 63 72 6f 73 79 |t of Sun| Microsy|
|00000470| 73 74 65 6d 73 2c 20 49 | 6e 63 2e 20 74 6f 20 61 |stems, I|nc. to a|
|00000480| 73 73 69 73 74 20 69 6e | 20 69 74 73 20 75 73 65 |ssist in| its use|
|00000490| 2c 20 63 6f 72 72 65 63 | 74 69 6f 6e 2c 0a 20 2a |, correc|tion,. *|
|000004a0| 20 6d 6f 64 69 66 69 63 | 61 74 69 6f 6e 20 6f 72 | modific|ation or|
|000004b0| 20 65 6e 68 61 6e 63 65 | 6d 65 6e 74 2e 0a 20 2a | enhance|ment.. *|
|000004c0| 20 0a 20 2a 20 53 55 4e | 20 4d 49 43 52 4f 53 59 | . * SUN| MICROSY|
|000004d0| 53 54 45 4d 53 2c 20 49 | 4e 43 2e 20 53 48 41 4c |STEMS, I|NC. SHAL|
|000004e0| 4c 20 48 41 56 45 20 4e | 4f 20 4c 49 41 42 49 4c |L HAVE N|O LIABIL|
|000004f0| 49 54 59 20 57 49 54 48 | 20 52 45 53 50 45 43 54 |ITY WITH| RESPECT|
|00000500| 20 54 4f 20 54 48 45 0a | 20 2a 20 49 4e 46 52 49 | TO THE.| * INFRI|
|00000510| 4e 47 45 4d 45 4e 54 20 | 4f 46 20 43 4f 50 59 52 |NGEMENT |OF COPYR|
|00000520| 49 47 48 54 53 2c 20 54 | 52 41 44 45 20 53 45 43 |IGHTS, T|RADE SEC|
|00000530| 52 45 54 53 20 4f 52 20 | 41 4e 59 20 50 41 54 45 |RETS OR |ANY PATE|
|00000540| 4e 54 53 20 42 59 20 53 | 55 4e 20 52 50 43 0a 20 |NTS BY S|UN RPC. |
|00000550| 2a 20 4f 52 20 41 4e 59 | 20 50 41 52 54 20 54 48 |* OR ANY| PART TH|
|00000560| 45 52 45 4f 46 2e 0a 20 | 2a 20 0a 20 2a 20 49 6e |EREOF.. |* . * In|
|00000570| 20 6e 6f 20 65 76 65 6e | 74 20 77 69 6c 6c 20 53 | no even|t will S|
|00000580| 75 6e 20 4d 69 63 72 6f | 73 79 73 74 65 6d 73 2c |un Micro|systems,|
|00000590| 20 49 6e 63 2e 20 62 65 | 20 6c 69 61 62 6c 65 20 | Inc. be| liable |
|000005a0| 66 6f 72 20 61 6e 79 20 | 6c 6f 73 74 20 72 65 76 |for any |lost rev|
|000005b0| 65 6e 75 65 0a 20 2a 20 | 6f 72 20 70 72 6f 66 69 |enue. * |or profi|
|000005c0| 74 73 20 6f 72 20 6f 74 | 68 65 72 20 73 70 65 63 |ts or ot|her spec|
|000005d0| 69 61 6c 2c 20 69 6e 64 | 69 72 65 63 74 20 61 6e |ial, ind|irect an|
|000005e0| 64 20 63 6f 6e 73 65 71 | 75 65 6e 74 69 61 6c 20 |d conseq|uential |
|000005f0| 64 61 6d 61 67 65 73 2c | 20 65 76 65 6e 20 69 66 |damages,| even if|
|00000600| 0a 20 2a 20 53 75 6e 20 | 68 61 73 20 62 65 65 6e |. * Sun |has been|
|00000610| 20 61 64 76 69 73 65 64 | 20 6f 66 20 74 68 65 20 | advised| of the |
|00000620| 70 6f 73 73 69 62 69 6c | 69 74 79 20 6f 66 20 73 |possibil|ity of s|
|00000630| 75 63 68 20 64 61 6d 61 | 67 65 73 2e 0a 20 2a 20 |uch dama|ges.. * |
|00000640| 0a 20 2a 20 53 75 6e 20 | 4d 69 63 72 6f 73 79 73 |. * Sun |Microsys|
|00000650| 74 65 6d 73 2c 20 49 6e | 63 2e 0a 20 2a 20 32 35 |tems, In|c.. * 25|
|00000660| 35 30 20 47 61 72 63 69 | 61 20 41 76 65 6e 75 65 |50 Garci|a Avenue|
|00000670| 0a 20 2a 20 4d 6f 75 6e | 74 61 69 6e 20 56 69 65 |. * Moun|tain Vie|
|00000680| 77 2c 20 43 61 6c 69 66 | 6f 72 6e 69 61 20 20 39 |w, Calif|ornia 9|
|00000690| 34 30 34 33 0a 20 2a 2f | 0a 23 69 66 20 21 64 65 |4043. */|.#if !de|
|000006a0| 66 69 6e 65 64 28 6c 69 | 6e 74 29 20 26 26 20 64 |fined(li|nt) && d|
|000006b0| 65 66 69 6e 65 64 28 53 | 43 43 53 49 44 53 29 0a |efined(S|CCSIDS).|
|000006c0| 73 74 61 74 69 63 20 63 | 68 61 72 20 73 63 63 73 |static c|har sccs|
|000006d0| 69 64 5b 5d 20 3d 20 22 | 40 28 23 29 78 64 72 2e |id[] = "|@(#)xdr.|
|000006e0| 63 20 31 2e 33 35 20 38 | 37 2f 30 38 2f 31 32 22 |c 1.35 8|7/08/12"|
|000006f0| 3b 0a 23 65 6e 64 69 66 | 0a 0a 2f 2a 0a 20 2a 20 |;.#endif|../*. * |
|00000700| 78 64 72 2e 63 2c 20 47 | 65 6e 65 72 69 63 20 58 |xdr.c, G|eneric X|
|00000710| 44 52 20 72 6f 75 74 69 | 6e 65 73 20 69 6d 70 6c |DR routi|nes impl|
|00000720| 65 6d 65 6e 74 61 74 69 | 6f 6e 2e 0a 20 2a 0a 20 |ementati|on.. *. |
|00000730| 2a 20 43 6f 70 79 72 69 | 67 68 74 20 28 43 29 20 |* Copyri|ght (C) |
|00000740| 31 39 38 36 2c 20 53 75 | 6e 20 4d 69 63 72 6f 73 |1986, Su|n Micros|
|00000750| 79 73 74 65 6d 73 2c 20 | 49 6e 63 2e 0a 20 2a 0a |ystems, |Inc.. *.|
|00000760| 20 2a 20 54 68 65 73 65 | 20 61 72 65 20 74 68 65 | * These| are the|
|00000770| 20 22 67 65 6e 65 72 69 | 63 22 20 78 64 72 20 72 | "generi|c" xdr r|
|00000780| 6f 75 74 69 6e 65 73 20 | 75 73 65 64 20 74 6f 20 |outines |used to |
|00000790| 73 65 72 69 61 6c 69 7a | 65 20 61 6e 64 20 64 65 |serializ|e and de|
|000007a0| 2d 73 65 72 69 61 6c 69 | 7a 65 0a 20 2a 20 6d 6f |-seriali|ze. * mo|
|000007b0| 73 74 20 63 6f 6d 6d 6f | 6e 20 64 61 74 61 20 69 |st commo|n data i|
|000007c0| 74 65 6d 73 2e 20 20 53 | 65 65 20 78 64 72 2e 68 |tems. S|ee xdr.h|
|000007d0| 20 66 6f 72 20 6d 6f 72 | 65 20 69 6e 66 6f 20 6f | for mor|e info o|
|000007e0| 6e 20 74 68 65 20 69 6e | 74 65 72 66 61 63 65 20 |n the in|terface |
|000007f0| 74 6f 0a 20 2a 20 78 64 | 72 2e 0a 20 2a 2f 0a 0a |to. * xd|r.. */..|
|00000800| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00000810| 68 3e 0a 63 68 61 72 20 | 2a 6d 61 6c 6c 6f 63 28 |h>.char |*malloc(|
|00000820| 29 3b 0a 0a 23 69 6e 63 | 6c 75 64 65 20 3c 72 70 |);..#inc|lude <rp|
|00000830| 63 2f 74 79 70 65 73 2e | 68 3e 0a 23 69 6e 63 6c |c/types.|h>.#incl|
|00000840| 75 64 65 20 3c 72 70 63 | 2f 78 64 72 2e 68 3e 0a |ude <rpc|/xdr.h>.|
|00000850| 0a 2f 2a 0a 20 2a 20 63 | 6f 6e 73 74 61 6e 74 73 |./*. * c|onstants|
|00000860| 20 73 70 65 63 69 66 69 | 63 20 74 6f 20 74 68 65 | specifi|c to the|
|00000870| 20 78 64 72 20 22 70 72 | 6f 74 6f 63 6f 6c 22 0a | xdr "pr|otocol".|
|00000880| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 58 44 52 5f | */.#def|ine XDR_|
|00000890| 46 41 4c 53 45 09 28 28 | 6c 6f 6e 67 29 20 30 29 |FALSE.((|long) 0)|
|000008a0| 0a 23 64 65 66 69 6e 65 | 20 58 44 52 5f 54 52 55 |.#define| XDR_TRU|
|000008b0| 45 09 28 28 6c 6f 6e 67 | 29 20 31 29 0a 23 64 65 |E.((long|) 1).#de|
|000008c0| 66 69 6e 65 20 4c 41 53 | 54 55 4e 53 49 47 4e 45 |fine LAS|TUNSIGNE|
|000008d0| 44 09 28 28 75 5f 69 6e | 74 29 20 30 2d 31 29 0a |D.((u_in|t) 0-1).|
|000008e0| 0a 2f 2a 0a 20 2a 20 66 | 6f 72 20 75 6e 69 74 20 |./*. * f|or unit |
|000008f0| 61 6c 69 67 6e 6d 65 6e | 74 0a 20 2a 2f 0a 73 74 |alignmen|t. */.st|
|00000900| 61 74 69 63 20 63 68 61 | 72 20 78 64 72 5f 7a 65 |atic cha|r xdr_ze|
|00000910| 72 6f 5b 42 59 54 45 53 | 5f 50 45 52 5f 58 44 52 |ro[BYTES|_PER_XDR|
|00000920| 5f 55 4e 49 54 5d 20 3d | 20 7b 20 30 2c 20 30 2c |_UNIT] =| { 0, 0,|
|00000930| 20 30 2c 20 30 20 7d 3b | 0a 0a 2f 2a 0a 20 2a 20 | 0, 0 };|../*. * |
|00000940| 46 72 65 65 20 61 20 64 | 61 74 61 20 73 74 72 75 |Free a d|ata stru|
|00000950| 63 74 75 72 65 20 75 73 | 69 6e 67 20 58 44 52 0a |cture us|ing XDR.|
|00000960| 20 2a 20 4e 6f 74 20 61 | 20 66 69 6c 74 65 72 2c | * Not a| filter,|
|00000970| 20 62 75 74 20 61 20 63 | 6f 6e 76 65 6e 69 65 6e | but a c|onvenien|
|00000980| 74 20 75 74 69 6c 69 74 | 79 20 6e 6f 6e 65 74 68 |t utilit|y noneth|
|00000990| 65 6c 65 73 73 0a 20 2a | 2f 0a 76 6f 69 64 0a 78 |eless. *|/.void.x|
|000009a0| 64 72 5f 66 72 65 65 28 | 70 72 6f 63 2c 20 6f 62 |dr_free(|proc, ob|
|000009b0| 6a 70 29 0a 09 78 64 72 | 70 72 6f 63 5f 74 20 70 |jp)..xdr|proc_t p|
|000009c0| 72 6f 63 3b 0a 09 63 68 | 61 72 20 2a 6f 62 6a 70 |roc;..ch|ar *objp|
|000009d0| 3b 0a 7b 0a 09 58 44 52 | 20 78 3b 0a 09 0a 09 78 |;.{..XDR| x;....x|
|000009e0| 2e 78 5f 6f 70 20 3d 20 | 58 44 52 5f 46 52 45 45 |.x_op = |XDR_FREE|
|000009f0| 3b 0a 09 28 2a 70 72 6f | 63 29 28 26 78 2c 20 6f |;..(*pro|c)(&x, o|
|00000a00| 62 6a 70 29 3b 0a 7d 0a | 0a 2f 2a 0a 20 2a 20 58 |bjp);.}.|./*. * X|
|00000a10| 44 52 20 6e 6f 74 68 69 | 6e 67 0a 20 2a 2f 0a 62 |DR nothi|ng. */.b|
|00000a20| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 76 6f 69 64 28 2f |ool_t.xd|r_void(/|
|00000a30| 2a 20 78 64 72 73 2c 20 | 61 64 64 72 20 2a 2f 29 |* xdrs, |addr */)|
|00000a40| 0a 09 2f 2a 20 58 44 52 | 20 2a 78 64 72 73 3b 20 |../* XDR| *xdrs; |
|00000a50| 2a 2f 0a 09 2f 2a 20 63 | 61 64 64 72 5f 74 20 61 |*/../* c|addr_t a|
|00000a60| 64 64 72 3b 20 2a 2f 0a | 7b 0a 0a 09 72 65 74 75 |ddr; */.|{...retu|
|00000a70| 72 6e 20 28 54 52 55 45 | 29 3b 0a 7d 0a 0a 2f 2a |rn (TRUE|);.}../*|
|00000a80| 0a 20 2a 20 58 44 52 20 | 69 6e 74 65 67 65 72 73 |. * XDR |integers|
|00000a90| 0a 20 2a 2f 0a 62 6f 6f | 6c 5f 74 0a 78 64 72 5f |. */.boo|l_t.xdr_|
|00000aa0| 69 6e 74 28 78 64 72 73 | 2c 20 69 70 29 0a 09 58 |int(xdrs|, ip)..X|
|00000ab0| 44 52 20 2a 78 64 72 73 | 3b 0a 09 69 6e 74 20 2a |DR *xdrs|;..int *|
|00000ac0| 69 70 3b 0a 7b 0a 0a 23 | 69 66 64 65 66 20 6c 69 |ip;.{..#|ifdef li|
|00000ad0| 6e 74 0a 09 28 76 6f 69 | 64 29 20 28 78 64 72 5f |nt..(voi|d) (xdr_|
|00000ae0| 73 68 6f 72 74 28 78 64 | 72 73 2c 20 28 73 68 6f |short(xd|rs, (sho|
|00000af0| 72 74 20 2a 29 69 70 29 | 29 3b 0a 09 72 65 74 75 |rt *)ip)|);..retu|
|00000b00| 72 6e 20 28 78 64 72 5f | 6c 6f 6e 67 28 78 64 72 |rn (xdr_|long(xdr|
|00000b10| 73 2c 20 28 6c 6f 6e 67 | 20 2a 29 69 70 29 29 3b |s, (long| *)ip));|
|00000b20| 0a 23 65 6c 73 65 0a 09 | 69 66 20 28 73 69 7a 65 |.#else..|if (size|
|00000b30| 6f 66 20 28 69 6e 74 29 | 20 3d 3d 20 73 69 7a 65 |of (int)| == size|
|00000b40| 6f 66 20 28 6c 6f 6e 67 | 29 29 20 7b 0a 09 09 72 |of (long|)) {...r|
|00000b50| 65 74 75 72 6e 20 28 78 | 64 72 5f 6c 6f 6e 67 28 |eturn (x|dr_long(|
|00000b60| 78 64 72 73 2c 20 28 6c | 6f 6e 67 20 2a 29 69 70 |xdrs, (l|ong *)ip|
|00000b70| 29 29 3b 0a 09 7d 20 65 | 6c 73 65 20 7b 0a 09 09 |));..} e|lse {...|
|00000b80| 72 65 74 75 72 6e 20 28 | 78 64 72 5f 73 68 6f 72 |return (|xdr_shor|
|00000b90| 74 28 78 64 72 73 2c 20 | 28 73 68 6f 72 74 20 2a |t(xdrs, |(short *|
|00000ba0| 29 69 70 29 29 3b 0a 09 | 7d 0a 23 65 6e 64 69 66 |)ip));..|}.#endif|
|00000bb0| 0a 7d 0a 0a 2f 2a 0a 20 | 2a 20 58 44 52 20 75 6e |.}../*. |* XDR un|
|00000bc0| 73 69 67 6e 65 64 20 69 | 6e 74 65 67 65 72 73 0a |signed i|ntegers.|
|00000bd0| 20 2a 2f 0a 62 6f 6f 6c | 5f 74 0a 78 64 72 5f 75 | */.bool|_t.xdr_u|
|00000be0| 5f 69 6e 74 28 78 64 72 | 73 2c 20 75 70 29 0a 09 |_int(xdr|s, up)..|
|00000bf0| 58 44 52 20 2a 78 64 72 | 73 3b 0a 09 75 5f 69 6e |XDR *xdr|s;..u_in|
|00000c00| 74 20 2a 75 70 3b 0a 7b | 0a 0a 23 69 66 64 65 66 |t *up;.{|..#ifdef|
|00000c10| 20 6c 69 6e 74 0a 09 28 | 76 6f 69 64 29 20 28 78 | lint..(|void) (x|
|00000c20| 64 72 5f 73 68 6f 72 74 | 28 78 64 72 73 2c 20 28 |dr_short|(xdrs, (|
|00000c30| 73 68 6f 72 74 20 2a 29 | 75 70 29 29 3b 0a 09 72 |short *)|up));..r|
|00000c40| 65 74 75 72 6e 20 28 78 | 64 72 5f 75 5f 6c 6f 6e |eturn (x|dr_u_lon|
|00000c50| 67 28 78 64 72 73 2c 20 | 28 75 5f 6c 6f 6e 67 20 |g(xdrs, |(u_long |
|00000c60| 2a 29 75 70 29 29 3b 0a | 23 65 6c 73 65 0a 09 69 |*)up));.|#else..i|
|00000c70| 66 20 28 73 69 7a 65 6f | 66 20 28 75 5f 69 6e 74 |f (sizeo|f (u_int|
|00000c80| 29 20 3d 3d 20 73 69 7a | 65 6f 66 20 28 75 5f 6c |) == siz|eof (u_l|
|00000c90| 6f 6e 67 29 29 20 7b 0a | 09 09 72 65 74 75 72 6e |ong)) {.|..return|
|00000ca0| 20 28 78 64 72 5f 75 5f | 6c 6f 6e 67 28 78 64 72 | (xdr_u_|long(xdr|
|00000cb0| 73 2c 20 28 75 5f 6c 6f | 6e 67 20 2a 29 75 70 29 |s, (u_lo|ng *)up)|
|00000cc0| 29 3b 0a 09 7d 20 65 6c | 73 65 20 7b 0a 09 09 72 |);..} el|se {...r|
|00000cd0| 65 74 75 72 6e 20 28 78 | 64 72 5f 73 68 6f 72 74 |eturn (x|dr_short|
|00000ce0| 28 78 64 72 73 2c 20 28 | 73 68 6f 72 74 20 2a 29 |(xdrs, (|short *)|
|00000cf0| 75 70 29 29 3b 0a 09 7d | 0a 23 65 6e 64 69 66 0a |up));..}|.#endif.|
|00000d00| 7d 0a 0a 2f 2a 0a 20 2a | 20 58 44 52 20 6c 6f 6e |}../*. *| XDR lon|
|00000d10| 67 20 69 6e 74 65 67 65 | 72 73 0a 20 2a 20 73 61 |g intege|rs. * sa|
|00000d20| 6d 65 20 61 73 20 78 64 | 72 5f 75 5f 6c 6f 6e 67 |me as xd|r_u_long|
|00000d30| 20 2d 20 6f 70 65 6e 20 | 63 6f 64 65 64 20 74 6f | - open |coded to|
|00000d40| 20 73 61 76 65 20 61 20 | 70 72 6f 63 20 63 61 6c | save a |proc cal|
|00000d50| 6c 21 0a 20 2a 2f 0a 62 | 6f 6f 6c 5f 74 0a 78 64 |l!. */.b|ool_t.xd|
|00000d60| 72 5f 6c 6f 6e 67 28 78 | 64 72 73 2c 20 6c 70 29 |r_long(x|drs, lp)|
|00000d70| 0a 09 72 65 67 69 73 74 | 65 72 20 58 44 52 20 2a |..regist|er XDR *|
|00000d80| 78 64 72 73 3b 0a 09 6c | 6f 6e 67 20 2a 6c 70 3b |xdrs;..l|ong *lp;|
|00000d90| 0a 7b 0a 0a 09 69 66 20 | 28 78 64 72 73 2d 3e 78 |.{...if |(xdrs->x|
|00000da0| 5f 6f 70 20 3d 3d 20 58 | 44 52 5f 45 4e 43 4f 44 |_op == X|DR_ENCOD|
|00000db0| 45 29 0a 09 09 72 65 74 | 75 72 6e 20 28 58 44 52 |E)...ret|urn (XDR|
|00000dc0| 5f 50 55 54 4c 4f 4e 47 | 28 78 64 72 73 2c 20 6c |_PUTLONG|(xdrs, l|
|00000dd0| 70 29 29 3b 0a 0a 09 69 | 66 20 28 78 64 72 73 2d |p));...i|f (xdrs-|
|00000de0| 3e 78 5f 6f 70 20 3d 3d | 20 58 44 52 5f 44 45 43 |>x_op ==| XDR_DEC|
|00000df0| 4f 44 45 29 0a 09 09 72 | 65 74 75 72 6e 20 28 58 |ODE)...r|eturn (X|
|00000e00| 44 52 5f 47 45 54 4c 4f | 4e 47 28 78 64 72 73 2c |DR_GETLO|NG(xdrs,|
|00000e10| 20 6c 70 29 29 3b 0a 0a | 09 69 66 20 28 78 64 72 | lp));..|.if (xdr|
|00000e20| 73 2d 3e 78 5f 6f 70 20 | 3d 3d 20 58 44 52 5f 46 |s->x_op |== XDR_F|
|00000e30| 52 45 45 29 0a 09 09 72 | 65 74 75 72 6e 20 28 54 |REE)...r|eturn (T|
|00000e40| 52 55 45 29 3b 0a 0a 09 | 72 65 74 75 72 6e 20 28 |RUE);...|return (|
|00000e50| 46 41 4c 53 45 29 3b 0a | 7d 0a 0a 2f 2a 0a 20 2a |FALSE);.|}../*. *|
|00000e60| 20 58 44 52 20 75 6e 73 | 69 67 6e 65 64 20 6c 6f | XDR uns|igned lo|
|00000e70| 6e 67 20 69 6e 74 65 67 | 65 72 73 0a 20 2a 20 73 |ng integ|ers. * s|
|00000e80| 61 6d 65 20 61 73 20 78 | 64 72 5f 6c 6f 6e 67 20 |ame as x|dr_long |
|00000e90| 2d 20 6f 70 65 6e 20 63 | 6f 64 65 64 20 74 6f 20 |- open c|oded to |
|00000ea0| 73 61 76 65 20 61 20 70 | 72 6f 63 20 63 61 6c 6c |save a p|roc call|
|00000eb0| 21 0a 20 2a 2f 0a 62 6f | 6f 6c 5f 74 0a 78 64 72 |!. */.bo|ol_t.xdr|
|00000ec0| 5f 75 5f 6c 6f 6e 67 28 | 78 64 72 73 2c 20 75 6c |_u_long(|xdrs, ul|
|00000ed0| 70 29 0a 09 72 65 67 69 | 73 74 65 72 20 58 44 52 |p)..regi|ster XDR|
|00000ee0| 20 2a 78 64 72 73 3b 0a | 09 75 5f 6c 6f 6e 67 20 | *xdrs;.|.u_long |
|00000ef0| 2a 75 6c 70 3b 0a 7b 0a | 0a 09 69 66 20 28 78 64 |*ulp;.{.|..if (xd|
|00000f00| 72 73 2d 3e 78 5f 6f 70 | 20 3d 3d 20 58 44 52 5f |rs->x_op| == XDR_|
|00000f10| 44 45 43 4f 44 45 29 0a | 09 09 72 65 74 75 72 6e |DECODE).|..return|
|00000f20| 20 28 58 44 52 5f 47 45 | 54 4c 4f 4e 47 28 78 64 | (XDR_GE|TLONG(xd|
|00000f30| 72 73 2c 20 28 6c 6f 6e | 67 20 2a 29 75 6c 70 29 |rs, (lon|g *)ulp)|
|00000f40| 29 3b 0a 09 69 66 20 28 | 78 64 72 73 2d 3e 78 5f |);..if (|xdrs->x_|
|00000f50| 6f 70 20 3d 3d 20 58 44 | 52 5f 45 4e 43 4f 44 45 |op == XD|R_ENCODE|
|00000f60| 29 0a 09 09 72 65 74 75 | 72 6e 20 28 58 44 52 5f |)...retu|rn (XDR_|
|00000f70| 50 55 54 4c 4f 4e 47 28 | 78 64 72 73 2c 20 28 6c |PUTLONG(|xdrs, (l|
|00000f80| 6f 6e 67 20 2a 29 75 6c | 70 29 29 3b 0a 09 69 66 |ong *)ul|p));..if|
|00000f90| 20 28 78 64 72 73 2d 3e | 78 5f 6f 70 20 3d 3d 20 | (xdrs->|x_op == |
|00000fa0| 58 44 52 5f 46 52 45 45 | 29 0a 09 09 72 65 74 75 |XDR_FREE|)...retu|
|00000fb0| 72 6e 20 28 54 52 55 45 | 29 3b 0a 09 72 65 74 75 |rn (TRUE|);..retu|
|00000fc0| 72 6e 20 28 46 41 4c 53 | 45 29 3b 0a 7d 0a 0a 2f |rn (FALS|E);.}../|
|00000fd0| 2a 0a 20 2a 20 58 44 52 | 20 73 68 6f 72 74 20 69 |*. * XDR| short i|
|00000fe0| 6e 74 65 67 65 72 73 0a | 20 2a 2f 0a 62 6f 6f 6c |ntegers.| */.bool|
|00000ff0| 5f 74 0a 78 64 72 5f 73 | 68 6f 72 74 28 78 64 72 |_t.xdr_s|hort(xdr|
|00001000| 73 2c 20 73 70 29 0a 09 | 72 65 67 69 73 74 65 72 |s, sp)..|register|
|00001010| 20 58 44 52 20 2a 78 64 | 72 73 3b 0a 09 73 68 6f | XDR *xd|rs;..sho|
|00001020| 72 74 20 2a 73 70 3b 0a | 7b 0a 09 6c 6f 6e 67 20 |rt *sp;.|{..long |
|00001030| 6c 3b 0a 0a 09 73 77 69 | 74 63 68 20 28 78 64 72 |l;...swi|tch (xdr|
|00001040| 73 2d 3e 78 5f 6f 70 29 | 20 7b 0a 0a 09 63 61 73 |s->x_op)| {...cas|
|00001050| 65 20 58 44 52 5f 45 4e | 43 4f 44 45 3a 0a 09 09 |e XDR_EN|CODE:...|
|00001060| 6c 20 3d 20 28 6c 6f 6e | 67 29 20 2a 73 70 3b 0a |l = (lon|g) *sp;.|
|00001070| 09 09 72 65 74 75 72 6e | 20 28 58 44 52 5f 50 55 |..return| (XDR_PU|
|00001080| 54 4c 4f 4e 47 28 78 64 | 72 73 2c 20 26 6c 29 29 |TLONG(xd|rs, &l))|
|00001090| 3b 0a 0a 09 63 61 73 65 | 20 58 44 52 5f 44 45 43 |;...case| XDR_DEC|
|000010a0| 4f 44 45 3a 0a 09 09 69 | 66 20 28 21 58 44 52 5f |ODE:...i|f (!XDR_|
|000010b0| 47 45 54 4c 4f 4e 47 28 | 78 64 72 73 2c 20 26 6c |GETLONG(|xdrs, &l|
|000010c0| 29 29 20 7b 0a 09 09 09 | 72 65 74 75 72 6e 20 28 |)) {....|return (|
|000010d0| 46 41 4c 53 45 29 3b 0a | 09 09 7d 0a 09 09 2a 73 |FALSE);.|..}...*s|
|000010e0| 70 20 3d 20 28 73 68 6f | 72 74 29 20 6c 3b 0a 09 |p = (sho|rt) l;..|
|000010f0| 09 72 65 74 75 72 6e 20 | 28 54 52 55 45 29 3b 0a |.return |(TRUE);.|
|00001100| 0a 09 63 61 73 65 20 58 | 44 52 5f 46 52 45 45 3a |..case X|DR_FREE:|
|00001110| 0a 09 09 72 65 74 75 72 | 6e 20 28 54 52 55 45 29 |...retur|n (TRUE)|
|00001120| 3b 0a 09 7d 0a 09 72 65 | 74 75 72 6e 20 28 46 41 |;..}..re|turn (FA|
|00001130| 4c 53 45 29 3b 0a 7d 0a | 0a 2f 2a 0a 20 2a 20 58 |LSE);.}.|./*. * X|
|00001140| 44 52 20 75 6e 73 69 67 | 6e 65 64 20 73 68 6f 72 |DR unsig|ned shor|
|00001150| 74 20 69 6e 74 65 67 65 | 72 73 0a 20 2a 2f 0a 62 |t intege|rs. */.b|
|00001160| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 75 5f 73 68 6f 72 |ool_t.xd|r_u_shor|
|00001170| 74 28 78 64 72 73 2c 20 | 75 73 70 29 0a 09 72 65 |t(xdrs, |usp)..re|
|00001180| 67 69 73 74 65 72 20 58 | 44 52 20 2a 78 64 72 73 |gister X|DR *xdrs|
|00001190| 3b 0a 09 75 5f 73 68 6f | 72 74 20 2a 75 73 70 3b |;..u_sho|rt *usp;|
|000011a0| 0a 7b 0a 09 75 5f 6c 6f | 6e 67 20 6c 3b 0a 0a 09 |.{..u_lo|ng l;...|
|000011b0| 73 77 69 74 63 68 20 28 | 78 64 72 73 2d 3e 78 5f |switch (|xdrs->x_|
|000011c0| 6f 70 29 20 7b 0a 0a 09 | 63 61 73 65 20 58 44 52 |op) {...|case XDR|
|000011d0| 5f 45 4e 43 4f 44 45 3a | 0a 09 09 6c 20 3d 20 28 |_ENCODE:|...l = (|
|000011e0| 75 5f 6c 6f 6e 67 29 20 | 2a 75 73 70 3b 0a 09 09 |u_long) |*usp;...|
|000011f0| 72 65 74 75 72 6e 20 28 | 58 44 52 5f 50 55 54 4c |return (|XDR_PUTL|
|00001200| 4f 4e 47 28 78 64 72 73 | 2c 20 26 6c 29 29 3b 0a |ONG(xdrs|, &l));.|
|00001210| 0a 09 63 61 73 65 20 58 | 44 52 5f 44 45 43 4f 44 |..case X|DR_DECOD|
|00001220| 45 3a 0a 09 09 69 66 20 | 28 21 58 44 52 5f 47 45 |E:...if |(!XDR_GE|
|00001230| 54 4c 4f 4e 47 28 78 64 | 72 73 2c 20 26 6c 29 29 |TLONG(xd|rs, &l))|
|00001240| 20 7b 0a 09 09 09 72 65 | 74 75 72 6e 20 28 46 41 | {....re|turn (FA|
|00001250| 4c 53 45 29 3b 0a 09 09 | 7d 0a 09 09 2a 75 73 70 |LSE);...|}...*usp|
|00001260| 20 3d 20 28 75 5f 73 68 | 6f 72 74 29 20 6c 3b 0a | = (u_sh|ort) l;.|
|00001270| 09 09 72 65 74 75 72 6e | 20 28 54 52 55 45 29 3b |..return| (TRUE);|
|00001280| 0a 0a 09 63 61 73 65 20 | 58 44 52 5f 46 52 45 45 |...case |XDR_FREE|
|00001290| 3a 0a 09 09 72 65 74 75 | 72 6e 20 28 54 52 55 45 |:...retu|rn (TRUE|
|000012a0| 29 3b 0a 09 7d 0a 09 72 | 65 74 75 72 6e 20 28 46 |);..}..r|eturn (F|
|000012b0| 41 4c 53 45 29 3b 0a 7d | 0a 0a 0a 2f 2a 0a 20 2a |ALSE);.}|.../*. *|
|000012c0| 20 58 44 52 20 61 20 63 | 68 61 72 0a 20 2a 2f 0a | XDR a c|har. */.|
|000012d0| 62 6f 6f 6c 5f 74 0a 78 | 64 72 5f 63 68 61 72 28 |bool_t.x|dr_char(|
|000012e0| 78 64 72 73 2c 20 63 70 | 29 0a 09 58 44 52 20 2a |xdrs, cp|)..XDR *|
|000012f0| 78 64 72 73 3b 0a 09 63 | 68 61 72 20 2a 63 70 3b |xdrs;..c|har *cp;|
|00001300| 0a 7b 0a 09 69 6e 74 20 | 69 3b 0a 0a 09 69 20 3d |.{..int |i;...i =|
|00001310| 20 28 2a 63 70 29 3b 0a | 09 69 66 20 28 21 78 64 | (*cp);.|.if (!xd|
|00001320| 72 5f 69 6e 74 28 78 64 | 72 73 2c 20 26 69 29 29 |r_int(xd|rs, &i))|
|00001330| 20 7b 0a 09 09 72 65 74 | 75 72 6e 20 28 46 41 4c | {...ret|urn (FAL|
|00001340| 53 45 29 3b 0a 09 7d 0a | 09 2a 63 70 20 3d 20 69 |SE);..}.|.*cp = i|
|00001350| 3b 0a 09 72 65 74 75 72 | 6e 20 28 54 52 55 45 29 |;..retur|n (TRUE)|
|00001360| 3b 0a 7d 0a 0a 2f 2a 0a | 20 2a 20 58 44 52 20 61 |;.}../*.| * XDR a|
|00001370| 6e 20 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 0a |n unsign|ed char.|
|00001380| 20 2a 2f 0a 62 6f 6f 6c | 5f 74 0a 78 64 72 5f 75 | */.bool|_t.xdr_u|
|00001390| 5f 63 68 61 72 28 78 64 | 72 73 2c 20 63 70 29 0a |_char(xd|rs, cp).|
|000013a0| 09 58 44 52 20 2a 78 64 | 72 73 3b 0a 09 63 68 61 |.XDR *xd|rs;..cha|
|000013b0| 72 20 2a 63 70 3b 0a 7b | 0a 09 75 5f 69 6e 74 20 |r *cp;.{|..u_int |
|000013c0| 75 3b 0a 0a 09 75 20 3d | 20 28 2a 63 70 29 3b 0a |u;...u =| (*cp);.|
|000013d0| 09 69 66 20 28 21 78 64 | 72 5f 75 5f 69 6e 74 28 |.if (!xd|r_u_int(|
|000013e0| 78 64 72 73 2c 20 26 75 | 29 29 20 7b 0a 09 09 72 |xdrs, &u|)) {...r|
|000013f0| 65 74 75 72 6e 20 28 46 | 41 4c 53 45 29 3b 0a 09 |eturn (F|ALSE);..|
|00001400| 7d 0a 09 2a 63 70 20 3d | 20 75 3b 0a 09 72 65 74 |}..*cp =| u;..ret|
|00001410| 75 72 6e 20 28 54 52 55 | 45 29 3b 0a 7d 0a 0a 2f |urn (TRU|E);.}../|
|00001420| 2a 0a 20 2a 20 58 44 52 | 20 62 6f 6f 6c 65 61 6e |*. * XDR| boolean|
|00001430| 73 0a 20 2a 2f 0a 62 6f | 6f 6c 5f 74 0a 78 64 72 |s. */.bo|ol_t.xdr|
|00001440| 5f 62 6f 6f 6c 28 78 64 | 72 73 2c 20 62 70 29 0a |_bool(xd|rs, bp).|
|00001450| 09 72 65 67 69 73 74 65 | 72 20 58 44 52 20 2a 78 |.registe|r XDR *x|
|00001460| 64 72 73 3b 0a 09 62 6f | 6f 6c 5f 74 20 2a 62 70 |drs;..bo|ol_t *bp|
|00001470| 3b 0a 7b 0a 09 6c 6f 6e | 67 20 6c 62 3b 0a 0a 09 |;.{..lon|g lb;...|
|00001480| 73 77 69 74 63 68 20 28 | 78 64 72 73 2d 3e 78 5f |switch (|xdrs->x_|
|00001490| 6f 70 29 20 7b 0a 0a 09 | 63 61 73 65 20 58 44 52 |op) {...|case XDR|
|000014a0| 5f 45 4e 43 4f 44 45 3a | 0a 09 09 6c 62 20 3d 20 |_ENCODE:|...lb = |
|000014b0| 2a 62 70 20 3f 20 58 44 | 52 5f 54 52 55 45 20 3a |*bp ? XD|R_TRUE :|
|000014c0| 20 58 44 52 5f 46 41 4c | 53 45 3b 0a 09 09 72 65 | XDR_FAL|SE;...re|
|000014d0| 74 75 72 6e 20 28 58 44 | 52 5f 50 55 54 4c 4f 4e |turn (XD|R_PUTLON|
|000014e0| 47 28 78 64 72 73 2c 20 | 26 6c 62 29 29 3b 0a 0a |G(xdrs, |&lb));..|
|000014f0| 09 63 61 73 65 20 58 44 | 52 5f 44 45 43 4f 44 45 |.case XD|R_DECODE|
|00001500| 3a 0a 09 09 69 66 20 28 | 21 58 44 52 5f 47 45 54 |:...if (|!XDR_GET|
|00001510| 4c 4f 4e 47 28 78 64 72 | 73 2c 20 26 6c 62 29 29 |LONG(xdr|s, &lb))|
|00001520| 20 7b 0a 09 09 09 72 65 | 74 75 72 6e 20 28 46 41 | {....re|turn (FA|
|00001530| 4c 53 45 29 3b 0a 09 09 | 7d 0a 09 09 2a 62 70 20 |LSE);...|}...*bp |
|00001540| 3d 20 28 6c 62 20 3d 3d | 20 58 44 52 5f 46 41 4c |= (lb ==| XDR_FAL|
|00001550| 53 45 29 20 3f 20 46 41 | 4c 53 45 20 3a 20 54 52 |SE) ? FA|LSE : TR|
|00001560| 55 45 3b 0a 09 09 72 65 | 74 75 72 6e 20 28 54 52 |UE;...re|turn (TR|
|00001570| 55 45 29 3b 0a 0a 09 63 | 61 73 65 20 58 44 52 5f |UE);...c|ase XDR_|
|00001580| 46 52 45 45 3a 0a 09 09 | 72 65 74 75 72 6e 20 28 |FREE:...|return (|
|00001590| 54 52 55 45 29 3b 0a 09 | 7d 0a 09 72 65 74 75 72 |TRUE);..|}..retur|
|000015a0| 6e 20 28 46 41 4c 53 45 | 29 3b 0a 7d 0a 0a 2f 2a |n (FALSE|);.}../*|
|000015b0| 0a 20 2a 20 58 44 52 20 | 65 6e 75 6d 65 72 61 74 |. * XDR |enumerat|
|000015c0| 69 6f 6e 73 0a 20 2a 2f | 0a 62 6f 6f 6c 5f 74 0a |ions. */|.bool_t.|
|000015d0| 78 64 72 5f 65 6e 75 6d | 28 78 64 72 73 2c 20 65 |xdr_enum|(xdrs, e|
|000015e0| 70 29 0a 09 58 44 52 20 | 2a 78 64 72 73 3b 0a 09 |p)..XDR |*xdrs;..|
|000015f0| 65 6e 75 6d 5f 74 20 2a | 65 70 3b 0a 7b 0a 23 69 |enum_t *|ep;.{.#i|
|00001600| 66 6e 64 65 66 20 6c 69 | 6e 74 0a 09 65 6e 75 6d |fndef li|nt..enum|
|00001610| 20 73 69 7a 65 63 68 65 | 63 6b 20 7b 20 53 49 5a | sizeche|ck { SIZ|
|00001620| 45 56 41 4c 20 7d 3b 09 | 2f 2a 20 75 73 65 64 20 |EVAL };.|/* used |
|00001630| 74 6f 20 66 69 6e 64 20 | 74 68 65 20 73 69 7a 65 |to find |the size|
|00001640| 20 6f 66 20 61 6e 20 65 | 6e 75 6d 20 2a 2f 0a 0a | of an e|num */..|
|00001650| 09 2f 2a 0a 09 20 2a 20 | 65 6e 75 6d 73 20 61 72 |./*.. * |enums ar|
|00001660| 65 20 74 72 65 61 74 65 | 64 20 61 73 20 69 6e 74 |e treate|d as int|
|00001670| 73 0a 09 20 2a 2f 0a 09 | 69 66 20 28 73 69 7a 65 |s.. */..|if (size|
|00001680| 6f 66 20 28 65 6e 75 6d | 20 73 69 7a 65 63 68 65 |of (enum| sizeche|
|00001690| 63 6b 29 20 3d 3d 20 73 | 69 7a 65 6f 66 20 28 6c |ck) == s|izeof (l|
|000016a0| 6f 6e 67 29 29 20 7b 0a | 09 09 72 65 74 75 72 6e |ong)) {.|..return|
|000016b0| 20 28 78 64 72 5f 6c 6f | 6e 67 28 78 64 72 73 2c | (xdr_lo|ng(xdrs,|
|000016c0| 20 28 6c 6f 6e 67 20 2a | 29 65 70 29 29 3b 0a 09 | (long *|)ep));..|
|000016d0| 7d 20 65 6c 73 65 20 69 | 66 20 28 73 69 7a 65 6f |} else i|f (sizeo|
|000016e0| 66 20 28 65 6e 75 6d 20 | 73 69 7a 65 63 68 65 63 |f (enum |sizechec|
|000016f0| 6b 29 20 3d 3d 20 73 69 | 7a 65 6f 66 20 28 73 68 |k) == si|zeof (sh|
|00001700| 6f 72 74 29 29 20 7b 0a | 09 09 72 65 74 75 72 6e |ort)) {.|..return|
|00001710| 20 28 78 64 72 5f 73 68 | 6f 72 74 28 78 64 72 73 | (xdr_sh|ort(xdrs|
|00001720| 2c 20 28 73 68 6f 72 74 | 20 2a 29 65 70 29 29 3b |, (short| *)ep));|
|00001730| 0a 09 7d 20 65 6c 73 65 | 20 7b 0a 09 09 72 65 74 |..} else| {...ret|
|00001740| 75 72 6e 20 28 46 41 4c | 53 45 29 3b 0a 09 7d 0a |urn (FAL|SE);..}.|
|00001750| 23 65 6c 73 65 0a 09 28 | 76 6f 69 64 29 20 28 78 |#else..(|void) (x|
|00001760| 64 72 5f 73 68 6f 72 74 | 28 78 64 72 73 2c 20 28 |dr_short|(xdrs, (|
|00001770| 73 68 6f 72 74 20 2a 29 | 65 70 29 29 3b 0a 09 72 |short *)|ep));..r|
|00001780| 65 74 75 72 6e 20 28 78 | 64 72 5f 6c 6f 6e 67 28 |eturn (x|dr_long(|
|00001790| 78 64 72 73 2c 20 28 6c | 6f 6e 67 20 2a 29 65 70 |xdrs, (l|ong *)ep|
|000017a0| 29 29 3b 0a 23 65 6e 64 | 69 66 0a 7d 0a 0a 2f 2a |));.#end|if.}../*|
|000017b0| 0a 20 2a 20 58 44 52 20 | 6f 70 61 71 75 65 20 64 |. * XDR |opaque d|
|000017c0| 61 74 61 0a 20 2a 20 41 | 6c 6c 6f 77 73 20 74 68 |ata. * A|llows th|
|000017d0| 65 20 73 70 65 63 69 66 | 69 63 61 74 69 6f 6e 20 |e specif|ication |
|000017e0| 6f 66 20 61 20 66 69 78 | 65 64 20 73 69 7a 65 20 |of a fix|ed size |
|000017f0| 73 65 71 75 65 6e 63 65 | 20 6f 66 20 6f 70 61 71 |sequence| of opaq|
|00001800| 75 65 20 62 79 74 65 73 | 2e 0a 20 2a 20 63 70 20 |ue bytes|.. * cp |
|00001810| 70 6f 69 6e 74 73 20 74 | 6f 20 74 68 65 20 6f 70 |points t|o the op|
|00001820| 61 71 75 65 20 6f 62 6a | 65 63 74 20 61 6e 64 20 |aque obj|ect and |
|00001830| 63 6e 74 20 67 69 76 65 | 73 20 74 68 65 20 62 79 |cnt give|s the by|
|00001840| 74 65 20 6c 65 6e 67 74 | 68 2e 0a 20 2a 2f 0a 62 |te lengt|h.. */.b|
|00001850| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 6f 70 61 71 75 65 |ool_t.xd|r_opaque|
|00001860| 28 78 64 72 73 2c 20 63 | 70 2c 20 63 6e 74 29 0a |(xdrs, c|p, cnt).|
|00001870| 09 72 65 67 69 73 74 65 | 72 20 58 44 52 20 2a 78 |.registe|r XDR *x|
|00001880| 64 72 73 3b 0a 09 63 61 | 64 64 72 5f 74 20 63 70 |drs;..ca|ddr_t cp|
|00001890| 3b 0a 09 72 65 67 69 73 | 74 65 72 20 75 5f 69 6e |;..regis|ter u_in|
|000018a0| 74 20 63 6e 74 3b 0a 7b | 0a 09 72 65 67 69 73 74 |t cnt;.{|..regist|
|000018b0| 65 72 20 75 5f 69 6e 74 | 20 72 6e 64 75 70 3b 0a |er u_int| rndup;.|
|000018c0| 09 73 74 61 74 69 63 20 | 63 72 75 64 5b 42 59 54 |.static |crud[BYT|
|000018d0| 45 53 5f 50 45 52 5f 58 | 44 52 5f 55 4e 49 54 5d |ES_PER_X|DR_UNIT]|
|000018e0| 3b 0a 0a 09 2f 2a 0a 09 | 20 2a 20 69 66 20 6e 6f |;.../*..| * if no|
|000018f0| 20 64 61 74 61 20 77 65 | 20 61 72 65 20 64 6f 6e | data we| are don|
|00001900| 65 0a 09 20 2a 2f 0a 09 | 69 66 20 28 63 6e 74 20 |e.. */..|if (cnt |
|00001910| 3d 3d 20 30 29 0a 09 09 | 72 65 74 75 72 6e 20 28 |== 0)...|return (|
|00001920| 54 52 55 45 29 3b 0a 0a | 09 2f 2a 0a 09 20 2a 20 |TRUE);..|./*.. * |
|00001930| 72 6f 75 6e 64 20 62 79 | 74 65 20 63 6f 75 6e 74 |round by|te count|
|00001940| 20 74 6f 20 66 75 6c 6c | 20 78 64 72 20 75 6e 69 | to full| xdr uni|
|00001950| 74 73 0a 09 20 2a 2f 0a | 09 72 6e 64 75 70 20 3d |ts.. */.|.rndup =|
|00001960| 20 63 6e 74 20 25 20 42 | 59 54 45 53 5f 50 45 52 | cnt % B|YTES_PER|
|00001970| 5f 58 44 52 5f 55 4e 49 | 54 3b 0a 09 69 66 20 28 |_XDR_UNI|T;..if (|
|00001980| 72 6e 64 75 70 20 3e 20 | 30 29 0a 09 09 72 6e 64 |rndup > |0)...rnd|
|00001990| 75 70 20 3d 20 42 59 54 | 45 53 5f 50 45 52 5f 58 |up = BYT|ES_PER_X|
|000019a0| 44 52 5f 55 4e 49 54 20 | 2d 20 72 6e 64 75 70 3b |DR_UNIT |- rndup;|
|000019b0| 0a 0a 09 69 66 20 28 78 | 64 72 73 2d 3e 78 5f 6f |...if (x|drs->x_o|
|000019c0| 70 20 3d 3d 20 58 44 52 | 5f 44 45 43 4f 44 45 29 |p == XDR|_DECODE)|
|000019d0| 20 7b 0a 09 09 69 66 20 | 28 21 58 44 52 5f 47 45 | {...if |(!XDR_GE|
|000019e0| 54 42 59 54 45 53 28 78 | 64 72 73 2c 20 63 70 2c |TBYTES(x|drs, cp,|
|000019f0| 20 63 6e 74 29 29 20 7b | 0a 09 09 09 72 65 74 75 | cnt)) {|....retu|
|00001a00| 72 6e 20 28 46 41 4c 53 | 45 29 3b 0a 09 09 7d 0a |rn (FALS|E);...}.|
|00001a10| 09 09 69 66 20 28 72 6e | 64 75 70 20 3d 3d 20 30 |..if (rn|dup == 0|
|00001a20| 29 0a 09 09 09 72 65 74 | 75 72 6e 20 28 54 52 55 |)....ret|urn (TRU|
|00001a30| 45 29 3b 0a 09 09 72 65 | 74 75 72 6e 20 28 58 44 |E);...re|turn (XD|
|00001a40| 52 5f 47 45 54 42 59 54 | 45 53 28 78 64 72 73 2c |R_GETBYT|ES(xdrs,|
|00001a50| 20 63 72 75 64 2c 20 72 | 6e 64 75 70 29 29 3b 0a | crud, r|ndup));.|
|00001a60| 09 7d 0a 0a 09 69 66 20 | 28 78 64 72 73 2d 3e 78 |.}...if |(xdrs->x|
|00001a70| 5f 6f 70 20 3d 3d 20 58 | 44 52 5f 45 4e 43 4f 44 |_op == X|DR_ENCOD|
|00001a80| 45 29 20 7b 0a 09 09 69 | 66 20 28 21 58 44 52 5f |E) {...i|f (!XDR_|
|00001a90| 50 55 54 42 59 54 45 53 | 28 78 64 72 73 2c 20 63 |PUTBYTES|(xdrs, c|
|00001aa0| 70 2c 20 63 6e 74 29 29 | 20 7b 0a 09 09 09 72 65 |p, cnt))| {....re|
|00001ab0| 74 75 72 6e 20 28 46 41 | 4c 53 45 29 3b 0a 09 09 |turn (FA|LSE);...|
|00001ac0| 7d 0a 09 09 69 66 20 28 | 72 6e 64 75 70 20 3d 3d |}...if (|rndup ==|
|00001ad0| 20 30 29 0a 09 09 09 72 | 65 74 75 72 6e 20 28 54 | 0)....r|eturn (T|
|00001ae0| 52 55 45 29 3b 0a 09 09 | 72 65 74 75 72 6e 20 28 |RUE);...|return (|
|00001af0| 58 44 52 5f 50 55 54 42 | 59 54 45 53 28 78 64 72 |XDR_PUTB|YTES(xdr|
|00001b00| 73 2c 20 78 64 72 5f 7a | 65 72 6f 2c 20 72 6e 64 |s, xdr_z|ero, rnd|
|00001b10| 75 70 29 29 3b 0a 09 7d | 0a 0a 09 69 66 20 28 78 |up));..}|...if (x|
|00001b20| 64 72 73 2d 3e 78 5f 6f | 70 20 3d 3d 20 58 44 52 |drs->x_o|p == XDR|
|00001b30| 5f 46 52 45 45 29 20 7b | 0a 09 09 72 65 74 75 72 |_FREE) {|...retur|
|00001b40| 6e 20 28 54 52 55 45 29 | 3b 0a 09 7d 0a 0a 09 72 |n (TRUE)|;..}...r|
|00001b50| 65 74 75 72 6e 20 28 46 | 41 4c 53 45 29 3b 0a 7d |eturn (F|ALSE);.}|
|00001b60| 0a 0a 2f 2a 0a 20 2a 20 | 58 44 52 20 63 6f 75 6e |../*. * |XDR coun|
|00001b70| 74 65 64 20 62 79 74 65 | 73 0a 20 2a 20 2a 63 70 |ted byte|s. * *cp|
|00001b80| 70 20 69 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |p is a p|ointer t|
|00001b90| 6f 20 74 68 65 20 62 79 | 74 65 73 2c 20 2a 73 69 |o the by|tes, *si|
|00001ba0| 7a 65 70 20 69 73 20 74 | 68 65 20 63 6f 75 6e 74 |zep is t|he count|
|00001bb0| 2e 0a 20 2a 20 49 66 20 | 2a 63 70 70 20 69 73 20 |.. * If |*cpp is |
|00001bc0| 4e 55 4c 4c 20 6d 61 78 | 73 69 7a 65 20 62 79 74 |NULL max|size byt|
|00001bd0| 65 73 20 61 72 65 20 61 | 6c 6c 6f 63 61 74 65 64 |es are a|llocated|
|00001be0| 0a 20 2a 2f 0a 62 6f 6f | 6c 5f 74 0a 78 64 72 5f |. */.boo|l_t.xdr_|
|00001bf0| 62 79 74 65 73 28 78 64 | 72 73 2c 20 63 70 70 2c |bytes(xd|rs, cpp,|
|00001c00| 20 73 69 7a 65 70 2c 20 | 6d 61 78 73 69 7a 65 29 | sizep, |maxsize)|
|00001c10| 0a 09 72 65 67 69 73 74 | 65 72 20 58 44 52 20 2a |..regist|er XDR *|
|00001c20| 78 64 72 73 3b 0a 09 63 | 68 61 72 20 2a 2a 63 70 |xdrs;..c|har **cp|
|00001c30| 70 3b 0a 09 72 65 67 69 | 73 74 65 72 20 75 5f 69 |p;..regi|ster u_i|
|00001c40| 6e 74 20 2a 73 69 7a 65 | 70 3b 0a 09 75 5f 69 6e |nt *size|p;..u_in|
|00001c50| 74 20 6d 61 78 73 69 7a | 65 3b 0a 7b 0a 09 72 65 |t maxsiz|e;.{..re|
|00001c60| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 73 70 20 |gister c|har *sp |
|00001c70| 3d 20 2a 63 70 70 3b 20 | 20 2f 2a 20 73 70 20 69 |= *cpp; | /* sp i|
|00001c80| 73 20 74 68 65 20 61 63 | 74 75 61 6c 20 73 74 72 |s the ac|tual str|
|00001c90| 69 6e 67 20 70 6f 69 6e | 74 65 72 20 2a 2f 0a 09 |ing poin|ter */..|
|00001ca0| 72 65 67 69 73 74 65 72 | 20 75 5f 69 6e 74 20 6e |register| u_int n|
|00001cb0| 6f 64 65 73 69 7a 65 3b | 0a 0a 09 2f 2a 0a 09 20 |odesize;|.../*.. |
|00001cc0| 2a 20 66 69 72 73 74 20 | 64 65 61 6c 20 77 69 74 |* first |deal wit|
|00001cd0| 68 20 74 68 65 20 6c 65 | 6e 67 74 68 20 73 69 6e |h the le|ngth sin|
|00001ce0| 63 65 20 78 64 72 20 62 | 79 74 65 73 20 61 72 65 |ce xdr b|ytes are|
|00001cf0| 20 63 6f 75 6e 74 65 64 | 0a 09 20 2a 2f 0a 09 69 | counted|.. */..i|
|00001d00| 66 20 28 21 20 78 64 72 | 5f 75 5f 69 6e 74 28 78 |f (! xdr|_u_int(x|
|00001d10| 64 72 73 2c 20 73 69 7a | 65 70 29 29 20 7b 0a 09 |drs, siz|ep)) {..|
|00001d20| 09 72 65 74 75 72 6e 20 | 28 46 41 4c 53 45 29 3b |.return |(FALSE);|
|00001d30| 0a 09 7d 0a 09 6e 6f 64 | 65 73 69 7a 65 20 3d 20 |..}..nod|esize = |
|00001d40| 2a 73 69 7a 65 70 3b 0a | 09 69 66 20 28 28 6e 6f |*sizep;.|.if ((no|
|00001d50| 64 65 73 69 7a 65 20 3e | 20 6d 61 78 73 69 7a 65 |desize >| maxsize|
|00001d60| 29 20 26 26 20 28 78 64 | 72 73 2d 3e 78 5f 6f 70 |) && (xd|rs->x_op|
|00001d70| 20 21 3d 20 58 44 52 5f | 46 52 45 45 29 29 20 7b | != XDR_|FREE)) {|
|00001d80| 0a 09 09 72 65 74 75 72 | 6e 20 28 46 41 4c 53 45 |...retur|n (FALSE|
|00001d90| 29 3b 0a 09 7d 0a 0a 09 | 2f 2a 0a 09 20 2a 20 6e |);..}...|/*.. * n|
|00001da0| 6f 77 20 64 65 61 6c 20 | 77 69 74 68 20 74 68 65 |ow deal |with the|
|00001db0| 20 61 63 74 75 61 6c 20 | 62 79 74 65 73 0a 09 20 | actual |bytes.. |
|00001dc0| 2a 2f 0a 09 73 77 69 74 | 63 68 20 28 78 64 72 73 |*/..swit|ch (xdrs|
|00001dd0| 2d 3e 78 5f 6f 70 29 20 | 7b 0a 0a 09 63 61 73 65 |->x_op) |{...case|
|00001de0| 20 58 44 52 5f 44 45 43 | 4f 44 45 3a 0a 09 09 69 | XDR_DEC|ODE:...i|
|00001df0| 66 20 28 6e 6f 64 65 73 | 69 7a 65 20 3d 3d 20 30 |f (nodes|ize == 0|
|00001e00| 29 20 7b 0a 09 09 09 72 | 65 74 75 72 6e 20 28 54 |) {....r|eturn (T|
|00001e10| 52 55 45 29 3b 0a 09 09 | 7d 0a 09 09 69 66 20 28 |RUE);...|}...if (|
|00001e20| 73 70 20 3d 3d 20 4e 55 | 4c 4c 29 20 7b 0a 09 09 |sp == NU|LL) {...|
|00001e30| 09 2a 63 70 70 20 3d 20 | 73 70 20 3d 20 28 63 68 |.*cpp = |sp = (ch|
|00001e40| 61 72 20 2a 29 6d 65 6d | 5f 61 6c 6c 6f 63 28 6e |ar *)mem|_alloc(n|
|00001e50| 6f 64 65 73 69 7a 65 29 | 3b 0a 09 09 7d 0a 09 09 |odesize)|;...}...|
|00001e60| 69 66 20 28 73 70 20 3d | 3d 20 4e 55 4c 4c 29 20 |if (sp =|= NULL) |
|00001e70| 7b 0a 09 09 09 28 76 6f | 69 64 29 20 66 70 72 69 |{....(vo|id) fpri|
|00001e80| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 22 78 64 72 |ntf(stde|rr, "xdr|
|00001e90| 5f 62 79 74 65 73 3a 20 | 6f 75 74 20 6f 66 20 6d |_bytes: |out of m|
|00001ea0| 65 6d 6f 72 79 5c 6e 22 | 29 3b 0a 09 09 09 72 65 |emory\n"|);....re|
|00001eb0| 74 75 72 6e 20 28 46 41 | 4c 53 45 29 3b 0a 09 09 |turn (FA|LSE);...|
|00001ec0| 7d 0a 09 09 2f 2a 20 66 | 61 6c 6c 20 69 6e 74 6f |}.../* f|all into|
|00001ed0| 20 2e 2e 2e 20 2a 2f 0a | 0a 09 63 61 73 65 20 58 | ... */.|..case X|
|00001ee0| 44 52 5f 45 4e 43 4f 44 | 45 3a 0a 09 09 72 65 74 |DR_ENCOD|E:...ret|
|00001ef0| 75 72 6e 20 28 78 64 72 | 5f 6f 70 61 71 75 65 28 |urn (xdr|_opaque(|
|00001f00| 78 64 72 73 2c 20 73 70 | 2c 20 6e 6f 64 65 73 69 |xdrs, sp|, nodesi|
|00001f10| 7a 65 29 29 3b 0a 0a 09 | 63 61 73 65 20 58 44 52 |ze));...|case XDR|
|00001f20| 5f 46 52 45 45 3a 0a 09 | 09 69 66 20 28 73 70 20 |_FREE:..|.if (sp |
|00001f30| 21 3d 20 4e 55 4c 4c 29 | 20 7b 0a 09 09 09 6d 65 |!= NULL)| {....me|
|00001f40| 6d 5f 66 72 65 65 28 73 | 70 2c 20 6e 6f 64 65 73 |m_free(s|p, nodes|
|00001f50| 69 7a 65 29 3b 0a 09 09 | 09 2a 63 70 70 20 3d 20 |ize);...|.*cpp = |
|00001f60| 4e 55 4c 4c 3b 0a 09 09 | 7d 0a 09 09 72 65 74 75 |NULL;...|}...retu|
|00001f70| 72 6e 20 28 54 52 55 45 | 29 3b 0a 09 7d 0a 09 72 |rn (TRUE|);..}..r|
|00001f80| 65 74 75 72 6e 20 28 46 | 41 4c 53 45 29 3b 0a 7d |eturn (F|ALSE);.}|
|00001f90| 0a 0a 2f 2a 0a 20 2a 20 | 49 6d 70 6c 65 6d 65 6e |../*. * |Implemen|
|00001fa0| 74 65 64 20 68 65 72 65 | 20 64 75 65 20 74 6f 20 |ted here| due to |
|00001fb0| 63 6f 6d 6d 6f 6e 61 6c | 69 74 79 20 6f 66 20 74 |commonal|ity of t|
|00001fc0| 68 65 20 6f 62 6a 65 63 | 74 2e 0a 20 2a 2f 0a 62 |he objec|t.. */.b|
|00001fd0| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 6e 65 74 6f 62 6a |ool_t.xd|r_netobj|
|00001fe0| 28 78 64 72 73 2c 20 6e | 70 29 0a 09 58 44 52 20 |(xdrs, n|p)..XDR |
|00001ff0| 2a 78 64 72 73 3b 0a 09 | 73 74 72 75 63 74 20 6e |*xdrs;..|struct n|
|00002000| 65 74 6f 62 6a 20 2a 6e | 70 3b 0a 7b 0a 0a 09 72 |etobj *n|p;.{...r|
|00002010| 65 74 75 72 6e 20 28 78 | 64 72 5f 62 79 74 65 73 |eturn (x|dr_bytes|
|00002020| 28 78 64 72 73 2c 20 26 | 6e 70 2d 3e 6e 5f 62 79 |(xdrs, &|np->n_by|
|00002030| 74 65 73 2c 20 26 6e 70 | 2d 3e 6e 5f 6c 65 6e 2c |tes, &np|->n_len,|
|00002040| 20 4d 41 58 5f 4e 45 54 | 4f 42 4a 5f 53 5a 29 29 | MAX_NET|OBJ_SZ))|
|00002050| 3b 0a 7d 0a 0a 2f 2a 0a | 20 2a 20 58 44 52 20 61 |;.}../*.| * XDR a|
|00002060| 20 64 65 73 63 72 69 6d | 69 6e 61 74 65 64 20 75 | descrim|inated u|
|00002070| 6e 69 6f 6e 0a 20 2a 20 | 53 75 70 70 6f 72 74 20 |nion. * |Support |
|00002080| 72 6f 75 74 69 6e 65 20 | 66 6f 72 20 64 69 73 63 |routine |for disc|
|00002090| 72 69 6d 69 6e 61 74 65 | 64 20 75 6e 69 6f 6e 73 |riminate|d unions|
|000020a0| 2e 0a 20 2a 20 59 6f 75 | 20 63 72 65 61 74 65 20 |.. * You| create |
|000020b0| 61 6e 20 61 72 72 61 79 | 20 6f 66 20 78 64 72 64 |an array| of xdrd|
|000020c0| 69 73 63 72 69 6d 20 73 | 74 72 75 63 74 75 72 65 |iscrim s|tructure|
|000020d0| 73 2c 20 74 65 72 6d 69 | 6e 61 74 65 64 20 77 69 |s, termi|nated wi|
|000020e0| 74 68 0a 20 2a 20 61 6e | 20 65 6e 74 72 79 20 77 |th. * an| entry w|
|000020f0| 69 74 68 20 61 20 6e 75 | 6c 6c 20 70 72 6f 63 65 |ith a nu|ll proce|
|00002100| 64 75 72 65 20 70 6f 69 | 6e 74 65 72 2e 20 20 54 |dure poi|nter. T|
|00002110| 68 65 20 72 6f 75 74 69 | 6e 65 20 67 65 74 73 0a |he routi|ne gets.|
|00002120| 20 2a 20 74 68 65 20 64 | 69 73 63 72 69 6d 69 6e | * the d|iscrimin|
|00002130| 61 6e 74 20 76 61 6c 75 | 65 20 61 6e 64 20 74 68 |ant valu|e and th|
|00002140| 65 6e 20 73 65 61 72 63 | 68 65 73 20 74 68 65 20 |en searc|hes the |
|00002150| 61 72 72 61 79 20 6f 66 | 20 78 64 72 64 69 73 63 |array of| xdrdisc|
|00002160| 72 69 6d 73 0a 20 2a 20 | 6c 6f 6f 6b 69 6e 67 20 |rims. * |looking |
|00002170| 66 6f 72 20 74 68 61 74 | 20 76 61 6c 75 65 2e 20 |for that| value. |
|00002180| 20 49 74 20 63 61 6c 6c | 73 20 74 68 65 20 70 72 | It call|s the pr|
|00002190| 6f 63 65 64 75 72 65 20 | 67 69 76 65 6e 20 69 6e |ocedure |given in|
|000021a0| 20 74 68 65 20 78 64 72 | 64 69 73 63 72 69 6d 0a | the xdr|discrim.|
|000021b0| 20 2a 20 74 6f 20 68 61 | 6e 64 6c 65 20 74 68 65 | * to ha|ndle the|
|000021c0| 20 64 69 73 63 72 69 6d | 69 6e 61 6e 74 2e 20 20 | discrim|inant. |
|000021d0| 49 66 20 74 68 65 72 65 | 20 69 73 20 6e 6f 20 73 |If there| is no s|
|000021e0| 70 65 63 69 66 69 63 20 | 72 6f 75 74 69 6e 65 20 |pecific |routine |
|000021f0| 61 20 64 65 66 61 75 6c | 74 0a 20 2a 20 72 6f 75 |a defaul|t. * rou|
|00002200| 74 69 6e 65 20 6d 61 79 | 20 62 65 20 63 61 6c 6c |tine may| be call|
|00002210| 65 64 2e 0a 20 2a 20 49 | 66 20 74 68 65 72 65 20 |ed.. * I|f there |
|00002220| 69 73 20 6e 6f 20 73 70 | 65 63 69 66 69 63 20 6f |is no sp|ecific o|
|00002230| 72 20 64 65 66 61 75 6c | 74 20 72 6f 75 74 69 6e |r defaul|t routin|
|00002240| 65 20 61 6e 20 65 72 72 | 6f 72 20 69 73 20 72 65 |e an err|or is re|
|00002250| 74 75 72 6e 65 64 2e 0a | 20 2a 2f 0a 62 6f 6f 6c |turned..| */.bool|
|00002260| 5f 74 0a 78 64 72 5f 75 | 6e 69 6f 6e 28 78 64 72 |_t.xdr_u|nion(xdr|
|00002270| 73 2c 20 64 73 63 6d 70 | 2c 20 75 6e 70 2c 20 63 |s, dscmp|, unp, c|
|00002280| 68 6f 69 63 65 73 2c 20 | 64 66 61 75 6c 74 29 0a |hoices, |dfault).|
|00002290| 09 72 65 67 69 73 74 65 | 72 20 58 44 52 20 2a 78 |.registe|r XDR *x|
|000022a0| 64 72 73 3b 0a 09 65 6e | 75 6d 5f 74 20 2a 64 73 |drs;..en|um_t *ds|
|000022b0| 63 6d 70 3b 09 09 2f 2a | 20 65 6e 75 6d 20 74 6f |cmp;../*| enum to|
|000022c0| 20 64 65 63 69 64 65 20 | 77 68 69 63 68 20 61 72 | decide |which ar|
|000022d0| 6d 20 74 6f 20 77 6f 72 | 6b 20 6f 6e 20 2a 2f 0a |m to wor|k on */.|
|000022e0| 09 63 68 61 72 20 2a 75 | 6e 70 3b 09 09 2f 2a 20 |.char *u|np;../* |
|000022f0| 74 68 65 20 75 6e 69 6f | 6e 20 69 74 73 65 6c 66 |the unio|n itself|
|00002300| 20 2a 2f 0a 09 73 74 72 | 75 63 74 20 78 64 72 5f | */..str|uct xdr_|
|00002310| 64 69 73 63 72 69 6d 20 | 2a 63 68 6f 69 63 65 73 |discrim |*choices|
|00002320| 3b 09 2f 2a 20 5b 76 61 | 6c 75 65 2c 20 78 64 72 |;./* [va|lue, xdr|
|00002330| 20 70 72 6f 63 5d 20 66 | 6f 72 20 65 61 63 68 20 | proc] f|or each |
|00002340| 61 72 6d 20 2a 2f 0a 09 | 78 64 72 70 72 6f 63 5f |arm */..|xdrproc_|
|00002350| 74 20 64 66 61 75 6c 74 | 3b 09 2f 2a 20 64 65 66 |t dfault|;./* def|
|00002360| 61 75 6c 74 20 78 64 72 | 20 72 6f 75 74 69 6e 65 |ault xdr| routine|
|00002370| 20 2a 2f 0a 7b 0a 09 72 | 65 67 69 73 74 65 72 20 | */.{..r|egister |
|00002380| 65 6e 75 6d 5f 74 20 64 | 73 63 6d 3b 0a 0a 09 2f |enum_t d|scm;.../|
|00002390| 2a 0a 09 20 2a 20 77 65 | 20 64 65 61 6c 20 77 69 |*.. * we| deal wi|
|000023a0| 74 68 20 74 68 65 20 64 | 69 73 63 72 69 6d 69 6e |th the d|iscrimin|
|000023b0| 61 74 6f 72 3b 20 20 69 | 74 27 73 20 61 6e 20 65 |ator; i|t's an e|
|000023c0| 6e 75 6d 0a 09 20 2a 2f | 0a 09 69 66 20 28 21 20 |num.. */|..if (! |
|000023d0| 78 64 72 5f 65 6e 75 6d | 28 78 64 72 73 2c 20 64 |xdr_enum|(xdrs, d|
|000023e0| 73 63 6d 70 29 29 20 7b | 0a 09 09 72 65 74 75 72 |scmp)) {|...retur|
|000023f0| 6e 20 28 46 41 4c 53 45 | 29 3b 0a 09 7d 0a 09 64 |n (FALSE|);..}..d|
|00002400| 73 63 6d 20 3d 20 2a 64 | 73 63 6d 70 3b 0a 0a 09 |scm = *d|scmp;...|
|00002410| 2f 2a 0a 09 20 2a 20 73 | 65 61 72 63 68 20 63 68 |/*.. * s|earch ch|
|00002420| 6f 69 63 65 73 20 66 6f | 72 20 61 20 76 61 6c 75 |oices fo|r a valu|
|00002430| 65 20 74 68 61 74 20 6d | 61 74 63 68 65 73 20 74 |e that m|atches t|
|00002440| 68 65 20 64 69 73 63 72 | 69 6d 69 6e 61 74 6f 72 |he discr|iminator|
|00002450| 2e 0a 09 20 2a 20 69 66 | 20 77 65 20 66 69 6e 64 |... * if| we find|
|00002460| 20 6f 6e 65 2c 20 65 78 | 65 63 75 74 65 20 74 68 | one, ex|ecute th|
|00002470| 65 20 78 64 72 20 72 6f | 75 74 69 6e 65 20 66 6f |e xdr ro|utine fo|
|00002480| 72 20 74 68 61 74 20 76 | 61 6c 75 65 2e 0a 09 20 |r that v|alue... |
|00002490| 2a 2f 0a 09 66 6f 72 20 | 28 3b 20 63 68 6f 69 63 |*/..for |(; choic|
|000024a0| 65 73 2d 3e 70 72 6f 63 | 20 21 3d 20 4e 55 4c 4c |es->proc| != NULL|
|000024b0| 5f 78 64 72 70 72 6f 63 | 5f 74 3b 20 63 68 6f 69 |_xdrproc|_t; choi|
|000024c0| 63 65 73 2b 2b 29 20 7b | 0a 09 09 69 66 20 28 63 |ces++) {|...if (c|
|000024d0| 68 6f 69 63 65 73 2d 3e | 76 61 6c 75 65 20 3d 3d |hoices->|value ==|
|000024e0| 20 64 73 63 6d 29 0a 09 | 09 09 72 65 74 75 72 6e | dscm)..|..return|
|000024f0| 20 28 28 2a 28 63 68 6f | 69 63 65 73 2d 3e 70 72 | ((*(cho|ices->pr|
|00002500| 6f 63 29 29 28 78 64 72 | 73 2c 20 75 6e 70 2c 20 |oc))(xdr|s, unp, |
|00002510| 4c 41 53 54 55 4e 53 49 | 47 4e 45 44 29 29 3b 0a |LASTUNSI|GNED));.|
|00002520| 09 7d 0a 0a 09 2f 2a 0a | 09 20 2a 20 6e 6f 20 6d |.}.../*.|. * no m|
|00002530| 61 74 63 68 20 2d 20 65 | 78 65 63 75 74 65 20 74 |atch - e|xecute t|
|00002540| 68 65 20 64 65 66 61 75 | 6c 74 20 78 64 72 20 72 |he defau|lt xdr r|
|00002550| 6f 75 74 69 6e 65 20 69 | 66 20 74 68 65 72 65 20 |outine i|f there |
|00002560| 69 73 20 6f 6e 65 0a 09 | 20 2a 2f 0a 09 72 65 74 |is one..| */..ret|
|00002570| 75 72 6e 20 28 28 64 66 | 61 75 6c 74 20 3d 3d 20 |urn ((df|ault == |
|00002580| 4e 55 4c 4c 5f 78 64 72 | 70 72 6f 63 5f 74 29 20 |NULL_xdr|proc_t) |
|00002590| 3f 20 46 41 4c 53 45 20 | 3a 0a 09 20 20 20 20 28 |? FALSE |:.. (|
|000025a0| 2a 64 66 61 75 6c 74 29 | 28 78 64 72 73 2c 20 75 |*dfault)|(xdrs, u|
|000025b0| 6e 70 2c 20 4c 41 53 54 | 55 4e 53 49 47 4e 45 44 |np, LAST|UNSIGNED|
|000025c0| 29 29 3b 0a 7d 0a 0a 0a | 2f 2a 0a 20 2a 20 4e 6f |));.}...|/*. * No|
|000025d0| 6e 2d 70 6f 72 74 61 62 | 6c 65 20 78 64 72 20 70 |n-portab|le xdr p|
|000025e0| 72 69 6d 69 74 69 76 65 | 73 2e 0a 20 2a 20 43 61 |rimitive|s.. * Ca|
|000025f0| 72 65 20 73 68 6f 75 6c | 64 20 62 65 20 74 61 6b |re shoul|d be tak|
|00002600| 65 6e 20 77 68 65 6e 20 | 6d 6f 76 69 6e 67 20 74 |en when |moving t|
|00002610| 68 65 73 65 20 72 6f 75 | 74 69 6e 65 73 20 74 6f |hese rou|tines to|
|00002620| 20 6e 65 77 20 61 72 63 | 68 69 74 65 63 74 75 72 | new arc|hitectur|
|00002630| 65 73 2e 0a 20 2a 2f 0a | 0a 0a 2f 2a 0a 20 2a 20 |es.. */.|../*. * |
|00002640| 58 44 52 20 6e 75 6c 6c | 20 74 65 72 6d 69 6e 61 |XDR null| termina|
|00002650| 74 65 64 20 41 53 43 49 | 49 20 73 74 72 69 6e 67 |ted ASCI|I string|
|00002660| 73 0a 20 2a 20 78 64 72 | 5f 73 74 72 69 6e 67 20 |s. * xdr|_string |
|00002670| 64 65 61 6c 73 20 77 69 | 74 68 20 22 43 20 73 74 |deals wi|th "C st|
|00002680| 72 69 6e 67 73 22 20 2d | 20 61 72 72 61 79 73 20 |rings" -| arrays |
|00002690| 6f 66 20 62 79 74 65 73 | 20 74 68 61 74 20 61 72 |of bytes| that ar|
|000026a0| 65 0a 20 2a 20 74 65 72 | 6d 69 6e 61 74 65 64 20 |e. * ter|minated |
|000026b0| 62 79 20 61 20 4e 55 4c | 4c 20 63 68 61 72 61 63 |by a NUL|L charac|
|000026c0| 74 65 72 2e 20 20 54 68 | 65 20 70 61 72 61 6d 65 |ter. Th|e parame|
|000026d0| 74 65 72 20 63 70 70 20 | 72 65 66 65 72 65 6e 63 |ter cpp |referenc|
|000026e0| 65 73 20 61 0a 20 2a 20 | 70 6f 69 6e 74 65 72 20 |es a. * |pointer |
|000026f0| 74 6f 20 73 74 6f 72 61 | 67 65 3b 20 49 66 20 74 |to stora|ge; If t|
|00002700| 68 65 20 70 6f 69 6e 74 | 65 72 20 69 73 20 6e 75 |he point|er is nu|
|00002710| 6c 6c 2c 20 74 68 65 6e | 20 74 68 65 20 6e 65 63 |ll, then| the nec|
|00002720| 65 73 73 61 72 79 0a 20 | 2a 20 73 74 6f 72 61 67 |essary. |* storag|
|00002730| 65 20 69 73 20 61 6c 6c | 6f 63 61 74 65 64 2e 20 |e is all|ocated. |
|00002740| 20 54 68 65 20 6c 61 73 | 74 20 70 61 72 61 6d 65 | The las|t parame|
|00002750| 74 65 72 20 69 73 20 74 | 68 65 20 6d 61 78 20 61 |ter is t|he max a|
|00002760| 6c 6c 6f 77 65 64 20 6c | 65 6e 67 74 68 0a 20 2a |llowed l|ength. *|
|00002770| 20 6f 66 20 74 68 65 20 | 73 74 72 69 6e 67 20 61 | of the |string a|
|00002780| 73 20 73 70 65 63 69 66 | 69 65 64 20 62 79 20 61 |s specif|ied by a|
|00002790| 20 70 72 6f 74 6f 63 6f | 6c 2e 0a 20 2a 2f 0a 62 | protoco|l.. */.b|
|000027a0| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 73 74 72 69 6e 67 |ool_t.xd|r_string|
|000027b0| 28 78 64 72 73 2c 20 63 | 70 70 2c 20 6d 61 78 73 |(xdrs, c|pp, maxs|
|000027c0| 69 7a 65 29 0a 09 72 65 | 67 69 73 74 65 72 20 58 |ize)..re|gister X|
|000027d0| 44 52 20 2a 78 64 72 73 | 3b 0a 09 63 68 61 72 20 |DR *xdrs|;..char |
|000027e0| 2a 2a 63 70 70 3b 0a 09 | 75 5f 69 6e 74 20 6d 61 |**cpp;..|u_int ma|
|000027f0| 78 73 69 7a 65 3b 0a 7b | 0a 09 72 65 67 69 73 74 |xsize;.{|..regist|
|00002800| 65 72 20 63 68 61 72 20 | 2a 73 70 20 3d 20 2a 63 |er char |*sp = *c|
|00002810| 70 70 3b 20 20 2f 2a 20 | 73 70 20 69 73 20 74 68 |pp; /* |sp is th|
|00002820| 65 20 61 63 74 75 61 6c | 20 73 74 72 69 6e 67 20 |e actual| string |
|00002830| 70 6f 69 6e 74 65 72 20 | 2a 2f 0a 09 75 5f 69 6e |pointer |*/..u_in|
|00002840| 74 20 73 69 7a 65 3b 0a | 09 75 5f 69 6e 74 20 6e |t size;.|.u_int n|
|00002850| 6f 64 65 73 69 7a 65 3b | 0a 0a 09 2f 2a 0a 09 20 |odesize;|.../*.. |
|00002860| 2a 20 66 69 72 73 74 20 | 64 65 61 6c 20 77 69 74 |* first |deal wit|
|00002870| 68 20 74 68 65 20 6c 65 | 6e 67 74 68 20 73 69 6e |h the le|ngth sin|
|00002880| 63 65 20 78 64 72 20 73 | 74 72 69 6e 67 73 20 61 |ce xdr s|trings a|
|00002890| 72 65 20 63 6f 75 6e 74 | 65 64 2d 73 74 72 69 6e |re count|ed-strin|
|000028a0| 67 73 0a 09 20 2a 2f 0a | 09 73 77 69 74 63 68 20 |gs.. */.|.switch |
|000028b0| 28 78 64 72 73 2d 3e 78 | 5f 6f 70 29 20 7b 0a 09 |(xdrs->x|_op) {..|
|000028c0| 63 61 73 65 20 58 44 52 | 5f 46 52 45 45 3a 0a 09 |case XDR|_FREE:..|
|000028d0| 09 69 66 20 28 73 70 20 | 3d 3d 20 4e 55 4c 4c 29 |.if (sp |== NULL)|
|000028e0| 20 7b 0a 09 09 09 72 65 | 74 75 72 6e 28 54 52 55 | {....re|turn(TRU|
|000028f0| 45 29 3b 09 2f 2a 20 61 | 6c 72 65 61 64 79 20 66 |E);./* a|lready f|
|00002900| 72 65 65 20 2a 2f 0a 09 | 09 7d 0a 09 09 2f 2a 20 |ree */..|.}.../* |
|00002910| 66 61 6c 6c 20 74 68 72 | 6f 75 67 68 2e 2e 2e 20 |fall thr|ough... |
|00002920| 2a 2f 0a 09 63 61 73 65 | 20 58 44 52 5f 45 4e 43 |*/..case| XDR_ENC|
|00002930| 4f 44 45 3a 0a 09 09 73 | 69 7a 65 20 3d 20 73 74 |ODE:...s|ize = st|
|00002940| 72 6c 65 6e 28 73 70 29 | 3b 0a 09 09 62 72 65 61 |rlen(sp)|;...brea|
|00002950| 6b 3b 0a 09 7d 0a 09 69 | 66 20 28 21 20 78 64 72 |k;..}..i|f (! xdr|
|00002960| 5f 75 5f 69 6e 74 28 78 | 64 72 73 2c 20 26 73 69 |_u_int(x|drs, &si|
|00002970| 7a 65 29 29 20 7b 0a 09 | 09 72 65 74 75 72 6e 20 |ze)) {..|.return |
|00002980| 28 46 41 4c 53 45 29 3b | 0a 09 7d 0a 09 69 66 20 |(FALSE);|..}..if |
|00002990| 28 73 69 7a 65 20 3e 20 | 6d 61 78 73 69 7a 65 29 |(size > |maxsize)|
|000029a0| 20 7b 0a 09 09 72 65 74 | 75 72 6e 20 28 46 41 4c | {...ret|urn (FAL|
|000029b0| 53 45 29 3b 0a 09 7d 0a | 09 6e 6f 64 65 73 69 7a |SE);..}.|.nodesiz|
|000029c0| 65 20 3d 20 73 69 7a 65 | 20 2b 20 31 3b 0a 0a 09 |e = size| + 1;...|
|000029d0| 2f 2a 0a 09 20 2a 20 6e | 6f 77 20 64 65 61 6c 20 |/*.. * n|ow deal |
|000029e0| 77 69 74 68 20 74 68 65 | 20 61 63 74 75 61 6c 20 |with the| actual |
|000029f0| 62 79 74 65 73 0a 09 20 | 2a 2f 0a 09 73 77 69 74 |bytes.. |*/..swit|
|00002a00| 63 68 20 28 78 64 72 73 | 2d 3e 78 5f 6f 70 29 20 |ch (xdrs|->x_op) |
|00002a10| 7b 0a 0a 09 63 61 73 65 | 20 58 44 52 5f 44 45 43 |{...case| XDR_DEC|
|00002a20| 4f 44 45 3a 0a 09 09 69 | 66 20 28 6e 6f 64 65 73 |ODE:...i|f (nodes|
|00002a30| 69 7a 65 20 3d 3d 20 30 | 29 20 7b 0a 09 09 09 72 |ize == 0|) {....r|
|00002a40| 65 74 75 72 6e 20 28 54 | 52 55 45 29 3b 0a 09 09 |eturn (T|RUE);...|
|00002a50| 7d 0a 09 09 69 66 20 28 | 73 70 20 3d 3d 20 4e 55 |}...if (|sp == NU|
|00002a60| 4c 4c 29 0a 09 09 09 2a | 63 70 70 20 3d 20 73 70 |LL)....*|cpp = sp|
|00002a70| 20 3d 20 28 63 68 61 72 | 20 2a 29 6d 65 6d 5f 61 | = (char| *)mem_a|
|00002a80| 6c 6c 6f 63 28 6e 6f 64 | 65 73 69 7a 65 29 3b 0a |lloc(nod|esize);.|
|00002a90| 09 09 69 66 20 28 73 70 | 20 3d 3d 20 4e 55 4c 4c |..if (sp| == NULL|
|00002aa0| 29 20 7b 0a 09 09 09 28 | 76 6f 69 64 29 20 66 70 |) {....(|void) fp|
|00002ab0| 72 69 6e 74 66 28 73 74 | 64 65 72 72 2c 20 22 78 |rintf(st|derr, "x|
|00002ac0| 64 72 5f 73 74 72 69 6e | 67 3a 20 6f 75 74 20 6f |dr_strin|g: out o|
|00002ad0| 66 20 6d 65 6d 6f 72 79 | 5c 6e 22 29 3b 0a 09 09 |f memory|\n");...|
|00002ae0| 09 72 65 74 75 72 6e 20 | 28 46 41 4c 53 45 29 3b |.return |(FALSE);|
|00002af0| 0a 09 09 7d 0a 09 09 73 | 70 5b 73 69 7a 65 5d 20 |...}...s|p[size] |
|00002b00| 3d 20 30 3b 0a 09 09 2f | 2a 20 66 61 6c 6c 20 69 |= 0;.../|* fall i|
|00002b10| 6e 74 6f 20 2e 2e 2e 20 | 2a 2f 0a 0a 09 63 61 73 |nto ... |*/...cas|
|00002b20| 65 20 58 44 52 5f 45 4e | 43 4f 44 45 3a 0a 09 09 |e XDR_EN|CODE:...|
|00002b30| 72 65 74 75 72 6e 20 28 | 78 64 72 5f 6f 70 61 71 |return (|xdr_opaq|
|00002b40| 75 65 28 78 64 72 73 2c | 20 73 70 2c 20 73 69 7a |ue(xdrs,| sp, siz|
|00002b50| 65 29 29 3b 0a 0a 09 63 | 61 73 65 20 58 44 52 5f |e));...c|ase XDR_|
|00002b60| 46 52 45 45 3a 0a 09 09 | 6d 65 6d 5f 66 72 65 65 |FREE:...|mem_free|
|00002b70| 28 73 70 2c 20 6e 6f 64 | 65 73 69 7a 65 29 3b 0a |(sp, nod|esize);.|
|00002b80| 09 09 2a 63 70 70 20 3d | 20 4e 55 4c 4c 3b 0a 09 |..*cpp =| NULL;..|
|00002b90| 09 72 65 74 75 72 6e 20 | 28 54 52 55 45 29 3b 0a |.return |(TRUE);.|
|00002ba0| 09 7d 0a 09 72 65 74 75 | 72 6e 20 28 46 41 4c 53 |.}..retu|rn (FALS|
|00002bb0| 45 29 3b 0a 7d 0a 0a 2f | 2a 20 0a 20 2a 20 57 72 |E);.}../|* . * Wr|
|00002bc0| 61 70 70 65 72 20 66 6f | 72 20 78 64 72 5f 73 74 |apper fo|r xdr_st|
|00002bd0| 72 69 6e 67 20 74 68 61 | 74 20 63 61 6e 20 62 65 |ring tha|t can be|
|00002be0| 20 63 61 6c 6c 65 64 20 | 64 69 72 65 63 74 6c 79 | called |directly|
|00002bf0| 20 66 72 6f 6d 20 0a 20 | 2a 20 72 6f 75 74 69 6e | from . |* routin|
|00002c00| 65 73 20 6c 69 6b 65 20 | 63 6c 6e 74 5f 63 61 6c |es like |clnt_cal|
|00002c10| 6c 0a 20 2a 2f 0a 62 6f | 6f 6c 5f 74 0a 78 64 72 |l. */.bo|ol_t.xdr|
|00002c20| 5f 77 72 61 70 73 74 72 | 69 6e 67 28 78 64 72 73 |_wrapstr|ing(xdrs|
|00002c30| 2c 20 63 70 70 29 0a 09 | 58 44 52 20 2a 78 64 72 |, cpp)..|XDR *xdr|
|00002c40| 73 3b 0a 09 63 68 61 72 | 20 2a 2a 63 70 70 3b 0a |s;..char| **cpp;.|
|00002c50| 7b 0a 09 69 66 20 28 78 | 64 72 5f 73 74 72 69 6e |{..if (x|dr_strin|
|00002c60| 67 28 78 64 72 73 2c 20 | 63 70 70 2c 20 4c 41 53 |g(xdrs, |cpp, LAS|
|00002c70| 54 55 4e 53 49 47 4e 45 | 44 29 29 20 7b 0a 09 09 |TUNSIGNE|D)) {...|
|00002c80| 72 65 74 75 72 6e 20 28 | 54 52 55 45 29 3b 0a 09 |return (|TRUE);..|
|00002c90| 7d 0a 09 72 65 74 75 72 | 6e 20 28 46 41 4c 53 45 |}..retur|n (FALSE|
|00002ca0| 29 3b 0a 7d 0a 46 75 6e | 6b 79 5f 53 74 75 66 66 |);.}.Fun|ky_Stuff|
|00002cb0| 0a 6c 65 6e 3d 60 77 63 | 20 2d 63 20 3c 20 78 64 |.len=`wc| -c < xd|
|00002cc0| 72 2e 63 60 0a 69 66 20 | 5b 20 24 6c 65 6e 20 21 |r.c`.if |[ $len !|
|00002cd0| 3d 20 20 20 20 31 31 30 | 34 39 20 5d 20 3b 20 74 |= 110|49 ] ; t|
|00002ce0| 68 65 6e 0a 20 20 65 63 | 68 6f 20 65 72 72 6f 72 |hen. ec|ho error|
|00002cf0| 3a 20 78 64 72 2e 63 20 | 77 61 73 20 24 6c 65 6e |: xdr.c |was $len|
|00002d00| 20 62 79 74 65 73 20 6c | 6f 6e 67 2c 20 73 68 6f | bytes l|ong, sho|
|00002d10| 75 6c 64 20 68 61 76 65 | 20 62 65 65 6e 20 20 20 |uld have| been |
|00002d20| 20 31 31 30 34 39 0a 66 | 69 0a 65 63 68 6f 20 78 | 11049.f|i.echo x|
|00002d30| 20 2d 20 78 64 72 2e 68 | 0a 63 61 74 20 3e 20 78 | - xdr.h|.cat > x|
|00002d40| 64 72 2e 68 20 3c 3c 27 | 46 75 6e 6b 79 5f 53 74 |dr.h <<'|Funky_St|
|00002d50| 75 66 66 27 0a 2f 2a 20 | 40 28 23 29 78 64 72 2e |uff'./* |@(#)xdr.|
|00002d60| 68 09 31 2e 31 20 38 37 | 2f 31 31 2f 30 34 20 33 |h.1.1 87|/11/04 3|
|00002d70| 2e 39 20 52 50 43 53 52 | 43 20 2a 2f 0a 2f 2a 0a |.9 RPCSR|C */./*.|
|00002d80| 20 2a 20 53 75 6e 20 52 | 50 43 20 69 73 20 61 20 | * Sun R|PC is a |
|00002d90| 70 72 6f 64 75 63 74 20 | 6f 66 20 53 75 6e 20 4d |product |of Sun M|
|00002da0| 69 63 72 6f 73 79 73 74 | 65 6d 73 2c 20 49 6e 63 |icrosyst|ems, Inc|
|00002db0| 2e 20 61 6e 64 20 69 73 | 20 70 72 6f 76 69 64 65 |. and is| provide|
|00002dc0| 64 20 66 6f 72 0a 20 2a | 20 75 6e 72 65 73 74 72 |d for. *| unrestr|
|00002dd0| 69 63 74 65 64 20 75 73 | 65 20 70 72 6f 76 69 64 |icted us|e provid|
|00002de0| 65 64 20 74 68 61 74 20 | 74 68 69 73 20 6c 65 67 |ed that |this leg|
|00002df0| 65 6e 64 20 69 73 20 69 | 6e 63 6c 75 64 65 64 20 |end is i|ncluded |
|00002e00| 6f 6e 20 61 6c 6c 20 74 | 61 70 65 0a 20 2a 20 6d |on all t|ape. * m|
|00002e10| 65 64 69 61 20 61 6e 64 | 20 61 73 20 61 20 70 61 |edia and| as a pa|
|00002e20| 72 74 20 6f 66 20 74 68 | 65 20 73 6f 66 74 77 61 |rt of th|e softwa|
|00002e30| 72 65 20 70 72 6f 67 72 | 61 6d 20 69 6e 20 77 68 |re progr|am in wh|
|00002e40| 6f 6c 65 20 6f 72 20 70 | 61 72 74 2e 20 20 55 73 |ole or p|art. Us|
|00002e50| 65 72 73 0a 20 2a 20 6d | 61 79 20 63 6f 70 79 20 |ers. * m|ay copy |
|00002e60| 6f 72 20 6d 6f 64 69 66 | 79 20 53 75 6e 20 52 50 |or modif|y Sun RP|
|00002e70| 43 20 77 69 74 68 6f 75 | 74 20 63 68 61 72 67 65 |C withou|t charge|
|00002e80| 2c 20 62 75 74 20 61 72 | 65 20 6e 6f 74 20 61 75 |, but ar|e not au|
|00002e90| 74 68 6f 72 69 7a 65 64 | 0a 20 2a 20 74 6f 20 6c |thorized|. * to l|
|00002ea0| 69 63 65 6e 73 65 20 6f | 72 20 64 69 73 74 72 69 |icense o|r distri|
|00002eb0| 62 75 74 65 20 69 74 20 | 74 6f 20 61 6e 79 6f 6e |bute it |to anyon|
|00002ec0| 65 20 65 6c 73 65 20 65 | 78 63 65 70 74 20 61 73 |e else e|xcept as|
|00002ed0| 20 70 61 72 74 20 6f 66 | 20 61 20 70 72 6f 64 75 | part of| a produ|
|00002ee0| 63 74 20 6f 72 0a 20 2a | 20 70 72 6f 67 72 61 6d |ct or. *| program|
|00002ef0| 20 64 65 76 65 6c 6f 70 | 65 64 20 62 79 20 74 68 | develop|ed by th|
|00002f00| 65 20 75 73 65 72 2e 0a | 20 2a 20 0a 20 2a 20 53 |e user..| * . * S|
|00002f10| 55 4e 20 52 50 43 20 49 | 53 20 50 52 4f 56 49 44 |UN RPC I|S PROVID|
|00002f20| 45 44 20 41 53 20 49 53 | 20 57 49 54 48 20 4e 4f |ED AS IS| WITH NO|
|00002f30| 20 57 41 52 52 41 4e 54 | 49 45 53 20 4f 46 20 41 | WARRANT|IES OF A|
|00002f40| 4e 59 20 4b 49 4e 44 20 | 49 4e 43 4c 55 44 49 4e |NY KIND |INCLUDIN|
|00002f50| 47 20 54 48 45 0a 20 2a | 20 57 41 52 52 41 4e 54 |G THE. *| WARRANT|
|00002f60| 49 45 53 20 4f 46 20 44 | 45 53 49 47 4e 2c 20 4d |IES OF D|ESIGN, M|
|00002f70| 45 52 43 48 41 4e 54 49 | 42 49 4c 49 54 59 20 41 |ERCHANTI|BILITY A|
|00002f80| 4e 44 20 46 49 54 4e 45 | 53 53 20 46 4f 52 20 41 |ND FITNE|SS FOR A|
|00002f90| 20 50 41 52 54 49 43 55 | 4c 41 52 0a 20 2a 20 50 | PARTICU|LAR. * P|
|00002fa0| 55 52 50 4f 53 45 2c 20 | 4f 52 20 41 52 49 53 49 |URPOSE, |OR ARISI|
|00002fb0| 4e 47 20 46 52 4f 4d 20 | 41 20 43 4f 55 52 53 45 |NG FROM |A COURSE|
|00002fc0| 20 4f 46 20 44 45 41 4c | 49 4e 47 2c 20 55 53 41 | OF DEAL|ING, USA|
|00002fd0| 47 45 20 4f 52 20 54 52 | 41 44 45 20 50 52 41 43 |GE OR TR|ADE PRAC|
|00002fe0| 54 49 43 45 2e 0a 20 2a | 20 0a 20 2a 20 53 75 6e |TICE.. *| . * Sun|
|00002ff0| 20 52 50 43 20 69 73 20 | 70 72 6f 76 69 64 65 64 | RPC is |provided|
|00003000| 20 77 69 74 68 20 6e 6f | 20 73 75 70 70 6f 72 74 | with no| support|
|00003010| 20 61 6e 64 20 77 69 74 | 68 6f 75 74 20 61 6e 79 | and wit|hout any|
|00003020| 20 6f 62 6c 69 67 61 74 | 69 6f 6e 20 6f 6e 20 74 | obligat|ion on t|
|00003030| 68 65 0a 20 2a 20 70 61 | 72 74 20 6f 66 20 53 75 |he. * pa|rt of Su|
|00003040| 6e 20 4d 69 63 72 6f 73 | 79 73 74 65 6d 73 2c 20 |n Micros|ystems, |
|00003050| 49 6e 63 2e 20 74 6f 20 | 61 73 73 69 73 74 20 69 |Inc. to |assist i|
|00003060| 6e 20 69 74 73 20 75 73 | 65 2c 20 63 6f 72 72 65 |n its us|e, corre|
|00003070| 63 74 69 6f 6e 2c 0a 20 | 2a 20 6d 6f 64 69 66 69 |ction,. |* modifi|
|00003080| 63 61 74 69 6f 6e 20 6f | 72 20 65 6e 68 61 6e 63 |cation o|r enhanc|
|00003090| 65 6d 65 6e 74 2e 0a 20 | 2a 20 0a 20 2a 20 53 55 |ement.. |* . * SU|
|000030a0| 4e 20 4d 49 43 52 4f 53 | 59 53 54 45 4d 53 2c 20 |N MICROS|YSTEMS, |
|000030b0| 49 4e 43 2e 20 53 48 41 | 4c 4c 20 48 41 56 45 20 |INC. SHA|LL HAVE |
|000030c0| 4e 4f 20 4c 49 41 42 49 | 4c 49 54 59 20 57 49 54 |NO LIABI|LITY WIT|
|000030d0| 48 20 52 45 53 50 45 43 | 54 20 54 4f 20 54 48 45 |H RESPEC|T TO THE|
|000030e0| 0a 20 2a 20 49 4e 46 52 | 49 4e 47 45 4d 45 4e 54 |. * INFR|INGEMENT|
|000030f0| 20 4f 46 20 43 4f 50 59 | 52 49 47 48 54 53 2c 20 | OF COPY|RIGHTS, |
|00003100| 54 52 41 44 45 20 53 45 | 43 52 45 54 53 20 4f 52 |TRADE SE|CRETS OR|
|00003110| 20 41 4e 59 20 50 41 54 | 45 4e 54 53 20 42 59 20 | ANY PAT|ENTS BY |
|00003120| 53 55 4e 20 52 50 43 0a | 20 2a 20 4f 52 20 41 4e |SUN RPC.| * OR AN|
|00003130| 59 20 50 41 52 54 20 54 | 48 45 52 45 4f 46 2e 0a |Y PART T|HEREOF..|
|00003140| 20 2a 20 0a 20 2a 20 49 | 6e 20 6e 6f 20 65 76 65 | * . * I|n no eve|
|00003150| 6e 74 20 77 69 6c 6c 20 | 53 75 6e 20 4d 69 63 72 |nt will |Sun Micr|
|00003160| 6f 73 79 73 74 65 6d 73 | 2c 20 49 6e 63 2e 20 62 |osystems|, Inc. b|
|00003170| 65 20 6c 69 61 62 6c 65 | 20 66 6f 72 20 61 6e 79 |e liable| for any|
|00003180| 20 6c 6f 73 74 20 72 65 | 76 65 6e 75 65 0a 20 2a | lost re|venue. *|
|00003190| 20 6f 72 20 70 72 6f 66 | 69 74 73 20 6f 72 20 6f | or prof|its or o|
|000031a0| 74 68 65 72 20 73 70 65 | 63 69 61 6c 2c 20 69 6e |ther spe|cial, in|
|000031b0| 64 69 72 65 63 74 20 61 | 6e 64 20 63 6f 6e 73 65 |direct a|nd conse|
|000031c0| 71 75 65 6e 74 69 61 6c | 20 64 61 6d 61 67 65 73 |quential| damages|
|000031d0| 2c 20 65 76 65 6e 20 69 | 66 0a 20 2a 20 53 75 6e |, even i|f. * Sun|
|000031e0| 20 68 61 73 20 62 65 65 | 6e 20 61 64 76 69 73 65 | has bee|n advise|
|000031f0| 64 20 6f 66 20 74 68 65 | 20 70 6f 73 73 69 62 69 |d of the| possibi|
|00003200| 6c 69 74 79 20 6f 66 20 | 73 75 63 68 20 64 61 6d |lity of |such dam|
|00003210| 61 67 65 73 2e 0a 20 2a | 20 0a 20 2a 20 53 75 6e |ages.. *| . * Sun|
|00003220| 20 4d 69 63 72 6f 73 79 | 73 74 65 6d 73 2c 20 49 | Microsy|stems, I|
|00003230| 6e 63 2e 0a 20 2a 20 32 | 35 35 30 20 47 61 72 63 |nc.. * 2|550 Garc|
|00003240| 69 61 20 41 76 65 6e 75 | 65 0a 20 2a 20 4d 6f 75 |ia Avenu|e. * Mou|
|00003250| 6e 74 61 69 6e 20 56 69 | 65 77 2c 20 43 61 6c 69 |ntain Vi|ew, Cali|
|00003260| 66 6f 72 6e 69 61 20 20 | 39 34 30 34 33 0a 20 2a |fornia |94043. *|
|00003270| 2f 0a 2f 2a 20 20 20 20 | 20 20 40 28 23 29 78 64 |/./* | @(#)xd|
|00003280| 72 2e 68 20 31 2e 31 39 | 20 38 37 2f 30 34 2f 32 |r.h 1.19| 87/04/2|
|00003290| 32 20 53 4d 49 20 20 20 | 20 20 20 2a 2f 0a 0a 2f |2 SMI | */../|
|000032a0| 2a 0a 20 2a 20 78 64 72 | 2e 68 2c 20 45 78 74 65 |*. * xdr|.h, Exte|
|000032b0| 72 6e 61 6c 20 44 61 74 | 61 20 52 65 70 72 65 73 |rnal Dat|a Repres|
|000032c0| 65 6e 74 61 74 69 6f 6e | 20 53 65 72 69 61 6c 69 |entation| Seriali|
|000032d0| 7a 61 74 69 6f 6e 20 52 | 6f 75 74 69 6e 65 73 2e |zation R|outines.|
|000032e0| 0a 20 2a 0a 20 2a 20 43 | 6f 70 79 72 69 67 68 74 |. *. * C|opyright|
|000032f0| 20 28 43 29 20 31 39 38 | 34 2c 20 53 75 6e 20 4d | (C) 198|4, Sun M|
|00003300| 69 63 72 6f 73 79 73 74 | 65 6d 73 2c 20 49 6e 63 |icrosyst|ems, Inc|
|00003310| 2e 0a 20 2a 2f 0a 0a 23 | 69 66 6e 64 65 66 20 5f |.. */..#|ifndef _|
|00003320| 5f 58 44 52 5f 48 45 41 | 44 45 52 5f 5f 0a 23 64 |_XDR_HEA|DER__.#d|
|00003330| 65 66 69 6e 65 20 5f 5f | 58 44 52 5f 48 45 41 44 |efine __|XDR_HEAD|
|00003340| 45 52 5f 5f 0a 0a 2f 2a | 0a 20 2a 20 58 44 52 20 |ER__../*|. * XDR |
|00003350| 70 72 6f 76 69 64 65 73 | 20 61 20 63 6f 6e 76 65 |provides| a conve|
|00003360| 6e 74 69 6f 6e 61 6c 20 | 77 61 79 20 66 6f 72 20 |ntional |way for |
|00003370| 63 6f 6e 76 65 72 74 69 | 6e 67 20 62 65 74 77 65 |converti|ng betwe|
|00003380| 65 6e 20 43 20 64 61 74 | 61 0a 20 2a 20 74 79 70 |en C dat|a. * typ|
|00003390| 65 73 20 61 6e 64 20 61 | 6e 20 65 78 74 65 72 6e |es and a|n extern|
|000033a0| 61 6c 20 62 69 74 2d 73 | 74 72 69 6e 67 20 72 65 |al bit-s|tring re|
|000033b0| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 2e 20 20 4c |presenta|tion. L|
|000033c0| 69 62 72 61 72 79 20 73 | 75 70 70 6c 69 65 64 0a |ibrary s|upplied.|
|000033d0| 20 2a 20 72 6f 75 74 69 | 6e 65 73 20 70 72 6f 76 | * routi|nes prov|
|000033e0| 69 64 65 20 66 6f 72 20 | 74 68 65 20 63 6f 6e 76 |ide for |the conv|
|000033f0| 65 72 73 69 6f 6e 20 6f | 6e 20 62 75 69 6c 74 2d |ersion o|n built-|
|00003400| 69 6e 20 43 20 64 61 74 | 61 20 74 79 70 65 73 2e |in C dat|a types.|
|00003410| 20 20 54 68 65 73 65 0a | 20 2a 20 72 6f 75 74 69 | These.| * routi|
|00003420| 6e 65 73 20 61 6e 64 20 | 75 74 69 6c 69 74 79 20 |nes and |utility |
|00003430| 72 6f 75 74 69 6e 65 73 | 20 64 65 66 69 6e 65 64 |routines| defined|
|00003440| 20 68 65 72 65 20 61 72 | 65 20 75 73 65 64 20 74 | here ar|e used t|
|00003450| 6f 20 68 65 6c 70 20 69 | 6d 70 6c 65 6d 65 6e 74 |o help i|mplement|
|00003460| 0a 20 2a 20 61 20 74 79 | 70 65 20 65 6e 63 6f 64 |. * a ty|pe encod|
|00003470| 65 2f 64 65 63 6f 64 65 | 20 72 6f 75 74 69 6e 65 |e/decode| routine|
|00003480| 20 66 6f 72 20 65 61 63 | 68 20 75 73 65 72 2d 64 | for eac|h user-d|
|00003490| 65 66 69 6e 65 64 20 74 | 79 70 65 2e 0a 20 2a 0a |efined t|ype.. *.|
|000034a0| 20 2a 20 45 61 63 68 20 | 64 61 74 61 20 74 79 70 | * Each |data typ|
|000034b0| 65 20 70 72 6f 76 69 64 | 65 73 20 61 20 73 69 6e |e provid|es a sin|
|000034c0| 67 6c 65 20 70 72 6f 63 | 65 64 75 72 65 20 77 68 |gle proc|edure wh|
|000034d0| 69 63 68 20 74 61 6b 65 | 73 20 74 77 6f 20 61 72 |ich take|s two ar|
|000034e0| 67 75 6d 65 6e 74 73 3a | 0a 20 2a 0a 20 2a 09 62 |guments:|. *. *.b|
|000034f0| 6f 6f 6c 5f 74 0a 20 2a | 09 78 64 72 70 72 6f 63 |ool_t. *|.xdrproc|
|00003500| 28 78 64 72 73 2c 20 61 | 72 67 72 65 73 70 29 0a |(xdrs, a|rgresp).|
|00003510| 20 2a 09 09 58 44 52 20 | 2a 78 64 72 73 3b 0a 20 | *..XDR |*xdrs;. |
|00003520| 2a 09 09 3c 74 79 70 65 | 3e 20 2a 61 72 67 72 65 |*..<type|> *argre|
|00003530| 73 70 3b 0a 20 2a 0a 20 | 2a 20 78 64 72 73 20 69 |sp;. *. |* xdrs i|
|00003540| 73 20 61 6e 20 69 6e 73 | 74 61 6e 63 65 20 6f 66 |s an ins|tance of|
|00003550| 20 61 20 58 44 52 20 68 | 61 6e 64 6c 65 2c 20 74 | a XDR h|andle, t|
|00003560| 6f 20 77 68 69 63 68 20 | 6f 72 20 66 72 6f 6d 20 |o which |or from |
|00003570| 77 68 69 63 68 20 74 68 | 65 20 64 61 74 61 0a 20 |which th|e data. |
|00003580| 2a 20 74 79 70 65 20 69 | 73 20 74 6f 20 62 65 20 |* type i|s to be |
|00003590| 63 6f 6e 76 65 72 74 65 | 64 2e 20 20 61 72 67 72 |converte|d. argr|
|000035a0| 65 73 70 20 69 73 20 61 | 20 70 6f 69 6e 74 65 72 |esp is a| pointer|
|000035b0| 20 74 6f 20 74 68 65 20 | 73 74 72 75 63 74 75 72 | to the |structur|
|000035c0| 65 20 74 6f 20 62 65 0a | 20 2a 20 63 6f 6e 76 65 |e to be.| * conve|
|000035d0| 72 74 65 64 2e 20 20 54 | 68 65 20 58 44 52 20 68 |rted. T|he XDR h|
|000035e0| 61 6e 64 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 61 |andle co|ntains a|
|000035f0| 6e 20 6f 70 65 72 61 74 | 69 6f 6e 20 66 69 65 6c |n operat|ion fiel|
|00003600| 64 20 77 68 69 63 68 20 | 69 6e 64 69 63 61 74 65 |d which |indicate|
|00003610| 73 0a 20 2a 20 77 68 69 | 63 68 20 6f 66 20 74 68 |s. * whi|ch of th|
|00003620| 65 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 28 45 4e |e operat|ions (EN|
|00003630| 43 4f 44 45 2c 20 44 45 | 43 4f 44 45 20 2a 20 6f |CODE, DE|CODE * o|
|00003640| 72 20 46 52 45 45 29 20 | 69 73 20 74 6f 20 62 65 |r FREE) |is to be|
|00003650| 20 70 65 72 66 6f 72 6d | 65 64 2e 0a 20 2a 0a 20 | perform|ed.. *. |
|00003660| 2a 20 58 44 52 5f 44 45 | 43 4f 44 45 20 6d 61 79 |* XDR_DE|CODE may|
|00003670| 20 61 6c 6c 6f 63 61 74 | 65 20 73 70 61 63 65 20 | allocat|e space |
|00003680| 69 66 20 74 68 65 20 70 | 6f 69 6e 74 65 72 20 61 |if the p|ointer a|
|00003690| 72 67 72 65 73 70 20 69 | 73 20 6e 75 6c 6c 2e 20 |rgresp i|s null. |
|000036a0| 20 54 68 69 73 0a 20 2a | 20 64 61 74 61 20 63 61 | This. *| data ca|
|000036b0| 6e 20 62 65 20 66 72 65 | 65 64 20 77 69 74 68 20 |n be fre|ed with |
|000036c0| 74 68 65 20 58 44 52 5f | 46 52 45 45 20 6f 70 65 |the XDR_|FREE ope|
|000036d0| 72 61 74 69 6f 6e 2e 0a | 20 2a 0a 20 2a 20 57 65 |ration..| *. * We|
|000036e0| 20 77 72 69 74 65 20 6f | 6e 6c 79 20 6f 6e 65 20 | write o|nly one |
|000036f0| 70 72 6f 63 65 64 75 72 | 65 20 70 65 72 20 64 61 |procedur|e per da|
|00003700| 74 61 20 74 79 70 65 20 | 74 6f 20 6d 61 6b 65 20 |ta type |to make |
|00003710| 69 74 20 65 61 73 79 0a | 20 2a 20 74 6f 20 6b 65 |it easy.| * to ke|
|00003720| 65 70 20 74 68 65 20 65 | 6e 63 6f 64 65 20 61 6e |ep the e|ncode an|
|00003730| 64 20 64 65 63 6f 64 65 | 20 70 72 6f 63 65 64 75 |d decode| procedu|
|00003740| 72 65 73 20 66 6f 72 20 | 61 20 64 61 74 61 20 74 |res for |a data t|
|00003750| 79 70 65 20 63 6f 6e 73 | 69 73 74 65 6e 74 2e 0a |ype cons|istent..|
|00003760| 20 2a 20 49 6e 20 6d 61 | 6e 79 20 63 61 73 65 73 | * In ma|ny cases|
|00003770| 20 74 68 65 20 73 61 6d | 65 20 63 6f 64 65 20 70 | the sam|e code p|
|00003780| 65 72 66 6f 72 6d 73 20 | 61 6c 6c 20 6f 70 65 72 |erforms |all oper|
|00003790| 61 74 69 6f 6e 73 20 6f | 6e 20 61 20 75 73 65 72 |ations o|n a user|
|000037a0| 20 64 65 66 69 6e 65 64 | 20 74 79 70 65 2c 0a 20 | defined| type,. |
|000037b0| 2a 20 62 65 63 61 75 73 | 65 20 61 6c 6c 20 74 68 |* becaus|e all th|
|000037c0| 65 20 68 61 72 64 20 77 | 6f 72 6b 20 69 73 20 64 |e hard w|ork is d|
|000037d0| 6f 6e 65 20 69 6e 20 74 | 68 65 20 63 6f 6d 70 6f |one in t|he compo|
|000037e0| 6e 65 6e 74 20 74 79 70 | 65 20 72 6f 75 74 69 6e |nent typ|e routin|
|000037f0| 65 73 2e 0a 20 2a 20 64 | 65 63 6f 64 65 20 61 73 |es.. * d|ecode as|
|00003800| 20 61 20 73 65 72 69 65 | 73 20 6f 66 20 63 61 6c | a serie|s of cal|
|00003810| 6c 73 20 6f 6e 20 74 68 | 65 20 6e 65 73 74 65 64 |ls on th|e nested|
|00003820| 20 64 61 74 61 20 74 79 | 70 65 73 2e 0a 20 2a 2f | data ty|pes.. */|
|00003830| 0a 0a 2f 2a 0a 20 2a 20 | 58 64 72 20 6f 70 65 72 |../*. * |Xdr oper|
|00003840| 61 74 69 6f 6e 73 2e 20 | 20 58 44 52 5f 45 4e 43 |ations. | XDR_ENC|
|00003850| 4f 44 45 20 63 61 75 73 | 65 73 20 74 68 65 20 74 |ODE caus|es the t|
|00003860| 79 70 65 20 74 6f 20 62 | 65 20 65 6e 63 6f 64 65 |ype to b|e encode|
|00003870| 64 20 69 6e 74 6f 20 74 | 68 65 0a 20 2a 20 73 74 |d into t|he. * st|
|00003880| 72 65 61 6d 2e 20 20 58 | 44 52 5f 44 45 43 4f 44 |ream. X|DR_DECOD|
|00003890| 45 20 63 61 75 73 65 73 | 20 74 68 65 20 74 79 70 |E causes| the typ|
|000038a0| 65 20 74 6f 20 62 65 20 | 65 78 74 72 61 63 74 65 |e to be |extracte|
|000038b0| 64 20 66 72 6f 6d 20 74 | 68 65 20 73 74 72 65 61 |d from t|he strea|
|000038c0| 6d 2e 0a 20 2a 20 58 44 | 52 5f 46 52 45 45 20 63 |m.. * XD|R_FREE c|
|000038d0| 61 6e 20 62 65 20 75 73 | 65 64 20 74 6f 20 72 65 |an be us|ed to re|
|000038e0| 6c 65 61 73 65 20 74 68 | 65 20 73 70 61 63 65 20 |lease th|e space |
|000038f0| 61 6c 6c 6f 63 61 74 65 | 64 20 62 79 20 61 6e 20 |allocate|d by an |
|00003900| 58 44 52 5f 44 45 43 4f | 44 45 0a 20 2a 20 72 65 |XDR_DECO|DE. * re|
|00003910| 71 75 65 73 74 2e 0a 20 | 2a 2f 0a 65 6e 75 6d 20 |quest.. |*/.enum |
|00003920| 78 64 72 5f 6f 70 20 7b | 0a 09 58 44 52 5f 45 4e |xdr_op {|..XDR_EN|
|00003930| 43 4f 44 45 3d 30 2c 0a | 09 58 44 52 5f 44 45 43 |CODE=0,.|.XDR_DEC|
|00003940| 4f 44 45 3d 31 2c 0a 09 | 58 44 52 5f 46 52 45 45 |ODE=1,..|XDR_FREE|
|00003950| 3d 32 0a 7d 3b 0a 0a 2f | 2a 0a 20 2a 20 54 68 69 |=2.};../|*. * Thi|
|00003960| 73 20 69 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |s is the| number |
|00003970| 6f 66 20 62 79 74 65 73 | 20 70 65 72 20 75 6e 69 |of bytes| per uni|
|00003980| 74 20 6f 66 20 65 78 74 | 65 72 6e 61 6c 20 64 61 |t of ext|ernal da|
|00003990| 74 61 2e 0a 20 2a 2f 0a | 23 64 65 66 69 6e 65 20 |ta.. */.|#define |
|000039a0| 42 59 54 45 53 5f 50 45 | 52 5f 58 44 52 5f 55 4e |BYTES_PE|R_XDR_UN|
|000039b0| 49 54 09 28 34 29 0a 23 | 64 65 66 69 6e 65 20 52 |IT.(4).#|define R|
|000039c0| 4e 44 55 50 28 78 29 20 | 20 28 28 28 28 78 29 20 |NDUP(x) | ((((x) |
|000039d0| 2b 20 42 59 54 45 53 5f | 50 45 52 5f 58 44 52 5f |+ BYTES_|PER_XDR_|
|000039e0| 55 4e 49 54 20 2d 20 31 | 29 20 2f 20 42 59 54 45 |UNIT - 1|) / BYTE|
|000039f0| 53 5f 50 45 52 5f 58 44 | 52 5f 55 4e 49 54 29 20 |S_PER_XD|R_UNIT) |
|00003a00| 5c 0a 09 09 20 20 20 20 | 2a 20 42 59 54 45 53 5f |\... |* BYTES_|
|00003a10| 50 45 52 5f 58 44 52 5f | 55 4e 49 54 29 0a 0a 2f |PER_XDR_|UNIT)../|
|00003a20| 2a 0a 20 2a 20 41 20 78 | 64 72 70 72 6f 63 5f 74 |*. * A x|drproc_t|
|00003a30| 20 65 78 69 73 74 73 20 | 66 6f 72 20 65 61 63 68 | exists |for each|
|00003a40| 20 64 61 74 61 20 74 79 | 70 65 20 77 68 69 63 68 | data ty|pe which|
|00003a50| 20 69 73 20 74 6f 20 62 | 65 20 65 6e 63 6f 64 65 | is to b|e encode|
|00003a60| 64 20 6f 72 20 64 65 63 | 6f 64 65 64 2e 0a 20 2a |d or dec|oded.. *|
|00003a70| 0a 20 2a 20 54 68 65 20 | 73 65 63 6f 6e 64 20 61 |. * The |second a|
|00003a80| 72 67 75 6d 65 6e 74 20 | 74 6f 20 74 68 65 20 78 |rgument |to the x|
|00003a90| 64 72 70 72 6f 63 5f 74 | 20 69 73 20 61 20 70 6f |drproc_t| is a po|
|00003aa0| 69 6e 74 65 72 20 74 6f | 20 61 6e 20 6f 70 61 71 |inter to| an opaq|
|00003ab0| 75 65 20 70 6f 69 6e 74 | 65 72 2e 0a 20 2a 20 54 |ue point|er.. * T|
|00003ac0| 68 65 20 6f 70 61 71 75 | 65 20 70 6f 69 6e 74 65 |he opaqu|e pointe|
|00003ad0| 72 20 67 65 6e 65 72 61 | 6c 6c 79 20 70 6f 69 6e |r genera|lly poin|
|00003ae0| 74 73 20 74 6f 20 61 20 | 73 74 72 75 63 74 75 72 |ts to a |structur|
|00003af0| 65 20 6f 66 20 74 68 65 | 20 64 61 74 61 20 74 79 |e of the| data ty|
|00003b00| 70 65 0a 20 2a 20 74 6f | 20 62 65 20 64 65 63 6f |pe. * to| be deco|
|00003b10| 64 65 64 2e 20 20 49 66 | 20 74 68 69 73 20 70 6f |ded. If| this po|
|00003b20| 69 6e 74 65 72 20 69 73 | 20 30 2c 20 74 68 65 6e |inter is| 0, then|
|00003b30| 20 74 68 65 20 74 79 70 | 65 20 72 6f 75 74 69 6e | the typ|e routin|
|00003b40| 65 73 20 73 68 6f 75 6c | 64 0a 20 2a 20 61 6c 6c |es shoul|d. * all|
|00003b50| 6f 63 61 74 65 20 64 79 | 6e 61 6d 69 63 20 73 74 |ocate dy|namic st|
|00003b60| 6f 72 61 67 65 20 6f 66 | 20 74 68 65 20 61 70 70 |orage of| the app|
|00003b70| 72 6f 70 72 69 61 74 65 | 20 73 69 7a 65 20 61 6e |ropriate| size an|
|00003b80| 64 20 72 65 74 75 72 6e | 20 69 74 2e 0a 20 2a 20 |d return| it.. * |
|00003b90| 62 6f 6f 6c 5f 74 09 28 | 2a 78 64 72 70 72 6f 63 |bool_t.(|*xdrproc|
|00003ba0| 5f 74 29 28 58 44 52 20 | 2a 2c 20 63 61 64 64 72 |_t)(XDR |*, caddr|
|00003bb0| 5f 74 20 2a 29 3b 0a 20 | 2a 2f 0a 74 79 70 65 64 |_t *);. |*/.typed|
|00003bc0| 65 66 09 62 6f 6f 6c 5f | 74 20 28 2a 78 64 72 70 |ef.bool_|t (*xdrp|
|00003bd0| 72 6f 63 5f 74 29 28 29 | 3b 0a 0a 2f 2a 0a 20 2a |roc_t)()|;../*. *|
|00003be0| 20 54 68 65 20 58 44 52 | 20 68 61 6e 64 6c 65 2e | The XDR| handle.|
|00003bf0| 0a 20 2a 20 43 6f 6e 74 | 61 69 6e 73 20 6f 70 65 |. * Cont|ains ope|
|00003c00| 72 61 74 69 6f 6e 20 77 | 68 69 63 68 20 69 73 20 |ration w|hich is |
|00003c10| 62 65 69 6e 67 20 61 70 | 70 6c 69 65 64 20 74 6f |being ap|plied to|
|00003c20| 20 74 68 65 20 73 74 72 | 65 61 6d 2c 0a 20 2a 20 | the str|eam,. * |
|00003c30| 61 6e 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 76 65 |an opera|tions ve|
|00003c40| 63 74 6f 72 20 66 6f 72 | 20 74 68 65 20 70 61 74 |ctor for| the pat|
|00003c50| 69 63 75 6c 61 72 20 69 | 6d 70 6c 65 6d 65 6e 74 |icular i|mplement|
|00003c60| 61 74 69 6f 6e 20 28 65 | 2e 67 2e 20 73 65 65 20 |ation (e|.g. see |
|00003c70| 78 64 72 5f 6d 65 6d 2e | 63 29 2c 0a 20 2a 20 61 |xdr_mem.|c),. * a|
|00003c80| 6e 64 20 74 77 6f 20 70 | 72 69 76 61 74 65 20 66 |nd two p|rivate f|
|00003c90| 69 65 6c 64 73 20 66 6f | 72 20 74 68 65 20 75 73 |ields fo|r the us|
|00003ca0| 65 20 6f 66 20 74 68 65 | 20 70 61 72 74 69 63 75 |e of the| particu|
|00003cb0| 6c 61 72 20 69 6d 70 65 | 6c 65 6d 65 6e 74 61 74 |lar impe|lementat|
|00003cc0| 69 6f 6e 2e 0a 20 2a 2f | 0a 74 79 70 65 64 65 66 |ion.. */|.typedef|
|00003cd0| 20 73 74 72 75 63 74 20 | 7b 0a 09 65 6e 75 6d 20 | struct |{..enum |
|00003ce0| 78 64 72 5f 6f 70 09 78 | 5f 6f 70 3b 09 09 2f 2a |xdr_op.x|_op;../*|
|00003cf0| 20 6f 70 65 72 61 74 69 | 6f 6e 3b 20 66 61 73 74 | operati|on; fast|
|00003d00| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 70 61 72 61 | additio|nal para|
|00003d10| 6d 20 2a 2f 0a 09 73 74 | 72 75 63 74 20 78 64 72 |m */..st|ruct xdr|
|00003d20| 5f 6f 70 73 20 7b 0a 09 | 09 62 6f 6f 6c 5f 74 09 |_ops {..|.bool_t.|
|00003d30| 28 2a 78 5f 67 65 74 6c | 6f 6e 67 29 28 29 3b 09 |(*x_getl|ong)();.|
|00003d40| 2f 2a 20 67 65 74 20 61 | 20 6c 6f 6e 67 20 66 72 |/* get a| long fr|
|00003d50| 6f 6d 20 75 6e 64 65 72 | 6c 79 69 6e 67 20 73 74 |om under|lying st|
|00003d60| 72 65 61 6d 20 2a 2f 0a | 09 09 62 6f 6f 6c 5f 74 |ream */.|..bool_t|
|00003d70| 09 28 2a 78 5f 70 75 74 | 6c 6f 6e 67 29 28 29 3b |.(*x_put|long)();|
|00003d80| 09 2f 2a 20 70 75 74 20 | 61 20 6c 6f 6e 67 20 74 |./* put |a long t|
|00003d90| 6f 20 22 20 2a 2f 0a 09 | 09 62 6f 6f 6c 5f 74 09 |o " */..|.bool_t.|
|00003da0| 28 2a 78 5f 67 65 74 62 | 79 74 65 73 29 28 29 3b |(*x_getb|ytes)();|
|00003db0| 2f 2a 20 67 65 74 20 73 | 6f 6d 65 20 62 79 74 65 |/* get s|ome byte|
|00003dc0| 73 20 66 72 6f 6d 20 22 | 20 2a 2f 0a 09 09 62 6f |s from "| */...bo|
|00003dd0| 6f 6c 5f 74 09 28 2a 78 | 5f 70 75 74 62 79 74 65 |ol_t.(*x|_putbyte|
|00003de0| 73 29 28 29 3b 2f 2a 20 | 70 75 74 20 73 6f 6d 65 |s)();/* |put some|
|00003df0| 20 62 79 74 65 73 20 74 | 6f 20 22 20 2a 2f 0a 09 | bytes t|o " */..|
|00003e00| 09 75 5f 69 6e 74 09 28 | 2a 78 5f 67 65 74 70 6f |.u_int.(|*x_getpo|
|00003e10| 73 74 6e 29 28 29 3b 2f | 2a 20 72 65 74 75 72 6e |stn)();/|* return|
|00003e20| 73 20 62 79 74 65 73 20 | 6f 66 66 20 66 72 6f 6d |s bytes |off from|
|00003e30| 20 62 65 67 69 6e 6e 69 | 6e 67 20 2a 2f 0a 09 09 | beginni|ng */...|
|00003e40| 62 6f 6f 6c 5f 74 20 20 | 28 2a 78 5f 73 65 74 70 |bool_t |(*x_setp|
|00003e50| 6f 73 74 6e 29 28 29 3b | 2f 2a 20 6c 65 74 73 20 |ostn)();|/* lets |
|00003e60| 79 6f 75 20 72 65 70 6f | 73 69 74 69 6f 6e 20 74 |you repo|sition t|
|00003e70| 68 65 20 73 74 72 65 61 | 6d 20 2a 2f 0a 09 09 6c |he strea|m */...l|
|00003e80| 6f 6e 67 20 2a 09 28 2a | 78 5f 69 6e 6c 69 6e 65 |ong *.(*|x_inline|
|00003e90| 29 28 29 3b 09 2f 2a 20 | 62 75 66 20 71 75 69 63 |)();./* |buf quic|
|00003ea0| 6b 20 70 74 72 20 74 6f | 20 62 75 66 66 65 72 65 |k ptr to| buffere|
|00003eb0| 64 20 64 61 74 61 20 2a | 2f 0a 09 09 76 6f 69 64 |d data *|/...void|
|00003ec0| 09 28 2a 78 5f 64 65 73 | 74 72 6f 79 29 28 29 3b |.(*x_des|troy)();|
|00003ed0| 09 2f 2a 20 66 72 65 65 | 20 70 72 69 76 61 74 65 |./* free| private|
|00003ee0| 73 20 6f 66 20 74 68 69 | 73 20 78 64 72 5f 73 74 |s of thi|s xdr_st|
|00003ef0| 72 65 61 6d 20 2a 2f 0a | 09 7d 20 2a 78 5f 6f 70 |ream */.|.} *x_op|
|00003f00| 73 3b 0a 09 63 61 64 64 | 72 5f 74 20 09 78 5f 70 |s;..cadd|r_t .x_p|
|00003f10| 75 62 6c 69 63 3b 09 2f | 2a 20 75 73 65 72 73 27 |ublic;./|* users'|
|00003f20| 20 64 61 74 61 20 2a 2f | 0a 09 63 61 64 64 72 5f | data */|..caddr_|
|00003f30| 74 09 09 78 5f 70 72 69 | 76 61 74 65 3b 09 2f 2a |t..x_pri|vate;./*|
|00003f40| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 70 72 69 76 | pointer| to priv|
|00003f50| 61 74 65 20 64 61 74 61 | 20 2a 2f 0a 09 63 61 64 |ate data| */..cad|
|00003f60| 64 72 5f 74 20 09 78 5f | 62 61 73 65 3b 09 09 2f |dr_t .x_|base;../|
|00003f70| 2a 20 70 72 69 76 61 74 | 65 20 75 73 65 64 20 66 |* privat|e used f|
|00003f80| 6f 72 20 70 6f 73 69 74 | 69 6f 6e 20 69 6e 66 6f |or posit|ion info|
|00003f90| 20 2a 2f 0a 09 69 6e 74 | 09 09 78 5f 68 61 6e 64 | */..int|..x_hand|
|00003fa0| 79 3b 09 2f 2a 20 65 78 | 74 72 61 20 70 72 69 76 |y;./* ex|tra priv|
|00003fb0| 61 74 65 20 77 6f 72 64 | 20 2a 2f 0a 7d 20 58 44 |ate word| */.} XD|
|00003fc0| 52 3b 0a 0a 2f 2a 0a 20 | 2a 20 4f 70 65 72 61 74 |R;../*. |* Operat|
|00003fd0| 69 6f 6e 73 20 64 65 66 | 69 6e 65 64 20 6f 6e 20 |ions def|ined on |
|00003fe0| 61 20 58 44 52 20 68 61 | 6e 64 6c 65 0a 20 2a 0a |a XDR ha|ndle. *.|
|00003ff0| 20 2a 20 58 44 52 09 09 | 2a 78 64 72 73 3b 0a 20 | * XDR..|*xdrs;. |
|00004000| 2a 20 6c 6f 6e 67 09 09 | 2a 6c 6f 6e 67 70 3b 0a |* long..|*longp;.|
|00004010| 20 2a 20 63 61 64 64 72 | 5f 74 09 20 61 64 64 72 | * caddr|_t. addr|
|00004020| 3b 0a 20 2a 20 75 5f 69 | 6e 74 09 20 6c 65 6e 3b |;. * u_i|nt. len;|
|00004030| 0a 20 2a 20 75 5f 69 6e | 74 09 20 70 6f 73 3b 0a |. * u_in|t. pos;.|
|00004040| 20 2a 2f 0a 23 64 65 66 | 69 6e 65 20 58 44 52 5f | */.#def|ine XDR_|
|00004050| 47 45 54 4c 4f 4e 47 28 | 78 64 72 73 2c 20 6c 6f |GETLONG(|xdrs, lo|
|00004060| 6e 67 70 29 09 09 09 5c | 0a 09 28 2a 28 78 64 72 |ngp)...\|..(*(xdr|
|00004070| 73 29 2d 3e 78 5f 6f 70 | 73 2d 3e 78 5f 67 65 74 |s)->x_op|s->x_get|
|00004080| 6c 6f 6e 67 29 28 78 64 | 72 73 2c 20 6c 6f 6e 67 |long)(xd|rs, long|
|00004090| 70 29 0a 23 64 65 66 69 | 6e 65 20 78 64 72 5f 67 |p).#defi|ne xdr_g|
|000040a0| 65 74 6c 6f 6e 67 28 78 | 64 72 73 2c 20 6c 6f 6e |etlong(x|drs, lon|
|000040b0| 67 70 29 09 09 09 5c 0a | 09 28 2a 28 78 64 72 73 |gp)...\.|.(*(xdrs|
|000040c0| 29 2d 3e 78 5f 6f 70 73 | 2d 3e 78 5f 67 65 74 6c |)->x_ops|->x_getl|
|000040d0| 6f 6e 67 29 28 78 64 72 | 73 2c 20 6c 6f 6e 67 70 |ong)(xdr|s, longp|
|000040e0| 29 0a 0a 23 64 65 66 69 | 6e 65 20 58 44 52 5f 50 |)..#defi|ne XDR_P|
|000040f0| 55 54 4c 4f 4e 47 28 78 | 64 72 73 2c 20 6c 6f 6e |UTLONG(x|drs, lon|
|00004100| 67 70 29 09 09 09 5c 0a | 09 28 2a 28 78 64 72 73 |gp)...\.|.(*(xdrs|
|00004110| 29 2d 3e 78 5f 6f 70 73 | 2d 3e 78 5f 70 75 74 6c |)->x_ops|->x_putl|
|00004120| 6f 6e 67 29 28 78 64 72 | 73 2c 20 6c 6f 6e 67 70 |ong)(xdr|s, longp|
|00004130| 29 0a 23 64 65 66 69 6e | 65 20 78 64 72 5f 70 75 |).#defin|e xdr_pu|
|00004140| 74 6c 6f 6e 67 28 78 64 | 72 73 2c 20 6c 6f 6e 67 |tlong(xd|rs, long|
|00004150| 70 29 09 09 09 5c 0a 09 | 28 2a 28 78 64 72 73 29 |p)...\..|(*(xdrs)|
|00004160| 2d 3e 78 5f 6f 70 73 2d | 3e 78 5f 70 75 74 6c 6f |->x_ops-|>x_putlo|
|00004170| 6e 67 29 28 78 64 72 73 | 2c 20 6c 6f 6e 67 70 29 |ng)(xdrs|, longp)|
|00004180| 0a 0a 23 64 65 66 69 6e | 65 20 58 44 52 5f 47 45 |..#defin|e XDR_GE|
|00004190| 54 42 59 54 45 53 28 78 | 64 72 73 2c 20 61 64 64 |TBYTES(x|drs, add|
|000041a0| 72 2c 20 6c 65 6e 29 09 | 09 09 5c 0a 09 28 2a 28 |r, len).|..\..(*(|
|000041b0| 78 64 72 73 29 2d 3e 78 | 5f 6f 70 73 2d 3e 78 5f |xdrs)->x|_ops->x_|
|000041c0| 67 65 74 62 79 74 65 73 | 29 28 78 64 72 73 2c 20 |getbytes|)(xdrs, |
|000041d0| 61 64 64 72 2c 20 6c 65 | 6e 29 0a 23 64 65 66 69 |addr, le|n).#defi|
|000041e0| 6e 65 20 78 64 72 5f 67 | 65 74 62 79 74 65 73 28 |ne xdr_g|etbytes(|
|000041f0| 78 64 72 73 2c 20 61 64 | 64 72 2c 20 6c 65 6e 29 |xdrs, ad|dr, len)|
|00004200| 09 09 09 5c 0a 09 28 2a | 28 78 64 72 73 29 2d 3e |...\..(*|(xdrs)->|
|00004210| 78 5f 6f 70 73 2d 3e 78 | 5f 67 65 74 62 79 74 65 |x_ops->x|_getbyte|
|00004220| 73 29 28 78 64 72 73 2c | 20 61 64 64 72 2c 20 6c |s)(xdrs,| addr, l|
|00004230| 65 6e 29 0a 0a 23 64 65 | 66 69 6e 65 20 58 44 52 |en)..#de|fine XDR|
|00004240| 5f 50 55 54 42 59 54 45 | 53 28 78 64 72 73 2c 20 |_PUTBYTE|S(xdrs, |
|00004250| 61 64 64 72 2c 20 6c 65 | 6e 29 09 09 09 5c 0a 09 |addr, le|n)...\..|
|00004260| 28 2a 28 78 64 72 73 29 | 2d 3e 78 5f 6f 70 73 2d |(*(xdrs)|->x_ops-|
|00004270| 3e 78 5f 70 75 74 62 79 | 74 65 73 29 28 78 64 72 |>x_putby|tes)(xdr|
|00004280| 73 2c 20 61 64 64 72 2c | 20 6c 65 6e 29 0a 23 64 |s, addr,| len).#d|
|00004290| 65 66 69 6e 65 20 78 64 | 72 5f 70 75 74 62 79 74 |efine xd|r_putbyt|
|000042a0| 65 73 28 78 64 72 73 2c | 20 61 64 64 72 2c 20 6c |es(xdrs,| addr, l|
|000042b0| 65 6e 29 09 09 09 5c 0a | 09 28 2a 28 78 64 72 73 |en)...\.|.(*(xdrs|
|000042c0| 29 2d 3e 78 5f 6f 70 73 | 2d 3e 78 5f 70 75 74 62 |)->x_ops|->x_putb|
|000042d0| 79 74 65 73 29 28 78 64 | 72 73 2c 20 61 64 64 72 |ytes)(xd|rs, addr|
|000042e0| 2c 20 6c 65 6e 29 0a 0a | 23 64 65 66 69 6e 65 20 |, len)..|#define |
|000042f0| 58 44 52 5f 47 45 54 50 | 4f 53 28 78 64 72 73 29 |XDR_GETP|OS(xdrs)|
|00004300| 09 09 09 09 5c 0a 09 28 | 2a 28 78 64 72 73 29 2d |....\..(|*(xdrs)-|
|00004310| 3e 78 5f 6f 70 73 2d 3e | 78 5f 67 65 74 70 6f 73 |>x_ops->|x_getpos|
|00004320| 74 6e 29 28 78 64 72 73 | 29 0a 23 64 65 66 69 6e |tn)(xdrs|).#defin|
|00004330| 65 20 78 64 72 5f 67 65 | 74 70 6f 73 28 78 64 72 |e xdr_ge|tpos(xdr|
|00004340| 73 29 09 09 09 09 5c 0a | 09 28 2a 28 78 64 72 73 |s)....\.|.(*(xdrs|
|00004350| 29 2d 3e 78 5f 6f 70 73 | 2d 3e 78 5f 67 65 74 70 |)->x_ops|->x_getp|
|00004360| 6f 73 74 6e 29 28 78 64 | 72 73 29 0a 0a 23 64 65 |ostn)(xd|rs)..#de|
|00004370| 66 69 6e 65 20 58 44 52 | 5f 53 45 54 50 4f 53 28 |fine XDR|_SETPOS(|
|00004380| 78 64 72 73 2c 20 70 6f | 73 29 09 09 09 09 5c 0a |xdrs, po|s)....\.|
|00004390| 09 28 2a 28 78 64 72 73 | 29 2d 3e 78 5f 6f 70 73 |.(*(xdrs|)->x_ops|
|000043a0| 2d 3e 78 5f 73 65 74 70 | 6f 73 74 6e 29 28 78 64 |->x_setp|ostn)(xd|
|000043b0| 72 73 2c 20 70 6f 73 29 | 0a 23 64 65 66 69 6e 65 |rs, pos)|.#define|
|000043c0| 20 78 64 72 5f 73 65 74 | 70 6f 73 28 78 64 72 73 | xdr_set|pos(xdrs|
|000043d0| 2c 20 70 6f 73 29 09 09 | 09 09 5c 0a 09 28 2a 28 |, pos)..|..\..(*(|
|000043e0| 78 64 72 73 29 2d 3e 78 | 5f 6f 70 73 2d 3e 78 5f |xdrs)->x|_ops->x_|
|000043f0| 73 65 74 70 6f 73 74 6e | 29 28 78 64 72 73 2c 20 |setpostn|)(xdrs, |
|00004400| 70 6f 73 29 0a 0a 23 64 | 65 66 69 6e 65 09 58 44 |pos)..#d|efine.XD|
|00004410| 52 5f 49 4e 4c 49 4e 45 | 28 78 64 72 73 2c 20 6c |R_INLINE|(xdrs, l|
|00004420| 65 6e 29 09 09 09 09 5c | 0a 09 28 2a 28 78 64 72 |en)....\|..(*(xdr|
|00004430| 73 29 2d 3e 78 5f 6f 70 | 73 2d 3e 78 5f 69 6e 6c |s)->x_op|s->x_inl|
|00004440| 69 6e 65 29 28 78 64 72 | 73 2c 20 6c 65 6e 29 0a |ine)(xdr|s, len).|
|00004450| 23 64 65 66 69 6e 65 09 | 78 64 72 5f 69 6e 6c 69 |#define.|xdr_inli|
|00004460| 6e 65 28 78 64 72 73 2c | 20 6c 65 6e 29 09 09 09 |ne(xdrs,| len)...|
|00004470| 09 5c 0a 09 28 2a 28 78 | 64 72 73 29 2d 3e 78 5f |.\..(*(x|drs)->x_|
|00004480| 6f 70 73 2d 3e 78 5f 69 | 6e 6c 69 6e 65 29 28 78 |ops->x_i|nline)(x|
|00004490| 64 72 73 2c 20 6c 65 6e | 29 0a 0a 23 64 65 66 69 |drs, len|)..#defi|
|000044a0| 6e 65 09 58 44 52 5f 44 | 45 53 54 52 4f 59 28 78 |ne.XDR_D|ESTROY(x|
|000044b0| 64 72 73 29 09 09 09 09 | 5c 0a 09 69 66 20 28 28 |drs)....|\..if ((|
|000044c0| 78 64 72 73 29 2d 3e 78 | 5f 6f 70 73 2d 3e 78 5f |xdrs)->x|_ops->x_|
|000044d0| 64 65 73 74 72 6f 79 29 | 20 09 09 09 5c 0a 09 09 |destroy)| ...\...|
|000044e0| 28 2a 28 78 64 72 73 29 | 2d 3e 78 5f 6f 70 73 2d |(*(xdrs)|->x_ops-|
|000044f0| 3e 78 5f 64 65 73 74 72 | 6f 79 29 28 78 64 72 73 |>x_destr|oy)(xdrs|
|00004500| 29 0a 23 64 65 66 69 6e | 65 09 78 64 72 5f 64 65 |).#defin|e.xdr_de|
|00004510| 73 74 72 6f 79 28 78 64 | 72 73 29 09 09 09 09 5c |stroy(xd|rs)....\|
|00004520| 0a 09 69 66 20 28 28 78 | 64 72 73 29 2d 3e 78 5f |..if ((x|drs)->x_|
|00004530| 6f 70 73 2d 3e 78 5f 64 | 65 73 74 72 6f 79 29 20 |ops->x_d|estroy) |
|00004540| 09 09 09 5c 0a 09 09 28 | 2a 28 78 64 72 73 29 2d |...\...(|*(xdrs)-|
|00004550| 3e 78 5f 6f 70 73 2d 3e | 78 5f 64 65 73 74 72 6f |>x_ops->|x_destro|
|00004560| 79 29 28 78 64 72 73 29 | 0a 0a 2f 2a 0a 20 2a 20 |y)(xdrs)|../*. * |
|00004570| 53 75 70 70 6f 72 74 20 | 73 74 72 75 63 74 20 66 |Support |struct f|
|00004580| 6f 72 20 64 69 73 63 72 | 69 6d 69 6e 61 74 65 64 |or discr|iminated|
|00004590| 20 75 6e 69 6f 6e 73 2e | 0a 20 2a 20 59 6f 75 20 | unions.|. * You |
|000045a0| 63 72 65 61 74 65 20 61 | 6e 20 61 72 72 61 79 20 |create a|n array |
|000045b0| 6f 66 20 78 64 72 64 69 | 73 63 72 69 6d 20 73 74 |of xdrdi|scrim st|
|000045c0| 72 75 63 74 75 72 65 73 | 2c 20 74 65 72 6d 69 6e |ructures|, termin|
|000045d0| 61 74 65 64 20 77 69 74 | 68 0a 20 2a 20 61 20 65 |ated wit|h. * a e|
|000045e0| 6e 74 72 79 20 77 69 74 | 68 20 61 20 6e 75 6c 6c |ntry wit|h a null|
|000045f0| 20 70 72 6f 63 65 64 75 | 72 65 20 70 6f 69 6e 74 | procedu|re point|
|00004600| 65 72 2e 20 20 54 68 65 | 20 78 64 72 5f 75 6e 69 |er. The| xdr_uni|
|00004610| 6f 6e 20 72 6f 75 74 69 | 6e 65 20 67 65 74 73 0a |on routi|ne gets.|
|00004620| 20 2a 20 74 68 65 20 64 | 69 73 63 72 69 6d 69 6e | * the d|iscrimin|
|00004630| 61 6e 74 20 76 61 6c 75 | 65 20 61 6e 64 20 74 68 |ant valu|e and th|
|00004640| 65 6e 20 73 65 61 72 63 | 68 65 73 20 74 68 65 20 |en searc|hes the |
|00004650| 61 72 72 61 79 20 6f 66 | 20 73 74 72 75 63 74 75 |array of| structu|
|00004660| 72 65 73 0a 20 2a 20 66 | 6f 72 20 61 20 6d 61 74 |res. * f|or a mat|
|00004670| 63 68 69 6e 67 20 76 61 | 6c 75 65 2e 20 20 49 66 |ching va|lue. If|
|00004680| 20 61 20 6d 61 74 63 68 | 20 69 73 20 66 6f 75 6e | a match| is foun|
|00004690| 64 20 74 68 65 20 61 73 | 73 6f 63 69 61 74 65 64 |d the as|sociated|
|000046a0| 20 78 64 72 20 72 6f 75 | 74 69 6e 65 0a 20 2a 20 | xdr rou|tine. * |
|000046b0| 69 73 20 63 61 6c 6c 65 | 64 20 74 6f 20 68 61 6e |is calle|d to han|
|000046c0| 64 6c 65 20 74 68 61 74 | 20 70 61 72 74 20 6f 66 |dle that| part of|
|000046d0| 20 74 68 65 20 75 6e 69 | 6f 6e 2e 20 20 49 66 20 | the uni|on. If |
|000046e0| 74 68 65 72 65 20 69 73 | 0a 20 2a 20 6e 6f 20 6d |there is|. * no m|
|000046f0| 61 74 63 68 2c 20 74 68 | 65 6e 20 61 20 64 65 66 |atch, th|en a def|
|00004700| 61 75 6c 74 20 72 6f 75 | 74 69 6e 65 20 6d 61 79 |ault rou|tine may|
|00004710| 20 62 65 20 63 61 6c 6c | 65 64 2e 0a 20 2a 20 49 | be call|ed.. * I|
|00004720| 66 20 74 68 65 72 65 20 | 69 73 20 6e 6f 20 6d 61 |f there |is no ma|
|00004730| 74 63 68 20 61 6e 64 20 | 6e 6f 20 64 65 66 61 75 |tch and |no defau|
|00004740| 6c 74 20 72 6f 75 74 69 | 6e 65 20 69 74 20 69 73 |lt routi|ne it is|
|00004750| 20 61 6e 20 65 72 72 6f | 72 2e 0a 20 2a 2f 0a 23 | an erro|r.. */.#|
|00004760| 64 65 66 69 6e 65 20 4e | 55 4c 4c 5f 78 64 72 70 |define N|ULL_xdrp|
|00004770| 72 6f 63 5f 74 20 28 28 | 78 64 72 70 72 6f 63 5f |roc_t ((|xdrproc_|
|00004780| 74 29 30 29 0a 73 74 72 | 75 63 74 20 78 64 72 5f |t)0).str|uct xdr_|
|00004790| 64 69 73 63 72 69 6d 20 | 7b 0a 09 69 6e 74 09 76 |discrim |{..int.v|
|000047a0| 61 6c 75 65 3b 0a 09 78 | 64 72 70 72 6f 63 5f 74 |alue;..x|drproc_t|
|000047b0| 20 70 72 6f 63 3b 0a 7d | 3b 0a 0a 2f 2a 0a 20 2a | proc;.}|;../*. *|
|000047c0| 20 49 6e 2d 6c 69 6e 65 | 20 72 6f 75 74 69 6e 65 | In-line| routine|
|000047d0| 73 20 66 6f 72 20 66 61 | 73 74 20 65 6e 63 6f 64 |s for fa|st encod|
|000047e0| 65 2f 64 65 63 6f 64 65 | 20 6f 66 20 70 72 69 6d |e/decode| of prim|
|000047f0| 69 74 76 65 20 64 61 74 | 61 20 74 79 70 65 73 2e |itve dat|a types.|
|00004800| 0a 20 2a 20 43 61 76 65 | 61 74 20 65 6d 70 74 6f |. * Cave|at empto|
|00004810| 72 3a 20 74 68 65 73 65 | 20 75 73 65 20 73 69 6e |r: these| use sin|
|00004820| 67 6c 65 20 6d 65 6d 6f | 72 79 20 63 79 63 6c 65 |gle memo|ry cycle|
|00004830| 73 20 74 6f 20 67 65 74 | 20 74 68 65 0a 20 2a 20 |s to get| the. * |
|00004840| 64 61 74 61 20 66 72 6f | 6d 20 74 68 65 20 75 6e |data fro|m the un|
|00004850| 64 65 72 6c 79 69 6e 67 | 20 62 75 66 66 65 72 2c |derlying| buffer,|
|00004860| 20 61 6e 64 20 77 69 6c | 6c 20 66 61 69 6c 20 74 | and wil|l fail t|
|00004870| 6f 20 6f 70 65 72 61 74 | 65 0a 20 2a 20 70 72 6f |o operat|e. * pro|
|00004880| 70 65 72 6c 79 20 69 66 | 20 74 68 65 20 64 61 74 |perly if| the dat|
|00004890| 61 20 69 73 20 6e 6f 74 | 20 61 6c 69 67 6e 65 64 |a is not| aligned|
|000048a0| 2e 20 20 54 68 65 20 73 | 74 61 6e 64 61 72 64 20 |. The s|tandard |
|000048b0| 77 61 79 20 74 6f 20 75 | 73 65 20 74 68 65 73 65 |way to u|se these|
|000048c0| 0a 20 2a 20 69 73 20 74 | 6f 20 73 61 79 3a 0a 20 |. * is t|o say:. |
|000048d0| 2a 09 69 66 20 28 28 62 | 75 66 20 3d 20 58 44 52 |*.if ((b|uf = XDR|
|000048e0| 5f 49 4e 4c 49 4e 45 28 | 78 64 72 73 2c 20 63 6f |_INLINE(|xdrs, co|
|000048f0| 75 6e 74 29 29 20 3d 3d | 20 4e 55 4c 4c 29 0a 20 |unt)) ==| NULL). |
|00004900| 2a 09 09 72 65 74 75 72 | 6e 20 28 46 41 4c 53 45 |*..retur|n (FALSE|
|00004910| 29 3b 0a 20 2a 09 3c 3c | 3c 20 6d 61 63 72 6f 20 |);. *.<<|< macro |
|00004920| 63 61 6c 6c 73 20 3e 3e | 3e 0a 20 2a 20 77 68 65 |calls >>|>. * whe|
|00004930| 72 65 20 60 60 63 6f 75 | 6e 74 27 27 20 69 73 20 |re ``cou|nt'' is |
|00004940| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 79 |the numb|er of by|
|00004950| 74 65 73 20 6f 66 20 64 | 61 74 61 20 6f 63 63 75 |tes of d|ata occu|
|00004960| 70 69 65 64 0a 20 2a 20 | 62 79 20 74 68 65 20 70 |pied. * |by the p|
|00004970| 72 69 6d 69 74 69 76 65 | 20 64 61 74 61 20 74 79 |rimitive| data ty|
|00004980| 70 65 73 2e 0a 20 2a 0a | 20 2a 20 4e 2e 42 2e 20 |pes.. *.| * N.B. |
|00004990| 61 6e 64 20 66 72 6f 7a | 65 6e 20 66 6f 72 20 61 |and froz|en for a|
|000049a0| 6c 6c 20 74 69 6d 65 3a | 20 65 61 63 68 20 64 61 |ll time:| each da|
|000049b0| 74 61 20 74 79 70 65 20 | 68 65 72 65 20 75 73 65 |ta type |here use|
|000049c0| 73 20 34 20 62 79 74 65 | 73 0a 20 2a 20 6f 66 20 |s 4 byte|s. * of |
|000049d0| 65 78 74 65 72 6e 61 6c | 20 72 65 70 72 65 73 65 |external| represe|
|000049e0| 6e 74 61 74 69 6f 6e 2e | 0a 20 2a 2f 0a 23 64 65 |ntation.|. */.#de|
|000049f0| 66 69 6e 65 20 49 58 44 | 52 5f 47 45 54 5f 4c 4f |fine IXD|R_GET_LO|
|00004a00| 4e 47 28 62 75 66 29 09 | 09 28 28 6c 6f 6e 67 29 |NG(buf).|.((long)|
|00004a10| 6e 74 6f 68 6c 28 28 75 | 5f 6c 6f 6e 67 29 2a 28 |ntohl((u|_long)*(|
|00004a20| 62 75 66 29 2b 2b 29 29 | 0a 23 64 65 66 69 6e 65 |buf)++))|.#define|
|00004a30| 20 49 58 44 52 5f 50 55 | 54 5f 4c 4f 4e 47 28 62 | IXDR_PU|T_LONG(b|
|00004a40| 75 66 2c 20 76 29 09 09 | 28 2a 28 62 75 66 29 2b |uf, v)..|(*(buf)+|
|00004a50| 2b 20 3d 20 28 6c 6f 6e | 67 29 68 74 6f 6e 6c 28 |+ = (lon|g)htonl(|
|00004a60| 28 75 5f 6c 6f 6e 67 29 | 76 29 29 0a 0a 23 64 65 |(u_long)|v))..#de|
|00004a70| 66 69 6e 65 20 49 58 44 | 52 5f 47 45 54 5f 42 4f |fine IXD|R_GET_BO|
|00004a80| 4f 4c 28 62 75 66 29 09 | 09 28 28 62 6f 6f 6c 5f |OL(buf).|.((bool_|
|00004a90| 74 29 49 58 44 52 5f 47 | 45 54 5f 4c 4f 4e 47 28 |t)IXDR_G|ET_LONG(|
|00004aa0| 62 75 66 29 29 0a 23 64 | 65 66 69 6e 65 20 49 58 |buf)).#d|efine IX|
|00004ab0| 44 52 5f 47 45 54 5f 45 | 4e 55 4d 28 62 75 66 2c |DR_GET_E|NUM(buf,|
|00004ac0| 20 74 29 09 09 28 28 74 | 29 49 58 44 52 5f 47 45 | t)..((t|)IXDR_GE|
|00004ad0| 54 5f 4c 4f 4e 47 28 62 | 75 66 29 29 0a 23 64 65 |T_LONG(b|uf)).#de|
|00004ae0| 66 69 6e 65 20 49 58 44 | 52 5f 47 45 54 5f 55 5f |fine IXD|R_GET_U_|
|00004af0| 4c 4f 4e 47 28 62 75 66 | 29 09 09 28 28 75 5f 6c |LONG(buf|)..((u_l|
|00004b00| 6f 6e 67 29 49 58 44 52 | 5f 47 45 54 5f 4c 4f 4e |ong)IXDR|_GET_LON|
|00004b10| 47 28 62 75 66 29 29 0a | 23 64 65 66 69 6e 65 20 |G(buf)).|#define |
|00004b20| 49 58 44 52 5f 47 45 54 | 5f 53 48 4f 52 54 28 62 |IXDR_GET|_SHORT(b|
|00004b30| 75 66 29 09 09 28 28 73 | 68 6f 72 74 29 49 58 44 |uf)..((s|hort)IXD|
|00004b40| 52 5f 47 45 54 5f 4c 4f | 4e 47 28 62 75 66 29 29 |R_GET_LO|NG(buf))|
|00004b50| 0a 23 64 65 66 69 6e 65 | 20 49 58 44 52 5f 47 45 |.#define| IXDR_GE|
|00004b60| 54 5f 55 5f 53 48 4f 52 | 54 28 62 75 66 29 09 09 |T_U_SHOR|T(buf)..|
|00004b70| 28 28 75 5f 73 68 6f 72 | 74 29 49 58 44 52 5f 47 |((u_shor|t)IXDR_G|
|00004b80| 45 54 5f 4c 4f 4e 47 28 | 62 75 66 29 29 0a 0a 23 |ET_LONG(|buf))..#|
|00004b90| 64 65 66 69 6e 65 20 49 | 58 44 52 5f 50 55 54 5f |define I|XDR_PUT_|
|00004ba0| 42 4f 4f 4c 28 62 75 66 | 2c 20 76 29 09 09 49 58 |BOOL(buf|, v)..IX|
|00004bb0| 44 52 5f 50 55 54 5f 4c | 4f 4e 47 28 28 62 75 66 |DR_PUT_L|ONG((buf|
|00004bc0| 29 2c 20 28 28 6c 6f 6e | 67 29 28 76 29 29 29 0a |), ((lon|g)(v))).|
|00004bd0| 23 64 65 66 69 6e 65 20 | 49 58 44 52 5f 50 55 54 |#define |IXDR_PUT|
|00004be0| 5f 45 4e 55 4d 28 62 75 | 66 2c 20 76 29 09 09 49 |_ENUM(bu|f, v)..I|
|00004bf0| 58 44 52 5f 50 55 54 5f | 4c 4f 4e 47 28 28 62 75 |XDR_PUT_|LONG((bu|
|00004c00| 66 29 2c 20 28 28 6c 6f | 6e 67 29 28 76 29 29 29 |f), ((lo|ng)(v)))|
|00004c10| 0a 23 64 65 66 69 6e 65 | 20 49 58 44 52 5f 50 55 |.#define| IXDR_PU|
|00004c20| 54 5f 55 5f 4c 4f 4e 47 | 28 62 75 66 2c 20 76 29 |T_U_LONG|(buf, v)|
|00004c30| 09 09 49 58 44 52 5f 50 | 55 54 5f 4c 4f 4e 47 28 |..IXDR_P|UT_LONG(|
|00004c40| 28 62 75 66 29 2c 20 28 | 28 6c 6f 6e 67 29 28 76 |(buf), (|(long)(v|
|00004c50| 29 29 29 0a 23 64 65 66 | 69 6e 65 20 49 58 44 52 |))).#def|ine IXDR|
|00004c60| 5f 50 55 54 5f 53 48 4f | 52 54 28 62 75 66 2c 20 |_PUT_SHO|RT(buf, |
|00004c70| 76 29 09 09 49 58 44 52 | 5f 50 55 54 5f 4c 4f 4e |v)..IXDR|_PUT_LON|
|00004c80| 47 28 28 62 75 66 29 2c | 20 28 28 6c 6f 6e 67 29 |G((buf),| ((long)|
|00004c90| 28 76 29 29 29 0a 23 64 | 65 66 69 6e 65 20 49 58 |(v))).#d|efine IX|
|00004ca0| 44 52 5f 50 55 54 5f 55 | 5f 53 48 4f 52 54 28 62 |DR_PUT_U|_SHORT(b|
|00004cb0| 75 66 2c 20 76 29 09 49 | 58 44 52 5f 50 55 54 5f |uf, v).I|XDR_PUT_|
|00004cc0| 4c 4f 4e 47 28 28 62 75 | 66 29 2c 20 28 28 6c 6f |LONG((bu|f), ((lo|
|00004cd0| 6e 67 29 28 76 29 29 29 | 0a 0a 2f 2a 0a 20 2a 20 |ng)(v)))|../*. * |
|00004ce0| 54 68 65 73 65 20 61 72 | 65 20 74 68 65 20 22 67 |These ar|e the "g|
|00004cf0| 65 6e 65 72 69 63 22 20 | 78 64 72 20 72 6f 75 74 |eneric" |xdr rout|
|00004d00| 69 6e 65 73 2e 0a 20 2a | 2f 0a 65 78 74 65 72 6e |ines.. *|/.extern|
|00004d10| 20 62 6f 6f 6c 5f 74 09 | 78 64 72 5f 76 6f 69 64 | bool_t.|xdr_void|
|00004d20| 28 29 3b 0a 65 78 74 65 | 72 6e 20 62 6f 6f 6c 5f |();.exte|rn bool_|
|00004d30| 74 09 78 64 72 5f 69 6e | 74 28 29 3b 0a 65 78 74 |t.xdr_in|t();.ext|
|00004d40| 65 72 6e 20 62 6f 6f 6c | 5f 74 09 78 64 72 5f 75 |ern bool|_t.xdr_u|
|00004d50| 5f 69 6e 74 28 29 3b 0a | 65 78 74 65 72 6e 20 62 |_int();.|extern b|
|00004d60| 6f 6f 6c 5f 74 09 78 64 | 72 5f 6c 6f 6e 67 28 29 |ool_t.xd|r_long()|
|00004d70| 3b 0a 65 78 74 65 72 6e | 20 62 6f 6f 6c 5f 74 09 |;.extern| bool_t.|
|00004d80| 78 64 72 5f 75 5f 6c 6f | 6e 67 28 29 3b 0a 65 78 |xdr_u_lo|ng();.ex|
|00004d90| 74 65 72 6e 20 62 6f 6f | 6c 5f 74 09 78 64 72 5f |tern boo|l_t.xdr_|
|00004da0| 73 68 6f 72 74 28 29 3b | 0a 65 78 74 65 72 6e 20 |short();|.extern |
|00004db0| 62 6f 6f 6c 5f 74 09 78 | 64 72 5f 75 5f 73 68 6f |bool_t.x|dr_u_sho|
|00004dc0| 72 74 28 29 3b 0a 65 78 | 74 65 72 6e 20 62 6f 6f |rt();.ex|tern boo|
|00004dd0| 6c 5f 74 09 78 64 72 5f | 62 6f 6f 6c 28 29 3b 0a |l_t.xdr_|bool();.|
|00004de0| 65 78 74 65 72 6e 20 62 | 6f 6f 6c 5f 74 09 78 64 |extern b|ool_t.xd|
|00004df0| 72 5f 65 6e 75 6d 28 29 | 3b 0a 65 78 74 65 72 6e |r_enum()|;.extern|
|00004e00| 20 62 6f 6f 6c 5f 74 09 | 78 64 72 5f 61 72 72 61 | bool_t.|xdr_arra|
|00004e10| 79 28 29 3b 0a 65 78 74 | 65 72 6e 20 62 6f 6f 6c |y();.ext|ern bool|
|00004e20| 5f 74 09 78 64 72 5f 62 | 79 74 65 73 28 29 3b 0a |_t.xdr_b|ytes();.|
|00004e30| 65 78 74 65 72 6e 20 62 | 6f 6f 6c 5f 74 09 78 64 |extern b|ool_t.xd|
|00004e40| 72 5f 6f 70 61 71 75 65 | 28 29 3b 0a 65 78 74 65 |r_opaque|();.exte|
|00004e50| 72 6e 20 62 6f 6f 6c 5f | 74 09 78 64 72 5f 73 74 |rn bool_|t.xdr_st|
|00004e60| 72 69 6e 67 28 29 3b 0a | 65 78 74 65 72 6e 20 62 |ring();.|extern b|
|00004e70| 6f 6f 6c 5f 74 09 78 64 | 72 5f 75 6e 69 6f 6e 28 |ool_t.xd|r_union(|
|00004e80| 29 3b 0a 65 78 74 65 72 | 6e 20 62 6f 6f 6c 5f 74 |);.exter|n bool_t|
|00004e90| 09 78 64 72 5f 63 68 61 | 72 28 29 3b 0a 65 78 74 |.xdr_cha|r();.ext|
|00004ea0| 65 72 6e 20 62 6f 6f 6c | 5f 74 09 78 64 72 5f 75 |ern bool|_t.xdr_u|
|00004eb0| 5f 63 68 61 72 28 29 3b | 0a 65 78 74 65 72 6e 20 |_char();|.extern |
|00004ec0| 62 6f 6f 6c 5f 74 09 78 | 64 72 5f 76 65 63 74 6f |bool_t.x|dr_vecto|
|00004ed0| 72 28 29 3b 0a 65 78 74 | 65 72 6e 20 62 6f 6f 6c |r();.ext|ern bool|
|00004ee0| 5f 74 09 78 64 72 5f 66 | 6c 6f 61 74 28 29 3b 0a |_t.xdr_f|loat();.|
|00004ef0| 65 78 74 65 72 6e 20 62 | 6f 6f 6c 5f 74 09 78 64 |extern b|ool_t.xd|
|00004f00| 72 5f 64 6f 75 62 6c 65 | 28 29 3b 0a 65 78 74 65 |r_double|();.exte|
|00004f10| 72 6e 20 62 6f 6f 6c 5f | 74 09 78 64 72 5f 72 65 |rn bool_|t.xdr_re|
|00004f20| 66 65 72 65 6e 63 65 28 | 29 3b 0a 65 78 74 65 72 |ference(|);.exter|
|00004f30| 6e 20 62 6f 6f 6c 5f 74 | 09 78 64 72 5f 70 6f 69 |n bool_t|.xdr_poi|
|00004f40| 6e 74 65 72 28 29 3b 0a | 65 78 74 65 72 6e 20 62 |nter();.|extern b|
|00004f50| 6f 6f 6c 5f 74 09 78 64 | 72 5f 77 72 61 70 73 74 |ool_t.xd|r_wrapst|
|00004f60| 72 69 6e 67 28 29 3b 0a | 0a 2f 2a 0a 20 2a 20 43 |ring();.|./*. * C|
|00004f70| 6f 6d 6d 6f 6e 20 6f 70 | 61 71 75 65 20 62 79 74 |ommon op|aque byt|
|00004f80| 65 73 20 6f 62 6a 65 63 | 74 73 20 75 73 65 64 20 |es objec|ts used |
|00004f90| 62 79 20 6d 61 6e 79 20 | 72 70 63 20 70 72 6f 74 |by many |rpc prot|
|00004fa0| 6f 63 6f 6c 73 3b 0a 20 | 2a 20 64 65 63 6c 61 72 |ocols;. |* declar|
|00004fb0| 65 64 20 68 65 72 65 20 | 64 75 65 20 74 6f 20 63 |ed here |due to c|
|00004fc0| 6f 6d 6d 6f 6e 61 6c 69 | 74 79 2e 0a 20 2a 2f 0a |ommonali|ty.. */.|
|00004fd0| 23 64 65 66 69 6e 65 20 | 4d 41 58 5f 4e 45 54 4f |#define |MAX_NETO|
|00004fe0| 42 4a 5f 53 5a 20 31 30 | 32 34 20 0a 73 74 72 75 |BJ_SZ 10|24 .stru|
|00004ff0| 63 74 20 6e 65 74 6f 62 | 6a 20 7b 0a 09 75 5f 69 |ct netob|j {..u_i|
|00005000| 6e 74 09 6e 5f 6c 65 6e | 3b 0a 09 63 68 61 72 09 |nt.n_len|;..char.|
|00005010| 2a 6e 5f 62 79 74 65 73 | 3b 0a 7d 3b 0a 74 79 70 |*n_bytes|;.};.typ|
|00005020| 65 64 65 66 20 73 74 72 | 75 63 74 20 6e 65 74 6f |edef str|uct neto|
|00005030| 62 6a 20 6e 65 74 6f 62 | 6a 3b 0a 65 78 74 65 72 |bj netob|j;.exter|
|00005040| 6e 20 62 6f 6f 6c 5f 74 | 20 20 20 78 64 72 5f 6e |n bool_t| xdr_n|
|00005050| 65 74 6f 62 6a 28 29 3b | 0a 0a 2f 2a 0a 20 2a 20 |etobj();|../*. * |
|00005060| 54 68 65 73 65 20 61 72 | 65 20 74 68 65 20 70 75 |These ar|e the pu|
|00005070| 62 6c 69 63 20 72 6f 75 | 74 69 6e 65 73 20 66 6f |blic rou|tines fo|
|00005080| 72 20 74 68 65 20 76 61 | 72 69 6f 75 73 20 69 6d |r the va|rious im|
|00005090| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 73 20 6f 66 |plementa|tions of|
|000050a0| 0a 20 2a 20 78 64 72 20 | 73 74 72 65 61 6d 73 2e |. * xdr |streams.|
|000050b0| 0a 20 2a 2f 0a 65 78 74 | 65 72 6e 20 76 6f 69 64 |. */.ext|ern void|
|000050c0| 20 20 20 78 64 72 6d 65 | 6d 5f 63 72 65 61 74 65 | xdrme|m_create|
|000050d0| 28 29 3b 09 09 2f 2a 20 | 58 44 52 20 75 73 69 6e |();../* |XDR usin|
|000050e0| 67 20 6d 65 6d 6f 72 79 | 20 62 75 66 66 65 72 73 |g memory| buffers|
|000050f0| 20 2a 2f 0a 65 78 74 65 | 72 6e 20 76 6f 69 64 20 | */.exte|rn void |
|00005100| 20 20 78 64 72 73 74 64 | 69 6f 5f 63 72 65 61 74 | xdrstd|io_creat|
|00005110| 65 28 29 3b 09 2f 2a 20 | 58 44 52 20 75 73 69 6e |e();./* |XDR usin|
|00005120| 67 20 73 74 64 69 6f 20 | 6c 69 62 72 61 72 79 20 |g stdio |library |
|00005130| 2a 2f 0a 65 78 74 65 72 | 6e 20 76 6f 69 64 20 20 |*/.exter|n void |
|00005140| 20 78 64 72 72 65 63 5f | 63 72 65 61 74 65 28 29 | xdrrec_|create()|
|00005150| 3b 09 09 2f 2a 20 58 44 | 52 20 70 73 65 75 64 6f |;../* XD|R pseudo|
|00005160| 20 72 65 63 6f 72 64 73 | 20 66 6f 72 20 74 63 70 | records| for tcp|
|00005170| 20 2a 2f 0a 65 78 74 65 | 72 6e 20 62 6f 6f 6c 5f | */.exte|rn bool_|
|00005180| 74 20 78 64 72 72 65 63 | 5f 65 6e 64 6f 66 72 65 |t xdrrec|_endofre|
|00005190| 63 6f 72 64 28 29 3b 09 | 2f 2a 20 6d 61 6b 65 20 |cord();.|/* make |
|000051a0| 65 6e 64 20 6f 66 20 78 | 64 72 20 72 65 63 6f 72 |end of x|dr recor|
|000051b0| 64 20 2a 2f 0a 65 78 74 | 65 72 6e 20 62 6f 6f 6c |d */.ext|ern bool|
|000051c0| 5f 74 20 78 64 72 72 65 | 63 5f 73 6b 69 70 72 65 |_t xdrre|c_skipre|
|000051d0| 63 6f 72 64 28 29 3b 09 | 2f 2a 20 6d 6f 76 65 20 |cord();.|/* move |
|000051e0| 74 6f 20 62 65 67 69 6e | 6e 69 6e 67 20 6f 66 20 |to begin|ning of |
|000051f0| 6e 65 78 74 20 72 65 63 | 6f 72 64 20 2a 2f 0a 65 |next rec|ord */.e|
|00005200| 78 74 65 72 6e 20 62 6f | 6f 6c 5f 74 20 78 64 72 |xtern bo|ol_t xdr|
|00005210| 72 65 63 5f 65 6f 66 28 | 29 3b 09 09 2f 2a 20 74 |rec_eof(|);../* t|
|00005220| 72 75 65 20 69 66 20 6e | 6f 20 6d 6f 72 65 20 69 |rue if n|o more i|
|00005230| 6e 70 75 74 20 2a 2f 0a | 0a 23 65 6e 64 69 66 20 |nput */.|.#endif |
|00005240| 21 5f 5f 58 44 52 5f 48 | 45 41 44 45 52 5f 5f 0a |!__XDR_H|EADER__.|
|00005250| 46 75 6e 6b 79 5f 53 74 | 75 66 66 0a 6c 65 6e 3d |Funky_St|uff.len=|
|00005260| 60 77 63 20 2d 63 20 3c | 20 78 64 72 2e 68 60 0a |`wc -c <| xdr.h`.|
|00005270| 69 66 20 5b 20 24 6c 65 | 6e 20 21 3d 20 20 20 20 |if [ $le|n != |
|00005280| 20 39 34 36 37 20 5d 20 | 3b 20 74 68 65 6e 0a 20 | 9467 ] |; then. |
|00005290| 20 65 63 68 6f 20 65 72 | 72 6f 72 3a 20 78 64 72 | echo er|ror: xdr|
|000052a0| 2e 68 20 77 61 73 20 24 | 6c 65 6e 20 62 79 74 65 |.h was $|len byte|
|000052b0| 73 20 6c 6f 6e 67 2c 20 | 73 68 6f 75 6c 64 20 68 |s long, |should h|
|000052c0| 61 76 65 20 62 65 65 6e | 20 20 20 20 20 39 34 36 |ave been| 946|
|000052d0| 37 0a 66 69 0a 65 63 68 | 6f 20 78 20 2d 20 78 64 |7.fi.ech|o x - xd|
|000052e0| 72 5f 61 72 72 61 79 2e | 63 0a 63 61 74 20 3e 20 |r_array.|c.cat > |
|000052f0| 78 64 72 5f 61 72 72 61 | 79 2e 63 20 3c 3c 27 46 |xdr_arra|y.c <<'F|
|00005300| 75 6e 6b 79 5f 53 74 75 | 66 66 27 0a 2f 2a 20 40 |unky_Stu|ff'./* @|
|00005310| 28 23 29 78 64 72 5f 61 | 72 72 61 79 2e 63 09 31 |(#)xdr_a|rray.c.1|
|00005320| 2e 31 20 38 37 2f 31 31 | 2f 30 34 20 33 2e 39 20 |.1 87/11|/04 3.9 |
|00005330| 52 50 43 53 52 43 20 2a | 2f 0a 2f 2a 0a 20 2a 20 |RPCSRC *|/./*. * |
|00005340| 53 75 6e 20 52 50 43 20 | 69 73 20 61 20 70 72 6f |Sun RPC |is a pro|
|00005350| 64 75 63 74 20 6f 66 20 | 53 75 6e 20 4d 69 63 72 |duct of |Sun Micr|
|00005360| 6f 73 79 73 74 65 6d 73 | 2c 20 49 6e 63 2e 20 61 |osystems|, Inc. a|
|00005370| 6e 64 20 69 73 20 70 72 | 6f 76 69 64 65 64 20 66 |nd is pr|ovided f|
|00005380| 6f 72 0a 20 2a 20 75 6e | 72 65 73 74 72 69 63 74 |or. * un|restrict|
|00005390| 65 64 20 75 73 65 20 70 | 72 6f 76 69 64 65 64 20 |ed use p|rovided |
|000053a0| 74 68 61 74 20 74 68 69 | 73 20 6c 65 67 65 6e 64 |that thi|s legend|
|000053b0| 20 69 73 20 69 6e 63 6c | 75 64 65 64 20 6f 6e 20 | is incl|uded on |
|000053c0| 61 6c 6c 20 74 61 70 65 | 0a 20 2a 20 6d 65 64 69 |all tape|. * medi|
|000053d0| 61 20 61 6e 64 20 61 73 | 20 61 20 70 61 72 74 20 |a and as| a part |
|000053e0| 6f 66 20 74 68 65 20 73 | 6f 66 74 77 61 72 65 20 |of the s|oftware |
|000053f0| 70 72 6f 67 72 61 6d 20 | 69 6e 20 77 68 6f 6c 65 |program |in whole|
|00005400| 20 6f 72 20 70 61 72 74 | 2e 20 20 55 73 65 72 73 | or part|. Users|
|00005410| 0a 20 2a 20 6d 61 79 20 | 63 6f 70 79 20 6f 72 20 |. * may |copy or |
|00005420| 6d 6f 64 69 66 79 20 53 | 75 6e 20 52 50 43 20 77 |modify S|un RPC w|
|00005430| 69 74 68 6f 75 74 20 63 | 68 61 72 67 65 2c 20 62 |ithout c|harge, b|
|00005440| 75 74 20 61 72 65 20 6e | 6f 74 20 61 75 74 68 6f |ut are n|ot autho|
|00005450| 72 69 7a 65 64 0a 20 2a | 20 74 6f 20 6c 69 63 65 |rized. *| to lice|
|00005460| 6e 73 65 20 6f 72 20 64 | 69 73 74 72 69 62 75 74 |nse or d|istribut|
|00005470| 65 20 69 74 20 74 6f 20 | 61 6e 79 6f 6e 65 20 65 |e it to |anyone e|
|00005480| 6c 73 65 20 65 78 63 65 | 70 74 20 61 73 20 70 61 |lse exce|pt as pa|
|00005490| 72 74 20 6f 66 20 61 20 | 70 72 6f 64 75 63 74 20 |rt of a |product |
|000054a0| 6f 72 0a 20 2a 20 70 72 | 6f 67 72 61 6d 20 64 65 |or. * pr|ogram de|
|000054b0| 76 65 6c 6f 70 65 64 20 | 62 79 20 74 68 65 20 75 |veloped |by the u|
|000054c0| 73 65 72 2e 0a 20 2a 20 | 0a 20 2a 20 53 55 4e 20 |ser.. * |. * SUN |
|000054d0| 52 50 43 20 49 53 20 50 | 52 4f 56 49 44 45 44 20 |RPC IS P|ROVIDED |
|000054e0| 41 53 20 49 53 20 57 49 | 54 48 20 4e 4f 20 57 41 |AS IS WI|TH NO WA|
|000054f0| 52 52 41 4e 54 49 45 53 | 20 4f 46 20 41 4e 59 20 |RRANTIES| OF ANY |
|00005500| 4b 49 4e 44 20 49 4e 43 | 4c 55 44 49 4e 47 20 54 |KIND INC|LUDING T|
|00005510| 48 45 0a 20 2a 20 57 41 | 52 52 41 4e 54 49 45 53 |HE. * WA|RRANTIES|
|00005520| 20 4f 46 20 44 45 53 49 | 47 4e 2c 20 4d 45 52 43 | OF DESI|GN, MERC|
|00005530| 48 41 4e 54 49 42 49 4c | 49 54 59 20 41 4e 44 20 |HANTIBIL|ITY AND |
|00005540| 46 49 54 4e 45 53 53 20 | 46 4f 52 20 41 20 50 41 |FITNESS |FOR A PA|
|00005550| 52 54 49 43 55 4c 41 52 | 0a 20 2a 20 50 55 52 50 |RTICULAR|. * PURP|
|00005560| 4f 53 45 2c 20 4f 52 20 | 41 52 49 53 49 4e 47 20 |OSE, OR |ARISING |
|00005570| 46 52 4f 4d 20 41 20 43 | 4f 55 52 53 45 20 4f 46 |FROM A C|OURSE OF|
|00005580| 20 44 45 41 4c 49 4e 47 | 2c 20 55 53 41 47 45 20 | DEALING|, USAGE |
|00005590| 4f 52 20 54 52 41 44 45 | 20 50 52 41 43 54 49 43 |OR TRADE| PRACTIC|
|000055a0| 45 2e 0a 20 2a 20 0a 20 | 2a 20 53 75 6e 20 52 50 |E.. * . |* Sun RP|
|000055b0| 43 20 69 73 20 70 72 6f | 76 69 64 65 64 20 77 69 |C is pro|vided wi|
|000055c0| 74 68 20 6e 6f 20 73 75 | 70 70 6f 72 74 20 61 6e |th no su|pport an|
|000055d0| 64 20 77 69 74 68 6f 75 | 74 20 61 6e 79 20 6f 62 |d withou|t any ob|
|000055e0| 6c 69 67 61 74 69 6f 6e | 20 6f 6e 20 74 68 65 0a |ligation| on the.|
|000055f0| 20 2a 20 70 61 72 74 20 | 6f 66 20 53 75 6e 20 4d | * part |of Sun M|
|00005600| 69 63 72 6f 73 79 73 74 | 65 6d 73 2c 20 49 6e 63 |icrosyst|ems, Inc|
|00005610| 2e 20 74 6f 20 61 73 73 | 69 73 74 20 69 6e 20 69 |. to ass|ist in i|
|00005620| 74 73 20 75 73 65 2c 20 | 63 6f 72 72 65 63 74 69 |ts use, |correcti|
|00005630| 6f 6e 2c 0a 20 2a 20 6d | 6f 64 69 66 69 63 61 74 |on,. * m|odificat|
|00005640| 69 6f 6e 20 6f 72 20 65 | 6e 68 61 6e 63 65 6d 65 |ion or e|nhanceme|
|00005650| 6e 74 2e 0a 20 2a 20 0a | 20 2a 20 53 55 4e 20 4d |nt.. * .| * SUN M|
|00005660| 49 43 52 4f 53 59 53 54 | 45 4d 53 2c 20 49 4e 43 |ICROSYST|EMS, INC|
|00005670| 2e 20 53 48 41 4c 4c 20 | 48 41 56 45 20 4e 4f 20 |. SHALL |HAVE NO |
|00005680| 4c 49 41 42 49 4c 49 54 | 59 20 57 49 54 48 20 52 |LIABILIT|Y WITH R|
|00005690| 45 53 50 45 43 54 20 54 | 4f 20 54 48 45 0a 20 2a |ESPECT T|O THE. *|
|000056a0| 20 49 4e 46 52 49 4e 47 | 45 4d 45 4e 54 20 4f 46 | INFRING|EMENT OF|
|000056b0| 20 43 4f 50 59 52 49 47 | 48 54 53 2c 20 54 52 41 | COPYRIG|HTS, TRA|
|000056c0| 44 45 20 53 45 43 52 45 | 54 53 20 4f 52 20 41 4e |DE SECRE|TS OR AN|
|000056d0| 59 20 50 41 54 45 4e 54 | 53 20 42 59 20 53 55 4e |Y PATENT|S BY SUN|
|000056e0| 20 52 50 43 0a 20 2a 20 | 4f 52 20 41 4e 59 20 50 | RPC. * |OR ANY P|
|000056f0| 41 52 54 20 54 48 45 52 | 45 4f 46 2e 0a 20 2a 20 |ART THER|EOF.. * |
|00005700| 0a 20 2a 20 49 6e 20 6e | 6f 20 65 76 65 6e 74 20 |. * In n|o event |
|00005710| 77 69 6c 6c 20 53 75 6e | 20 4d 69 63 72 6f 73 79 |will Sun| Microsy|
|00005720| 73 74 65 6d 73 2c 20 49 | 6e 63 2e 20 62 65 20 6c |stems, I|nc. be l|
|00005730| 69 61 62 6c 65 20 66 6f | 72 20 61 6e 79 20 6c 6f |iable fo|r any lo|
|00005740| 73 74 20 72 65 76 65 6e | 75 65 0a 20 2a 20 6f 72 |st reven|ue. * or|
|00005750| 20 70 72 6f 66 69 74 73 | 20 6f 72 20 6f 74 68 65 | profits| or othe|
|00005760| 72 20 73 70 65 63 69 61 | 6c 2c 20 69 6e 64 69 72 |r specia|l, indir|
|00005770| 65 63 74 20 61 6e 64 20 | 63 6f 6e 73 65 71 75 65 |ect and |conseque|
|00005780| 6e 74 69 61 6c 20 64 61 | 6d 61 67 65 73 2c 20 65 |ntial da|mages, e|
|00005790| 76 65 6e 20 69 66 0a 20 | 2a 20 53 75 6e 20 68 61 |ven if. |* Sun ha|
|000057a0| 73 20 62 65 65 6e 20 61 | 64 76 69 73 65 64 20 6f |s been a|dvised o|
|000057b0| 66 20 74 68 65 20 70 6f | 73 73 69 62 69 6c 69 74 |f the po|ssibilit|
|000057c0| 79 20 6f 66 20 73 75 63 | 68 20 64 61 6d 61 67 65 |y of suc|h damage|
|000057d0| 73 2e 0a 20 2a 20 0a 20 | 2a 20 53 75 6e 20 4d 69 |s.. * . |* Sun Mi|
|000057e0| 63 72 6f 73 79 73 74 65 | 6d 73 2c 20 49 6e 63 2e |crosyste|ms, Inc.|
|000057f0| 0a 20 2a 20 32 35 35 30 | 20 47 61 72 63 69 61 20 |. * 2550| Garcia |
|00005800| 41 76 65 6e 75 65 0a 20 | 2a 20 4d 6f 75 6e 74 61 |Avenue. |* Mounta|
|00005810| 69 6e 20 56 69 65 77 2c | 20 43 61 6c 69 66 6f 72 |in View,| Califor|
|00005820| 6e 69 61 20 20 39 34 30 | 34 33 0a 20 2a 2f 0a 23 |nia 940|43. */.#|
|00005830| 69 66 20 21 64 65 66 69 | 6e 65 64 28 6c 69 6e 74 |if !defi|ned(lint|
|00005840| 29 20 26 26 20 64 65 66 | 69 6e 65 64 28 53 43 43 |) && def|ined(SCC|
|00005850| 53 49 44 53 29 0a 73 74 | 61 74 69 63 20 63 68 61 |SIDS).st|atic cha|
|00005860| 72 20 73 63 63 73 69 64 | 5b 5d 20 3d 20 22 40 28 |r sccsid|[] = "@(|
|00005870| 23 29 78 64 72 5f 61 72 | 72 61 79 2e 63 20 31 2e |#)xdr_ar|ray.c 1.|
|00005880| 31 30 20 38 37 2f 30 38 | 2f 31 31 20 43 6f 70 79 |10 87/08|/11 Copy|
|00005890| 72 20 31 39 38 34 20 53 | 75 6e 20 4d 69 63 72 6f |r 1984 S|un Micro|
|000058a0| 22 3b 0a 23 65 6e 64 69 | 66 0a 0a 2f 2a 0a 20 2a |";.#endi|f../*. *|
|000058b0| 20 78 64 72 5f 61 72 72 | 61 79 2e 63 2c 20 47 65 | xdr_arr|ay.c, Ge|
|000058c0| 6e 65 72 69 63 20 58 44 | 52 20 72 6f 75 74 69 6e |neric XD|R routin|
|000058d0| 65 73 20 69 6d 70 65 6c | 6d 65 6e 74 61 74 69 6f |es impel|mentatio|
|000058e0| 6e 2e 0a 20 2a 0a 20 2a | 20 43 6f 70 79 72 69 67 |n.. *. *| Copyrig|
|000058f0| 68 74 20 28 43 29 20 31 | 39 38 34 2c 20 53 75 6e |ht (C) 1|984, Sun|
|00005900| 20 4d 69 63 72 6f 73 79 | 73 74 65 6d 73 2c 20 49 | Microsy|stems, I|
|00005910| 6e 63 2e 0a 20 2a 0a 20 | 2a 20 54 68 65 73 65 20 |nc.. *. |* These |
|00005920| 61 72 65 20 74 68 65 20 | 22 6e 6f 6e 2d 74 72 69 |are the |"non-tri|
|00005930| 76 69 61 6c 22 20 78 64 | 72 20 70 72 69 6d 69 74 |vial" xd|r primit|
|00005940| 69 76 65 73 20 75 73 65 | 64 20 74 6f 20 73 65 72 |ives use|d to ser|
|00005950| 69 61 6c 69 7a 65 20 61 | 6e 64 20 64 65 2d 73 65 |ialize a|nd de-se|
|00005960| 72 69 61 6c 69 7a 65 0a | 20 2a 20 61 72 72 61 79 |rialize.| * array|
|00005970| 73 2e 20 20 53 65 65 20 | 78 64 72 2e 68 20 66 6f |s. See |xdr.h fo|
|00005980| 72 20 6d 6f 72 65 20 69 | 6e 66 6f 20 6f 6e 20 74 |r more i|nfo on t|
|00005990| 68 65 20 69 6e 74 65 72 | 66 61 63 65 20 74 6f 20 |he inter|face to |
|000059a0| 78 64 72 2e 0a 20 2a 2f | 0a 0a 23 69 6e 63 6c 75 |xdr.. */|..#inclu|
|000059b0| 64 65 20 3c 73 74 64 69 | 6f 2e 68 3e 0a 0a 23 69 |de <stdi|o.h>..#i|
|000059c0| 6e 63 6c 75 64 65 20 3c | 72 70 63 2f 74 79 70 65 |nclude <|rpc/type|
|000059d0| 73 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 72 |s.h>.#in|clude <r|
|000059e0| 70 63 2f 78 64 72 2e 68 | 3e 0a 0a 23 64 65 66 69 |pc/xdr.h|>..#defi|
|000059f0| 6e 65 20 4c 41 53 54 55 | 4e 53 49 47 4e 45 44 09 |ne LASTU|NSIGNED.|
|00005a00| 28 28 75 5f 69 6e 74 29 | 30 2d 31 29 0a 0a 0a 2f |((u_int)|0-1).../|
|00005a10| 2a 0a 20 2a 20 58 44 52 | 20 61 6e 20 61 72 72 61 |*. * XDR| an arra|
|00005a20| 79 20 6f 66 20 61 72 62 | 69 74 72 61 72 79 20 65 |y of arb|itrary e|
|00005a30| 6c 65 6d 65 6e 74 73 0a | 20 2a 20 2a 61 64 64 72 |lements.| * *addr|
|00005a40| 70 20 69 73 20 61 20 70 | 6f 69 6e 74 65 72 20 74 |p is a p|ointer t|
|00005a50| 6f 20 74 68 65 20 61 72 | 72 61 79 2c 20 2a 73 69 |o the ar|ray, *si|
|00005a60| 7a 65 70 20 69 73 20 74 | 68 65 20 6e 75 6d 62 65 |zep is t|he numbe|
|00005a70| 72 20 6f 66 20 65 6c 65 | 6d 65 6e 74 73 2e 0a 20 |r of ele|ments.. |
|00005a80| 2a 20 49 66 20 61 64 64 | 72 70 20 69 73 20 4e 55 |* If add|rp is NU|
|00005a90| 4c 4c 20 28 2a 73 69 7a | 65 70 20 2a 20 65 6c 73 |LL (*siz|ep * els|
|00005aa0| 69 7a 65 29 20 62 79 74 | 65 73 20 61 72 65 20 61 |ize) byt|es are a|
|00005ab0| 6c 6c 6f 63 61 74 65 64 | 2e 0a 20 2a 20 65 6c 73 |llocated|.. * els|
|00005ac0| 69 7a 65 20 69 73 20 74 | 68 65 20 73 69 7a 65 20 |ize is t|he size |
|00005ad0| 28 69 6e 20 62 79 74 65 | 73 29 20 6f 66 20 65 61 |(in byte|s) of ea|
|00005ae0| 63 68 20 65 6c 65 6d 65 | 6e 74 2c 20 61 6e 64 20 |ch eleme|nt, and |
|00005af0| 65 6c 70 72 6f 63 20 69 | 73 20 74 68 65 0a 20 2a |elproc i|s the. *|
|00005b00| 20 78 64 72 20 70 72 6f | 63 65 64 75 72 65 20 74 | xdr pro|cedure t|
|00005b10| 6f 20 63 61 6c 6c 20 74 | 6f 20 68 61 6e 64 6c 65 |o call t|o handle|
|00005b20| 20 65 61 63 68 20 65 6c | 65 6d 65 6e 74 20 6f 66 | each el|ement of|
|00005b30| 20 74 68 65 20 61 72 72 | 61 79 2e 0a 20 2a 2f 0a | the arr|ay.. */.|
|00005b40| 62 6f 6f 6c 5f 74 0a 78 | 64 72 5f 61 72 72 61 79 |bool_t.x|dr_array|
|00005b50| 28 78 64 72 73 2c 20 61 | 64 64 72 70 2c 20 73 69 |(xdrs, a|ddrp, si|
|00005b60| 7a 65 70 2c 20 6d 61 78 | 73 69 7a 65 2c 20 65 6c |zep, max|size, el|
|00005b70| 73 69 7a 65 2c 20 65 6c | 70 72 6f 63 29 0a 09 72 |size, el|proc)..r|
|00005b80| 65 67 69 73 74 65 72 20 | 58 44 52 20 2a 78 64 72 |egister |XDR *xdr|
|00005b90| 73 3b 0a 09 63 61 64 64 | 72 5f 74 20 2a 61 64 64 |s;..cadd|r_t *add|
|00005ba0| 72 70 3b 09 09 2f 2a 20 | 61 72 72 61 79 20 70 6f |rp;../* |array po|
|00005bb0| 69 6e 74 65 72 20 2a 2f | 0a 09 75 5f 69 6e 74 20 |inter */|..u_int |
|00005bc0| 2a 73 69 7a 65 70 3b 09 | 09 2f 2a 20 6e 75 6d 62 |*sizep;.|./* numb|
|00005bd0| 65 72 20 6f 66 20 65 6c | 65 6d 65 6e 74 73 20 2a |er of el|ements *|
|00005be0| 2f 0a 09 75 5f 69 6e 74 | 20 6d 61 78 73 69 7a 65 |/..u_int| maxsize|
|00005bf0| 3b 09 09 2f 2a 20 6d 61 | 78 20 6e 75 6d 62 65 72 |;../* ma|x number|
|00005c00| 6f 66 20 65 6c 65 6d 65 | 6e 74 73 20 2a 2f 0a 09 |of eleme|nts */..|
|00005c10| 75 5f 69 6e 74 20 65 6c | 73 69 7a 65 3b 09 09 2f |u_int el|size;../|
|00005c20| 2a 20 73 69 7a 65 20 69 | 6e 20 62 79 74 65 73 20 |* size i|n bytes |
|00005c30| 6f 66 20 65 61 63 68 20 | 65 6c 65 6d 65 6e 74 20 |of each |element |
|00005c40| 2a 2f 0a 09 78 64 72 70 | 72 6f 63 5f 74 20 65 6c |*/..xdrp|roc_t el|
|00005c50| 70 72 6f 63 3b 09 2f 2a | 20 78 64 72 20 72 6f 75 |proc;./*| xdr rou|
|00005c60| 74 69 6e 65 20 74 6f 20 | 68 61 6e 64 6c 65 20 65 |tine to |handle e|
|00005c70| 61 63 68 20 65 6c 65 6d | 65 6e 74 20 2a 2f 0a 7b |ach elem|ent */.{|
|00005c80| 0a 09 72 65 67 69 73 74 | 65 72 20 75 5f 69 6e 74 |..regist|er u_int|
|00005c90| 20 69 3b 0a 09 72 65 67 | 69 73 74 65 72 20 63 61 | i;..reg|ister ca|
|00005ca0| 64 64 72 5f 74 20 74 61 | 72 67 65 74 20 3d 20 2a |ddr_t ta|rget = *|
|00005cb0| 61 64 64 72 70 3b 0a 09 | 72 65 67 69 73 74 65 72 |addrp;..|register|
|00005cc0| 20 75 5f 69 6e 74 20 63 | 3b 20 20 2f 2a 20 74 68 | u_int c|; /* th|
|00005cd0| 65 20 61 63 74 75 61 6c | 20 65 6c 65 6d 65 6e 74 |e actual| element|
|00005ce0| 20 63 6f 75 6e 74 20 2a | 2f 0a 09 72 65 67 69 73 | count *|/..regis|
|00005cf0| 74 65 72 20 62 6f 6f 6c | 5f 74 20 73 74 61 74 20 |ter bool|_t stat |
|00005d00| 3d 20 54 52 55 45 3b 0a | 09 72 65 67 69 73 74 65 |= TRUE;.|.registe|
|00005d10| 72 20 75 5f 69 6e 74 20 | 6e 6f 64 65 73 69 7a 65 |r u_int |nodesize|
|00005d20| 3b 0a 0a 09 2f 2a 20 6c | 69 6b 65 20 73 74 72 69 |;.../* l|ike stri|
|00005d30| 6e 67 73 2c 20 61 72 72 | 61 79 73 20 61 72 65 20 |ngs, arr|ays are |
|00005d40| 72 65 61 6c 6c 79 20 63 | 6f 75 6e 74 65 64 20 61 |really c|ounted a|
|00005d50| 72 72 61 79 73 20 2a 2f | 0a 09 69 66 20 28 21 20 |rrays */|..if (! |
|00005d60| 78 64 72 5f 75 5f 69 6e | 74 28 78 64 72 73 2c 20 |xdr_u_in|t(xdrs, |
|00005d70| 73 69 7a 65 70 29 29 20 | 7b 0a 09 09 72 65 74 75 |sizep)) |{...retu|
|00005d80| 72 6e 20 28 46 41 4c 53 | 45 29 3b 0a 09 7d 0a 09 |rn (FALS|E);..}..|
|00005d90| 63 20 3d 20 2a 73 69 7a | 65 70 3b 0a 09 69 66 20 |c = *siz|ep;..if |
|00005da0| 28 28 63 20 3e 20 6d 61 | 78 73 69 7a 65 29 20 26 |((c > ma|xsize) &|
|00005db0| 26 20 28 78 64 72 73 2d | 3e 78 5f 6f 70 20 21 3d |& (xdrs-|>x_op !=|
|00005dc0| 20 58 44 52 5f 46 52 45 | 45 29 29 20 7b 0a 09 09 | XDR_FRE|E)) {...|
|00005dd0| 72 65 74 75 72 6e 20 28 | 46 41 4c 53 45 29 3b 0a |return (|FALSE);.|
|00005de0| 09 7d 0a 09 6e 6f 64 65 | 73 69 7a 65 20 3d 20 63 |.}..node|size = c|
|00005df0| 20 2a 20 65 6c 73 69 7a | 65 3b 0a 0a 09 2f 2a 0a | * elsiz|e;.../*.|
|00005e00| 09 20 2a 20 69 66 20 77 | 65 20 61 72 65 20 64 65 |. * if w|e are de|
|00005e10| 73 65 72 69 61 6c 69 7a | 69 6e 67 2c 20 77 65 20 |serializ|ing, we |
|00005e20| 6d 61 79 20 6e 65 65 64 | 20 74 6f 20 61 6c 6c 6f |may need| to allo|
|00005e30| 63 61 74 65 20 61 6e 20 | 61 72 72 61 79 2e 0a 09 |cate an |array...|
|00005e40| 20 2a 20 57 65 20 61 6c | 73 6f 20 73 61 76 65 20 | * We al|so save |
|00005e50| 74 69 6d 65 20 62 79 20 | 63 68 65 63 6b 69 6e 67 |time by |checking|
|00005e60| 20 66 6f 72 20 61 20 6e | 75 6c 6c 20 61 72 72 61 | for a n|ull arra|
|00005e70| 79 20 69 66 20 77 65 20 | 61 72 65 20 66 72 65 65 |y if we |are free|
|00005e80| 69 6e 67 2e 0a 09 20 2a | 2f 0a 09 69 66 20 28 74 |ing... *|/..if (t|
|00005e90| 61 72 67 65 74 20 3d 3d | 20 4e 55 4c 4c 29 0a 09 |arget ==| NULL)..|
|00005ea0| 09 73 77 69 74 63 68 20 | 28 78 64 72 73 2d 3e 78 |.switch |(xdrs->x|
|00005eb0| 5f 6f 70 29 20 7b 0a 09 | 09 63 61 73 65 20 58 44 |_op) {..|.case XD|
|00005ec0| 52 5f 44 45 43 4f 44 45 | 3a 0a 09 09 09 69 66 20 |R_DECODE|:....if |
|00005ed0| 28 63 20 3d 3d 20 30 29 | 0a 09 09 09 09 72 65 74 |(c == 0)|.....ret|
|00005ee0| 75 72 6e 20 28 54 52 55 | 45 29 3b 0a 09 09 09 2a |urn (TRU|E);....*|
|00005ef0| 61 64 64 72 70 20 3d 20 | 74 61 72 67 65 74 20 3d |addrp = |target =|
|00005f00| 20 6d 65 6d 5f 61 6c 6c | 6f 63 28 6e 6f 64 65 73 | mem_all|oc(nodes|
|00005f10| 69 7a 65 29 3b 0a 09 09 | 09 69 66 20 28 74 61 72 |ize);...|.if (tar|
|00005f20| 67 65 74 20 3d 3d 20 4e | 55 4c 4c 29 20 7b 0a 09 |get == N|ULL) {..|
|00005f30| 09 09 09 28 76 6f 69 64 | 29 20 66 70 72 69 6e 74 |...(void|) fprint|
|00005f40| 66 28 73 74 64 65 72 72 | 2c 20 0a 09 09 09 09 09 |f(stderr|, ......|
|00005f50| 22 78 64 72 5f 61 72 72 | 61 79 3a 20 6f 75 74 20 |"xdr_arr|ay: out |
|00005f60| 6f 66 20 6d 65 6d 6f 72 | 79 5c 6e 22 29 3b 0a 09 |of memor|y\n");..|
|00005f70| 09 09 09 72 65 74 75 72 | 6e 20 28 46 41 4c 53 45 |...retur|n (FALSE|
|00005f80| 29 3b 0a 09 09 09 7d 0a | 09 09 09 62 7a 65 72 6f |);....}.|...bzero|
|00005f90| 28 74 61 72 67 65 74 2c | 20 6e 6f 64 65 73 69 7a |(target,| nodesiz|
|00005fa0| 65 29 3b 0a 09 09 09 62 | 72 65 61 6b 3b 0a 0a 09 |e);....b|reak;...|
|00005fb0| 09 63 61 73 65 20 58 44 | 52 5f 46 52 45 45 3a 0a |.case XD|R_FREE:.|
|00005fc0| 09 09 09 72 65 74 75 72 | 6e 20 28 54 52 55 45 29 |...retur|n (TRUE)|
|00005fd0| 3b 0a 09 7d 0a 09 0a 09 | 2f 2a 0a 09 20 2a 20 6e |;..}....|/*.. * n|
|00005fe0| 6f 77 20 77 65 20 78 64 | 72 20 65 61 63 68 20 65 |ow we xd|r each e|
|00005ff0| 6c 65 6d 65 6e 74 20 6f | 66 20 61 72 72 61 79 0a |lement o|f array.|
|00006000| 09 20 2a 2f 0a 09 66 6f | 72 20 28 69 20 3d 20 30 |. */..fo|r (i = 0|
|00006010| 3b 20 28 69 20 3c 20 63 | 29 20 26 26 20 73 74 61 |; (i < c|) && sta|
|00006020| 74 3b 20 69 2b 2b 29 20 | 7b 0a 09 09 73 74 61 74 |t; i++) |{...stat|
|00006030| 20 3d 20 28 2a 65 6c 70 | 72 6f 63 29 28 78 64 72 | = (*elp|roc)(xdr|
|00006040| 73 2c 20 74 61 72 67 65 | 74 2c 20 4c 41 53 54 55 |s, targe|t, LASTU|
|00006050| 4e 53 49 47 4e 45 44 29 | 3b 0a 09 09 74 61 72 67 |NSIGNED)|;...targ|
|00006060| 65 74 20 2b 3d 20 65 6c | 73 69 7a 65 3b 0a 09 7d |et += el|size;..}|
|00006070| 0a 0a 09 2f 2a 0a 09 20 | 2a 20 74 68 65 20 61 72 |.../*.. |* the ar|
|00006080| 72 61 79 20 6d 61 79 20 | 6e 65 65 64 20 66 72 65 |ray may |need fre|
|00006090| 65 69 6e 67 0a 09 20 2a | 2f 0a 09 69 66 20 28 78 |eing.. *|/..if (x|
|000060a0| 64 72 73 2d 3e 78 5f 6f | 70 20 3d 3d 20 58 44 52 |drs->x_o|p == XDR|
|000060b0| 5f 46 52 45 45 29 20 7b | 0a 09 09 6d 65 6d 5f 66 |_FREE) {|...mem_f|
|000060c0| 72 65 65 28 2a 61 64 64 | 72 70 2c 20 6e 6f 64 65 |ree(*add|rp, node|
|000060d0| 73 69 7a 65 29 3b 0a 09 | 09 2a 61 64 64 72 70 20 |size);..|.*addrp |
|000060e0| 3d 20 4e 55 4c 4c 3b 0a | 09 7d 0a 09 72 65 74 75 |= NULL;.|.}..retu|
|000060f0| 72 6e 20 28 73 74 61 74 | 29 3b 0a 7d 0a 0a 2f 2a |rn (stat|);.}../*|
|00006100| 0a 20 2a 20 78 64 72 5f | 76 65 63 74 6f 72 28 29 |. * xdr_|vector()|
|00006110| 3a 0a 20 2a 0a 20 2a 20 | 58 44 52 20 61 20 66 69 |:. *. * |XDR a fi|
|00006120| 78 65 64 20 6c 65 6e 67 | 74 68 20 61 72 72 61 79 |xed leng|th array|
|00006130| 2e 20 55 6e 6c 69 6b 65 | 20 76 61 72 69 61 62 6c |. Unlike| variabl|
|00006140| 65 2d 6c 65 6e 67 74 68 | 20 61 72 72 61 79 73 2c |e-length| arrays,|
|00006150| 0a 20 2a 20 74 68 65 20 | 73 74 6f 72 61 67 65 20 |. * the |storage |
|00006160| 6f 66 20 66 69 78 65 64 | 20 6c 65 6e 67 74 68 20 |of fixed| length |
|00006170| 61 72 72 61 79 73 20 69 | 73 20 73 74 61 74 69 63 |arrays i|s static|
|00006180| 20 61 6e 64 20 75 6e 66 | 72 65 65 61 62 6c 65 2e | and unf|reeable.|
|00006190| 0a 20 2a 20 3e 20 62 61 | 73 65 70 3a 20 62 61 73 |. * > ba|sep: bas|
|000061a0| 65 20 6f 66 20 74 68 65 | 20 61 72 72 61 79 0a 20 |e of the| array. |
|000061b0| 2a 20 3e 20 73 69 7a 65 | 3a 20 73 69 7a 65 20 6f |* > size|: size o|
|000061c0| 66 20 74 68 65 20 61 72 | 72 61 79 0a 20 2a 20 3e |f the ar|ray. * >|
|000061d0| 20 65 6c 65 6d 73 69 7a | 65 3a 20 73 69 7a 65 20 | elemsiz|e: size |
|000061e0| 6f 66 20 65 61 63 68 20 | 65 6c 65 6d 65 6e 74 0a |of each |element.|
|000061f0| 20 2a 20 3e 20 78 64 72 | 5f 65 6c 65 6d 3a 20 72 | * > xdr|_elem: r|
|00006200| 6f 75 74 69 6e 65 20 74 | 6f 20 58 44 52 20 65 61 |outine t|o XDR ea|
|00006210| 63 68 20 65 6c 65 6d 65 | 6e 74 0a 20 2a 2f 0a 62 |ch eleme|nt. */.b|
|00006220| 6f 6f 6c 5f 74 0a 78 64 | 72 5f 76 65 63 74 6f 72 |ool_t.xd|r_vector|
|00006230| 28 78 64 72 73 2c 20 62 | 61 73 65 70 2c 20 6e 65 |(xdrs, b|asep, ne|
|00006240| 6c 65 6d 2c 20 65 6c 65 | 6d 73 69 7a 65 2c 20 78 |lem, ele|msize, x|
|00006250| 64 72 5f 65 6c 65 6d 29 | 0a 09 72 65 67 69 73 74 |dr_elem)|..regist|
|00006260| 65 72 20 58 44 52 20 2a | 78 64 72 73 3b 0a 09 72 |er XDR *|xdrs;..r|
|00006270| 65 67 69 73 74 65 72 20 | 63 68 61 72 20 2a 62 61 |egister |char *ba|
|00006280| 73 65 70 3b 0a 09 72 65 | 67 69 73 74 65 72 20 75 |sep;..re|gister u|
|00006290| 5f 69 6e 74 20 6e 65 6c | 65 6d 3b 0a 09 72 65 67 |_int nel|em;..reg|
|000062a0| 69 73 74 65 72 20 75 5f | 69 6e 74 20 65 6c 65 6d |ister u_|int elem|
|000062b0| 73 69 7a 65 3b 0a 09 72 | 65 67 69 73 74 65 72 20 |size;..r|egister |
|000062c0| 78 64 72 70 72 6f 63 5f | 74 20 78 64 72 5f 65 6c |xdrproc_|t xdr_el|
|000062d0| 65 6d 3b 09 0a 7b 0a 09 | 72 65 67 69 73 74 65 72 |em;..{..|register|
|000062e0| 20 75 5f 69 6e 74 20 69 | 3b 0a 09 72 65 67 69 73 | u_int i|;..regis|
|000062f0| 74 65 72 20 63 68 61 72 | 20 2a 65 6c 70 74 72 3b |ter char| *elptr;|
|00006300| 0a 0a 09 65 6c 70 74 72 | 20 3d 20 62 61 73 65 70 |...elptr| = basep|
|00006310| 3b 0a 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |;..for (|i = 0; i|
|00006320| 20 3c 20 6e 65 6c 65 6d | 3b 20 69 2b 2b 29 20 7b | < nelem|; i++) {|
|00006330| 0a 09 09 69 66 20 28 21 | 20 28 2a 78 64 72 5f 65 |...if (!| (*xdr_e|
|00006340| 6c 65 6d 29 28 78 64 72 | 73 2c 20 65 6c 70 74 72 |lem)(xdr|s, elptr|
|00006350| 2c 20 4c 41 53 54 55 4e | 53 49 47 4e 45 44 29 29 |, LASTUN|SIGNED))|
|00006360| 20 7b 0a 09 09 09 72 65 | 74 75 72 6e 28 46 41 4c | {....re|turn(FAL|
|00006370| 53 45 29 3b 0a 09 09 7d | 0a 09 09 65 6c 70 74 72 |SE);...}|...elptr|
|00006380| 20 2b 3d 20 65 6c 65 6d | 73 69 7a 65 3b 0a 09 7d | += elem|size;..}|
|00006390| 0a 09 72 65 74 75 72 6e | 28 54 52 55 45 29 3b 09 |..return|(TRUE);.|
|000063a0| 0a 7d 0a 0a 46 75 6e 6b | 79 5f 53 74 75 66 66 0a |.}..Funk|y_Stuff.|
|000063b0| 6c 65 6e 3d 60 77 63 20 | 2d 63 20 3c 20 78 64 72 |len=`wc |-c < xdr|
|000063c0| 5f 61 72 72 61 79 2e 63 | 60 0a 69 66 20 5b 20 24 |_array.c|`.if [ $|
|000063d0| 6c 65 6e 20 21 3d 20 20 | 20 20 20 34 32 34 38 20 |len != | 4248 |
|000063e0| 5d 20 3b 20 74 68 65 6e | 0a 20 20 65 63 68 6f 20 |] ; then|. echo |
|000063f0| 65 72 72 6f 72 3a 20 78 | 64 72 5f 61 72 72 61 79 |error: x|dr_array|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.