Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!husc6!rice!sun-spots-request From: paquette@cpsc.ucalgary.ca (Trevor Paquette) Newsgroups: comp.sys.sun Subject: xdr_char() routine Keywords: Software Message-ID: <785@cs-spool.calgary.UUCP> Date: 8 Mar 89 22:28:52 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 32 Approved: Sun-Spots@rice.edu Original-Date: Thu, 23 Feb 89 14:34:14 EST X-Sun-Spots-Digest: Volume 7, Issue 188, message 12 of 22 I am currently writing a program that must use the xdr routines for reading and wrinting data. I have however come across a small drawback. One of the machines that I am proting the code to (Iris 3020) does not have xdr_char() in it's libraries. My question then is this: How can I emulate xdr_char() with the other xdr routines? I have tried the following but it core dumps in me.. xdr_char(xdrs, ch) XDR *xdrs; char *ch; { char t[2]; int ret; if(xdrs -> x_op == XDR_ENCODE) { t[0] = *ch; t[1] = 0; ret = xdr_string(xdrs, t, 1); } else { ret = xdr_string(xdrs, t, 1); *ch = t[0]; } return(ret); } Trevor Paquette/GraphicsLand, Calgary, Alberta ..uunet!{ubc-cs,utai,alberta}!calgary!paquette ICBM:51 03 N/114 05 W calgary!paquette@cs.ubc.ca Luminous beings we are, not this crude matter