-
Notifications
You must be signed in to change notification settings - Fork 0
/
GLOBALS.H
executable file
·61 lines (46 loc) · 1.53 KB
/
GLOBALS.H
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
#ifndef __GLOBALS__
#define __GLOBALS__
#include <stdio.h>
// The module state returned from register_module, stored in usrptr->state
extern int moduleState;
// Pointer to our MCV file
extern FILE *mcv;
extern BTVFILE *bdb;
#define ACCOUNT_LOG "MBBSEmu"
#define LOG(s) shocst(ACCOUNT_LOG, s)
#define LOG1(s, a) do { char buf[128]; sprintf(buf, s, a); LOG(buf); } while (0)
#define LOG2(s, a, b) do { char buf[128]; sprintf(buf, s, a, b); LOG(buf); } while (0)
#define USR_LOG(s) do { prf(s); outprf(usrnum); } while (0)
#define USR_LOG1(fmt, a) do { prf(fmt, a); outprf(usrnum); } while (0)
#define USR_LOG2(fmt, a, b) do { prf(fmt, a, b); outprf(usrnum); } while (0)
#define FSED_TOPIC_LENGTH 51
#define FSED_TEXT_LENGTH (24 * 80 + 1)
typedef struct _FullScreenEditorData {
char topic[FSED_TOPIC_LENGTH];
char text[FSED_TEXT_LENGTH];
} FullScreenEditorData;
typedef struct _StateData {
int numItems;
int stack[8];
} StateData;
typedef int (*QueryFunc)(char *,char*, int);
typedef void (*AcquireFunc)(char *, int);
typedef int (*NextFunc)(char *);
typedef struct _BtrieveData
{
int keyNumber;
char keyData[32];
int verifyData;
int verifyKey;
QueryFunc queryFunc;
AcquireFunc acquireFunc;
NextFunc nextFunc;
} BtrieveData;
// This data is stored inside vda memory on a per-user basis
typedef struct _UserData {
StateData stateData;
FullScreenEditorData fullScreenEditorData;
BtrieveData btrieveData;
} UserData;
#define getUserData() ((UserData*) vdaptr)
#endif