uniform.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* classes: h_files */
  2. #ifndef SCM_UNIFORM_H
  3. #define SCM_UNIFORM_H
  4. /* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009, 2013 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. /*
  23. * Uniform vectors contain unboxed values. They are not necessarily contiguous.
  24. */
  25. SCM_INTERNAL const size_t scm_i_array_element_type_sizes[];
  26. #define SCM_ARRAY_ELEMENT_TYPE_IS_UNBOXED(t) \
  27. (scm_i_array_element_type_sizes[(t)] != 0)
  28. /* type size in bytes */
  29. SCM_API size_t scm_array_handle_uniform_element_size (scm_t_array_handle *h);
  30. /* type size in bits */
  31. SCM_API size_t scm_array_handle_uniform_element_bit_size (scm_t_array_handle *h);
  32. SCM_API const void *scm_array_handle_uniform_elements (scm_t_array_handle *h);
  33. SCM_API void *scm_array_handle_uniform_writable_elements (scm_t_array_handle *h);
  34. SCM_API SCM scm_uniform_vector_p (SCM v);
  35. SCM_API SCM scm_uniform_vector_length (SCM v);
  36. SCM_API SCM scm_uniform_vector_element_type (SCM v);
  37. SCM_API SCM scm_uniform_vector_element_type_code (SCM v);
  38. SCM_API SCM scm_uniform_vector_element_size (SCM v);
  39. SCM_API SCM scm_uniform_vector_ref (SCM v, SCM idx);
  40. SCM_API SCM scm_uniform_vector_set_x (SCM v, SCM idx, SCM val);
  41. SCM_API SCM scm_uniform_vector_to_list (SCM v);
  42. SCM_API SCM scm_uniform_vector_read_x (SCM v, SCM port_or_fd,
  43. SCM start, SCM end);
  44. SCM_API SCM scm_uniform_vector_write (SCM v, SCM port_or_fd,
  45. SCM start, SCM end);
  46. SCM_API int scm_is_uniform_vector (SCM obj);
  47. SCM_API size_t scm_c_uniform_vector_length (SCM v);
  48. SCM_API SCM scm_c_uniform_vector_ref (SCM v, size_t idx);
  49. SCM_API void scm_c_uniform_vector_set_x (SCM v, size_t idx, SCM val);
  50. SCM_API const void *scm_uniform_vector_elements (SCM uvec,
  51. scm_t_array_handle *h,
  52. size_t *lenp, ssize_t *incp);
  53. SCM_API void *scm_uniform_vector_writable_elements (SCM uvec,
  54. scm_t_array_handle *h,
  55. size_t *lenp,
  56. ssize_t *incp);
  57. SCM_INTERNAL void scm_init_uniform (void);
  58. #endif /* SCM_UNIFORM_H */
  59. /*
  60. Local Variables:
  61. c-file-style: "gnu"
  62. End:
  63. */