From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2c23a44c4c8fd6b X-Google-Attributes: gid103376,public From: Laurent Pautet Subject: Re: fixed point types over an interface Date: 1997/02/12 Message-ID: #1/1 X-Deja-AN: 218256168 Sender: pautet@quasimodo.enst.fr References: <32FBB550.41C67EA6@efogm.msd.ray.com> Content-Type: text/plain; charset=iso-8859-1 Organization: ENST, France Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1997-02-12T00:00:00+00:00 List-Id: >> Another possibility is to use a target independent >> implementation of Stream_IO, such as is provided with GLADE >> (the GNAT implementation of the distributed annex PCS). GLADE >> uses XDR for stream representation, which avoids any endian (or >> other target dependent) problems. nassera> good choice. I just wanted to also add that Sun NFS and nassera> Sun RPC also uses XDR. nassera> man xdr: (on solaris 2.5) nassera> DESCRIPTION XDR routines allow C programmers to describe nassera> arbitrary data structures in a machine-independent nassera> fashion. Data for remote procedure calls (RPC) are nassera> transmitted using these routines. nassera> by the way, I wonder why the man output above mentions nassera> only "C programmers". Because it doesn't apply to Ada :-) For instance: XDR says : The representation of all items requires a multiple of four bytes (or 32 bits) of data. LRM says : For composite types, the Write or Read attribute for each component is called in a canonical order ... Read and Write should use the smallest number of stream elements needed to represent all values in the base range of the scalar type. So a string of 7 characters is stored on 8 bytes with XDR and 7 with Ada. GLADE is only 95% XDR in order to follow LRM requirements. The 5% comes from the XDR 4 bytes rule (basically strings).