#include #include #include #include "err_handling.h" #define SLEN 64 #define MLEN 64 static char *txt[SLEN]; static int sp=0; int ErrCode; char *ErrMessage=NULL; void (*outrtn)()=NULL; void *outarg; void *my_malloc(size_t size, const char *text) { void *ptr; ptr=calloc(1,size); /* printf("new %s %X %d\n", text, ptr, size); */ return(ptr); } void my_free(void *ptr) { /* printf("my_free %X\n", ptr); */ free(ptr); } void ErrTxt(char *text, int systemError) { if (systemError) { sp=0; ErrCode=errno; ErrMessage=strerror(errno); } if (sp=256) length=255; strncpy(buf, text, length); buf[length]='\0'; ErrWrite(buf); } #ifdef __VMS typedef struct { short size, dummy; char *text; } Desc; void err_show(Desc *desc) { err_show_(desc->text, desc->size); } #endif void errsetoutrtn_(void (*rtn)(), void *arg) { ErrSetOutRtn(rtn, arg); }