Update UNRAR.H
[xy_vsfilter.git] / include / virtualdub / ScriptError.h
blobaf378e3b33250be61a8230f9397d19d1640fb788
1 #ifndef f_SYLIA_SCRIPTERROR_H
2 #define f_SYLIA_SCRIPTERROR_H
4 class CScriptError {
5 public:
6 int err;
8 enum {
9 PARSE_ERROR=1,
10 SEMICOLON_EXPECTED,
11 IDENTIFIER_EXPECTED,
13 TYPE_INT_REQUIRED,
14 TYPE_ARRAY_REQUIRED,
15 TYPE_FUNCTION_REQUIRED,
16 TYPE_OBJECT_REQUIRED,
18 OBJECT_MEMBER_NAME_REQUIRED,
19 FUNCCALLEND_EXPECTED,
20 TOO_MANY_PARAMS,
21 DIVIDE_BY_ZERO,
22 VAR_NOT_FOUND,
23 MEMBER_NOT_FOUND,
24 OVERLOADED_FUNCTION_NOT_FOUND,
25 IDENT_TOO_LONG,
26 OPERATOR_EXPECTED,
27 CLOSEPARENS_EXPECTED,
28 CLOSEBRACKET_EXPECTED,
30 VAR_UNDEFINED,
32 OUT_OF_STRING_SPACE,
33 OUT_OF_MEMORY,
34 INTERNAL_ERROR,
35 EXTERNAL_ERROR,
37 FCALL_OUT_OF_RANGE,
38 FCALL_INVALID_PTYPE,
39 FCALL_UNKNOWN_STR,
42 CScriptError(int err_num) : err(err_num) { }
44 int getErr() { return err; }
47 #define SCRIPT_ERROR(x) throw CScriptError(CScriptError::##x)
49 extern "C" __declspec(dllexport) char * __stdcall TranslateScriptError(int);
51 char inline *TranslateScriptError(CScriptError cse) {
52 return TranslateScriptError(cse.getErr());
55 #endif