2006-10-23 10:57:59 +00:00
|
|
|
/*
|
2006-10-24 04:22:40 +00:00
|
|
|
* $Id: err.c,v 1.3 2006-10-24 04:22:39 bacon Exp $
|
2006-10-23 10:57:59 +00:00
|
|
|
*/
|
|
|
|
|
2006-10-24 04:22:40 +00:00
|
|
|
#include <ase/lsp/lsp.h>
|
2006-10-23 10:57:59 +00:00
|
|
|
|
2006-10-24 04:22:40 +00:00
|
|
|
static const ase_char_t* __errstr[] =
|
2006-10-23 10:57:59 +00:00
|
|
|
{
|
2006-10-24 04:22:40 +00:00
|
|
|
ASE_T("no error"),
|
|
|
|
ASE_T("out of memory"),
|
|
|
|
ASE_T("abort"),
|
|
|
|
ASE_T("end"),
|
|
|
|
ASE_T("input not attached"),
|
|
|
|
ASE_T("input"),
|
|
|
|
ASE_T("output not attached"),
|
|
|
|
ASE_T("output"),
|
|
|
|
ASE_T("syntax"),
|
|
|
|
ASE_T("bad arguments"),
|
|
|
|
ASE_T("wrong arguments"),
|
|
|
|
ASE_T("too few arguments"),
|
|
|
|
ASE_T("too many arguments"),
|
|
|
|
ASE_T("undefined function"),
|
|
|
|
ASE_T("bad function"),
|
|
|
|
ASE_T("duplicate formal"),
|
|
|
|
ASE_T("bad symbol"),
|
|
|
|
ASE_T("undefined symbol"),
|
|
|
|
ASE_T("empty body"),
|
|
|
|
ASE_T("bad value"),
|
|
|
|
ASE_T("divide by zero")
|
2006-10-23 10:57:59 +00:00
|
|
|
};
|
|
|
|
|
2006-10-24 04:22:40 +00:00
|
|
|
int ase_lsp_geterrnum (ase_lsp_t* lsp)
|
2006-10-23 10:57:59 +00:00
|
|
|
{
|
|
|
|
return lsp->errnum;
|
|
|
|
}
|
|
|
|
|
2006-10-24 04:22:40 +00:00
|
|
|
const ase_char_t* ase_lsp_geterrstr (int errnum)
|
2006-10-23 10:57:59 +00:00
|
|
|
{
|
2006-10-24 04:22:40 +00:00
|
|
|
if (errnum >= 0 && errnum < ase_countof(__errstr))
|
2006-10-23 10:57:59 +00:00
|
|
|
{
|
|
|
|
return __errstr[errnum];
|
|
|
|
}
|
|
|
|
|
2006-10-24 04:22:40 +00:00
|
|
|
return ASE_T("unknown error");
|
2006-10-23 10:57:59 +00:00
|
|
|
}
|