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,7844279822ce7c28 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Newbie question : types , representation Date: 1999/08/24 Message-ID: <4Oyw3.549$W5.69009@typhoon-sf.snfc21.pbi.net>#1/1 X-Deja-AN: 516609196 References: <37C1AA76.14D14819@tu-cottbus.de> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 935508224 206.170.2.120 (Tue, 24 Aug 1999 08:23:44 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Tue, 24 Aug 1999 08:23:44 PDT Newsgroups: comp.lang.ada Date: 1999-08-24T00:00:00+00:00 List-Id: >From an old base64 decoder, slightly modified from Ada 83 to Ada 95: type bytes is mod 256; for bytes'size use 8; package out_io is new sequential_io(bytes); subtype base64s is integer range 0 .. 63; a_byte:bytes:=0; next_byte:bytes:=0; type slots is mod 4; pack_di:slots:=0; procedure put(n:in base64s) is begin case pack_di is when 0 => a_byte:=bytes(n)*4; when 1 => out_io.write(f_output, a_byte+bytes(n/16)); a_byte:=bytes((n mod 16)*16); when 2 => out_io.write(f_output, a_byte+bytes(n/4)); a_byte:=bytes(n mod 4)*64; when 3 => out_io.write(f_output, a_byte+bytes(n)); end case; pack_di:=pack_di+1; end put;