Commit | Line | Data |
---|---|---|
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 | * | |
7 | * This program is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU General Public License as | |
9 | * published by the Free Software Foundation; either version 2, or (at | |
10 | * your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this software; see the file COPYING. If not, write to | |
19 | * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, | |
20 | * Boston, MA 02111-1307 USA | |
21 | * | |
22 | * As a special exception, the Free Software Foundation gives | |
23 | * permission for additional uses of the text contained in its release | |
24 | * of GUILE. | |
25 | * | |
26 | * The exception is that, if you link the GUILE library with other | |
27 | * files to produce an executable, this does not by itself cause the | |
28 | * resulting executable to be covered by the GNU General Public | |
29 | * License. Your use of that executable is in no way restricted on | |
30 | * account of linking the GUILE library code into it. | |
31 | * | |
32 | * This exception does not however invalidate any other reasons why | |
33 | * the executable file might be covered by the GNU General Public | |
34 | * License. | |
35 | * | |
36 | * This exception applies only to the code released by the Free | |
37 | * Software Foundation under the name GUILE. If you copy code from | |
38 | * other Free Software Foundation releases into a copy of GUILE, as | |
39 | * the General Public License permits, the exception does not apply to | |
40 | * the code that you add in this way. To avoid misleading anyone as | |
41 | * to the status of such modified files, you must delete this | |
42 | * exception notice from them. | |
43 | * | |
44 | * If you write modifications of your own for GUILE, it is your choice | |
45 | * whether to permit this exception to apply to your modifications. | |
46 | * If you do not wish that, delete this exception notice. */ | |
47 | \f | |
48 | ||
88a93471 MV |
49 | /* SCM_SRFI1314_API is a macro prepended to all function and data definitions |
50 | which should be exported or imported in the resulting dynamic link | |
51 | library in the Win32 port. */ | |
52 | ||
8f99e3f3 | 53 | #if defined (SCM_SRFI1314_IMPORT) |
88a93471 | 54 | # define SCM_SRFI1314_API __declspec (dllimport) extern |
8f99e3f3 | 55 | #elif defined (SCM_SRFI1314_EXPORT) || defined (DLL_EXPORT) |
88a93471 MV |
56 | # define SCM_SRFI1314_API __declspec (dllexport) extern |
57 | #else | |
58 | # define SCM_SRFI1314_API extern | |
59 | #endif | |
60 | ||
ca003b26 MG |
61 | #define SCM_CHARSET_SIZE 256 |
62 | ||
139e5cb2 | 63 | /* We expect 8-bit bytes here. Should be no problem in the year |
2671725a MG |
64 | 2001. */ |
65 | #ifndef SCM_BITS_PER_LONG | |
66 | # define SCM_BITS_PER_LONG (sizeof (long) * 8) | |
67 | #endif | |
68 | ||
ca003b26 | 69 | #define SCM_CHARSET_GET(cs, idx) (((long *) SCM_SMOB_DATA (cs))\ |
139e5cb2 MV |
70 | [((unsigned char) (idx)) / SCM_BITS_PER_LONG] &\ |
71 | (1L << (((unsigned char) (idx)) % SCM_BITS_PER_LONG))) | |
ca003b26 MG |
72 | |
73 | #define SCM_CHARSETP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_charset)) | |
74 | ||
75 | /* Smob type code for character sets. */ | |
88a93471 | 76 | SCM_SRFI1314_API int scm_tc16_charset; |
ca003b26 | 77 | |
88a93471 MV |
78 | SCM_SRFI1314_API void scm_c_init_srfi_14 (void); |
79 | SCM_SRFI1314_API void scm_init_srfi_14 (void); | |
ca003b26 | 80 | |
88a93471 MV |
81 | SCM_SRFI1314_API SCM scm_char_set_p (SCM obj); |
82 | SCM_SRFI1314_API SCM scm_char_set_eq (SCM char_sets); | |
83 | SCM_SRFI1314_API SCM scm_char_set_leq (SCM char_sets); | |
84 | SCM_SRFI1314_API SCM scm_char_set_hash (SCM cs, SCM bound); | |
85 | SCM_SRFI1314_API SCM scm_char_set_cursor (SCM cs); | |
86 | SCM_SRFI1314_API SCM scm_char_set_ref (SCM cs, SCM cursor); | |
87 | SCM_SRFI1314_API SCM scm_char_set_cursor_next (SCM cs, SCM cursor); | |
88 | SCM_SRFI1314_API SCM scm_end_of_char_set_p (SCM cursor); | |
89 | SCM_SRFI1314_API SCM scm_char_set_fold (SCM kons, SCM knil, SCM cs); | |
90 | SCM_SRFI1314_API SCM scm_char_set_unfold (SCM p, SCM f, SCM g, SCM seed, SCM base_cs); | |
91 | SCM_SRFI1314_API SCM scm_char_set_unfold_x (SCM p, SCM f, SCM g, SCM seed, SCM base_cs); | |
92 | SCM_SRFI1314_API SCM scm_char_set_for_each (SCM proc, SCM cs); | |
93 | SCM_SRFI1314_API SCM scm_char_set_map (SCM proc, SCM cs); | |
94 | SCM_SRFI1314_API SCM scm_char_set_copy (SCM cs); | |
95 | SCM_SRFI1314_API SCM scm_char_set (SCM rest); | |
96 | SCM_SRFI1314_API SCM scm_list_to_char_set (SCM list, SCM base_cs); | |
97 | SCM_SRFI1314_API SCM scm_list_to_char_set_x (SCM list, SCM base_cs); | |
98 | SCM_SRFI1314_API SCM scm_string_to_char_set (SCM str, SCM base_cs); | |
99 | SCM_SRFI1314_API SCM scm_string_to_char_set_x (SCM str, SCM base_cs); | |
100 | SCM_SRFI1314_API SCM scm_char_set_filter (SCM pred, SCM cs, SCM base_cs); | |
101 | SCM_SRFI1314_API SCM scm_char_set_filter_x (SCM pred, SCM cs, SCM base_cs); | |
102 | SCM_SRFI1314_API SCM scm_ucs_range_to_char_set (SCM lower, SCM upper, SCM error, SCM base_cs); | |
103 | SCM_SRFI1314_API SCM scm_ucs_range_to_char_set_x (SCM lower, SCM upper, SCM error, SCM base_cs); | |
104 | SCM_SRFI1314_API SCM scm_char_set_size (SCM cs); | |
105 | SCM_SRFI1314_API SCM scm_char_set_count (SCM pred, SCM cs); | |
106 | SCM_SRFI1314_API SCM scm_char_set_to_list (SCM cs); | |
107 | SCM_SRFI1314_API SCM scm_char_set_to_string (SCM cs); | |
108 | SCM_SRFI1314_API SCM scm_char_set_contains_p (SCM cs, SCM ch); | |
109 | SCM_SRFI1314_API SCM scm_char_set_every (SCM pred, SCM cs); | |
110 | SCM_SRFI1314_API SCM scm_char_set_any (SCM pred, SCM cs); | |
111 | SCM_SRFI1314_API SCM scm_char_set_adjoin (SCM cs, SCM rest); | |
112 | SCM_SRFI1314_API SCM scm_char_set_delete (SCM cs, SCM rest); | |
113 | SCM_SRFI1314_API SCM scm_char_set_adjoin_x (SCM cs, SCM rest); | |
114 | SCM_SRFI1314_API SCM scm_char_set_delete_x (SCM cs, SCM rest); | |
115 | SCM_SRFI1314_API SCM scm_char_set_complement (SCM cs); | |
116 | SCM_SRFI1314_API SCM scm_char_set_union (SCM rest); | |
117 | SCM_SRFI1314_API SCM scm_char_set_intersection (SCM rest); | |
118 | SCM_SRFI1314_API SCM scm_char_set_difference (SCM cs1, SCM rest); | |
119 | SCM_SRFI1314_API SCM scm_char_set_xor (SCM rest); | |
120 | SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection (SCM cs1, SCM rest); | |
121 | SCM_SRFI1314_API SCM scm_char_set_complement_x (SCM cs); | |
122 | SCM_SRFI1314_API SCM scm_char_set_union_x (SCM cs1, SCM rest); | |
123 | SCM_SRFI1314_API SCM scm_char_set_intersection_x (SCM cs1, SCM rest); | |
124 | SCM_SRFI1314_API SCM scm_char_set_difference_x (SCM cs1, SCM rest); | |
125 | SCM_SRFI1314_API SCM scm_char_set_xor_x (SCM cs1, SCM rest); | |
126 | SCM_SRFI1314_API SCM scm_char_set_diff_plus_intersection_x (SCM cs1, SCM cs2, SCM rest); | |
653c7291 | 127 | |
ca003b26 | 128 | #endif /* SCM_SRFI_14_H */ |