mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
* srfi-14.c (scm_char_set_intersection, scm_char_set_xor): remove
the compulsory cs1 arguments: all args are optional in final spec. * srfi-14.h: declarations updated.
This commit is contained in:
parent
b8a42df3f1
commit
a6ec2a3cef
3 changed files with 56 additions and 30 deletions
|
@ -1,3 +1,9 @@
|
|||
2001-07-22 Gary Houston <ghouston@arglist.com>
|
||||
|
||||
* srfi-14.c (scm_char_set_intersection, scm_char_set_xor): remove
|
||||
the compulsory cs1 arguments: all args are optional in final spec.
|
||||
* srfi-14.h: declarations updated.
|
||||
|
||||
2001-07-18 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||
|
||||
* srfi-11.scm, srfi-8.scm: Update copyright notice.
|
||||
|
|
|
@ -1070,31 +1070,41 @@ SCM_DEFINE (scm_char_set_union, "char-set-union", 0, 0, 1,
|
|||
#undef FUNC_NAME
|
||||
|
||||
|
||||
SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 1, 0, 1,
|
||||
(SCM cs1, SCM rest),
|
||||
SCM_DEFINE (scm_char_set_intersection, "char-set-intersection", 0, 0, 1,
|
||||
(SCM rest),
|
||||
"Return the intersection of all argument character sets.")
|
||||
#define FUNC_NAME s_scm_char_set_intersection
|
||||
{
|
||||
int c = 2;
|
||||
SCM res;
|
||||
long * p;
|
||||
|
||||
SCM_VALIDATE_SMOB (1, cs1, charset);
|
||||
SCM_VALIDATE_REST_ARGUMENT (rest);
|
||||
|
||||
res = scm_char_set_copy (cs1);
|
||||
if (SCM_NULLP (rest))
|
||||
res = make_char_set (FUNC_NAME);
|
||||
else
|
||||
{
|
||||
long *p;
|
||||
int argnum = 2;
|
||||
|
||||
res = scm_char_set_copy (SCM_CAR (rest));
|
||||
p = (long *) SCM_SMOB_DATA (res);
|
||||
while (!SCM_NULLP (rest))
|
||||
rest = SCM_CDR (rest);
|
||||
|
||||
while (SCM_CONSP (rest))
|
||||
{
|
||||
int k;
|
||||
SCM cs = SCM_CAR (rest);
|
||||
SCM_VALIDATE_SMOB (c, cs, charset);
|
||||
c++;
|
||||
rest = SCM_CDR (rest);
|
||||
long *cs_data;
|
||||
|
||||
SCM_VALIDATE_SMOB (argnum, cs, charset);
|
||||
argnum++;
|
||||
cs_data = (long *) SCM_SMOB_DATA (cs);
|
||||
rest = SCM_CDR (rest);
|
||||
for (k = 0; k < LONGS_PER_CHARSET; k++)
|
||||
p[k] &= ((long *) SCM_SMOB_DATA (cs))[k];
|
||||
p[k] &= cs_data[k];
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
@ -1130,30 +1140,40 @@ SCM_DEFINE (scm_char_set_difference, "char-set-difference", 1, 0, 1,
|
|||
#undef FUNC_NAME
|
||||
|
||||
|
||||
SCM_DEFINE (scm_char_set_xor, "char-set-xor", 1, 0, 1,
|
||||
(SCM cs1, SCM rest),
|
||||
SCM_DEFINE (scm_char_set_xor, "char-set-xor", 0, 0, 1,
|
||||
(SCM rest),
|
||||
"Return the exclusive-or of all argument character sets.")
|
||||
#define FUNC_NAME s_scm_char_set_xor
|
||||
{
|
||||
int c = 2;
|
||||
SCM res;
|
||||
long * p;
|
||||
|
||||
SCM_VALIDATE_SMOB (1, cs1, charset);
|
||||
SCM_VALIDATE_REST_ARGUMENT (rest);
|
||||
|
||||
res = scm_char_set_copy (cs1);
|
||||
if (SCM_NULLP (rest))
|
||||
res = make_char_set (FUNC_NAME);
|
||||
else
|
||||
{
|
||||
long * p;
|
||||
int argnum = 2;
|
||||
|
||||
res = scm_char_set_copy (SCM_CAR (rest));
|
||||
p = (long *) SCM_SMOB_DATA (res);
|
||||
while (!SCM_NULLP (rest))
|
||||
rest = SCM_CDR (rest);
|
||||
|
||||
while (SCM_CONSP (rest))
|
||||
{
|
||||
int k;
|
||||
SCM cs = SCM_CAR (rest);
|
||||
SCM_VALIDATE_SMOB (c, cs, charset);
|
||||
c++;
|
||||
long *cs_data;
|
||||
|
||||
SCM_VALIDATE_SMOB (argnum, cs, charset);
|
||||
argnum++;
|
||||
cs_data = (long *) SCM_SMOB_DATA (cs);
|
||||
rest = SCM_CDR (rest);
|
||||
|
||||
for (k = 0; k < LONGS_PER_CHARSET; k++)
|
||||
p[k] ^= ((long *) SCM_SMOB_DATA (cs))[k];
|
||||
p[k] ^= cs_data[k];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -102,9 +102,9 @@ SCM scm_char_set_adjoin_x (SCM cs, SCM rest);
|
|||
SCM scm_char_set_delete_x (SCM cs, SCM rest);
|
||||
SCM scm_char_set_complement (SCM cs);
|
||||
SCM scm_char_set_union (SCM rest);
|
||||
SCM scm_char_set_intersection (SCM cs1, SCM rest);
|
||||
SCM scm_char_set_intersection (SCM rest);
|
||||
SCM scm_char_set_difference (SCM cs1, SCM rest);
|
||||
SCM scm_char_set_xor (SCM cs1, SCM rest);
|
||||
SCM scm_char_set_xor (SCM rest);
|
||||
SCM scm_char_set_diff_plus_intersection (SCM cs1, SCM rest);
|
||||
SCM scm_char_set_complement_x (SCM cs);
|
||||
SCM scm_char_set_union_x (SCM cs1, SCM rest);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue