blob: 2825d6d2f1ad832fc2ffa16787368e755ee0ddaf (
plain) (
blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
#ifndef TIBIA_SCRIPT_HH_
#define TIBIA_SCRIPT_HH_ 1
#include "main.hh"
#include "enums.hh"
struct TReadScriptFile {
// REGULAR FUNCTIONS
// =========================================================================
TReadScriptFile(void);
~TReadScriptFile(void);
void open(const char *FileName);
void close(void);
void error(const char *Text);
void nextToken(void);
char *getIdentifier(void);
int getNumber(void);
char *getString(void);
uint8 *getBytesequence(void);
void getCoordinate(int *x, int *y, int *z);
char getSpecial(void);
char *readIdentifier(void){
this->nextToken();
return this->getIdentifier();
}
int readNumber(void){
this->nextToken();
int Sign = 1;
if(this->Token == SPECIAL && this->Special == '-'){
Sign = -1;
this->nextToken();
}
return Sign * this->getNumber();
}
char *readString(void){
this->nextToken();
return this->getString();
}
uint8 *readBytesequence(void){
this->nextToken();
return this->getBytesequence();
}
void readCoordinate(int *x, int *y, int *z){
this->nextToken();
this->getCoordinate(x, y, z);
}
char readSpecial(void){
this->nextToken();
return this->getSpecial();
}
void TReadScriptFile::readSymbol(char Symbol){
if(this->readSpecial() != Symbol){
this->error("symbol mismatch");
}
}
// DATA
// =========================================================================
TOKEN Token;
FILE *File[3];
char Filename[3][4096];
int Line[3];
char String[4000];
int RecursionDepth;
uint8 *Bytes;
int Number;
int CoordX;
int CoordY;
int CoordZ;
char Special;
};
struct TWriteScriptFile {
// REGULAR FUNCTIONS
// =========================================================================
//TWriteScriptFile(void);
// DATA
// =========================================================================
FILE *File;
char Filename[4096];
int Line;
};
#endif //TIBIA_SCRIPT_HH_
|