mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
(scm_string_any, scm_string_every, scm_string_to_listS,
scm_string_trim, scm_string_trim_right, scm_string_trim_both, scm_string_compare, scm_string_compare_ci, scm_string_eq, scm_string_neq, scm_string_lt, scm_string_gt, scm_string_le, scm_string_ge, scm_string_ci_eq, scm_string_ci_neq, scm_string_ci_lt, scm_string_ci_gt, scm_string_ci_le, scm_string_ci_ge, scm_string_indexS, scm_string_index_right, scm_string_skip, scm_string_skip_right, scm_string_count, scm_string_map, scm_string_map_x, scm_string_fold, scm_string_fold_right, scm_string_for_each, scm_string_filter, scm_string_delete): Use "unsigned char" instead of "char" so that non-ASCII characters can be dealt with. Thanks to Alexey Voinov!
This commit is contained in:
parent
059fed0e6f
commit
b7c59b11ad
1 changed files with 32 additions and 32 deletions
|
@ -61,7 +61,7 @@ SCM_DEFINE (scm_string_any, "string-any-c-code", 2, 2, 0,
|
|||
"successful application of @var{pred}.")
|
||||
#define FUNC_NAME s_scm_string_any
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM res;
|
||||
|
||||
|
@ -108,7 +108,7 @@ SCM_DEFINE (scm_string_every, "string-every-c-code", 2, 2, 0,
|
|||
"application of @var{pred} to the last character of @var{s}.")
|
||||
#define FUNC_NAME s_scm_string_every
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM res;
|
||||
|
||||
|
@ -189,7 +189,7 @@ SCM_DEFINE (scm_string_to_listS, "string->list", 1, 2, 0,
|
|||
"Convert the string @var{str} into a list of characters.")
|
||||
#define FUNC_NAME s_scm_string_to_listS
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM result = SCM_EOL;
|
||||
|
||||
|
@ -645,7 +645,7 @@ SCM_DEFINE (scm_string_trim, "string-trim", 1, 3, 0,
|
|||
"trimmed.")
|
||||
#define FUNC_NAME s_scm_string_trim
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -720,7 +720,7 @@ SCM_DEFINE (scm_string_trim_right, "string-trim-right", 1, 3, 0,
|
|||
"trimmed.")
|
||||
#define FUNC_NAME s_scm_string_trim_right
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -795,7 +795,7 @@ SCM_DEFINE (scm_string_trim_both, "string-trim-both", 1, 3, 0,
|
|||
"trimmed.")
|
||||
#define FUNC_NAME s_scm_string_trim_both
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -906,7 +906,7 @@ SCM_DEFINE (scm_string_compare, "string-compare", 5, 4, 0,
|
|||
"@var{i} is the first position that does not match.")
|
||||
#define FUNC_NAME s_scm_string_compare
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -949,7 +949,7 @@ SCM_DEFINE (scm_string_compare_ci, "string-compare-ci", 5, 4, 0,
|
|||
"character comparison is done case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_compare_ci
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -987,7 +987,7 @@ SCM_DEFINE (scm_string_eq, "string=", 2, 4, 0,
|
|||
"value otherwise.")
|
||||
#define FUNC_NAME s_scm_string_eq
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1022,7 +1022,7 @@ SCM_DEFINE (scm_string_neq, "string<>", 2, 4, 0,
|
|||
"value otherwise.")
|
||||
#define FUNC_NAME s_scm_string_neq
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1057,7 +1057,7 @@ SCM_DEFINE (scm_string_lt, "string<", 2, 4, 0,
|
|||
"true value otherwise.")
|
||||
#define FUNC_NAME s_scm_string_lt
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1092,7 +1092,7 @@ SCM_DEFINE (scm_string_gt, "string>", 2, 4, 0,
|
|||
"true value otherwise.")
|
||||
#define FUNC_NAME s_scm_string_gt
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1127,7 +1127,7 @@ SCM_DEFINE (scm_string_le, "string<=", 2, 4, 0,
|
|||
"value otherwise.")
|
||||
#define FUNC_NAME s_scm_string_le
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1162,7 +1162,7 @@ SCM_DEFINE (scm_string_ge, "string>=", 2, 4, 0,
|
|||
"otherwise.")
|
||||
#define FUNC_NAME s_scm_string_ge
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1198,7 +1198,7 @@ SCM_DEFINE (scm_string_ci_eq, "string-ci=", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_eq
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1234,7 +1234,7 @@ SCM_DEFINE (scm_string_ci_neq, "string-ci<>", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_neq
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1270,7 +1270,7 @@ SCM_DEFINE (scm_string_ci_lt, "string-ci<", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_lt
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1306,7 +1306,7 @@ SCM_DEFINE (scm_string_ci_gt, "string-ci>", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_gt
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1342,7 +1342,7 @@ SCM_DEFINE (scm_string_ci_le, "string-ci<=", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_le
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1378,7 +1378,7 @@ SCM_DEFINE (scm_string_ci_ge, "string-ci>=", 2, 4, 0,
|
|||
"case-insensitively.")
|
||||
#define FUNC_NAME s_scm_string_ci_ge
|
||||
{
|
||||
char * cstr1, * cstr2;
|
||||
unsigned char * cstr1, * cstr2;
|
||||
int cstart1, cend1, cstart2, cend2;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s1, cstr1,
|
||||
|
@ -1658,7 +1658,7 @@ SCM_DEFINE (scm_string_indexS, "string-index", 2, 2, 0,
|
|||
"@end itemize")
|
||||
#define FUNC_NAME s_scm_string_indexS
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -1717,7 +1717,7 @@ SCM_DEFINE (scm_string_index_right, "string-index-right", 2, 2, 0,
|
|||
"@end itemize")
|
||||
#define FUNC_NAME s_scm_string_index_right
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -1777,7 +1777,7 @@ SCM_DEFINE (scm_string_skip, "string-skip", 2, 2, 0,
|
|||
"@end itemize")
|
||||
#define FUNC_NAME s_scm_string_skip
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -1837,7 +1837,7 @@ SCM_DEFINE (scm_string_skip_right, "string-skip-right", 2, 2, 0,
|
|||
"@end itemize")
|
||||
#define FUNC_NAME s_scm_string_skip_right
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_SUBSTRING_SPEC_COPY (1, s, cstr,
|
||||
|
@ -1896,7 +1896,7 @@ SCM_DEFINE (scm_string_count, "string-count", 2, 2, 0,
|
|||
"@end itemize")
|
||||
#define FUNC_NAME s_scm_string_count
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
int count = 0;
|
||||
|
||||
|
@ -2442,7 +2442,7 @@ SCM_DEFINE (scm_string_map, "string-map", 2, 2, 0,
|
|||
"string elements is not specified.")
|
||||
#define FUNC_NAME s_scm_string_map
|
||||
{
|
||||
char * cstr, *p;
|
||||
unsigned char * cstr, *p;
|
||||
int cstart, cend;
|
||||
SCM result;
|
||||
|
||||
|
@ -2473,7 +2473,7 @@ SCM_DEFINE (scm_string_map_x, "string-map!", 2, 2, 0,
|
|||
"modified in-place, the return value is not specified.")
|
||||
#define FUNC_NAME s_scm_string_map_x
|
||||
{
|
||||
char * cstr, *p;
|
||||
unsigned char * cstr, *p;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_PROC (1, proc);
|
||||
|
@ -2502,7 +2502,7 @@ SCM_DEFINE (scm_string_fold, "string-fold", 3, 2, 0,
|
|||
"result of @var{kons}' application.")
|
||||
#define FUNC_NAME s_scm_string_fold
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM result;
|
||||
|
||||
|
@ -2529,7 +2529,7 @@ SCM_DEFINE (scm_string_fold_right, "string-fold-right", 3, 2, 0,
|
|||
"result of @var{kons}' application.")
|
||||
#define FUNC_NAME s_scm_string_fold_right
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM result;
|
||||
|
||||
|
@ -2678,7 +2678,7 @@ SCM_DEFINE (scm_string_for_each, "string-for-each", 2, 2, 0,
|
|||
"return value is not specified.")
|
||||
#define FUNC_NAME s_scm_string_for_each
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
|
||||
SCM_VALIDATE_PROC (1, proc);
|
||||
|
@ -2914,7 +2914,7 @@ SCM_DEFINE (scm_string_filter, "string-filter", 2, 2, 0,
|
|||
"character set, it is tested for membership.")
|
||||
#define FUNC_NAME s_scm_string_filter
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM result;
|
||||
int idx;
|
||||
|
@ -2980,7 +2980,7 @@ SCM_DEFINE (scm_string_delete, "string-delete", 2, 2, 0,
|
|||
"character set, it is tested for membership.")
|
||||
#define FUNC_NAME s_scm_string_delete
|
||||
{
|
||||
char * cstr;
|
||||
unsigned char * cstr;
|
||||
int cstart, cend;
|
||||
SCM result;
|
||||
int idx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue