3 #ifndef SCM_ARRAY_HANDLE_H
4 #define SCM_ARRAY_HANDLE_H
6 /* Copyright (C) 1995,1996,1997,1999,2000,2001, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
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.
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.
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
26 #include "libguile/__scm.h"
30 typedef struct scm_t_array_dim
37 struct scm_t_array_handle
;
39 typedef SCM (*scm_i_t_array_ref
) (struct scm_t_array_handle
*, ssize_t
);
40 typedef void (*scm_i_t_array_set
) (struct scm_t_array_handle
*, ssize_t
, SCM
);
42 typedef struct scm_t_array_handle
{
45 scm_t_array_dim
*dims
;
47 scm_i_t_array_ref ref
;
48 scm_i_t_array_set set
;
50 void *writable_elements
;
53 SCM_API
void scm_array_get_handle (SCM array
, scm_t_array_handle
*h
);
54 SCM_API
size_t scm_array_handle_rank (scm_t_array_handle
*h
);
55 SCM_API scm_t_array_dim
*scm_array_handle_dims (scm_t_array_handle
*h
);
56 SCM_API ssize_t
scm_array_handle_pos (scm_t_array_handle
*h
, SCM indices
);
57 SCM_API
const SCM
*scm_array_handle_elements (scm_t_array_handle
*h
);
58 SCM_API SCM
*scm_array_handle_writable_elements (scm_t_array_handle
*h
);
59 SCM_API
void scm_array_handle_release (scm_t_array_handle
*h
);
61 /* See inline.h for scm_array_handle_ref and scm_array_handle_set */
63 SCM_INTERNAL
void scm_init_array_handle (void);
66 #endif /* SCM_ARRAY_HANDLE_H */