#include <stdio.h>
#include <ctype.h>
#include <string.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <limits.h>
#include <sys/types.h>
#include <sys/wait.h>
char temp[PATH_MAX]; /* Name of general temp file */
char temp2[PATH_MAX]; /* Name of general temp file */
char tempdir[PATH_MAX]; /* Name of general temp dir */
-char editor_path[256]; /* path to external editor */
-char printcmd[256]; /* print command */
+char editor_path[SIZ]; /* path to external editor */
+char printcmd[SIZ]; /* print command */
int editor_pid = (-1);
char fullname[32];
jmp_buf nextbuf;
char have_xterm = 0; /* are we running on an xterm? */
char rc_username[32];
char rc_password[32];
-char hostbuf[256];
-char portbuf[256];
+char hostbuf[SIZ];
+char portbuf[SIZ];
char rc_floor_mode;
char floor_mode;
char curr_floor = 0; /* number of current floor */
-char floorlist[128][256]; /* names of floors */
+char floorlist[128][SIZ]; /* names of floors */
char express_msgs = 0; /* express messages waiting! */
+int termn8 = 0; /* Set to nonzero to cause a logoff */
extern int rc_ansi_color; /* ansi color value from citadel.rc */
void formout(char *name)
{ /* display a file */
- char cmd[256];
+ char cmd[SIZ];
snprintf(cmd, sizeof cmd, "MESG %s", name);
serv_puts(cmd);
serv_gets(cmd);
void userlist(char *patn)
{
- char buf[256];
- char fl[256];
+ char buf[SIZ];
+ char fl[SIZ];
struct tm *tmbuf;
time_t lc;
*/
void dotgoto(char *towhere, int display_name)
{
- char aaa[256], bbb[256], psearch[256];
+ char aaa[SIZ], bbb[SIZ], psearch[SIZ];
static long ls = 0L;
int newmailcount;
static int oldmailcount = (-1);
*/
void gotonext(void)
{
- char buf[256];
+ char buf[SIZ];
struct march *mptr, *mptr2;
char next_room[ROOMNAMELEN];
*/
void forget_all_rooms_on(int ffloor)
{
- char buf[256];
+ char buf[SIZ];
struct march *flist, *fptr;
printf("Forgetting all rooms on %s...\r", &floorlist[ffloor][0]);
{
int a, tofloor;
struct march *mptr;
- char buf[256], targ[256];
+ char buf[SIZ], targ[SIZ];
if (floorlist[0][0] == 0)
load_floorlist();
{
char pass1[20];
char pass2[20];
- char buf[256];
+ char buf[SIZ];
if (strlen(rc_password) > 0) {
strcpy(pass1, rc_password);
*/
void who_is_online(int longlist)
{
- char buf[256], username[256], roomname[256], fromhost[256];
- char flags[256];
- char actual_user[256], actual_room[256], actual_host[256];
- char tbuf[256], clientsoft[256];
+ char buf[SIZ], username[SIZ], roomname[SIZ], fromhost[SIZ];
+ char flags[SIZ];
+ char actual_user[SIZ], actual_room[SIZ], actual_host[SIZ];
+ char tbuf[SIZ], clientsoft[SIZ];
time_t timenow = 0;
time_t idletime, idlehours, idlemins, idlesecs;
int last_session = (-1);
extract(actual_room, buf, 9);
extract(actual_host, buf, 10);
- pprintf("\nFlags: %-3s Sess# %-3d Name: %-25s Room: %s\n",
- flags, extract_int(buf, 0), username, roomname);
- pprintf("from <%s> using <%s>, idle %ld:%02ld:%02ld\n",
- fromhost, clientsoft,
- (long) idlehours, (long) idlemins, (long) idlesecs);
+ pprintf(" Flags: %s\n", flags);
+ pprintf("Session: %d\n", extract_int(buf, 0));
+ pprintf(" Name: %s\n", username);
+ pprintf("In room: %s\n", roomname);
+ pprintf(" Host: %s\n", fromhost);
+ pprintf(" Client: %s\n", clientsoft);
+ pprintf(" Idle: %ld:%02ld:%02ld\n",
+ (long) idlehours,
+ (long) idlemins,
+ (long) idlesecs);
if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
pprintf("(really ");
if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
pprintf(")\n");
}
+ pprintf("\n");
} else {
if (extract_int(buf, 0) == last_session) {
char *telnet_client_host = NULL;
char *sptr, *sptr2; /* USed to extract the nonce */
char hexstring[MD5_HEXSTRING_SIZE];
- volatile int termn8 = 0;
int stored_password = 0;
- char password[256];
+ char password[SIZ];
sttybbs(SB_SAVE); /* Store the old terminal parameters */
load_command_set(); /* parse the citadel.rc file */
} /* end switch */
} while (termn8 == 0);
- TERMN8:printf("%s logged out.\n", fullname);
- while (march != NULL)
+TERMN8: printf("%s logged out.\n", fullname);
+ while (march != NULL) {
remove_march(march->march_name, 0);
- if (mcmd == 30)
+ }
+ if (mcmd == 30) {
printf("\n\nType 'off' to hang up, or next user...\n");
+ }
snprintf(aaa, sizeof aaa, "LOUT");
serv_puts(aaa);
serv_gets(aaa);
}
goto GSTA;
-} /* end main() */
+} /* end main() */