📄 mal_client.h
字号:
#ifndef _MAL_CLIENT_H_#define _MAL_CLIENT_H_#define bitset int/* #define MAL_CLIENT_DEBUG */#include "mal_resolve.h"#include "mal_profiler.h"#include "mal.h"#define MAL_MAXCLIENTS 64#define CONSOLE 0#define isAdministrator(X) (X==mal_clients)#define FREECLIENT 0#define FINISHING 1 #define CLAIMED 2#define AWAITING 4#define TIMEOUT (5*60) /* seconds */#define PROCESSTIMEOUT 2 /* seconds */#ifdef HAVE_SYS_RESOURCE_H# include <sys/resource.h>#endiftypedef struct CLIENT_INPUT { bstream *fdin; int yycur; int listing; char *prompt; struct CLIENT_INPUT *next; } ClientInput;typedef struct CLIENT { int idx; /* entry in mal_clients */ oid user; /* user id in the auth administration */ int sessionkey; /* NOTUSED ANYMORE */ int permission; /* access mode */ str scenario; /* scenario management references */ str oldscenario; str srcFile; /* NULL for stdin, or file name */ void *state[7], *oldstate[7]; MALfcn phase[7], oldphase[7]; char itrace; /* trace execution using interactive mdb */ short debugOptimizer,debugScheduler; sht flags; /* resource tracing flags */ lng timer; /* trace time in usec */#define timerFlag 1#define memoryFlag 2#define ioFlag 4#define flowFlag 8 time_t login; time_t logout; time_t delay; bstream *fdin; bstream *console; /* always available for reading */ int yycur; /* the scanners current position */ ClientInput *bak; /* used for recursive script and string execution */ stream *fdout; /* streams from and to user. */ str output; /* output buffer */ str prompt; /* acknowledge prompt */ int promptlength; int blkmode; /* control block parsing */ bitset listing; bitset debug; stream *sysmon; /* trace interaction */ stream *journal; str history; /* where to keep console history */ short mode; /* FREECLIENT..BLOCKED */ str cwd; /* working directory of client */ Thread mythread; size_t mypid; str errbuf; /* location of GDK exceptions */ struct CLIENT *father; Module nspace; /* private scope resolution list */ Symbol curprg; /* focus of parser */ Symbol backup; /* save parsing context */ MalStkPtr glb; /* global variable stack */} *Client, ClientRec;mal_export ClientRec mal_clients[MAL_MAXCLIENTS+1];mal_export Client MCgetClient (void);mal_export Client MCinitClient(oid user, bstream *fin, stream *fout);mal_export void MCinitClientThread(Client c);mal_export void MCcloseClient (Client c);mal_export Client MCforkClient (Client c);mal_export void MCkillClient (Client c, int timeout);mal_export int MCcountClients(void);mal_export int MCreadClient (Client c);mal_export str MCstopClient(Client c, oid which);mal_export str MCstopClientIndex(Client c, int id);mal_export void MCshutdown(Client c, int timeout);mal_export void MCcleanupClients(void);mal_export void MCtraceAllClients(int flag);mal_export void MCtraceClient(oid which, int flag);mal_export bstream *MCgetConsole(Client c);mal_export void MCpushClientInput(Client c, bstream *new_input, int listing, char *prompt);mal_export void MCpopClientInput(Client c);#endif /* _MAL_CLIENT_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -