J
jacob navia
#include "containers.h"
#include <stdio.h>
void ContainerRaiseError(const char *fnname,int errcode)
{
const char *arg;
switch(errcode) {
case CONTAINER_ERROR_BADARG:
arg = "Bad argument to a function";
break;
case CONTAINER_ERROR_NOMEMORY:
arg = "Insufficient memory";
break;
case CONTAINER_ERROR_INDEX:
arg = "Index error";
break;
case CONTAINER_ERROR_READONLY:
arg = "Object is read only";
break;
default:
arg = "Unknown error";
break;
}
fprintf(stderr,"Container library: Error %s in function %s\n",arg,fnname);
}
void EmptyErrorFunction(const char *fnname,int errcode) { }
#include <stdio.h>
void ContainerRaiseError(const char *fnname,int errcode)
{
const char *arg;
switch(errcode) {
case CONTAINER_ERROR_BADARG:
arg = "Bad argument to a function";
break;
case CONTAINER_ERROR_NOMEMORY:
arg = "Insufficient memory";
break;
case CONTAINER_ERROR_INDEX:
arg = "Index error";
break;
case CONTAINER_ERROR_READONLY:
arg = "Object is read only";
break;
default:
arg = "Unknown error";
break;
}
fprintf(stderr,"Container library: Error %s in function %s\n",arg,fnname);
}
void EmptyErrorFunction(const char *fnname,int errcode) { }