|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T h
Length: 1272 (0x4f8)
Types: TextFile
Names: »hex2bin.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z«
└─⟦e5a54fb17⟧
└─⟦this⟧ »pp-5.0/Tools/hex2bin/hex2bin.c«
/* hex2bin: Converts a hex file to binary */
# ifndef lint
static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Tools/hex2bin/RCS/hex2bin.c,v 5.0 90/09/20 16:26:27 pp Exp Locker: pp $";
# endif
/*
* $Header: /cs/research/pp/hubris/pp-beta/Tools/hex2bin/RCS/hex2bin.c,v 5.0 90/09/20 16:26:27 pp Exp Locker: pp $
*
* $Log: hex2bin.c,v $
* Revision 5.0 90/09/20 16:26:27 pp
* rcsforce : 5.0 public release
*
*/
#include <stdio.h>
/* --------------------- Begin Routines -------------------------------- */
main()
{
int zone, first_zone, octet;
first_zone = 1;
octet = 0;
while ((zone = getchar()) != EOF)
{
switch (zone)
{
case '0' :
case '1' :
case '2' :
case '3' :
case '4' :
case '5' :
case '6' :
case '7' :
case '8' :
case '9' : zone -= 48 ;
break;
case 'a' :
case 'b' :
case 'c' :
case 'd' :
case 'e' :
case 'f' : zone -= 87 ;
break;
case 'A' :
case 'B' :
case 'C' :
case 'D' :
case 'E' :
case 'F' : zone -= 55;
break;
default : continue;
}
if (first_zone)
{
octet = zone * 16;
first_zone = 0;
}
else
{
octet += zone;
putchar(octet);
first_zone = 1;
}
}
if (!first_zone)
putchar(octet);
}