Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[50c14b]: Script.h Maximize Restore History

Download this file

Script.h    83 lines (76 with data), 2.6 kB

 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
// script.h: interface for the script class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SCRIPT_H__53B2709A_F74F_43C4_9A0B_F9932963C9F9__INCLUDED_)
#define AFX_SCRIPT_H__53B2709A_F74F_43C4_9A0B_F9932963C9F9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class Cscript
{
public:
Cscript();
virtual ~Cscript();
int BuildScriptTree();
void NukeBlocks();
int get_next_scriptitem(CString &item, int function);
int find_itemtype(search_data &searchdata, search_data &finddata, int itemtype);
int ReadScriptFile(int fhandle, int maxlen);
int CloseScriptFile();
int WriteScriptToFile(FILE *fpoi);
CString GetErrLine();
inline int ErrLine()
{
return lineno;
}
inline void RollBack()
{
lineno=1;
cnt=0;
bcnt=tcnt=rcnt=acnt=0;
}
bool m_changed;
//parsed script data (blocks[triggers[], responses[actions[]]])
int bcnt, tcnt, rcnt, acnt;
int blockcount;
block *blocks;
private:
int SkipChar(char chr);
int ReadToken(char *token, bool crlf);
int ReadString(int store, char *where);
int ReadNumber(int store, int &where);
int ReadObjectToB(int store, object &object);
int ReadArea(int store, int *area); //only for IWD/IWD2
int ReadObjectPST(int store, object &object);
int ReadObjectIWD(int store, object &object);
int ReadObjectIWD2(int store, object &object);
int ReadObject(int store, object &object);
int ReadPSTPoint(int store, int *where4); //only for PST
int ReadTrigger(int store, trigger &trigger);
int ReadAction(int store, action &action);
int ReadResponse(int store, response &response);
int ReadBlock(int store, block &block);
int WriteString(FILE *fpoi, char *str);
int WriteNumber(FILE *fpoi, int number);
int WriteObjectToB(FILE *fpoi, object &object);
int WriteArea(FILE *fpoi, int *area); //only for IWD2
int WriteObjectPST(FILE *fpoi, object &object);
int WriteObjectIWD(FILE *fpoi, object &object);
int WriteObjectIWD2(FILE *fpoi, object &object);
int WriteObject(FILE *fpoi, object &object);
int WriteTrigger(FILE *fpoi, trigger &trigger);
int WriteAction(FILE *fpoi, action &action);
int WriteResponse(FILE *fpoi, response &response);
int WriteBlock(FILE *fpoi, block &block);
int cgets(char *buf, int max);
int lineno, lastln;
int cnt, maxlen;
char *scrdata;
};
#define StorePosition() \
cnt_bak=cnt; \
lineno_bak=lineno
#define RestorePosition() \
cnt=cnt_bak; \
lineno=lineno_bak
#endif // !defined(AFX_SCRIPT_H__53B2709A_F74F_43C4_9A0B_F9932963C9F9__INCLUDED_)