22 int i= ((int) ((
unsigned char)
c));
23 return ((
c >=
'a') && (
c <=
'z')) || ((
c >=
'A') && (
c <=
'Z')) ||
24 ((i >= 128) && (i != 159) && (i != 189) && (i != 190) && (i != 191));
29 int code= (int) ((
unsigned char)
c);
30 return ((
c >=
'a') && (
c <=
'z')) || ((code >= 160) && (code < 189)) ||
36 int code= (int) ((
unsigned char)
c);
37 return ((
c >=
'A') && (
c <=
'Z')) || ((code >= 128) && (code < 159)) ||
38 ((code >= 192) && (code < 224));
48 if (
N (s) == 0)
return false;
49 for (i= 0; i <
N (s); i++)
57 if (
N (s) == 0)
return false;
58 for (i= 0; i <
N (s); i++)
66 if (
N (s) == 0)
return false;
67 for (i= 0; i <
N (s); i++)
68 if (s[i] <
'a' || s[i] >
'z')
return false;
75 if (
N (s) == 0)
return false;
76 for (i= 0; i <
N (s); i++)
84 if (
N (s) == 0)
return false;
85 for (i= 0; i <
N (s); i++)
96 if (
is_iso_locase (
c))
return (
char) (((int) ((
unsigned char)
c)) - 32);
102 if (
is_iso_upcase (
c))
return (
char) (((int) ((
unsigned char)
c)) + 32);
108 if (
c ==
'{')
return '}';
109 if (
c ==
'(')
return ')';
110 if (
c ==
'[')
return ']';
117 return string ((
char) (((
int) ((
unsigned char) s[0])) - 32)) * s (1,
N (s));
123 return string ((
char) (((
int) ((
unsigned char) s[0])) + 32)) * s (1,
N (s));
130 for (i= 0; i <
N (s); i++)
132 else r[i]= (
char) (((
int) ((
unsigned char) s[i])) - 32);
140 for (i= 0; i <
N (s); i++)
142 else r[i]= (
char) (((
int) ((
unsigned char) s[i])) + 32);
189 for (i= 0; i < n; i++)
190 if ((s[i] ==
'\'') && ((i + 1) < n)) {
235 r <<
'\'' << s[i + 1];
247 for (i= 0; i < n; i++)
301 for (i= 0; i < n; i++)
302 if (s[i] ==
'\337')
r <<
'\377';
311 for (i= 0; i < n; i++)
312 if (s[i] ==
'\377')
r <<
'\337';
322 "\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221"
323 "\222\223\224\225\226\227\230\231\232\233\234\235\236\237 \20\212 "
324 "\211\221\237¨\222\223\224\231‐\232\233 "
325 "\241˛\252´\251\261ˇ¸\262\263\264\271˝\272\273\217\301\302\200\304\210\202"
326 "\307\203\311\206\313\205\315\316\204\320\213\214\323\324\216\326."
327 "\220\227\332\226\334\335\225\377\257\341\342\240\344\250\242\347\243\351"
328 "\246\353\245\355\356\244\236\253\254\363\364\256\366/"
329 "\260\267\372\266\374\375\265 ";
331 "\303\241\306\310\317\314\312G\305\245\243\321\322 "
332 "\325\300\330\246\251\252\253\336\333\331Y\254\256\257II\360\247\343\261"
333 "\346\350\357\354\352g\345\265\263\361\362 "
334 "\365\340\370\266\271\272\273\376\373\371y\274\276\277i!?"
335 "LA\301\302A\304AA\307E\311E\313I\315\316I\320NO\323\324O\326OOU\332U\334"
337 "Sa\341\342a\344aa\347e\351e\353i\355\356i\360no\363\364o\366oou\372u\374"
342 int i= (int) ((
unsigned char)
c);
343 if (i < 128)
return c;
349 int i= (int) ((
unsigned char)
c);
350 if (i < 128)
return c;
358 for (i= 0; i < n; i++)
367 for (i= 0; i < n; i++)
379 if (
nr == 0)
return "0";
380 if (
nr <= 26)
return string ((
char) (((
int)
'a') +
nr - 1));
393 int i,
m= (
nr - 1) % 6, n= ((
nr - 1) / 6) + 1;
414 for (i= 0; i < n; i++)
422 return "\"" * s *
"\"";
438#if (defined OS_MINGW || defined OS_WIN)
443 for (i= 0; i < n; i++)
472 for (i= 0; i < n; i++) {
473 if ((s[i] ==
'\2') || (s[i] ==
'\5') || (s[i] ==
'\33'))
r <<
'\33';
483 for (i= 0; i < n; i++) {
484 unsigned char c= (
unsigned char) s[i];
485 if ((
c ==
'\n') || (
c ==
'\t'))
r <<
' ';
486 else if (((
int)
c) >= 32)
r << s[i];
495 for (i= 0; i < n; i++) {
496 unsigned char c= (
unsigned char) s[i];
497 if (
c ==
' ')
r <<
'\\';
507 for (i= 0; i < n; i++)
518 for (i= 0; i < n; i++) {
520 if (i + 1 < n && s[i + 1] ==
'\\') {
524 else if (i + 3 < n && s[i + 1] ==
'x' &&
is_hex_digit (s[i + 2]) &&
526 string e= s (i + 2, i + 4);
544 while (
test[
j] !=
'\0') {
545 if (i >= n)
return false;
546 if (s[i] !=
test[
j])
return false;
557 if (i >= n)
return false;
558 if (s[i] !=
test[
j])
return false;
578 if (
N (
r) >
N (s))
return false;
579 return s (
N (s) -
N (
r),
N (s)) ==
r;
584 if (
N (
r) >
N (s))
return false;
585 return s (
N (s) -
N (
r),
N (s)) ==
r;
590 int n=
N (s),
j= 0,
k= i;
591 while (
test[
j] !=
'\0') {
592 if (
k >= n)
return false;
593 if (s[
k] !=
test[
j])
return false;
611 if (
k >= n)
return false;
612 if (s[
k] !=
test[
j])
return false;
623 for (; i <
N (s); i++) {
637 if (i == n)
return false;
639 if (i + 1 == n)
return false;
640 if (!
is_digit (s[i + 1]))
return false;
643 else if (!
is_digit (s[i]))
return false;
654 if (i == n)
return false;
656 if (i + 1 == n)
return false;
663 if ((i < n) && (s[i] ==
'.')) i++;
666 if ((i < n) && ((s[i] ==
'e') || (s[i] ==
'E'))) {
668 if ((i < n) && (s[i] ==
'-')) i++;
669 if ((i == n) || (!
is_digit (s[i]))) {
692 for (
int i= 0; i <
N (s); i++)
693 if (s[i] !=
' ' && s[i] !=
'\t' && s[i] !=
'\n')
return false;
700 while ((i < n) && ((s[i] ==
' ') || (s[i] ==
'\t')))
707 while ((i < n) && ((s[i] ==
' ') || (s[i] ==
'\t') || (s[i] ==
'\n')))
714 while ((i < n) && (s[i] !=
'\n'))
724 for (i++; i < n; i++)
725 if (s[i - 1] ==
'>')
break;
733 int i= 0,
ts= 0, n=
N (s);
740 else if (s[i] ==
'\n') {
791 for (i= 0; i <
len; i++)
802 for (
int i= 0; i <
s_N; i++) {
812 int n=
N (in),
na=
N (a);
814 for (
int i= 0; i <
na; i++)
815 if (
N (a[i]) > 0 && in[
pos] == a[i][0] &&
test (in,
pos, a[i]))
824 int k=
N (s), n=
N (in);
825 if (
k == 0)
return pos;
827 while (
pos +
k <= n) {
852 for (
int i= 0; i <
s_N; i++) {
877 int i= 0, next, n=
N (in);
880 if (next == -1)
break;
892 if (
s1 (n - i, n) ==
s2 (0, i))
return i;
922 while (
spos <=
N (s)) {
951 for (
int i= 0; i <
N (s);)
965 for (
int i= 0; i <
N (a); i++) {
966 if (i != 0)
r <<
sep;
983 for (end=
N (s) - 1; end >= 0 &&
is_space (s[end]); end--)
985 return s (0, end + 1);
996 for (
int i= 0; i <
N (a); i++)
1013 while (l <
c1 && l <
c2 &&
s1[
c1 - l - 1] ==
s2[
c2 - l - 1])
1015 if (l +
r >
bl +
br) {
1033 if (
n1 == 0 ||
n2 == 0)
return;
1035 for (
int k= 1;
k <
t;
k++) {
1061 for (
int k= 0;
k <
N (
r);
k+= 4) {
1072 if (
c1 == 0 &&
c2 == 0) {
1080 for (
int k= 0;
k <
N (
r2);
k+= 4) {
1096 for (
int k= 0;
k <
N (
r);
k+= 4)
1112 string s2= s (i, n);
bool starts(string s, const char *what)
string alpha_nr(int nr)
Generates an alphabetic string for an integer.
bool is_alphanum(string s)
string escape_spaces(string s)
Escape spaces in a string with a backslash.
string igerman_to_german(string s)
Convert igerman string to german string.
void skip_line(string s, int &i)
string locase_all(string s)
Converts all uppercase characters in a string to lowercase.
string unescape_guile(string s)
Unescape a Guile-syntax string.
bool read(string s, int &i, const char *test)
static char cork_to_il2(char c)
int search_forwards(array< string > a, int pos, string in)
string trim_spaces(string s)
array< string > tokenize(string s, string sep)
void skip_symbol(string s, int &i)
bool ends(string s, const char *what)
string string_union(string s1, string s2)
Union of two strings.
static string il2_to_cork_string
void parse_length(string s, double &len, string &unit)
Parses a string containing a length value and its unit.
string convert_tabs_to_spaces(string s, int tw)
Converts tabs in a string to spaces.
string remove_prefix(string s, string prefix)
Remove the prefix from s if matches.
string raw_quote(string s)
Add quotes around a string to indicate it's a string, not a symbol.
static int find_longest(string s1, string s2, int &c1, int &c2)
bool contains(string s, string what)
bool is_iso_alpha(char c)
Checks if a character is an ISO alphabetic character.
bool is_whitespace(string s)
int count_occurrences(string s, string in)
string spanish_to_ispanish(string s)
Convert Spanish string to ispanish string.
string escape_sh(string s)
Escape a string for use in shell scripts.
string trim_spaces_left(string s)
void skip_whitespace(string s, int &i)
string upcase_first(string s)
Converts the first character of a string to uppercase.
char locase(char c)
Converts an uppercase character to lowercase.
bool is_alpha(string s)
Checks if a string contains only alphabetic characters.
bool occurs(string what, string in)
static char il2_to_cork(char c)
bool read_int(string s, int &i, int &result)
bool is_locase_alpha(string s)
Checks if a string contains only lowercase alphabetic characters.
char closing_delimiter(char c)
Finds the closing delimiter corresponding to the given opening delimiter.
string locase_first(string s)
Converts the first character of a string to lowercase.
string recompose(array< string > a, string sep)
string escape_generic(string s)
Escape a string with generic escape sequences.
string ispanish_to_spanish(string s)
Convert ispanish string to Spanish string.
array< int > differences(string s1, string s2)
the differences between two strings by identifying the common substrings and returning the different ...
bool test(string s, int i, const char *test)
string escape_verbatim(string s)
Escape a string to be displayed verbatim.
char upcase(char c)
Converts a lowercase character to uppercase.
static bool match_wildcard(string s, int spos, string w, int wpos)
string string_minus(string s1, string s2)
Remove characters from one string that are in another string.
bool is_iso_locase(char c)
Checks if a character is an ISO lowercase alphabetic character.
string replace(string s, string what, string by)
bool read_word(string s, int &i, string &result)
int distance(string s1, string s2)
a measure of difference (distance) between two strings.
bool read_double(string s, int &i, double &result)
string upcase_all(string s)
Converts all lowercase characters in a string to uppercase.
string fnsymbol_nr(int nr)
Generates footnote symbols for a given integer.
int find_non_alpha(string s, int pos, bool forward)
string german_to_igerman(string s)
Convert german string to igerman string.
bool is_numeric(string s)
Checks if a string contains only numeric characters.
void skip_spaces(string s, int &i)
static string cork_to_il2_string
bool is_iso_upcase(char c)
Checks if a character is an ISO uppercase alphabetic character.
void parse(string s, int &pos, QI &ret)
bool read_line(string s, int &i, string &result)
string Alpha_nr(int nr)
Generates an uppercase alphabetic string for an integer.
string dos_to_better(string s)
Convert DOS line endings to more standard line endings.
static void find_common(string s1, string s2, int &c1, int &c2)
int search_backwards(string s, int pos, string in)
int overlapping(string s1, string s2)
string raw_unquote(string s)
Remove quotes from a string label.
int index_of(string s, char c)
string trim_spaces_right(string s)
string remove_suffix(string s, string suffix)
Remove the suffix from s if matches.
bool is_hex_digit(char c)
int N(array< T > a)
Get the length of the array.
SI as_int(double x)
Converts a double to a signed integer, rounding to the nearest integer.
The list class represents a linked list.
SI min(SI i, SI j)
Returns the minimum of two signed integers.
SI max(SI i, SI j)
Returns the maximum of two signed integers.
int from_hex(string s)
Converts a hexadecimal string to an integer.
double as_double(string s)
string suffix(url u, bool use_locase)