/* This file is part of the Project Athena Zephyr Notification System. * It contains source for the ZReadAscii function. * Created by: Robert French * Copyright (c) 1987, 1990 by the Massachusetts Institute of Technology. * For copying and distribution information, see the file #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) register unsigned int temp; if (ptr[0] == '0' && ptr[1] == 'x') { c1 = Z_cnvt_xtoi(ptr[0]); c2 = Z_cnvt_xtoi(ptr[1]); hexbyte = (c1 << 4) | c2; return *ptr ? ZERR_BADFIELD : ZERR_NONE; Code_t ZReadAscii32(ptr, len, value_ptr) unsigned long *value_ptr; retval = ZReadAscii(ptr, len, buf, 4); *value_ptr = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; Code_t ZReadAscii16(ptr, len, value_ptr) unsigned short *value_ptr; retval = ZReadAscii(ptr, len, buf, 2); *value_ptr = (buf[0] << 8) | buf[1];