From 54304e71740f558d3d8258a96bc2f1a7e9634cc9 Mon Sep 17 00:00:00 2001 From: schnetter Date: Thu, 25 Aug 2005 14:18:10 +0000 Subject: Add Cactus variable type CCTK_POINTER_TO_CONST Complete the implementation of the Cactus variable type CCTK_POINTER_TO_CONST. Define a constant CCTK_VARIABLE_POINTER_TO_CONST. Handle this variable when asking for its name and its size. Allow values of this type in tables. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4113 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/include/cctk_Constants.h | 39 ++++++++++++++++++++------------------- src/include/util_Table.h | 16 ++++++++++++++++ 2 files changed, 36 insertions(+), 19 deletions(-) (limited to 'src/include') diff --git a/src/include/cctk_Constants.h b/src/include/cctk_Constants.h index a07dec1e..89f561ad 100644 --- a/src/include/cctk_Constants.h +++ b/src/include/cctk_Constants.h @@ -11,25 +11,26 @@ #ifndef _CCTK_CONSTANTS_H_ #define _CCTK_CONSTANTS_H_ -#define CCTK_VARIABLE_VOID 100 -#define CCTK_VARIABLE_BYTE 101 -#define CCTK_VARIABLE_INT 102 -#define CCTK_VARIABLE_INT1 103 -#define CCTK_VARIABLE_INT2 104 -#define CCTK_VARIABLE_INT4 105 -#define CCTK_VARIABLE_INT8 106 -#define CCTK_VARIABLE_REAL 107 -#define CCTK_VARIABLE_REAL4 108 -#define CCTK_VARIABLE_REAL8 109 -#define CCTK_VARIABLE_REAL16 110 -#define CCTK_VARIABLE_COMPLEX 111 -#define CCTK_VARIABLE_COMPLEX8 112 -#define CCTK_VARIABLE_COMPLEX16 113 -#define CCTK_VARIABLE_COMPLEX32 114 -#define CCTK_VARIABLE_CHAR 115 -#define CCTK_VARIABLE_STRING 116 -#define CCTK_VARIABLE_POINTER 117 -#define CCTK_VARIABLE_FPOINTER 118 +#define CCTK_VARIABLE_VOID 100 +#define CCTK_VARIABLE_BYTE 101 +#define CCTK_VARIABLE_INT 102 +#define CCTK_VARIABLE_INT1 103 +#define CCTK_VARIABLE_INT2 104 +#define CCTK_VARIABLE_INT4 105 +#define CCTK_VARIABLE_INT8 106 +#define CCTK_VARIABLE_REAL 107 +#define CCTK_VARIABLE_REAL4 108 +#define CCTK_VARIABLE_REAL8 109 +#define CCTK_VARIABLE_REAL16 110 +#define CCTK_VARIABLE_COMPLEX 111 +#define CCTK_VARIABLE_COMPLEX8 112 +#define CCTK_VARIABLE_COMPLEX16 113 +#define CCTK_VARIABLE_COMPLEX32 114 +#define CCTK_VARIABLE_CHAR 115 +#define CCTK_VARIABLE_STRING 116 +#define CCTK_VARIABLE_POINTER 117 +#define CCTK_VARIABLE_POINTER_TO_CONST 118 +#define CCTK_VARIABLE_FPOINTER 119 /* DEPRECATED IN BETA 12 */ #define CCTK_VARIABLE_FN_POINTER CCTK_VARIABLE_FPOINTER diff --git a/src/include/util_Table.h b/src/include/util_Table.h index db1d0102..b21a44cb 100644 --- a/src/include/util_Table.h +++ b/src/include/util_Table.h @@ -178,6 +178,9 @@ int Util_TableGetGenericArray(int handle, /* pointers */ int Util_TableSetPointer(int handle, CCTK_POINTER value, const char *key); +int Util_TableSetPointerToConst(int handle, + CCTK_POINTER_TO_CONST value, + const char *key); int Util_TableSetFPointer(int handle, CCTK_FPOINTER value, const char *key); /* * ... the following function (an alias for the previous one) is for @@ -234,6 +237,10 @@ int Util_TableSetComplex32(int handle, CCTK_COMPLEX32 value, const char *key); int Util_TableSetPointerArray(int handle, int N_elements, const CCTK_POINTER array[], const char *key); +int Util_TableSetPointerToConstArray(int handle, + int N_elements, + const CCTK_POINTER_TO_CONST array[], + const char *key); int Util_TableSetFPointerArray(int handle, int N_elements, const CCTK_FPOINTER array[], const char *key); @@ -327,6 +334,10 @@ int Util_TableSetComplex32Array(int handle, /* pointers */ int Util_TableGetPointer(int handle, CCTK_POINTER *value, const char *key); +int Util_TableGetPointerToConst(int handle, + CCTK_POINTER_TO_CONST *value, + const char *key); + int Util_TableGetFPointer(int handle, CCTK_FPOINTER *value, const char *key); /* * ... the following function (an alias for the previous one) is for @@ -383,6 +394,11 @@ int Util_TableGetComplex32(int handle, CCTK_COMPLEX32 *value, const char *key); int Util_TableGetPointerArray(int handle, int N_elements, CCTK_POINTER array[], const char *key); +int Util_TableGetPointerToConstArray(int handle, + int N_elements, + CCTK_POINTER_TO_CONST array[], + const char *key); + int Util_TableGetFPointerArray(int handle, int N_elements, CCTK_FPOINTER array[], const char *key); -- cgit v1.2.3