Changed license terms to the plain LGPL thru-out.
[bpt/guile.git] / srfi / srfi-14.h
CommitLineData
ca003b26
MG
1#ifndef SCM_SRFI_14_H
2#define SCM_SRFI_14_H
3/* srfi-14.c --- SRFI-14 procedures for Guile
4 *
5 * Copyright (C) 2001 Free Software Foundation, Inc.
6 *
73be1d9e
MV
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
ca003b26 11 *
73be1d9e
MV
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
ca003b26 16 *
73be1d9e
MV
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
ca003b26
MG
21\f
22
88a93471
MV
23/* SCM_SRFI1314_API is a macro prepended to all function and data definitions
24 which should be exported or imported in the resulting dynamic link
25 library in the Win32 port. */
26
8f99e3f3 27#if defined (SCM_SRFI1314_IMPORT)
88a93471 28# define SCM_SRFI1314_API __declspec (dllimport) extern
8f99e3f3 29#elif defined (SCM_SRFI1314_EXPORT) || defined (DLL_EXPORT)
88a93471
MV
30# define SCM_SRFI1314_API __declspec (dllexport) extern
31#else
32# define SCM_SRFI1314_API extern
33#endif
34
ca003b26
MG
35#define SCM_CHARSET_SIZE 256
36
139e5cb2 37/* We expect 8-bit bytes here. Should be no problem in the year
2671725a
MG
38 2001. */
39#ifndef SCM_BITS_PER_LONG
40# define SCM_BITS_PER_LONG (sizeof (long) * 8)
41#endif
42
ca003b26 43#define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\
139e5cb2
MV
44 [((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\
45 (1L << (((unsigned char) (idx)) % SCM_BITS_PER_LONG)))
ca003b26
MG
46
47#define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset))
48
49/* Smob type code for character sets. */
88a93471 50SCM_SRFI1314_API int scm_tc16_charset;
ca003b26 51
88a93471
MV
52SCM_SRFI1314_API void scm_c_init_srfi_14 (void);
53SCM_SRFI1314_API void scm_init_srfi_14 (void);
ca003b26 54
88a93471
MV
55SCM_SRFI1314_API SCM scm_char_set_p (SCM obj);
56SCM_SRFI1314_API SCM scm_char_set_eq (SCM char_sets);
57SCM_SRFI1314_API SCM scm_char_set_leq (SCM char_sets);
58SCM_SRFI1314_API SCM scm_char_set_hash (SCM cs, SCM bound);
59SCM_SRFI1314_API SCM scm_char_set_cursor (SCM cs);
60SCM_SRFI1314_API SCM scm_char_set_ref (SCM cs, SCM cursor);
61SCM_SRFI1314_API SCM scm_char_set_cursor_next (SCM cs, SCM cursor);
62SCM_SRFI1314_API SCM scm_end_of_char_set_p (SCM cursor);
63SCM_SRFI1314_API SCM scm_char_set_fold (SCM kons, SCM knil, SCM cs);
64SCM_SRFI1314_API SCM scm_char_set_unfold (SCM p, SCM f, SCM g, SCM seed, SCM base_cs);
65SCM_SRFI1314_API SCM scm_char_set_unfold_x (SCM p, SCM f, SCM g, SCM seed, SCM base_cs);
66SCM_SRFI1314_API SCM scm_char_set_for_each (SCM proc, SCM cs);
67SCM_SRFI1314_API SCM scm_char_set_map (SCM proc, SCM cs);
68SCM_SRFI1314_API SCM scm_char_set_copy (SCM cs);
69SCM_SRFI1314_API SCM scm_char_set (SCM rest);
70SCM_SRFI1314_API SCM scm_list_to_char_set (SCM list, SCM base_cs);
71SCM_SRFI1314_API SCM scm_list_to_char_set_x (SCM list, SCM base_cs);
72SCM_SRFI1314_API SCM scm_string_to_char_set (SCM str, SCM base_cs);
73SCM_SRFI1314_API SCM scm_string_to_char_set_x (SCM str, SCM base_cs);
74SCM_SRFI1314_API SCM scm_char_set_filter (SCM pred, SCM cs, SCM base_cs);
75SCM_SRFI1314_API SCM scm_char_set_filter_x (SCM pred, SCM cs, SCM base_cs);
76SCM_SRFI1314_API SCM scm_ucs_range_to_char_set (SCM lower, SCM upper, SCM error, SCM base_cs);
77SCM_SRFI1314_API SCM scm_ucs_range_to_char_set_x (SCM lower, SCM upper, SCM error, SCM base_cs);
78SCM_SRFI1314_API SCM scm_char_set_size (SCM cs);
79SCM_SRFI1314_API SCM scm_char_set_count (SCM pred, SCM cs);
80SCM_SRFI1314_API SCM scm_char_set_to_list (SCM cs);
81SCM_SRFI1314_API SCM scm_char_set_to_string (SCM cs);
82SCM_SRFI1314_API SCM scm_char_set_contains_p (SCM cs, SCM ch);
83SCM_SRFI1314_API SCM scm_char_set_every (SCM pred, SCM cs);
84SCM_SRFI1314_API SCM scm_char_set_any (SCM pred, SCM cs);
85SCM_SRFI1314_API SCM scm_char_set_adjoin (SCM cs, SCM rest);
86SCM_SRFI1314_API SCM scm_char_set_delete (SCM cs, SCM rest);
87SCM_SRFI1314_API SCM scm_char_set_adjoin_x (SCM cs, SCM rest);
88SCM_SRFI1314_API SCM scm_char_set_delete_x (SCM cs, SCM rest);
89SCM_SRFI1314_API SCM scm_char_set_complement (SCM cs);
90SCM_SRFI1314_API SCM scm_char_set_union (SCM rest);
91SCM_SRFI1314_API SCM scm_char_set_intersection (SCM rest);
92SCM_SRFI1314_API SCM scm_char_set_difference (SCM cs1, SCM rest);
93SCM_SRFI1314_API SCM scm_char_set_xor (SCM rest);
94SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection (SCM cs1, SCM rest);
95SCM_SRFI1314_API SCM scm_char_set_complement_x (SCM cs);
96SCM_SRFI1314_API SCM scm_char_set_union_x (SCM cs1, SCM rest);
97SCM_SRFI1314_API SCM scm_char_set_intersection_x (SCM cs1, SCM rest);
98SCM_SRFI1314_API SCM scm_char_set_difference_x (SCM cs1, SCM rest);
99SCM_SRFI1314_API SCM scm_char_set_xor_x (SCM cs1, SCM rest);
100SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection_x (SCM cs1, SCM cs2, SCM rest);
653c7291 101
ca003b26 102#endif /* SCM_SRFI_14_H */