diff -r 671e6c5cfb20 -r 45175fd73d3f plugins/zephyr/ZReadAscii.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/zephyr/ZReadAscii.c Thu Apr 12 09:21:16 2001 +0000 @@ -0,0 +1,108 @@ +/* This file is part of the Project Athena Zephyr Notification System. + * It contains source for the ZReadAscii function. + * + * Created by: Robert French + * + * $Source$ + * $Author: warmenhoven $ + * + * Copyright (c) 1987, 1990 by the Massachusetts Institute of Technology. + * For copying and distribution information, see the file + * "mit-copyright.h". + */ +/* $Header$ */ + +#ifndef lint +static char rcsid_ZReadAscii_c[] = "$Header$"; +#endif /* lint */ + +#include +#include + +#if 0 +static __inline__ +int +Z_cnvt_xtoi (char c) +{ + c -= '0'; + if (c < 10) + return c; + c -= 'A'-'9'-1; + if (c < 16) + return c; + return -1; +} +#endif + +#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?temp:((temp-='A'-'9'-1),(temp<16)?temp:-1)) + +Code_t ZReadAscii(ptr, len, field, num) + char *ptr; + int len; + unsigned char *field; + int num; +{ + int i; + unsigned int hexbyte; + register int c1, c2; + register unsigned int temp; + + for (i=0;i