diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-10-03 13:14:28 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-10-03 13:14:28 +0000 |
commit | ba4821ed7ee6aef53ec48d3739c77edad8bd7858 (patch) | |
tree | c80f8eddb21d902a486b3176a0b3a4f8c1ae27fd /src/include/cctk_WarnLevel.h | |
parent | de4ddf226c8b8f842d3ee40319fcc4f693899903 (diff) |
Patch from Jian Tao to add some callback functionality to the
warning system. This allows thorns to register functions which
will be called when CCTK_Warn or CCTK_Info are called, with the
contents of the warning/info message, thus allowing thorns to
do things like logging warnings to file or displaying on webpages.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4157 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/include/cctk_WarnLevel.h')
-rw-r--r-- | src/include/cctk_WarnLevel.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/include/cctk_WarnLevel.h b/src/include/cctk_WarnLevel.h index d867eae9..e826bfdf 100644 --- a/src/include/cctk_WarnLevel.h +++ b/src/include/cctk_WarnLevel.h @@ -47,11 +47,35 @@ __attribute__ ((format (printf, 2, 3))) #endif ; +/* prototypes for warn/info callback routines */ + +typedef void (*cctk_warnfunc)(int level, + int line, + const char *file, + const char *thorn, + const char *message, + void *data); + +typedef void (*cctk_infofunc)(const char *thorn, + const char *message, + void *data); + +/* prototypes for warn/info registration routines */ +int CCTK_WarnCallbackRegister(int minlevel, + int maxlevel, + void *data, + cctk_warnfunc callback); + + +int CCTK_InfoCallbackRegister(void *data, + cctk_infofunc callback); + + #ifdef __cplusplus } #endif -#endif /* CCODE */ +#endif /* CCODE */ /* suggested values for warning levels (courtesy of Steve, PR#1742) */ #define CCTK_WARN_ABORT 0 /* abort the Cactus run */ |