31 char isRoman(
const char *str,
int maxchars) {
32 char *ch = (
char*)str;
33 for (; *ch && (!maxchars || (ch-str) <= maxchars); ch++)
34 if (!strchr(
"IVXLCDMivxlcdm ", *ch))
40 int i, n = (int)strlen(str);
41 short * num= (
short *) calloc(n,
sizeof(
short));
42 for (i = 0; str[i]; i++) {
76 for (i = 1; str[i]; i++) {
77 if (num[i] > num[i-1]) {
83 for (i = 0; str[i]; i++) {
#define SWORD_NAMESPACE_START
SWORD_NAMESPACE_START char isRoman(const char *str, int maxchars)
int fromRoman(const char *str)
#define SWORD_NAMESPACE_END