From owner-freebsd-chat Tue Jul 18 12:26: 8 2000 Delivered-To: freebsd-chat@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id E732437B703 for ; Tue, 18 Jul 2000 12:25:55 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.15 #1) id 13Ecpg-000DZR-00; Tue, 18 Jul 2000 20:15:08 +0100 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.15 #1) id 13Ecpg-000810-00; Tue, 18 Jul 2000 20:15:08 +0100 Date: Tue, 18 Jul 2000 20:15:08 +0100 From: Ben Smithurst To: Alexander Langer Cc: Dag-Erling Smorgrav , Greg Lehey , Jamie Bowden , chat@FreeBSD.ORG Subject: Re: vinum Message-ID: <20000718201508.F4668@strontium.scientia.demon.co.uk> References: <20000716115559.G57098@wantadilla.lemis.com> <20000718195708.B94391@cichlids.cichlids.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="SqEuGDw53xMPnx3c" Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20000718195708.B94391@cichlids.cichlids.com> Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --SqEuGDw53xMPnx3c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alexander Langer wrote: > Thus spake Dag-Erling Smorgrav (des@flood.ping.uio.no): >=20 >> Greg Lehey writes: >>> #define VINUM_MAGIC 22322600044678729LL /* should be this */ >> "IN VINO" >>> #define VINUM_NOMAGIC 22322600044678990LL /* becomes this after o= bliteration */ >> "NO VINO" >=20 > I'm missing something here :-) >=20 > How do you get that here? See which character each of the eight bytes in those numbers corresponds too. Assuming that's what you were asking... ben@magnesium:~/tmp$ cat t.c #include int main(void) { long long a =3D 22322600044678729LL, b =3D 22322600044678990LL; write(1, &a, sizeof a); write(1, &b, sizeof b); return (0); } ben@magnesium:~/tmp$ cc -Wall t.c ben@magnesium:~/tmp$ ./a.out | hd 00000000 49 4e 20 56 49 4e 4f 00 4e 4f 20 56 49 4e 4f 00 |IN VINO.NO VIN= O.| 00000010 ok, who's going to give me the Perl one-liner to do that? It would probably involve pack/unpack which I've never got on well with. --=20 Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D FreeBSD Documentation Project / --SqEuGDw53xMPnx3c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: PGPfreeware 5.0i for non-commercial use MessageID: 2tgBtoMe6/H+Nz11zp3EqlZm425+jGL5 iQCVAwUBOXSsuysPVtiZOS99AQE3wAP/b31SObu+m1U+Gj42rgp9DSYZVEcVVFZn prhlQCuKJiLAQkTpW0FstY5y4bF08WWvpB9heNSkP6tLGg6vtZScUR0pDu0RWJXn kZ1co0chBNS5QqiFU+cy6QEw/SZOfm1O7y27Z8jblZoXfEMi6PHBE7rG0g/Iwrqb 5dDsWHtiKPY= =rZ1J -----END PGP SIGNATURE----- --SqEuGDw53xMPnx3c-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message