From 6ee8d06250a1ae553afb2a825c203d831cadec5b Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 1 Sep 2003 11:04:15 +0000 Subject: Document the datatype conversion routine prototype. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@109 10716dce-81a3-4424-a2c8-48026a0d3035 --- doc/documentation.tex | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/documentation.tex b/doc/documentation.tex index e771384..385fc48 100644 --- a/doc/documentation.tex +++ b/doc/documentation.tex @@ -244,19 +244,23 @@ CTK_INT Hyperslab_DefineLocalMappingByPhys ( For a C implementation, such a user-supplied conversion function should be declared according to the following typedef: \begin{verbatim} -typedef void (*t_hslabConversionFn) (CCTK_INT nelems, - CCTK_INT stride, - CCTK_INT from_type, - CCTK_INT to_type, - const void *from, - void *to); +typedef CCTK_INT (*t_hslabConversionFn) (CCTK_INT nelems, + CCTK_INT src_stride, + CCTK_INT dst_stride, + CCTK_INT src_type, + CCTK_INT dst_type, + CCTK_POINTER_TO_CONST src, + CCTK_POINTER dst); \end{verbatim} A data type conversion function gets passed the number of elements to - convert ({\tt nelems}), and a stride between adjacent elements - ({\tt stride}), a pointer to the data to convert ({\tt from}), a pointer to - the conversion target buffer ({\tt to}), and the corresponding CCTK data - types for the data ({\tt from\_type, to\_type}). + convert ({\tt nelems}), the strides between adjacent elements in the + source and destination arrays ({\tt src\_stride, dst\_stride}), + the source and destination CCTK datatypes ({\tt src\_type, dst\_type}), + a pointer to the data to convert ({\tt src}), and a pointer to + the conversion target buffer ({\tt dst}). + The routine should return the number of elements converted ({\tt nelems}) + for success. If a user-supplied function is given ({\tt conversion\_fn} is not NULL), subsequent hyperslab get/put calls will use for data type conversions. -- cgit v1.2.3