error logger headaches

This commit is contained in:
2026-03-11 14:58:11 -04:00
parent 0003a9d6d2
commit bb7579f7b0
4 changed files with 52 additions and 0 deletions

View File

@ -25,6 +25,28 @@ static const int amsmathutil25_maxthreads = 50;
static const int amsmathutil25_threadpsz = 5000;
//Global Changeable Error Logger //
//Using accessor pattern
//pointer to function of signature void errorlogger(const char *errmsg, int errcode, void *errglobal);
extern void (*amsmathutil25_errlogger)(const char *, int, void *);
extern void* amsmathutil25_errglobal;
typedef void (*amsmathutil25_errloggerptr_t)(const char *, int, void *);
amsmathutil25_errloggerptr_t amsmathutil25_get_errlogger(); //call this to get the error logger to log errors
// //the other way to do this
// // return type "pointer to function(const char*, int, void*) returning void"
// void (*amsmathutil25_get_errlogger(void))(const char *, int, void *);
// //not exactly clear....
void amsmathutil25_set_errlogger(
void(*errloggerpointer)(const char *, int, void *),
void* errglobal
);
//End Error Logger
};
//Library subsections