34 logfp = fopen ("citadel.log", "r");
37 perror ("Could not open citadel.log");
42 if (!strcmp (argv[1], "-t"))
43 last20 (file, (long) pos);
45 fprintf (stderr, "%s: usage: %s [-t]\n", argv[0], argv[0]);
51 while (fgets (buf, 256, logfp) != NULL)
53 buf[strlen (buf) - 1] = 0;
56 strcpy (buf, index (buf, '|'));
58 strcpy (buf, index (buf, '|'));
59 strcpy (LogName, buf);
65 if (LogType & CL_CONNECT)
66 strcpy (aaa, "Connect");
67 if (LogType & CL_LOGIN)
68 strcpy (aaa, "Login");
69 if (LogType & CL_NEWUSER)
70 strcpy (aaa, "New User");
71 if (LogType & CL_BADPW)
72 strcpy (aaa, "Bad PW Attempt");
73 if (LogType & CL_TERMINATE)
74 strcpy (aaa, "Terminate");
75 if (LogType & CL_DROPCARR)
76 strcpy (aaa, "Dropped Carrier");
77 if (LogType & CL_SLEEPING)
78 strcpy (aaa, "Sleeping");
79 if (LogType & CL_PWCHANGE)
80 strcpy (aaa, "Changed Passwd");
81 tm = (struct tm *) localtime (&LogTime);
82 tstring = (char *) asctime (tm);
83 printf ("%30s %20s %s", LogName, aaa, tstring);