containererror.c

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) { }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top