82#if defined(__cplusplus) || defined(c_plusplus)
91#if defined(__cplusplus) || defined(c_plusplus)
133 (void) memset(exception,0,
sizeof(*exception));
170 if (p->
reason != (
char *) NULL)
175 return((
void *) NULL);
197 exception->
reason=(
char *) NULL;
283 const char *reason,
const char *description)
285 if (reason == (
char *) NULL)
288 if (description != (
char *) NULL)
289 (
void) fprintf(stderr,
" (%s)",description);
290 (void) fprintf(stderr,
".\n");
291 (void) fflush(stderr);
324 const char *reason,
const char *description)
326 if (reason == (
char *) NULL)
329 if (description != (
char *) NULL)
330 (
void) fprintf(stderr,
" (%s)",description);
331 (void) fprintf(stderr,
".\n");
332 (void) fflush(stderr);
366 const char *reason,
const char *description)
368 if (reason == (
char *) NULL)
371 if (description != (
char *) NULL)
372 (
void) fprintf(stderr,
" (%s)",description);
373 (void) fprintf(stderr,
".\n");
374 (void) fflush(stderr);
441 (void) memset(exception,0,
sizeof(*exception));
477#if defined(WIZARDSTOOLKIT_HAVE_STRERROR_R)
478#if !defined(WIZARDSTOOLKIT_STRERROR_R_CHAR_P)
479 (void) strerror_r(error,exception,
sizeof(exception));
482 sizeof(exception)),
sizeof(exception));
543 case MACError:
return(
"MAC/Error/");
584#if defined(WIZARDSTOOLKIT_LOCALE)
591 assert(tag != (
const char *) NULL);
595 if (locale_message == (
const char *) NULL)
597 if (locale_message == message)
599 return(locale_message);
714 const char *description)
717 (*error_handler)(error,reason,description);
750 const char *description)
753 (*fatal_error_handler)(error,reason,description);
784 const char *description)
787 (*warning_handler)(warning,reason,description);
820 return(previous_handler);
853 return(previous_handler);
886 return(previous_handler);
921 const ExceptionType severity,
const char *reason,
const char *description)
946 (void) memset(p,0,
sizeof(*p));
948 if (reason != (
const char *) NULL)
950 if (description != (
const char *) NULL)
998 ExceptionInfo *exception,
const char *module,
const char *function,
999 const size_t line,
const ExceptionType severity,
const char *format,
1014#if defined(WIZARDSTOOLKIT_HAVE_VSNPRINTF)
1017 n=vsprintf(reason,format,operands);
1024 module,function,(
double) line);
1030 const char *module,
const char *function,
const size_t line,
1039 va_start(operands,format);
WizardExport const char * GetClientName(void)
#define ThrowFatalException(severity, tag)
WizardExport void WizardWarning(const ExceptionType warning, const char *reason, const char *description)
static FatalErrorHandler fatal_error_handler
static WarningHandler warning_handler
static const char * ExceptionSeverityToTag(const ExceptionType severity)
static void DefaultErrorHandler(const ExceptionType, const char *, const char *)
WizardExport ExceptionInfo * AcquireExceptionInfo(void)
WizardExport ExceptionInfo * DestroyExceptionInfo(ExceptionInfo *exception)
WizardExport ExceptionType GetExceptionSeverity(const ExceptionInfo *exception)
WizardExport WizardBooleanType ThrowWizardException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *format,...)
WizardExport void CatchException(ExceptionInfo *exception)
WizardExport void GetExceptionInfo(ExceptionInfo *exception)
static void DefaultWarningHandler(const ExceptionType, const char *, const char *)
WizardExport WizardBooleanType ThrowWizardExceptionList(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *format, va_list operands)
WizardExport void ClearWizardException(ExceptionInfo *exception)
WizardExport ErrorHandler SetErrorHandler(ErrorHandler handler)
static void * DestroyExceptionElement(void *exception)
WizardExport void WizardError(const ExceptionType error, const char *reason, const char *description)
WizardExport WarningHandler SetWarningHandler(WarningHandler handler)
WizardExport void InheritException(ExceptionInfo *exception, const ExceptionInfo *relative)
WizardExport WizardBooleanType ThrowException(ExceptionInfo *exception, const ExceptionType severity, const char *reason, const char *description)
WizardExport const char * GetLocaleExceptionMessage(const ExceptionType severity, const char *tag)
static void DefaultFatalErrorHandler(const ExceptionType, const char *, const char *)
static ErrorHandler error_handler
WizardExport char * GetExceptionMessage(const int error)
WizardExport void WizardFatalError(const ExceptionType error, const char *reason, const char *description)
WizardExport FatalErrorHandler SetFatalErrorHandler(FatalErrorHandler handler)
WizardExport const char * GetLocaleMessage(const char *)
void(* WarningHandler)(const ExceptionType, const char *, const char *)
void(* FatalErrorHandler)(const ExceptionType, const char *, const char *)
void(* ErrorHandler)(const ExceptionType, const char *, const char *)
WizardExport void * GetLastValueInLinkedList(LinkedListInfo *list_info)
WizardExport void * RemoveLastElementFromLinkedList(LinkedListInfo *list_info)
WizardExport void ResetLinkedListIterator(LinkedListInfo *list_info)
WizardExport WizardBooleanType AppendValueToLinkedList(LinkedListInfo *list_info, const void *value)
WizardExport LinkedListInfo * NewLinkedList(const size_t capacity)
WizardExport void * GetNextValueInLinkedList(LinkedListInfo *list_info)
WizardExport LinkedListInfo * DestroyLinkedList(LinkedListInfo *list_info, void *(*relinquish_value)(void *))
WizardExport ssize_t FormatLocaleString(char *string, const size_t length, const char *format,...)
WizardBooleanType LogWizardEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
WizardExport void * AcquireWizardMemory(const size_t size)
WizardExport void * RelinquishWizardMemory(void *memory)
WizardExport void RelinquishSemaphoreInfo(SemaphoreInfo **semaphore_info)
WizardExport SemaphoreInfo * AcquireSemaphoreInfo(void)
WizardExport void LockSemaphoreInfo(SemaphoreInfo *semaphore_info)
WizardExport void UnlockSemaphoreInfo(SemaphoreInfo *semaphore_info)
WizardExport int LocaleCompare(const char *p, const char *q)
WizardExport char * ConstantString(const char *source)
WizardExport size_t CopyWizardString(char *destination, const char *source, const size_t length)
SemaphoreInfo * semaphore
WizardBooleanType relinquish
WizardExport void WizardsToolkitTerminus(void)