15 int main(int argc, char **argv)
26 attach_to_server(argc,argv);
28 if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
29 fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
32 strcpy(nodetitle, "this BBS");
37 while (serv_gets(buf), strcmp(buf,"000")) {
38 if (a==0) my_pid = atoi(buf);
39 if (a==2) strcpy(nodetitle, buf);
43 printf(" Users currently logged on to %s\n", nodetitle);
47 fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
51 printf("Session User name Room From host\n");
52 printf("------- ------------------------- -------------------- ------------------------\n");
53 while (serv_gets(buf), strcmp(buf,"000")) {
54 s_pid = extract_int(buf,0);
55 extract(s_user,buf,1);
56 extract(s_room,buf,2);
57 extract(s_host,buf,3);
58 if (s_pid != my_pid) {
59 printf("%-7d%c%-25s %-20s %-24s\n",
61 ((s_pid == my_pid) ? '*' : ' '),
62 s_user,s_room,s_host);
74 * replacement strerror() for systems that don't have it
80 sprintf(buf,"errno = %d",e);