/* * parse2hexnum - Parse two hex numbers * * This routine converts a string of two numbers, seperated by commas, * into two binary values. Note that if either of the values can not * be returned, this routine will return failure and not update either * return value. */ boolean parse2hexnum(char *srcstr, int *retvalue1, int *retvalue2) { char *str; int value1, value2; if(!gethexnum(srcstr, &str, &value1) || (*str++ != ',') || !gethexnum(str, &str, &value2)) { return(FALSE); } *retvalue1 = value1; *retvalue2 = value2; return(TRUE); }
SCO::SCO(const std::string& str) : version_(0) , number_(0) , cloneID_(0) { if(not isSCOString(str)) { LOG_DEBUG("Could make a sconame out of " << str); throw fungi::IOException("Not a SCOName string"); } cloneID_ = gethexnum(str,0,2); number_ = gethexnum(str,3,11); version_ = gethexnum(str, 12,14); }
boolean parsehexnum(char *srcstr, int *retvalue) { char *dummy; return(gethexnum(srcstr, &dummy, retvalue)); }