diff options
author | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-02-03 12:20:40 +0000 |
---|---|---|
committer | allen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-02-03 12:20:40 +0000 |
commit | 118355583a6e67141bc0b5844b4057dab07c67c9 (patch) | |
tree | e861f7241c5bc5b7dd9612a73fea77e10edd6312 /src | |
parent | e844fb5a9731296e0562f4c78d9b044ff129f0db (diff) |
standardizing names ... you will need to do a gmake <config>-clean before
recompiling.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1342 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r-- | src/include/CactusTimers.h | 46 | ||||
-rw-r--r-- | src/include/Hash.h | 71 | ||||
-rw-r--r-- | src/include/cctk.h | 1 | ||||
-rw-r--r-- | src/include/cctk_Constants.h | 46 | ||||
-rw-r--r-- | src/include/cctk_File.h | 2 | ||||
-rw-r--r-- | src/include/cctk_Groups.h | 1 | ||||
-rw-r--r-- | src/include/cctk_Parameter.h | 129 | ||||
-rw-r--r-- | src/include/cctki_Stagger.h | 47 | ||||
-rw-r--r-- | src/include/util_BinaryTree.h | 57 | ||||
-rw-r--r-- | src/include/util_Hash.h | 72 |
10 files changed, 332 insertions, 140 deletions
diff --git a/src/include/CactusTimers.h b/src/include/CactusTimers.h index e79cb483..6a9b821d 100644 --- a/src/include/CactusTimers.h +++ b/src/include/CactusTimers.h @@ -13,11 +13,11 @@ /* Typedefs */ -typedef enum {val_none, val_int, val_long, val_double} t_TimerValType; +typedef enum {val_none, val_int, val_long, val_double} cTimerValType; typedef struct { - t_TimerValType type; + cTimerValType type; const char *heading; const char *units; union @@ -26,26 +26,26 @@ typedef struct long int l; double d; } val; -} t_TimerVal; +} cTimerVal; typedef struct { int n_vals; - t_TimerVal *vals; -} t_TimerInfo; + cTimerVal *vals; +} cTimerData; typedef struct { - t_TimerInfo info; + cTimerData info; void *(*create)(int); void (*destroy)(int, void *); void (*start)(int, void *); void (*stop)(int, void *); void (*reset)(int, void *); - void (*get)(int, void *, t_TimerVal *); - void (*set)(int, void *, t_TimerVal *); -} t_TimerFuncs; + void (*get)(int, void *, cTimerVal *); + void (*set)(int, void *, cTimerVal *); +} cTimerFuncs; @@ -55,22 +55,22 @@ typedef struct extern "C" { #endif -int CCTK_TimerRegister(const char *name, t_TimerFuncs *functions); +int CCTK_TimerRegister(const char *name, cTimerFuncs *functions); int CCTK_TimerCreate(const char *name); int CCTK_TimerCreateI(void); -void CCTK_TimerDestroy(const char *name); -void CCTK_TimerDestroyI(int this_timer); -void CCTK_TimerStart(const char *name); -void CCTK_TimerStartI(int this_timer); -void CCTK_TimerStop(const char *name); -void CCTK_TimerStopI(int this_timer); -void CCTK_TimerReset(const char *name); -void CCTK_TimerResetI(int this_timer); -void CCTK_TimerGet(const char *name, t_TimerInfo *info); -void CCTK_TimerGetI(int this_timer, t_TimerInfo *info); - -t_TimerInfo *CCTK_TimerCreateInfo(void); -void CCTK_TimerDestroyInfo(t_TimerInfo *info); +int CCTK_TimerDestroy(const char *name); +int CCTK_TimerDestroyI(int this_timer); +int CCTK_TimerStart(const char *name); +int CCTK_TimerStartI(int this_timer); +int CCTK_TimerStop(const char *name); +int CCTK_TimerStopI(int this_timer); +int CCTK_TimerReset(const char *name); +int CCTK_TimerResetI(int this_timer); +int CCTK_Timer(const char *name, cTimerData *info); +int CCTK_TimerI(int this_timer, cTimerData *info); + +cTimerData *CCTK_TimerCreateData(void); +int CCTK_TimerDestroyData(cTimerData *info); #ifdef __cplusplus } diff --git a/src/include/Hash.h b/src/include/Hash.h deleted file mode 100644 index aee1095f..00000000 --- a/src/include/Hash.h +++ /dev/null @@ -1,71 +0,0 @@ - /*@@ - @header Hash.h - @date Wed Oct 27 23:28:53 1999 - @author Tom Goodale - @desc - Header file for hash stuff. - @enddesc - @version $Header$ - @@*/ - -#ifndef _HASH_H_ -#define _HASH_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct T_HASH_ENTRY -{ - struct T_HASH_ENTRY *last; - struct T_HASH_ENTRY *next; - - unsigned int hash; - - unsigned int klen; - char *key; - - void *data; -} t_hash_entry; - -typedef struct T_HASH -{ - unsigned int size; - unsigned int fill; - unsigned int keys; - - t_hash_entry **array; -} t_hash; - -t_hash *HashCreate(unsigned int initial_size); -void HashDestroy(t_hash *hash); - -int HashStore(t_hash *hash, - unsigned int klen, - char *key, - unsigned int hashval, - void *data); - -int HashAdd(t_hash *hash, - unsigned int klen, - char *key, - unsigned int hashval, - void *data); - -int HashDelete(t_hash *hash, - unsigned int klen, - char *key, unsigned int hashval); - -void *HashGet(t_hash *hash, - unsigned int klen, - char *key, - unsigned int hashval); - -unsigned int HashHash(unsigned int klen, - char *key); - -#ifdef __cplusplus -} -#endif - -#endif /* _HASH_H_ */ diff --git a/src/include/cctk.h b/src/include/cctk.h index e4f55fbb..12476fff 100644 --- a/src/include/cctk.h +++ b/src/include/cctk.h @@ -92,6 +92,7 @@ #include "cctk_Interp.h" #include "cctk_IOMethods.h" #include "cctk_Misc.h" +#include "cctk_Parameter.h" #include "cctk_Reduction.h" #include "cctk_WarnLevel.h" diff --git a/src/include/cctk_Constants.h b/src/include/cctk_Constants.h index ba9b85ec..47b9b0b6 100644 --- a/src/include/cctk_Constants.h +++ b/src/include/cctk_Constants.h @@ -32,53 +32,9 @@ #define CCTK_STEERABLE_ALWAYS 1 #define CCTK_STEERABLE_RECOVER 2 -/* stagger flags: yes/no, number of staggerings: 3 */ -#define CCTK_NO_STAGGER 0 -#define CCTK_STAGGER 1 +/* number of staggerings */ #define CCTK_NSTAGGER 3 -/* stagger code in one direction */ -#define CCTK_STAG_M 0 -#define CCTK_STAG_C 1 -#define CCTK_STAG_P 2 - -/* stagger code of three directions */ -#define CCTK_STAG_MMM 0 -#define CCTK_STAG_CMM 1 -#define CCTK_STAG_PMM 2 - -#define CCTK_STAG_MCM 3 -#define CCTK_STAG_CCM 4 -#define CCTK_STAG_PCM 5 - -#define CCTK_STAG_MPM 6 -#define CCTK_STAG_CPM 7 -#define CCTK_STAG_PPM 8 - -#define CCTK_STAG_MMC 9 -#define CCTK_STAG_CMC 11 -#define CCTK_STAG_PMC 12 - -#define CCTK_STAG_MCC 13 -#define CCTK_STAG_CCC 14 -#define CCTK_STAG_PCC 15 - -#define CCTK_STAG_MPC 16 -#define CCTK_STAG_CPC 17 -#define CCTK_STAG_PPC 18 - -#define CCTK_STAG_MMP 19 -#define CCTK_STAG_CMP 20 -#define CCTK_STAG_PMP 21 - -#define CCTK_STAG_MCP 22 -#define CCTK_STAG_CCP 23 -#define CCTK_STAG_PCP 24 - -#define CCTK_STAG_MPP 25 -#define CCTK_STAG_CPP 26 -#define CCTK_STAG_PPP 27 - #endif /* _CCTK_CONSTANTS_ */ diff --git a/src/include/cctk_File.h b/src/include/cctk_File.h index 64f006b0..68b2129f 100644 --- a/src/include/cctk_File.h +++ b/src/include/cctk_File.h @@ -17,7 +17,7 @@ extern "C" { #endif -int CCTK_mkdir(char *dir); +int CCTK_mkdir(const char *dir); #ifdef __cplusplus } diff --git a/src/include/cctk_Groups.h b/src/include/cctk_Groups.h index de8de9ab..efc5478b 100644 --- a/src/include/cctk_Groups.h +++ b/src/include/cctk_Groups.h @@ -39,6 +39,7 @@ int CCTK_FirstVarIndexI(int group); char *CCTK_FullName(int var); int CCTK_GroupData(int group, cGroup *gp); +int CCTK_GroupDimI(int group); CCTK_INT **CCTK_GroupGhostsizesI(int group); int CCTK_GroupIndex(const char *groupname); int CCTK_GroupIndexFromVar(const char *var); diff --git a/src/include/cctk_Parameter.h b/src/include/cctk_Parameter.h new file mode 100644 index 00000000..79f033bf --- /dev/null +++ b/src/include/cctk_Parameter.h @@ -0,0 +1,129 @@ + /*@@ + @file cctk_Parameter.h + @date Wed Sep 8 10:46:19 MSZ 1999 + @author Andre Merzky + @desc + Public defines for parameter stuff + @enddesc + @version $Header$ + @@*/ + +#ifndef _CCTK_PARAMETER_H +#define _CCTK_PARAMETER_H + +/* this include file declares all parameter structs/defines which + * should be visible and useable for some thorn programmers. + * At first of all this means (read) access to parameter properties. + * Direct acces to parameter values (or its data pointers) are not + * allowed. The functions/declarations for this are in + * ParameterBindings.h, which in turn includes this file. + */ + +/* thes SCOPE* defines are used as flags fo parameter scopes. */ + +#define SCOPE_GLOBAL 1 /* parameter is visible everywhere */ +#define SCOPE_RESTRICTED 2 /* parameter is visible for friend thorns only */ +#define SCOPE_PRIVATE 3 /* parameter is visible for parent thorn only */ +#define SCOPE_NOT_GLOBAL 4 /* parameter is not visible everywhere */ +#define SCOPE_ANY 5 /* parameter scope is undefined/arbitrary */ + +static char *cctk_parameter_scopes[] = {"GLOBAL", "RESTRICTED", "PRIVATE"}; + +/* parameter types */ + +#define PARAMETER_KEYWORD 1 /* parameter is keyword */ +#define PARAMETER_STRING 2 /* parameter is string */ +#define PARAMETER_SENTENCE 3 /* parameter is sentence */ +#define PARAMETER_INT 4 /* parameter is integer */ +#define PARAMETER_INTEGER 4 /* parameter is integer */ +#define PARAMETER_REAL 5 /* parameter is float */ +#define PARAMETER_BOOLEAN 6 /* parameter is bool */ + +static const char *cctk_parameter_type_names[] = {"KEYWORD", + "STRING", + "SENTENCE", + "INTEGER", + "REAL", + "BOOLEAN"}; + +/* what is a parameter range: + * list of independent ranges, each with + * - orig string (range) + * - active flag + * - description + */ +typedef struct RANGE +{ + struct RANGE *last; + struct RANGE *next; + char *range; + char *origin; + int active; + char *description; +} t_range; + + +/* what are parameter properties: + * everything users may know about paras: + * - name + * - thorn it belongs to + * - scope + * - description + * - default value + * - type + * - range (see above) + * - number of times it has been set + * - steerable flag + */ +typedef struct PARAM_PROPS +{ + char *name; + char *thorn; + int scope; + + char *description; + char *defval; + + int type; + t_range *range; + + int n_set; + int steerable; + +} cParamData; + +#ifdef __cplusplus +extern "C" { +#endif + +/* set the value of a parameter */ +int CCTK_ParameterSet (const char *name, /* The name of the parameter */ + const char *thorn, /* The originating thorn */ + const char *value); /* The value of the parameter */ + +/* get the data pointer to and type of a parameter's value */ +void *CCTK_ParameterGet (const char *name, /* The name of the parameter */ + const char *thorn, /* The originating thorn */ + int *type); /* Holds type of parameter */ + +/* get the string representation of a parameter's value + (string should be freed afterwards) */ +char *ParameterValString (const char *name, /* The name of the parameter */ + const char *thorn); /* The originating thorn */ + +/* walk through list of parameters */ +const char *CCTK_ParameterWalk(int first, /* Get first parameter or not */ + const char *origin); /* Origin of this walk */ + +/* get list of parameter names for given thorn */ +int CCTK_ParameterList (const char* thorn, char ***paramlist, int *n_param); + +/* get parameter properties for gven parameter/thorn pair */ +cParamData *CCTK_ParameterData (const char *name, + const char *thorn); + +#ifdef __cplusplus +} +#endif + +#endif /* _CCTK_PARAMETER_H */ diff --git a/src/include/cctki_Stagger.h b/src/include/cctki_Stagger.h index 77151ec3..492c0f99 100644 --- a/src/include/cctki_Stagger.h +++ b/src/include/cctki_Stagger.h @@ -25,4 +25,51 @@ int CCTKi_ParseStaggerString(int dim, } #endif +/* stagger flags: yes/no, number of staggerings: 3 */ +#define CCTK_NO_STAGGER 0 +#define CCTK_STAGGER 1 + +/* stagger code in one direction */ +#define CCTK_STAG_M 0 +#define CCTK_STAG_C 1 +#define CCTK_STAG_P 2 + +/* stagger code of three directions */ +#define CCTK_STAG_MMM 0 +#define CCTK_STAG_CMM 1 +#define CCTK_STAG_PMM 2 + +#define CCTK_STAG_MCM 3 +#define CCTK_STAG_CCM 4 +#define CCTK_STAG_PCM 5 + +#define CCTK_STAG_MPM 6 +#define CCTK_STAG_CPM 7 +#define CCTK_STAG_PPM 8 + +#define CCTK_STAG_MMC 9 +#define CCTK_STAG_CMC 11 +#define CCTK_STAG_PMC 12 + +#define CCTK_STAG_MCC 13 +#define CCTK_STAG_CCC 14 +#define CCTK_STAG_PCC 15 + +#define CCTK_STAG_MPC 16 +#define CCTK_STAG_CPC 17 +#define CCTK_STAG_PPC 18 + +#define CCTK_STAG_MMP 19 +#define CCTK_STAG_CMP 20 +#define CCTK_STAG_PMP 21 + +#define CCTK_STAG_MCP 22 +#define CCTK_STAG_CCP 23 +#define CCTK_STAG_PCP 24 + +#define CCTK_STAG_MPP 25 +#define CCTK_STAG_CPP 26 +#define CCTK_STAG_PPP 27 + + #endif /* _CCTKI_STAGGER_H_ */ diff --git a/src/include/util_BinaryTree.h b/src/include/util_BinaryTree.h new file mode 100644 index 00000000..71c6d529 --- /dev/null +++ b/src/include/util_BinaryTree.h @@ -0,0 +1,57 @@ + /*@@ + @header BinaryTree.h + @date Mon Oct 5 11:01:20 1998 + @author Tom Goodale + @desc + Prototypes and data definitions for binary tree routines. + @enddesc + @version $Header$ + @@*/ + +#ifndef _BINARYTREE_H_ +#define _BINARYTREE_H_ + +#ifdef _cplusplus +extern "C" { +#endif + +typedef struct T_TREE +{ + struct T_TREE *left; + struct T_TREE *right; + struct T_TREE *next; + + void *data; +} uBinTree; + + +uBinTree *Util_BinTreeStoreData(uBinTree *root, + uBinTree *subtree, + void *data, + int (*compare)(const void *, const void *)); + +int Util_BinTreeTraverseInorder(uBinTree *root, + int (*process)(void *, void *), + void *info); + +int Util_BinTreeTraversePreorder(uBinTree *root, + int (*process)(void *, void *), + void *info); + +int Util_BinTreeTraversePostorder(uBinTree *root, + int (*process)(void *, void *), + void *info); + +int Util_BinTreePrintNodes(uBinTree *root, + int depth, + void (*print_node)(void *, int)); + +uBinTree *Util_BinTreeFindNode(uBinTree *root, + void *data, + int (*compare)(const void *, const void *)); + +#ifdef _cplusplus +} +#endif + +#endif diff --git a/src/include/util_Hash.h b/src/include/util_Hash.h new file mode 100644 index 00000000..62e6f2cc --- /dev/null +++ b/src/include/util_Hash.h @@ -0,0 +1,72 @@ + /*@@ + @header Hash.h + @date Wed Oct 27 23:28:53 1999 + @author Tom Goodale + @desc + Header file for hash stuff. + @enddesc + @version $Header$ + @@*/ + +#ifndef _HASH_H_ +#define _HASH_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct T_HASH_ENTRY +{ + struct T_HASH_ENTRY *last; + struct T_HASH_ENTRY *next; + + unsigned int hash; + + unsigned int klen; + char *key; + + void *data; +} iHashEntry; + +typedef struct T_HASH +{ + unsigned int size; + unsigned int fill; + unsigned int keys; + + iHashEntry **array; +} uHash; + +uHash *Util_HashCreate(unsigned int initial_size); +int Util_HashDestroy(uHash *hash); + +int Util_HashStore(uHash *hash, + unsigned int klen, + char *key, + unsigned int hashval, + void *data); + +int Util_HashAdd(uHash *hash, + unsigned int klen, + char *key, + unsigned int hashval, + void *data); + +int Util_HashDelete(uHash *hash, + unsigned int klen, + char *key, + unsigned int hashval); + +void *Util_HashData(uHash *hash, + unsigned int klen, + char *key, + unsigned int hashval); + +unsigned int Util_HashHash(unsigned int klen, + char *key); + +#ifdef __cplusplus +} +#endif + +#endif /* _HASH_H_ */ |