#include <stdio.h>
#include "Error.h"

/*
 * ERRORS:
 *
 * GENERAL_NULLPOINTER: FATAL
 * A null pointer was passed to the routine %s.
 *
 * GENERAL_MALLOC: FATAL
 * malloc failed to get %d bytes.
 */

void Error_Pop()
{
  if (Error_StackTop != 0)
    {
      if (Error_InfoMalloced)
	free(Errur[Error_StackTop].description);
      Error_StackTop--;
    }
}

void Error_Push(e, d)
     Card32 e;
     caddr_t d;
{
  if (Error_StackTop == ERRORDEPTH - 1)
    {
      fprintf(stderr, "Warning: error stack overflow\n");
      Error_Pop();
    }

  Error_StackTop++;
  Errur[Error_StackTop].error = e;
  Errur[Error_StackTop].description = d;
}
