Commit | Line | Data |
---|---|---|
cf396142 AW |
1 | /* classes: h_files */ |
2 | ||
3 | #ifndef SCM_BITVECTORS_H | |
4 | #define SCM_BITVECTORS_H | |
5 | ||
6 | /* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009 Free Software Foundation, Inc. | |
7 | * | |
8 | * This library is free software; you can redistribute it and/or | |
9 | * modify it under the terms of the GNU Lesser General Public License | |
10 | * as published by the Free Software Foundation; either version 3 of | |
11 | * the License, or (at your option) any later version. | |
12 | * | |
13 | * This library is distributed in the hope that it will be useful, but | |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | * Lesser General Public License for more details. | |
17 | * | |
18 | * You should have received a copy of the GNU Lesser General Public | |
19 | * License along with this library; if not, write to the Free Software | |
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |
21 | * 02110-1301 USA | |
22 | */ | |
23 | ||
24 | \f | |
25 | ||
26 | #include "libguile/__scm.h" | |
27 | #include "libguile/array-handle.h" | |
28 | ||
29 | \f | |
30 | ||
31 | /* Bitvectors. Exciting stuff, maybe! | |
32 | */ | |
33 | ||
34 | ||
35 | /** Bit vectors */ | |
36 | ||
37 | SCM_API SCM scm_bitvector_p (SCM vec); | |
38 | SCM_API SCM scm_bitvector (SCM bits); | |
39 | SCM_API SCM scm_make_bitvector (SCM len, SCM fill); | |
40 | SCM_API SCM scm_bitvector_length (SCM vec); | |
41 | SCM_API SCM scm_bitvector_ref (SCM vec, SCM idx); | |
42 | SCM_API SCM scm_bitvector_set_x (SCM vec, SCM idx, SCM val); | |
43 | SCM_API SCM scm_list_to_bitvector (SCM list); | |
44 | SCM_API SCM scm_bitvector_to_list (SCM vec); | |
45 | SCM_API SCM scm_bitvector_fill_x (SCM vec, SCM val); | |
46 | ||
47 | SCM_API SCM scm_bit_count (SCM item, SCM seq); | |
48 | SCM_API SCM scm_bit_position (SCM item, SCM v, SCM k); | |
49 | SCM_API SCM scm_bit_set_star_x (SCM v, SCM kv, SCM obj); | |
50 | SCM_API SCM scm_bit_count_star (SCM v, SCM kv, SCM obj); | |
51 | SCM_API SCM scm_bit_invert_x (SCM v); | |
52 | SCM_API SCM scm_istr2bve (SCM str); | |
53 | ||
54 | SCM_API int scm_is_bitvector (SCM obj); | |
55 | SCM_API SCM scm_c_make_bitvector (size_t len, SCM fill); | |
56 | SCM_API size_t scm_c_bitvector_length (SCM vec); | |
57 | SCM_API SCM scm_c_bitvector_ref (SCM vec, size_t idx); | |
58 | SCM_API void scm_c_bitvector_set_x (SCM vec, size_t idx, SCM val); | |
59 | SCM_API const scm_t_uint32 *scm_array_handle_bit_elements (scm_t_array_handle *h); | |
60 | SCM_API scm_t_uint32 *scm_array_handle_bit_writable_elements (scm_t_array_handle *h); | |
61 | SCM_API size_t scm_array_handle_bit_elements_offset (scm_t_array_handle *h); | |
62 | SCM_API const scm_t_uint32 *scm_bitvector_elements (SCM vec, | |
63 | scm_t_array_handle *h, | |
64 | size_t *offp, | |
65 | size_t *lenp, | |
66 | ssize_t *incp); | |
67 | SCM_API scm_t_uint32 *scm_bitvector_writable_elements (SCM vec, | |
68 | scm_t_array_handle *h, | |
69 | size_t *offp, | |
70 | size_t *lenp, | |
71 | ssize_t *incp); | |
72 | ||
73 | SCM_INTERNAL void scm_init_bitvectors (void); | |
74 | ||
75 | #endif /* SCM_BITVECTORS_H */ | |
76 | ||
77 | /* | |
78 | Local Variables: | |
79 | c-file-style: "gnu" | |
80 | End: | |
81 | */ |