Date: Tue, 18 Jul 2000 20:15:08 +0100 From: Ben Smithurst <ben@FreeBSD.org> To: Alexander Langer <alex@big.endian.de> Cc: Dag-Erling Smorgrav <des@flood.ping.uio.no>, Greg Lehey <grog@lemis.com>, Jamie Bowden <ragnar@sysabend.org>, chat@FreeBSD.ORG Subject: Re: vinum Message-ID: <20000718201508.F4668@strontium.scientia.demon.co.uk> In-Reply-To: <20000718195708.B94391@cichlids.cichlids.com> References: <Pine.BSF.4.10.10007140654420.26349-100000@moo.sysabend.org> <20000716115559.G57098@wantadilla.lemis.com> <xzpr98uajhn.fsf@flood.ping.uio.no> <20000718195708.B94391@cichlids.cichlids.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <grog@lemis.com> 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 <unistd.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000718201508.F4668>