4
* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
5
* CrossWire Bible Society
9
* This program is free software; you can redistribute it and/or modify it
10
* under the terms of the GNU General Public License as published by the
11
* Free Software Foundation version 2.
13
* This program is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
26
char isroman (const char *str, int maxchars) {
27
char *ch = (char*)str;
28
for (; *ch && (!maxchars || (ch-str) <= maxchars); ch++)
29
if (!strchr("IVXLCDMivxlcdm ", *ch))
34
int from_rom(const char* str) {
35
int i, n = strlen(str);
36
short * num= (short *) calloc(n, sizeof(short));
37
for (i = 0; str[i]; i++) {
71
for (i = 1; str[i]; i++) {
72
if (num[i] > num[i-1]) {
78
for (i = 0; str[i]; i++) {