Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 3289d561 authored by rswindell's avatar rswindell

Replaced the set of (ancient) arrays used for saving/restoring lines of

terminal text and attributes with a linked-list. In doing so:
- the save depth is no longer fixed (at 4), but dynamic and unbounded
- the current column position is also saved/restored (bug fix)
- no more copy/pasta from sbbsdefs.h into js_console.cpp
- the JS console.saveline() and restore() methods now return Bool to indicate
  success/failure

Also, some trailing white-space was auto-removed due to local editor settings.
parent d23e9244
......@@ -59,7 +59,7 @@ int sbbs_t::bputs(const char *str)
if(toupper(str[l])=='Z') /* EOF */
break;
ctrl_a(str[l++]);
continue;
continue;
}
if(str[l]=='@') { /* '@' */
if(str==mnestr /* Mnemonic string or */
......@@ -68,7 +68,7 @@ int sbbs_t::bputs(const char *str)
i=show_atcode(str+l); /* return 0 if not valid @ code */
l+=i; /* i is length of code string */
if(i) /* if valid string, go to top */
continue;
continue;
}
for(i=0;i<TOTAL_TEXT;i++)
if(str==text[i])
......@@ -77,10 +77,10 @@ int sbbs_t::bputs(const char *str)
i=show_atcode(str+l);
l+=i;
if(i)
continue;
}
continue;
}
}
outchar(str[l++]);
outchar(str[l++]);
}
return(l);
}
......@@ -105,7 +105,7 @@ int sbbs_t::rputs(const char *str, size_t len)
if(outcom(str[l])!=0)
break;
if(lbuflen<LINE_BUFSIZE)
lbuf[lbuflen++]=str[l];
lbuf[lbuflen++]=str[l];
}
return(l);
}
......@@ -236,7 +236,7 @@ void sbbs_t::outchar(char ch)
if(!(sys_status&SS_PAUSEOFF)) {
pause();
while(lncntr && online && !(sys_status&SS_ABORT))
pause();
pause();
}
}
......@@ -252,7 +252,7 @@ void sbbs_t::outchar(char ch)
if(ch==(char)TELNET_IAC && !(telnet_mode&TELNET_MODE_OFF))
outcom(TELNET_IAC); /* Must escape Telnet IAC char (255) */
outcom(ch);
}
}
}
if(!outchar_esc) {
if((uchar)ch>=' ') {
......@@ -294,15 +294,15 @@ void sbbs_t::outchar(char ch)
if(!lbuflen)
latr=curatr;
if(lbuflen<LINE_BUFSIZE)
lbuf[lbuflen++]=ch;
lbuf[lbuflen++]=ch;
}
if(outchar_esc==3)
outchar_esc=0;
if(lncntr==rows-1 && ((useron.misc&UPAUSE) || sys_status&SS_PAUSEON)
if(lncntr==rows-1 && ((useron.misc&UPAUSE) || sys_status&SS_PAUSEON)
&& !(sys_status&(SS_PAUSEOFF|SS_ABORT))) {
lncntr=0;
pause();
pause();
}
}
......@@ -407,7 +407,7 @@ void sbbs_t::cleartoeol(void)
while(++i<cols)
outcom(' ');
while(++j<cols)
outcom(BS);
outcom(BS);
}
}
......@@ -428,11 +428,11 @@ void sbbs_t::ctrl_a(char x)
if(x && (uchar)x<=CTRL_Z) { /* Ctrl-A through Ctrl-Z for users with MF only */
if(!(useron.flags1&FLAG(x+64)))
console^=(CON_ECHO_OFF);
return;
return;
}
if((uchar)x>0x7f) {
cursor_right((uchar)x-0x7f);
return;
return;
}
switch(toupper(x)) {
case '!': /* level 10 or higher */
......@@ -637,7 +637,7 @@ void sbbs_t::ctrl_a(char x)
case '7': /* White Background */
atr=(atr&0x8f)|(uchar)BG_LIGHTGRAY;
attr(atr);
break;
break;
}
}
......@@ -670,7 +670,7 @@ bool sbbs_t::msgabort()
{
static ulong counter;
if(sys_status&SS_SYSPAGE && !(++counter%100))
if(sys_status&SS_SYSPAGE && !(++counter%100))
sbbs_beep(sbbs_random(800),1);
checkline();
......@@ -719,3 +719,36 @@ void sbbs_t::progress(const char* text, int count, int total, int interval)
SAFEPRINTF2(str, "[ %-8s %4.1f%% ]", text, pct);
cursor_left(backfill(str, pct, cfg.color[clr_progress_full], cfg.color[clr_progress_empty]));
}
struct savedline {
char buf[LINE_BUFSIZE+1]; /* Line buffer (i.e. ANSI-encoded) */
char beg_attr; /* Starting attribute of each line */
char end_attr; /* Ending attribute of each line */
long column; /* Current column number */
};
bool sbbs_t::saveline(void)
{
struct savedline line;
line.beg_attr = latr;
line.end_attr = curatr;
line.column = column;
snprintf(line.buf, sizeof(line.buf), "%.*s", lbuflen, lbuf);
TERMINATE(line.buf);
lbuflen=0;
return listPushNodeData(&savedlines, &line, sizeof(line)) != NULL;
}
bool sbbs_t::restoreline(void)
{
struct savedline* line = (struct savedline*)listPopNode(&savedlines);
if(line == NULL)
return false;
lbuflen=0;
attr(line->beg_attr);
rputs(line->buf);
curatr = line->end_attr;
column = line->column;
free(line);
return true;
}
......@@ -45,7 +45,7 @@
/*****************************/
enum {
CON_PROP_STATUS
,CON_PROP_LNCNTR
,CON_PROP_LNCNTR
,CON_PROP_COLUMN
,CON_PROP_LASTLINELEN
,CON_PROP_ATTR
......@@ -270,7 +270,7 @@ static JSBool js_console_set(JSContext *cx, JSObject *obj, jsid id, JSBool stric
sbbs->sys_status&=~SS_ABORT;
break;
case CON_PROP_ABORTABLE:
sbbs->rio_abortable=val
sbbs->rio_abortable=val
? true:false; // This is a dumb bool conversion to make BC++ happy
break;
case CON_PROP_TELNET_MODE:
......@@ -728,7 +728,7 @@ js_ungetstr(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
if((js_str=JS_ValueToString(cx, argv[0]))==NULL)
return(JS_FALSE);
......@@ -758,7 +758,7 @@ js_yesno(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
if((js_str=JS_ValueToString(cx, argv[0]))==NULL)
return(JS_FALSE);
......@@ -785,7 +785,7 @@ js_noyes(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
if((js_str=JS_ValueToString(cx, argv[0]))==NULL)
return(JS_FALSE);
......@@ -815,7 +815,7 @@ js_mnemonics(JSContext *cx, uintN argc, jsval *arglist)
if((js_str=JS_ValueToString(cx, argv[0]))==NULL)
return(JS_FALSE);
JSSTRING_TO_MSTRING(cx, js_str, cstr, NULL);
if(cstr==NULL)
return JS_FALSE;
......@@ -987,7 +987,7 @@ js_beep(JSContext *cx, uintN argc, jsval *arglist)
for(i=0;i<count;i++)
sbbs->outchar('\a');
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -1192,7 +1192,7 @@ js_printtail(JSContext *cx, uintN argc, jsval *arglist)
if(js_str==NULL)
return(JS_FALSE);
if(!lines)
if(!lines)
lines=5;
JSSTRING_TO_MSTRING(cx, js_str, cstr, NULL);
......@@ -1251,12 +1251,12 @@ js_uselect(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
if(!argc) {
JS_SET_RVAL(cx, arglist, INT_TO_JSVAL(sbbs->uselect(0,0,NULL,NULL,NULL)));
return(JS_TRUE);
}
for(i=0;i<argc;i++) {
if(JSVAL_IS_NUMBER(argv[i])) {
if(!JS_ValueToInt32(cx,argv[i],&num)) {
......@@ -1340,18 +1340,10 @@ js_saveline(JSContext *cx, uintN argc, jsval *arglist)
{
sbbs_t* sbbs;
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
if(sbbs->slcnt<SAVE_LINES) {
sbbs->slatr[sbbs->slcnt]=sbbs->latr;
sbbs->slcuratr[sbbs->slcnt]=sbbs->curatr;
sprintf(sbbs->slbuf[sbbs->slcnt],"%.*s",sbbs->lbuflen,sbbs->lbuf);
sbbs->slcnt++;
sbbs->lbuflen=0;
}
JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(sbbs->saveline()));
return(JS_TRUE);
}
......@@ -1361,18 +1353,11 @@ js_restoreline(JSContext *cx, uintN argc, jsval *arglist)
sbbs_t* sbbs;
jsrefcount rc;
JS_SET_RVAL(cx, arglist, JSVAL_VOID);
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, JS_THIS_OBJECT(cx, arglist)))==NULL)
return(JS_FALSE);
rc=JS_SUSPENDREQUEST(cx);
sbbs->lbuflen=0;
if(sbbs->slcnt)
sbbs->slcnt--;
sbbs->attr(sbbs->slatr[sbbs->slcnt]);
sbbs->rputs(sbbs->slbuf[sbbs->slcnt]);
sbbs->curatr=sbbs->slcuratr[sbbs->slcnt];
JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(sbbs->restoreline()));
JS_RESUMEREQUEST(cx, rc);
return(JS_TRUE);
}
......@@ -1492,7 +1477,7 @@ js_getxy(JSContext *cx, uintN argc, jsval *arglist)
if((sbbs=(sbbs_t*)JS_GetPrivate(cx, obj))==NULL)
return(JS_FALSE);
rc=JS_SUSPENDREQUEST(cx);
sbbs->ansi_getxy(&x,&y);
JS_RESUMEREQUEST(cx, rc);
......@@ -1769,48 +1754,48 @@ static jsSyncMethodSpec js_console_functions[] = {
,JSDOCSTR("get a single key with optional <i>timeout</i> in milliseconds (defaults to 0, for no wait), "
"see <tt>K_*</tt> in <tt>sbbsdefs.js</tt> for <i>mode</i> bits")
,311
},
},
{"getkey", js_getkey, 0, JSTYPE_STRING, JSDOCSTR("[mode=<tt>K_NONE</tt>]")
,JSDOCSTR("get a single key, with wait, "
"see <tt>K_*</tt> in <tt>sbbsdefs.js</tt> for <i>mode</i> bits")
,310
},
},
{"getstr", js_getstr, 0, JSTYPE_STRING, JSDOCSTR("[string] [,maxlen=<tt>128</tt>] [,mode=<tt>K_NONE</tt>] [,history[]]")
,JSDOCSTR("get a text string from the user, "
"see <tt>K_*</tt> in <tt>sbbsdefs.js</tt> for <i>mode</i> bits.<br>"
"<i>history[]</i>, added in v3.17, allows a command history (string array) to be recalled using the up/down arrow keys."
)
,310
},
},
{"getnum", js_getnum, 0, JSTYPE_NUMBER, JSDOCSTR("[maxnum[, default]]")
,JSDOCSTR("get a number between 1 and <i>maxnum</i> from the user with a default value of <i>default</i>")
,310
},
},
{"getkeys", js_getkeys, 1, JSTYPE_NUMBER, JSDOCSTR("string keys [,maxnum]")
,JSDOCSTR("get one key from of a list of valid command <i>keys</i>, "
"or a number between 1 and <i>maxnum</i>")
,310
},
},
{"gettemplate", js_gettemplate, 1, JSTYPE_STRING, JSDOCSTR("format [,string] [,mode=<tt>0</tt>]")
,JSDOCSTR("get a string based on template")
,310
},
},
{"ungetstr", js_ungetstr, 1, JSTYPE_VOID, JSDOCSTR("keys")
,JSDOCSTR("put a data (e.g. a string of characters) in the keyboard input buffer")
,310
},
},
{"yesno", js_yesno, 1, JSTYPE_BOOLEAN, JSDOCSTR("question")
,JSDOCSTR("YES/no question - returns <i>true</i> if yes is selected")
,310
},
},
{"noyes", js_noyes, 1, JSTYPE_BOOLEAN, JSDOCSTR("question")
,JSDOCSTR("NO/yes question - returns <i>true</i> if no is selected")
,310
},
},
{"mnemonics", js_mnemonics, 1, JSTYPE_VOID, JSDOCSTR("text")
,JSDOCSTR("print a mnemonics string, command keys highlighted with tilde (~) characters")
,310
},
},
{"clear", js_clear, 0, JSTYPE_VOID, JSDOCSTR("[attribute]")
,JSDOCSTR("clear screen and home cursor, "
"optionally (in v3.13b+) setting current attribute first")
......@@ -1824,16 +1809,16 @@ static jsSyncMethodSpec js_console_functions[] = {
,JSDOCSTR("clear current line, "
"optionally (in v3.13b+) setting current attribute first")
,310
},
},
{"cleartoeol", js_cleartoeol, 0, JSTYPE_VOID, JSDOCSTR("[attribute]")
,JSDOCSTR("clear to end-of-line (ANSI), "
"optionally (in v3.13b+) setting current attribute first")
,311
},
},
{"crlf", js_crlf, 0, JSTYPE_VOID, JSDOCSTR("[count=<tt>1</tt>]")
,JSDOCSTR("output <i>count</i> number of carriage-return/line-feed pairs (new-lines)")
,310
},
},
{"pause", js_pause, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("display pause prompt and wait for key hit")
,310
......@@ -1845,20 +1830,20 @@ static jsSyncMethodSpec js_console_functions[] = {
{"print", js_print, 1, JSTYPE_VOID, JSDOCSTR("value [,value]")
,JSDOCSTR("display one or more values as strings (supports Ctrl-A codes, Telnet-escaping, auto-screen pausing, etc.)")
,310
},
},
{"write", js_write, 1, JSTYPE_VOID, JSDOCSTR("value [,value]")
,JSDOCSTR("display one or more values as raw strings (may include NULs)")
,310
},
},
{"writeln", js_writeln, 1, JSTYPE_VOID, JSDOCSTR("value [,value]")
,JSDOCSTR("display one or more values as raw strings followed by a single carriage-return/line-feed pair (new-line)")
,315
},
},
{"putmsg", js_putmsg, 1, JSTYPE_VOID, JSDOCSTR("text [,mode=<tt>P_NONE</tt>]")
,JSDOCSTR("display message text (Ctrl-A codes, @-codes, pipe codes, etc), "
"see <tt>P_*</tt> in <tt>sbbsdefs.js</tt> for <i>mode</i> bits")
,310
},
},
{"center", js_center, 1, JSTYPE_VOID, JSDOCSTR("text")
,JSDOCSTR("display a string centered on the screen")
,310
......@@ -1870,43 +1855,43 @@ static jsSyncMethodSpec js_console_functions[] = {
{"printfile", js_printfile, 1, JSTYPE_VOID, JSDOCSTR("filename [,mode=<tt>P_NONE</tt>]")
,JSDOCSTR("print a message text file with optional mode")
,310
},
},
{"printtail", js_printtail, 2, JSTYPE_VOID, JSDOCSTR("filename, lines [,mode=<tt>P_NONE</tt>]")
,JSDOCSTR("print last x lines of file with optional mode")
,310
},
},
{"editfile", js_editfile, 1, JSTYPE_BOOLEAN, JSDOCSTR("filename")
,JSDOCSTR("edit/create a text file using the user's preferred message editor")
,310
},
},
{"uselect", js_uselect, 0, JSTYPE_NUMBER, JSDOCSTR("[number, title, item] [,ars]")
,JSDOCSTR("user selection menu, call for each item, then with no args to display select menu")
,312
},
{"saveline", js_saveline, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("save last output line")
},
{"saveline", js_saveline, 0, JSTYPE_BOOLEAN, JSDOCSTR("")
,JSDOCSTR("push the current console line of text and attributes to a (local) LIFO list of //saved lines//")
,310
},
{"restoreline", js_restoreline, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("restore last output line")
},
{"restoreline", js_restoreline, 0, JSTYPE_BOOLEAN, JSDOCSTR("")
,JSDOCSTR("pop the most recently //saved line// of text and attributes and display it on the remote console")
,310
},
},
{"ansi", js_ansi, 1, JSTYPE_STRING, JSDOCSTR("attribute [,current_attribute]")
,JSDOCSTR("returns ANSI sequence required to generate specified terminal <i>attribute</i> "
"(e.g. <tt>YELLOW|HIGH|BG_BLUE</tt>), "
"if <i>current_attribute</i> is specified, an optimized ANSI sequence may be returned")
,310
},
},
{"ansi_save", js_pushxy, 0, JSTYPE_ALIAS },
{"ansi_pushxy", js_pushxy, 0, JSTYPE_ALIAS },
{"pushxy", js_pushxy, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("save current cursor position (AKA ansi_save)")
,JSDOCSTR("save the current cursor position (x and y coordinates) in the remote terminal")
,311
},
{"ansi_restore", js_popxy, 0, JSTYPE_ALIAS },
{"ansi_popxy", js_popxy, 0, JSTYPE_ALIAS },
{"popxy", js_popxy, 0, JSTYPE_VOID, JSDOCSTR("")
,JSDOCSTR("restore saved cursor position (AKA ansi_restore)")
,JSDOCSTR("restore a saved cursor position to the remote terminal (requires terminal support, e.g. ANSI)")
,311
},
{"ansi_gotoxy", js_gotoxy, 1, JSTYPE_ALIAS },
......@@ -1987,7 +1972,7 @@ static JSBool js_console_resolve(JSContext *cx, JSObject *obj, jsid id)
if(id != JSID_VOID && id != JSID_EMPTY) {
jsval idval;
JS_IdToValue(cx, id, &idval);
if(JSVAL_IS_STRING(idval)) {
JSSTRING_TO_MSTRING(cx, JSVAL_TO_STRING(idval), name, NULL);
......
......@@ -3378,7 +3378,8 @@ sbbs_t::sbbs_t(ushort node_num, union xp_sockaddr *addr, size_t addr_len, const
telnet_last_rxch=0;
telnet_ack_event=CreateEvent(NULL, /* Manual Reset: */FALSE,/* InitialState */FALSE,NULL);
sys_status=lncntr=tos=criterrs=slcnt=0L;
listInit(&savedlines, /* flags: */0);
sys_status=lncntr=tos=criterrs=0L;
column=0;
lastlinelen=0;
curatr=LIGHTGRAY;
......@@ -3880,6 +3881,8 @@ sbbs_t::~sbbs_t()
FREE_AND_NULL(batdn_cdt);
FREE_AND_NULL(batdn_alt);
listFree(&savedlines);
#ifdef USE_CRYPTLIB
while(ssh_mutex_created && pthread_mutex_destroy(&ssh_mutex)==EBUSY)
mswait(1);
......@@ -4258,7 +4261,6 @@ void sbbs_t::reset_logon_vars(void)
autoterm=0;
cterm_version = 0;
lbuflen=0;
slcnt=0;
altul=0;
timeleft_warn=0;
keybufbot=keybuftop=0;
......@@ -4579,13 +4581,13 @@ void node_thread(void* arg)
/* crash here July-27-2018:
ntdll.dll!77282e19() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
[External Code]
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
[External Code]
sbbs.dll!pthread_mutex_lock(_RTL_CRITICAL_SECTION * mutex) Line 171 C
sbbs.dll!protected_uint32_adjust(protected_uint32_t * i, int adjustment) Line 244 C
sbbs.dll!update_clients() Line 185 C++
> sbbs.dll!node_thread(void * arg) Line 4568 C++
[External Code]
[External Code]
node_threads_running {value=0 mutex={DebugInfo=0x00000000 <NULL> LockCount=-6 RecursionCount=0 ...} } protected_uint32_t
*/
......
......@@ -463,10 +463,7 @@ public:
long lastlinelen; /* The previously displayed line length */
long autoterm; /* Auto-detected terminal type */
long cterm_version; /* (MajorVer*1000) + MinorVer */
char slbuf[SAVE_LINES][LINE_BUFSIZE+1]; /* Saved for redisplay */
char slatr[SAVE_LINES]; /* Starting attribute of each line */
char slcuratr[SAVE_LINES]; /* Ending attribute of each line */
int slcnt; /* Number of lines currently saved */
link_list_t savedlines;
char lbuf[LINE_BUFSIZE+1];/* Temp storage for each line output */
int lbuflen; /* Number of characters in line buffer */
char latr; /* Starting attribute of line buffer */
......@@ -531,7 +528,7 @@ public:
csi_t main_csi; /* Main Command Shell Image */
smbmsg_t* current_msg; /* For message header @-codes */
file_t* current_file;
file_t* current_file;
/* Global command shell variables */
uint global_str_vars;
......@@ -711,6 +708,8 @@ public:
long term_supports(long cmp_flags=0);
int backfill(const char* str, float pct, int full_attr, int empty_attr);
void progress(const char* str, int count, int total, int interval=1);
bool saveline(void);
bool restoreline(void);
/* getstr.cpp */
size_t getstr_offset;
......
......@@ -75,7 +75,7 @@
#define JAVASCRIPT_CONTEXT_STACK (16*1024)
#define JAVASCRIPT_TIME_LIMIT (24*60*600) /* in 100ms ticks */
#define JAVASCRIPT_YIELD_INTERVAL 10000
#define JAVASCRIPT_GC_INTERVAL 100
#define JAVASCRIPT_GC_INTERVAL 100
#define JAVASCRIPT_LOAD_PATH "load"
#define JAVASCRIPT_LOAD_PATH_LIST "load_path_list"
......@@ -125,7 +125,7 @@ typedef struct js_callback {
#define LEN_GLNAME 40 /* Group/Lib long name */
#define LEN_SSNAME 25 /* Sub/Dir short name */
#define LEN_SLNAME 40 /* Sub/Dir long name */
/* User Questions (e.g. for new users) */
#define UQ_ALIASES (1L<<0) /* Ask for alias */
#define UQ_LOCATION (1L<<1) /* Ask for location */
......@@ -148,8 +148,8 @@ typedef struct js_callback {
#define UQ_NONETMAIL (1L<<18) /* Don't ask for e-mail/netmail address */
#define UQ_NOUPRLWR (1L<<19) /* Don't force upper/lower case strings */
#define UQ_COLORTERM (1L<<20) /* Ask if new user has color terminal */
/* Different bits in sys_misc */
#define SM_CLOSED (1L<<0) /* System is clsoed to New Users */
#define SM_SYSSTAT (1L<<1) /* Sysops activity included in statistics */
......@@ -183,7 +183,7 @@ typedef struct js_callback {
#define SM_DELEMAIL (1L<<29) /* Physically remove deleted e-mail immed. */
#define SM_USRVDELM (1L<<30) /* Users can see deleted msgs */
#define SM_SYSVDELM (1L<<31) /* Sysops can see deleted msgs */
/* Different bits in node_misc */
#define NM_NO_NUM (1<<8) /* Don't allow logons by user number */
#define NM_LOGON_R (1<<9) /* Allow logons by user real name */
......@@ -192,7 +192,7 @@ typedef struct js_callback {
#define NM_7BITONLY (1L<<16) /* Except 7-bit input only (E71 terminals) */
#define NM_NOPAUSESPIN (1L<<18) /* No spinning cursor at pause prompt */
#define NM_CLOSENODEDAB (1L<<19) /* Keep node.dab file closed (for Samba) */
/* Bit values for level_misc[x] */
#define LEVEL_EXPTOLVL (1<<0) /* Expire to level_expireto[x] */
#define LEVEL_EXPTOVAL (1<<1) /* Expire to val[level_expireto[x]] */
......@@ -306,7 +306,7 @@ typedef struct js_callback {
#define ERR_CREATE "creating" /* creating */
#define ERR_LOCK "locking" /* locking */
#define ERR_UNLOCK "unlocking" /* unlocking */
#define ERR_TIMEOUT "timeout" /* timeout waiting for resource */
#define ERR_TIMEOUT "timeout" /* timeout waiting for resource */
#define ERR_IOCTL "sending IOCTL" /* IOCTL error */
#define ERR_SEEK "seeking" /* SEEKing error */
......@@ -348,7 +348,7 @@ enum {
,clr_votes_empty
,clr_progress_full
,clr_progress_empty
,MIN_COLORS
,MIN_COLORS
};
enum { /* Values for xtrn_t.type */
......@@ -365,8 +365,8 @@ enum { /* Values for xtrn_t.type */
,XTRN_RBBS1 /* DORINFO1.DEF always */
,XTRN_TRIBBS /* TRIBBS.SYS */
,XTRN_DOOR32 /* DOOR32.SYS */
};
};
typedef enum { /* Values for xtrn_t.event */
EVENT_NONE /* Only accessible by menu */
,EVENT_LOGON /* Execute during logon sequence */
......@@ -377,8 +377,8 @@ typedef enum { /* Values for xtrn_t.event */
,EVENT_UPLOAD /* Execute after uploading a file */
,EVENT_DOWNLOAD /* Execute after downloading a file */
,EVENT_LOCAL_CHAT /* Execute upon local/sysop chat */
} user_event_t;
} user_event_t;
/* Misc bits for event_t.misc */
#define EVENT_EXCL (1<<0) /* Exclusive */
#define EVENT_FORCE (1<<1) /* Force users off-line for event */
......@@ -448,27 +448,26 @@ typedef enum { /* Values for xtrn_t.event */
#define QHUB_NOKLUDGES (1<<14) /* Don't include @-kludges */
#define QHUB_NOHEADERS (1<<16) /* Don't include HEADERS.DAT */
#define QHUB_NOVOTING (1<<17) /* Don't include VOTING.DAT */
/* Bits in user.chat */
#define CHAT_ECHO (1<<0) /* Multinode chat echo */
#define CHAT_ACTION (1<<1) /* Chat actions */
#define CHAT_NOPAGE (1<<2) /* Can't be paged */
#define CHAT_NOACT (1<<3) /* No activity alerts */
#define CHAT_SPLITP (1<<4) /* Split screen private chat */
#define INVALID_DIR ((uint)-1) /* Invalid directory value */
#define INVALID_SUB ((uint)-1) /* Invalid sub-board value */
#define KEY_BUFSIZE 1024 /* Size of keyboard input buffer */
#define SAVE_LINES 4 /* Maximum number of lines to save */
#define LINE_BUFSIZE 512 /* Size of line output buffer */