40 lines
780 B
C
40 lines
780 B
C
#ifndef _MSPH_ERR_H
|
|
#define _MSPH_ERR_H
|
|
|
|
#include "spho/err.h"
|
|
|
|
|
|
#define MSPH_ERR_SYS 0x0001
|
|
#define MSPH_ERR_INVAL 0x0002
|
|
#define MSPH_ERR_TOOLONG 0x0003
|
|
|
|
#define MSPH_ERR_TOKEN_TOOLONG 0x1001
|
|
#define MSPH_ERR_TOKEN_EOF 0x1002
|
|
#define MSPH_ERR_TOKEN_NOMATCH 0x1003
|
|
#define MSPH_ERR_TOKEN_INVAL 0x1004
|
|
|
|
#define MSPH_ERR_TREE_TOOLONG 0x2001
|
|
#define MSPH_ERR_TREE_EOF 0x2002
|
|
#define MSPH_ERR_TREE_NOMATCH 0x2003
|
|
|
|
#define MSPH_ERR_TYPE_INVAL 0x3001
|
|
|
|
#define MSPH_ERR_SPHOPHI 0x10001
|
|
|
|
|
|
// TODO add more diagnostics
|
|
|
|
#define MSPH_ERR(ctx, e) SPHO_ERR(ctx, e)
|
|
#define MSPH_TOKS_ERR(toks, e) MSPH_ERR((toks)->ctx, e)
|
|
|
|
#define MSPH_ERR_INFO(ctx, e, info) SPHO_ERR_INFO(ctx, e, info)
|
|
|
|
|
|
#define MSPH_ERR_RESET(ctx) \
|
|
do { \
|
|
ctx->err = 0; \
|
|
ctx->err_info = 0; \
|
|
} while (0)
|
|
|
|
|
|
#endif
|