#include "snprintf.h"
#endif
#include "screen.h"
+#include "citadel_dirs.h"
#include "md5.h"
kill(0 - getpgrp(), SIGKILL);
}
color(ORIGINAL_PAIR); /* Restore the old color settings */
- sttybbs(SB_RESTORE); /* return the old terminal settings */
+ stty_ctdl(SB_RESTORE); /* return the old terminal settings */
/*
* uncomment the following if you need to know why Citadel exited
printf("*** Exit code %d at %s:%d\n", code, file, line);
*/
void catch_sigcont(int signum)
{
- sttybbs(SB_LAST);
+ stty_ctdl(SB_LAST);
signal(SIGCONT, catch_sigcont);
}
int r; /* IPC response code */
char *listing = NULL;
- r = CtdlIPCUserListing(ipc, &listing, buf);
+ r = CtdlIPCUserListing(ipc, patn, &listing, buf);
if (r / 100 != 1) {
pprintf("%s\n", buf);
return;
pprintf(" User Name Num L LastCall Calls Posts\n");
pprintf("------------------------- ----- - ---------- ----- -----\n");
- while (strlen(listing) > 0) {
+ if (listing != NULL) while (strlen(listing) > 0) {
extract_token(buf, listing, 0, '\n', sizeof buf);
remove_token(listing, 0, '\n');
system(rc_gotmail_cmd);
}
}
- status_line(ipc->ServInfo.humannode, ipc->ServInfo.bbs_city,
+ status_line(ipc->ServInfo.humannode, ipc->ServInfo.site_location,
room_name, secure, newmailcount);
}
logoff(NULL, 3);
}
- sttybbs(SB_SAVE); /* Store the old terminal parameters */
+ stty_ctdl(SB_SAVE); /* Store the old terminal parameters */
load_command_set(); /* parse the citadel.rc file */
- sttybbs(SB_NO_INTR); /* Install the new ones */
+ stty_ctdl(SB_NO_INTR); /* Install the new ones */
/* signal(SIGHUP, dropcarr);FIXME */ /* Cleanup gracefully if carrier is dropped */
signal(SIGPIPE, dropcarr); /* Cleanup gracefully if local conn. dropped */
signal(SIGTERM, dropcarr); /* Cleanup gracefully if terminated */
if (!strcmp(argv[a], "-p")) {
struct stat st;
- if (chdir(BBSDIR) < 0) {
- perror("can't change to " BBSDIR);
+ if (chdir(CTDLDIR) < 0) {
+ perror("can't change to " CTDLDIR);
logoff(NULL, 3);
}
* guaranteed to have the uid/gid we want.
*/
if (!getuid() || !getgid()) {
- if (stat(BBSDIR "/citadel.config", &st) < 0) {
+ if (stat(file_citadel_config, &st) < 0) {
perror("couldn't stat citadel.config");
logoff(NULL, 3);
}
get_serv_info(ipc, telnet_client_host);
scr_printf("%-24s\n%s\n%s\n", ipc->ServInfo.software, ipc->ServInfo.humannode,
- ipc->ServInfo.bbs_city);
+ ipc->ServInfo.site_location);
scr_flush();
- status_line(ipc->ServInfo.humannode, ipc->ServInfo.bbs_city, NULL,
+ status_line(ipc->ServInfo.humannode, ipc->ServInfo.site_location, NULL,
secure, -1);
screenwidth = 80; /* default screen dimensions */
* program. Don't mess with these once they've been set, because we
* will be unlinking them later on in the program and we don't
* want to delete something that we didn't create. */
- snprintf(temp, sizeof temp, tmpnam(NULL));
- snprintf(temp2, sizeof temp2, tmpnam(NULL));
- snprintf(tempdir, sizeof tempdir, tmpnam(NULL));
+ CtdlMakeTempFileName(temp, sizeof temp);
+ CtdlMakeTempFileName(temp2, sizeof temp2);
+ CtdlMakeTempFileName(tempdir, sizeof tempdir);
/* Get screen dimensions. First we go to a default of 80x24. Then
* we try to get the user's actual screen dimensions off the server.
formout(ipc, "help");
break;
case 4:
- entmsg(ipc, 0, 0);
+ entmsg(ipc, 0, ((userflags & US_EXTEDIT) ? 2 : 0));
break;
case 36:
entmsg(ipc, 0, 1);
{
/* Only m.author is used */
struct ctdlipcmessage m;
- newprompt("What do you want your username to be? ", m.author, USERNAME_SIZE - 1);
+ newprompt("What do you want your username to be? ",
+ m.author, USERNAME_SIZE - 1);
+ m.text = "";
r = CtdlIPCPostMessage(ipc, 2, &m, aaa);
if (r / 100 != 2)
scr_printf("%s\n", aaa);
case 2:
if (ipc->isLocal) {
screen_reset();
- sttybbs(SB_RESTORE);
+ stty_ctdl(SB_RESTORE);
snprintf(aaa, sizeof aaa, "USERNAME=\042%s\042; export USERNAME;"
"exec ./subsystem %ld %d %d", fullname,
usernum, screenwidth, axlevel);
ka_system(aaa);
- sttybbs(SB_NO_INTR);
+ stty_ctdl(SB_NO_INTR);
screen_set();
} else {
scr_printf("*** Can't run doors when server is not local.\n");
CtdlIPCLogout(ipc);
if ((mcmd == 29) || (mcmd == 15)) {
screen_delete();
- sttybbs(SB_RESTORE);
+ stty_ctdl(SB_RESTORE);
formout(ipc, "goodbye");
logoff(ipc, 0);
}