1 |
/* srfi-14.c --- SRFI-14 procedures for Guile |
/* srfi-14.c --- SRFI-14 procedures for Guile |
2 |
* |
* |
3 |
* Copyright (C) 2001 Free Software Foundation, Inc. |
* Copyright (C) 2001 Free Software Foundation, Inc. |
4 |
* |
* |
5 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
6 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
7 |
* published by the Free Software Foundation; either version 2, or (at |
* published by the Free Software Foundation; either version 2, or (at |
8 |
* your option) any later version. |
* your option) any later version. |
9 |
* |
* |
10 |
* This program is distributed in the hope that it will be useful, but |
* This program is distributed in the hope that it will be useful, but |
11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 |
* General Public License for more details. |
* General Public License for more details. |
14 |
* |
* |
15 |
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
16 |
* along with this software; see the file COPYING. If not, write to |
* along with this software; see the file COPYING. If not, write to |
17 |
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
98 |
make_char_set (const char * func_name) |
make_char_set (const char * func_name) |
99 |
{ |
{ |
100 |
long * p; |
long * p; |
101 |
|
|
102 |
p = scm_gc_malloc (BYTES_PER_CHARSET, "character-set"); |
p = scm_gc_malloc (BYTES_PER_CHARSET, "character-set"); |
103 |
memset (p, 0, BYTES_PER_CHARSET); |
memset (p, 0, BYTES_PER_CHARSET); |
104 |
SCM_RETURN_NEWSMOB (scm_tc16_charset, p); |
SCM_RETURN_NEWSMOB (scm_tc16_charset, p); |
105 |
} |
} |
106 |
|
|
107 |
|
|
108 |
SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0, |
SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0, |
109 |
(SCM obj), |
(SCM obj), |
110 |
"Return @code{#t} if @var{obj} is a character set, @code{#f}\n" |
"Return @code{#t} if @var{obj} is a character set, @code{#f}\n" |
111 |
"otherwise.") |
"otherwise.") |
167 |
if (prev_data) |
if (prev_data) |
168 |
{ |
{ |
169 |
int k; |
int k; |
170 |
|
|
171 |
for (k = 0; k < LONGS_PER_CHARSET; k++) |
for (k = 0; k < LONGS_PER_CHARSET; k++) |
172 |
{ |
{ |
173 |
if ((prev_data[k] & csi_data[k]) != prev_data[k]) |
if ((prev_data[k] & csi_data[k]) != prev_data[k]) |
196 |
int k; |
int k; |
197 |
|
|
198 |
SCM_VALIDATE_SMOB (1, cs, charset); |
SCM_VALIDATE_SMOB (1, cs, charset); |
199 |
|
|
200 |
if (SCM_UNBNDP (bound)) |
if (SCM_UNBNDP (bound)) |
201 |
bnd = default_bnd; |
bnd = default_bnd; |
202 |
else |
else |
1447 |
scm_c_init_srfi_14 (); |
scm_c_init_srfi_14 (); |
1448 |
|
|
1449 |
/* Install the charset primitives. */ |
/* Install the charset primitives. */ |
|
#ifndef SCM_MAGIC_SNARFER |
|
1450 |
#include "srfi/srfi-14.x" |
#include "srfi/srfi-14.x" |
|
#endif |
|
1451 |
} |
} |
1452 |
|
|
1453 |
/* End of srfi-14.c. */ |
/* End of srfi-14.c. */ |