summaryrefslogtreecommitdiff
path: root/CError.h
blob: 6137d239aa7a1888274438338f5fb82dc9961443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "CompilerTools.h"
#pragma once

#define CError_ASSERT(cond) if (!(cond)) { CError_Internal(__FILE__, __LINE__); }
#define CError_FAIL(cond) if (cond) { CError_Internal(__FILE__, __LINE__); }

typedef struct _CErrorBuffer {
    char *start;
    char *end;
    unsigned long size;
    unsigned long remaining;
} CErrorBuffer;

extern void CError_Init();
extern void CError_SetErrorToken(Token *token);
extern void CError_SetNullErrorToken();
extern void CError_LockErrorPos(Token *token, Token **saved);
extern void CError_UnlockErrorPos(Token **saved);
extern void CError_ResetErrorSkip();
extern void CError_GetErrorString(char *buf, short code);
extern void CError_BufferInit(CErrorBuffer *eb, char *buf, long bufSize);
extern void CError_BufferGrow(CErrorBuffer *eb, long amount);
extern void CError_BufferAppendChar(CErrorBuffer *eb, char ch);
extern void CError_BufferAppendString(CErrorBuffer *eb, const char *str);
extern void CError_BufferTerminate(CErrorBuffer *eb);
// FIX LOTS OF THESE
extern void CError_BufferAppendQualifier(CErrorBuffer *eb, int quals);
extern void CError_BufferAppendTemplArgExpr(CErrorBuffer *eb, void *targExpr);
extern void CError_BufferAppendTemplArg(CErrorBuffer *eb, void *targ);
extern void CError_BufferAppendTemplArgs(CErrorBuffer *eb, void *targs);
extern void CError_BufferAppendNameSpace(CErrorBuffer *eb, void *ns);
extern void CError_BufferAppendPType(CErrorBuffer *eb, void *ty);
extern void CError_BufferAppendTemplDepType(CErrorBuffer *eb, void *ty);
extern void CError_BufferAppendFuncArgs(CErrorBuffer *eb, void *args, unsigned char flag);
extern void CError_BufferAppendType(CErrorBuffer *eb, void *ty, int quals);
extern char *CError_GetTypeName(void *ty, int quals, unsigned char useGlobalHeap);
extern void CError_AppendUnqualFunctionName(CErrorBuffer *eb, void *unk1, void *unk2, void *unk3);
extern void CError_AppendFunctionName(CErrorBuffer *eb, void *unk1, void *unk2, void *unk3, void *unk4);
extern void CError_AppendObjectName(CErrorBuffer *eb, void *obj);
extern void CError_AppendMethodName(CErrorBuffer *eb, void *obj);
extern char *CError_GetQualifiedName(void *ns, StringNode *name);
extern char *CError_GetFunctionName(void *a, void *b, void *c);
extern char *CError_GetObjectName(void *obj);
extern char *CError_GetNameString(void *obj, StringNode *operatorName);
extern void CError_ErrorMessage(int errTable, char *buf, unsigned char flag1, unsigned char flag2);
extern void CError_BufferAppendTemplateStack(CErrorBuffer *eb);
extern void CError_ErrorMessageVA(short code, char *buf, va_list list, unsigned char flag1, unsigned char flag2);
extern void CError_VAErrorMessage(short code, va_list list, unsigned char flag1, unsigned char flag2);
extern void CError_Error(short code, ...);
extern void CError_ErrorTerm(short code);
extern void CError_ErrorSkip(short code, ...);
extern void CError_ErrorFuncCall(short code, void *aa, void *bb);
extern void CError_OverloadedFunctionError2(void *aa, void *bb, void *cc);
extern void CError_OverloadedFunctionError(void *aa, void *bb);
extern void CError_AbstractClassError();
extern void CError_Warning(short code, ...);
extern void CError_BreakPoint(const char *a, const char *b);
extern void CError_Internal();
extern void CError_ExpressionTooComplex();
extern void CError_NoMem();
extern void CError_UserBreak();
extern void CError_CannotOpen();
extern void CError_QualifierCheck(int quals);