-
Notifications
You must be signed in to change notification settings - Fork 3
/
menu.h
executable file
·146 lines (120 loc) · 3.17 KB
/
menu.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include <termio.h>
#include <skynet/exitcodes.h>
#include <skynet/alias.h>
/*
* Skynet menu system header file
*
* You must #define noextern before you #include this header file
* if you are using this in your main()
*
* under system V there are 2 copies of this program:
* skynet/src/menu/menu.h
* /usr/include/skynet/menu.h
*
*/
/*******************************************************************/
/*
* A user record
*/
struct urec {
char uname[L_cuserid], alias[L_alias], device[15],
doing[65], prompt[80];
int fpid, bpid, level, maxtime, days, uload, who;
long starttime, from, flags, privs, status, credits;
};
/*
* The control struct that sits above the hotel-log in shared
* memory.
*/
struct ctlstr {
long sysflags;
short paymax, nopaymax, numslots, eatrate, alarmclock, grace,
almostfull;
char skynetpath[80], credits[11], credits2[11], hotkeys[11];
};
struct menopt {
long privreq;
int levelreq;
char option[5], descrip[65], title[65], progopt[9], doing[65],
**field;
struct menopt *next;
};
#define icmNIL (struct menopt *) 0
/*
* This is a msgqueue type that the background process receives when
* something "happens" to the user
*/
struct mymsgbuf {
long mtype;
struct actionstr {
int type;
char msg[256];
} act;
} mymsgp;
#ifndef noextern
/*
* The following takes care of global variable problems.
*
*/
extern struct urec *hotlog;
extern struct ctlstr *ctl;
extern struct termio oldterm;
extern key_t m_qid, m_mid;
extern int childpid, goodchild, slotnum, ppid;
extern char **recp, **sloginp;
extern long key;
#else
struct urec *hotlog;
struct ctlstr *ctl;
struct termio oldterm;
key_t m_qid, m_mid;
int childpid, goodchild, slotnum, ppid;
char **recp, **sloginp;
long key;
#endif
#define MYREC hotlog[slotnum]
/*
* Message types to the background process
*/
#define T_TIMEWARN 1
#define T_TIMEXP 2
#define T_SHUTDOWN 3
#define T_KICKED 4
#define T_NEWPHONEMSG 5
#define T_NEWMAIL 6
#define T_PAGE 7
#define T_XFERFUNDS 8
#define T_RDQMSGS 9
#define T_SYSMSG 10
#define T_QUIT 11
/*
* Skynet user status flags
*/
#include <skynet/mstf.h>
/*
* User configurable flags
*/
#include <skynet/mflags.h>
/*
* Skynet system status flags
*/
#define S_SYSLOCKED 00000001 /* allow no logins at all */
#define S_PAIDONLY 00000002 /* allow only paid users */
#define S_GROUPONLY 00000004 /* allow only certain groups */
#define S_VALONLY 00000010 /* allow only validated users */
#define S_SYSOPONLY 00000020 /* allow only sysops */
#define S_COSYSOPONLY 00000040 /* allow only co-sysops */
#define S_TICKCREDITS 00000100 /* charge credits */
#define S_CKTIME 00000200 /* enforce time limits */
#define S_PDGOVERRIDE 00000400 /* paid override on grouponly */
#define S_TEMP4 00001000 /* so no recompile necessary */
/*
* Note: all "privs" are runtime configurable
*/
#define LPCHAR 15
#define SKYUSER "skynet"