/* these variables are local to this module */
char keepalives_enabled = KA_YES; /* send NOOPs to server when idle */
-int ok_to_interrupt = 0; /* print express msgs asynchronously */
+int ok_to_interrupt = 0; /* print instant msgs asynchronously */
time_t AnsiDetect; /* when did we send the detect code? */
int enable_color = 0; /* nonzero for ANSI color */
/*
- * print_express() - print express messages if there are any
+ * print_instant() - print instant messages if there are any
*/
-void print_express(void)
+void print_instant(void)
{
char buf[1024];
FILE *outpipe;
time_t timestamp;
- struct tm *stamp;
+ struct tm stamp;
int flags = 0;
char sender[64];
char node[64];
char *listing = NULL;
int r; /* IPC result code */
- if (express_msgs == 0)
+ if (instant_msgs == 0)
return;
if (rc_exp_beep) {
scr_printf("\r---");
}
- while (express_msgs != 0) {
+ while (instant_msgs != 0) {
r = CtdlIPCGetInstantMessage(ipc_for_signal_handlers, &listing, buf);
if (r / 100 != 1)
return;
- express_msgs = extract_int(buf, 0);
+ instant_msgs = extract_int(buf, 0);
timestamp = extract_long(buf, 1);
flags = extract_int(buf, 2);
- extract(sender, buf, 3);
- extract(node, buf, 4);
+ extract_token(sender, buf, 3, '|', sizeof sender);
+ extract_token(node, buf, 4, '|', sizeof node);
strcpy(last_paged, sender);
- stamp = localtime(×tamp);
+ localtime_r(×tamp, &stamp);
/* If the page is a Logoff Request, honor it. */
if (flags & 2) {
else
fprintf(outpipe, "Message ");
/* Timestamp. Can this be improved? */
- if (stamp->tm_hour == 0 || stamp->tm_hour == 12)
+ if (stamp.tm_hour == 0 || stamp.tm_hour == 12)
fprintf(outpipe, "at 12:%02d%cm",
- stamp->tm_min,
- stamp->tm_hour ? 'p' : 'a');
- else if (stamp->tm_hour > 12) /* pm */
+ stamp.tm_min,
+ stamp.tm_hour ? 'p' : 'a');
+ else if (stamp.tm_hour > 12) /* pm */
fprintf(outpipe, "at %d:%02dpm",
- stamp->tm_hour - 12,
- stamp->tm_min);
+ stamp.tm_hour - 12,
+ stamp.tm_min);
else /* am */
fprintf(outpipe, "at %d:%02dam",
- stamp->tm_hour, stamp->tm_min);
+ stamp.tm_hour, stamp.tm_min);
fprintf(outpipe, " from %s", sender);
if (strncmp(ipc_for_signal_handlers->ServInfo.nodename, node, 32))
fprintf(outpipe, " @%s", node);
fprintf(outpipe, ":\n%s\n", listing);
pclose(outpipe);
- if (express_msgs == 0)
+ if (instant_msgs == 0)
return;
continue;
}
}
- /* fall back to built-in express message display */
+ /* fall back to built-in instant message display */
scr_printf("\n");
lines_printed++;
scr_printf("Message ");
/* Timestamp. Can this be improved? */
- if (stamp->tm_hour == 0 || stamp->tm_hour == 12)/* 12am/12pm */
- scr_printf("at 12:%02d%cm", stamp->tm_min,
- stamp->tm_hour ? 'p' : 'a');
- else if (stamp->tm_hour > 12) /* pm */
+ if (stamp.tm_hour == 0 || stamp.tm_hour == 12)/* 12am/12pm */
+ scr_printf("at 12:%02d%cm", stamp.tm_min,
+ stamp.tm_hour ? 'p' : 'a');
+ else if (stamp.tm_hour > 12) /* pm */
scr_printf("at %d:%02dpm",
- stamp->tm_hour - 12, stamp->tm_min);
+ stamp.tm_hour - 12, stamp.tm_min);
else /* am */
- scr_printf("at %d:%02dam", stamp->tm_hour, stamp->tm_min);
+ scr_printf("at %d:%02dam", stamp.tm_hour, stamp.tm_min);
/* Sender */
scr_printf(" from %s", sender);
*/
if (keepalives_enabled == KA_YES) {
r = CtdlIPCNoop(ipc_for_signal_handlers);
- if (express_msgs > 0) {
+ if (instant_msgs > 0) {
if (ok_to_interrupt == 1) {
scr_printf("\r%64s\r", "");
- print_express();
+ print_instant();
scr_printf("%s%c ", room_name,
room_prompt(room_flags));
scr_flush();
#ifndef DISABLE_CURSES
#if defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H)
- if (a == ERR)
+ if (a == ERR) {
logoff(NULL, 3);
+ }
#endif
#endif
int i;
char buf[128];
- print_express();
+ print_instant();
color(DIM_WHITE);
scr_printf("%s ", prompt);
color(DIM_MAGENTA);
rc_force_mail_prompts = 0;
rc_ansi_color = 0;
rc_color_use_bg = 0;
- rc_reply_extedit = 0;
strcpy(rc_url_cmd, "");
strcpy(rc_gotmail_cmd, "");
#ifdef HAVE_OPENSSL
ccfile = fopen(buf, "r");
}
if (ccfile == NULL) {
- snprintf(buf, sizeof buf, "%s/citadel.rc", BBSDIR);
+ snprintf(buf, sizeof buf,
+#ifndef HAVE_ETC_DIR
+ CTDLDIR
+#else
+ ETC_DIR
+#endif
+ "/citadel.rc");
ccfile = fopen(buf, "r");
}
if (ccfile == NULL) {
rc_alt_semantics = 0;
}
}
- if (!strncasecmp(buf, "reply_with_external_editor=", 27)) {
- if (!strncasecmp(&buf[27], "yes", 3)) {
- rc_reply_extedit = 1;
- }
- else {
- rc_reply_extedit = 0;
- }
- }
+
if (!strncasecmp(buf, "cmd=", 4)) {
strcpy(buf, &buf[4]);
/* if we're running in idiot mode, display a cute little menu */
IFNEXPERT formout(ipc, "mainmenu");
- print_express();
+ print_instant();
strcpy(argbuf, "");
cmdpos = 0;
for (a = 0; a < 5; ++a)
/*
* set tty modes. commands are:
*
- * 01- set to bbs mode
+ * 01- set to Citadel mode
* 2 - save current settings for later restoral
* 3 - restore saved settings
*/
#ifdef HAVE_TERMIOS_H
-void sttybbs(int cmd)
-{ /* SysV version of sttybbs() */
+void stty_ctdl(int cmd)
+{ /* SysV version of stty_ctdl() */
struct termios live;
static struct termios saved_settings;
static int last_cmd = 0;
}
#else
-void sttybbs(int cmd)
-{ /* BSD version of sttybbs() */
+void stty_ctdl(int cmd)
+{ /* BSD version of stty_ctdl() */
struct sgttyb live;
static struct sgttyb saved_settings;
static int last_cmd = 0;
}
else {
for (i=0; i<choices; ++i) {
- extract(buf, menustring, i);
+ extract_token(buf, menustring, i, '|', sizeof buf);
keyopt(buf);
scr_printf(" ");
}
scr_printf("\rOne of... ");
scr_printf(" \n");
for (i=0; i<choices; ++i) {
- extract(buf, menustring, i);
+ extract_token(buf, menustring, i, '|', sizeof buf);
scr_printf(" ");
keyopt(buf);
scr_printf("\n");
}
for (i=0; i<choices; ++i) {
- extract(buf, menustring, i);
+ extract_token(buf, menustring, i, '|', sizeof buf);
for (c=1; c<strlen(buf); ++c) {
if ( (ch == tolower(buf[c]))
&& (buf[c-1]=='<')