return 0;
}
+/* Convert C from hexadecimal character to integer. */
+int
+virHexToBin(unsigned char c)
+{
+ switch (c) {
+ default: return c - '0';
+ case 'a': case 'A': return 10;
+ case 'b': case 'B': return 11;
+ case 'c': case 'C': return 12;
+ case 'd': case 'D': return 13;
+ case 'e': case 'E': return 14;
+ case 'f': case 'F': return 15;
+ }
+}
+
/**
* virSkipSpaces:
* @str: pointer to the char pointer used
char **end_ptr,
double *result);
+int virHexToBin(unsigned char c);
+
int virMacAddrCompare (const char *mac1, const char *mac2);
void virSkipSpaces(const char **str);
return(err);
}
-/* Convert C from hexadecimal character to integer. */
-static int
-hextobin (unsigned char c)
-{
- switch (c)
- {
- default: return c - '0';
- case 'a': case 'A': return 10;
- case 'b': case 'B': return 11;
- case 'c': case 'C': return 12;
- case 'd': case 'D': return 13;
- case 'e': case 'E': return 14;
- case 'f': case 'F': return 15;
- }
-}
-
/**
* virUUIDParse:
* @uuidstr: zero terminated string representation of the UUID
}
if (!c_isxdigit(*cur))
goto error;
- uuid[i] = hextobin(*cur);
+ uuid[i] = virHexToBin(*cur);
uuid[i] *= 16;
cur++;
if (*cur == 0)
goto error;
if (!c_isxdigit(*cur))
goto error;
- uuid[i] += hextobin(*cur);
+ uuid[i] += virHexToBin(*cur);
i++;
cur++;
}