bitvectors.h 2.9 KB

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