summaryrefslogtreecommitdiff
path: root/CError.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-08 15:47:26 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-08 15:47:26 +0100
commitaf15bf78ad6b0663db22c507d4abcdd7b83dfb8a (patch)
treeac133f5e22f35488211a5277e26afcb1a0eb384f /CError.h
parent97f6a2438df1eaeb4128ce36f29346ea38a3db4a (diff)
downloadMWCC-af15bf78ad6b0663db22c507d4abcdd7b83dfb8a.tar.gz
MWCC-af15bf78ad6b0663db22c507d4abcdd7b83dfb8a.zip
add missing CError.h, finish more of Option.c, update variable names to match official names from asserts in the Windows build
Diffstat (limited to '')
-rw-r--r--CError.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/CError.h b/CError.h
new file mode 100644
index 0000000..6137d23
--- /dev/null
+++ b/CError.h
@@ -0,0 +1,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);