uniform.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef SCM_UNIFORM_H
  2. #define SCM_UNIFORM_H
  3. /* Copyright 1995-1997,1999-2001,2004,2006,2008-2009,2013-2014,2018
  4. Free Software Foundation, Inc.
  5. This file is part of Guile.
  6. Guile is free software: you can redistribute it and/or modify it
  7. under the terms of the GNU Lesser General Public License as published
  8. by the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Guile is distributed in the hope that it will be useful, but WITHOUT
  11. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License for more details.
  14. You should have received a copy of the GNU Lesser General Public
  15. License along with Guile. If not, see
  16. <https://www.gnu.org/licenses/>. */
  17. #include "libguile/array-handle.h"
  18. /*
  19. * Uniform vectors contain unboxed values. They are not necessarily contiguous.
  20. */
  21. SCM_INTERNAL const size_t scm_i_array_element_type_sizes[];
  22. #define SCM_ARRAY_ELEMENT_TYPE_IS_UNBOXED(t) \
  23. (scm_i_array_element_type_sizes[(t)] != 0)
  24. /* type size in bytes */
  25. SCM_API size_t scm_array_handle_uniform_element_size (scm_t_array_handle *h);
  26. /* type size in bits */
  27. SCM_API size_t scm_array_handle_uniform_element_bit_size (scm_t_array_handle *h);
  28. SCM_API const void *scm_array_handle_uniform_elements (scm_t_array_handle *h);
  29. SCM_API void *scm_array_handle_uniform_writable_elements (scm_t_array_handle *h);
  30. SCM_INTERNAL void scm_init_uniform (void);
  31. #endif /* SCM_UNIFORM_H */