lib/errCatch.c File Reference

#include "common.h"
#include "errabort.h"
#include "dystring.h"
#include "errCatch.h"

Include dependency graph for errCatch.c:

Go to the source code of this file.

Functions

errCatcherrCatchNew ()
void errCatchFree (struct errCatch **pErrCatch)
static void errCatchAbortHandler ()
static void errCatchWarnHandler (char *format, va_list args)
boolean errCatchPushHandlers (struct errCatch *errCatch)
void errCatchEnd (struct errCatch *errCatch)
boolean errCatchFinish (struct errCatch **pErrCatch)

Variables

static char const rcsid [] = "$Id: errCatch.c,v 1.2 2006/08/10 01:02:47 kent Exp $"
static struct errCatcherrCatchStack = NULL


Function Documentation

static void errCatchAbortHandler (  )  [static]

Definition at line 47 of file errCatch.c.

References errCatchStack, errCatch::gotError, errCatch::jmpBuf, and TRUE.

Referenced by errCatchPushHandlers().

00049 {
00050 errCatchStack->gotError = TRUE;
00051 longjmp(errCatchStack->jmpBuf, -1);
00052 }

Here is the caller graph for this function:

void errCatchEnd ( struct errCatch errCatch  ) 

Definition at line 70 of file errCatch.c.

References errAbort(), errCatchStack, errCatch::next, popAbortHandler(), and popWarnHandler().

Referenced by errCatchFinish(), htmlPageForwardedNoAbort(), qaPageFromForm(), and qaPageGet().

00072 {
00073 popWarnHandler();
00074 popAbortHandler();
00075 if (errCatch != errCatchStack)
00076    errAbort("Mismatch betweene errCatch and errCatchStack");
00077 errCatchStack = errCatch->next;
00078 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean errCatchFinish ( struct errCatch **  pErrCatch  ) 

Definition at line 80 of file errCatch.c.

References errCatchEnd(), errCatchFree(), FALSE, TRUE, and warn().

00084 {
00085 struct errCatch *errCatch = *pErrCatch;
00086 boolean ok = TRUE;
00087 if (errCatch != NULL)
00088     {
00089     errCatchEnd(errCatch);
00090     if (errCatch->gotError)
00091         {
00092         ok = FALSE;
00093         warn(errCatch->message->string);
00094         }
00095     errCatchFree(pErrCatch);
00096     }
00097 return ok;
00098 }

Here is the call graph for this function:

void errCatchFree ( struct errCatch **  pErrCatch  ) 

Definition at line 34 of file errCatch.c.

References dyStringFree, freez(), and errCatch::message.

Referenced by errCatchFinish(), htmlPageForwardedNoAbort(), qaPageFromForm(), and qaPageGet().

00036 {
00037 struct errCatch *errCatch = *pErrCatch;
00038 if (errCatch != NULL)
00039     {
00040     dyStringFree(&errCatch->message);
00041     freez(pErrCatch);
00042     }
00043 }

Here is the call graph for this function:

Here is the caller graph for this function:

struct errCatch* errCatchNew (  )  [read]

Definition at line 25 of file errCatch.c.

References AllocVar, dyStringNew, and errCatch::message.

Referenced by htmlPageForwardedNoAbort(), qaPageFromForm(), and qaPageGet().

00027 {
00028 struct errCatch *errCatch;
00029 AllocVar(errCatch);
00030 errCatch->message = dyStringNew(0);
00031 return errCatch;
00032 }

Here is the caller graph for this function:

boolean errCatchPushHandlers ( struct errCatch errCatch  ) 

Definition at line 61 of file errCatch.c.

References errCatchAbortHandler(), errCatchStack, errCatchWarnHandler(), pushAbortHandler(), pushWarnHandler(), slAddHead, and TRUE.

00063 {
00064 pushAbortHandler(errCatchAbortHandler);
00065 pushWarnHandler(errCatchWarnHandler);
00066 slAddHead(&errCatchStack, errCatch);
00067 return TRUE;
00068 }

Here is the call graph for this function:

static void errCatchWarnHandler ( char *  format,
va_list  args 
) [static]

Definition at line 54 of file errCatch.c.

References dyStringAppendC(), dyStringVaPrintf(), errCatchStack, and errCatch::message.

Referenced by errCatchPushHandlers().

00056 {
00057 dyStringVaPrintf(errCatchStack->message, format, args);
00058 dyStringAppendC(errCatchStack->message, '\n');
00059 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

struct errCatch* errCatchStack = NULL [static]

Definition at line 45 of file errCatch.c.

Referenced by errCatchAbortHandler(), errCatchEnd(), errCatchPushHandlers(), and errCatchWarnHandler().

char const rcsid[] = "$Id: errCatch.c,v 1.2 2006/08/10 01:02:47 kent Exp $" [static]

Definition at line 22 of file errCatch.c.


Generated on Tue Dec 25 19:48:22 2007 for blat by  doxygen 1.5.2