From e12fcb08a14de1f5738e0162bba50cdbf87dee47 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 5 Jul 2007 18:05:43 +0000 Subject: First import... --- mpq-errors.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 mpq-errors.c (limited to 'mpq-errors.c') diff --git a/mpq-errors.c b/mpq-errors.c new file mode 100644 index 0000000..e0b8655 --- /dev/null +++ b/mpq-errors.c @@ -0,0 +1,22 @@ +#include "mpq-errors.h" +#include "errors.h" + +static const char * error_strings[] = { + "No error.", + "Error opening file.", + "File specified isn't an MPQ archive.", + "Not enough memory.", + "File read error.", +}; + +static const char * wrong_errno = "Invalid error number - internal error."; + +int mpqlib_errno() { + return __mpqlib_errno; +} + +const char * mpqlib_error() { + if ((__mpqlib_errno < 0) || (__mpqlib_errno >= MPQLIB_ERRORS_MAX)) + return wrong_errno; + return error_strings[__mpqlib_errno]; +} -- cgit v1.2.3