various changes, getting ready for merge
This commit is contained in:
parent
8f637feac8
commit
44db7d5460
11
src/lt.c
11
src/lt.c
|
@ -53,6 +53,11 @@ char *LT_TkNames[] = {
|
|||
"TOK_Identi", "TOK_EOF", "TOK_ChrSeq"
|
||||
};
|
||||
|
||||
static const char *errors[] = {
|
||||
"LT_Error: Syntax error",
|
||||
"LT_Error: Unknown operation"
|
||||
};
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
@ -135,6 +140,12 @@ bool LT_Assert(bool assertion, const char *str)
|
|||
return assertion;
|
||||
}
|
||||
|
||||
void LT_Error(int type)
|
||||
{
|
||||
fprintf(stderr, "%s", errors[type]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
LT_AssertInfo LT_CheckAssert()
|
||||
{
|
||||
LT_AssertInfo ltAssertion;
|
||||
|
|
9
src/lt.h
9
src/lt.h
|
@ -31,8 +31,6 @@ THE SOFTWARE.
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <iconv.h>
|
||||
|
||||
/*
|
||||
* Definitions
|
||||
*/
|
||||
|
@ -57,6 +55,12 @@ enum
|
|||
TOK_Number, TOK_Identi, TOK_EOF, TOK_ChrSeq
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
LTERR_SYNTAX,
|
||||
LTERR_UNKNOWN_OPERATION
|
||||
};
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
@ -97,6 +101,7 @@ void LT_EXPORT LT_Init(LT_InitInfo initInfo);
|
|||
void LT_EXPORT LT_Quit();
|
||||
bool LT_EXPORT LT_Assert(bool assertion, const char *str);
|
||||
LT_AssertInfo LT_EXPORT LT_CheckAssert();
|
||||
void LT_EXPORT LT_Error(int type); // [marrub] C use ONLY
|
||||
|
||||
bool LT_EXPORT LT_OpenFile(const char *filePath);
|
||||
void LT_EXPORT LT_CloseFile();
|
||||
|
|
Reference in New Issue
Block a user