Reify bytevector? in the correct module
[bpt/guile.git] / libguile / bitvectors.h
CommitLineData
cf396142
AW
1/* classes: h_files */
2
3#ifndef SCM_BITVECTORS_H
4#define SCM_BITVECTORS_H
5
cf64dca6 6/* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009, 2014 Free Software Foundation, Inc.
cf396142
AW
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
37SCM_API SCM scm_bitvector_p (SCM vec);
38SCM_API SCM scm_bitvector (SCM bits);
39SCM_API SCM scm_make_bitvector (SCM len, SCM fill);
40SCM_API SCM scm_bitvector_length (SCM vec);
41SCM_API SCM scm_bitvector_ref (SCM vec, SCM idx);
42SCM_API SCM scm_bitvector_set_x (SCM vec, SCM idx, SCM val);
43SCM_API SCM scm_list_to_bitvector (SCM list);
44SCM_API SCM scm_bitvector_to_list (SCM vec);
45SCM_API SCM scm_bitvector_fill_x (SCM vec, SCM val);
46
47SCM_API SCM scm_bit_count (SCM item, SCM seq);
48SCM_API SCM scm_bit_position (SCM item, SCM v, SCM k);
49SCM_API SCM scm_bit_set_star_x (SCM v, SCM kv, SCM obj);
50SCM_API SCM scm_bit_count_star (SCM v, SCM kv, SCM obj);
51SCM_API SCM scm_bit_invert_x (SCM v);
52SCM_API SCM scm_istr2bve (SCM str);
53
54SCM_API int scm_is_bitvector (SCM obj);
55SCM_API SCM scm_c_make_bitvector (size_t len, SCM fill);
56SCM_API size_t scm_c_bitvector_length (SCM vec);
57SCM_API SCM scm_c_bitvector_ref (SCM vec, size_t idx);
58SCM_API void scm_c_bitvector_set_x (SCM vec, size_t idx, SCM val);
59SCM_API const scm_t_uint32 *scm_array_handle_bit_elements (scm_t_array_handle *h);
60SCM_API scm_t_uint32 *scm_array_handle_bit_writable_elements (scm_t_array_handle *h);
61SCM_API size_t scm_array_handle_bit_elements_offset (scm_t_array_handle *h);
62SCM_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);
67SCM_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
cf64dca6 73SCM_INTERNAL scm_t_uint32 *scm_i_bitvector_bits (SCM vec);
ff1feca9
AW
74SCM_INTERNAL int scm_i_print_bitvector (SCM vec, SCM port, scm_print_state *pstate);
75SCM_INTERNAL SCM scm_i_bitvector_equal_p (SCM vec1, SCM vec2);
cf396142
AW
76SCM_INTERNAL void scm_init_bitvectors (void);
77
78#endif /* SCM_BITVECTORS_H */
79
80/*
81 Local Variables:
82 c-file-style: "gnu"
83 End:
84*/