1 /* Citadel/UX room-oriented routines */
12 #include <sys/types.h>
25 #define IFNEXPERT if ((userflags&US_EXPERT)==0)
28 void sttybbs(int cmd);
29 void hit_any_key(void);
31 void strprompt(char *prompt, char *str, int len);
32 void newprompt(char *prompt, char *str, int len);
33 int struncmp(char *lstr, char *rstr, int len);
34 void dotgoto(char *towhere, int display_name);
35 void serv_read(char *buf, int bytes);
36 void formout(char *name);
38 int fmout(int width, FILE *fp, char pagin, int height, int starting_lp, char subst);
39 void citedit(FILE *fp, long int base_pos);
40 void progress(long int curr, long int cmax);
41 int pattern(char *search, char *patn);
42 int file_checksum(char *filename);
43 int nukedir(char *dirname);
44 void color(int colornum);
46 extern unsigned room_flags;
47 extern char room_name[];
49 extern char tempdir[];
50 extern int editor_pid;
51 extern char editor_path[];
52 extern int screenwidth;
53 extern int screenheight;
54 extern char fullname[];
56 extern char sigcaught;
57 extern char floor_mode;
58 extern char curr_floor;
65 extern char floorlist[128][256];
68 void load_floorlist(void) {
72 for (a=0; a<128; ++a) floorlist[a][0] = 0;
77 strcpy(floorlist[0],"Main Floor");
80 while (serv_gets(buf), strcmp(buf,"000")) {
81 extract(floorlist[extract_int(buf,0)],buf,1);
86 void room_tree_list(struct roomlisting *rp) {
96 if (rp->lnext != NULL) {
97 room_tree_list(rp->lnext);
100 if (sigcaught == 0) {
101 strcpy(rmname, rp->rlname);
103 if ((c + strlen(rmname) + 4) > screenwidth) {
107 if (f & QR_MAILBOX) {
110 else if (f & QR_PRIVATE) {
117 if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) printf("} ");
118 else if (f & QR_DIRECTORY) printf("] ");
119 else if (f & QR_NETWORK) printf(") ");
121 c = c + strlen(rmname) + 3;
124 if (rp->rnext != NULL) {
125 room_tree_list(rp->rnext);
133 * Room ordering stuff (compare first by floor, then by order)
135 int rordercmp(struct roomlisting *r1, struct roomlisting *r2)
137 if ((r1==NULL)&&(r2==NULL)) return(0);
138 if (r1==NULL) return(-1);
139 if (r2==NULL) return(1);
140 if (r1->rlfloor < r2->rlfloor) return(-1);
141 if (r1->rlfloor > r2->rlfloor) return(1);
142 if (r1->rlorder < r2->rlorder) return(-1);
143 if (r1->rlorder > r2->rlorder) return(1);
149 * Common code for all room listings
151 void listrms(char *variety)
155 struct roomlisting *rl = NULL;
156 struct roomlisting *rp;
157 struct roomlisting *rs;
160 /* Ask the server for a room list */
163 if (buf[0]!='1') return;
164 while (serv_gets(buf), strcmp(buf, "000")) {
165 rp = malloc(sizeof(struct roomlisting));
166 extract(rp->rlname, buf, 0);
167 rp->rlflags = extract_int(buf, 1);
168 rp->rlfloor = extract_int(buf, 2);
169 rp->rlorder = extract_int(buf, 3);
177 else while (rp != NULL) {
178 if (rordercmp(rp, rs)<0) {
179 if (rs->lnext == NULL) {
188 if (rs->rnext == NULL) {
200 sttybbs(SB_YES_INTR);
201 room_tree_list(NULL);
208 void list_other_floors(void) {
212 for (a=0; a<128; ++a) if ((strlen(floorlist[a])>0)&&(a!=curr_floor)) {
213 if ((c + strlen(floorlist[a]) + 4) > screenwidth) {
217 printf("%s: ",floorlist[a]);
218 c = c + strlen(floorlist[a]) + 3;
224 * List known rooms. kn_floor_mode should be set to 0 for a 'flat' listing,
225 * 1 to list rooms on the current floor, or 1 to list rooms on all floors.
227 void knrooms(int kn_floor_mode)
234 if (kn_floor_mode == 0) {
236 printf("\n Rooms with unread messages:\n");
239 printf("\n\n No unseen messages in:\n");
244 if (kn_floor_mode == 1) {
246 printf("\n Rooms with unread messages on %s:\n",
247 floorlist[(int)curr_floor]);
248 sprintf(buf,"LKRN %d",curr_floor);
251 printf("\n\n Rooms with no new messages on %s:\n",
252 floorlist[(int)curr_floor]);
253 sprintf(buf,"LKRO %d",curr_floor);
256 printf("\n\n Other floors:\n");
261 if (kn_floor_mode == 2) {
262 for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
264 printf("\n Rooms on %s:\n",floorlist[a]);
265 sprintf(buf,"LKRA %d",a);
272 IFNEXPERT hit_any_key();
276 void listzrooms(void) { /* list public forgotten rooms */
278 printf("\n Forgotten public rooms:\n");
282 IFNEXPERT hit_any_key();
286 int set_room_attr(int ibuf, char *prompt, unsigned int sbit)
290 a = boolprompt(prompt, (ibuf&sbit));
292 if (!a) ibuf=(ibuf^sbit);
299 * Select a floor (used in several commands)
300 * The supplied argument is the 'default' floor number.
301 * This function returns the selected floor number.
303 int select_floor(int rfloor)
308 if (floor_mode == 1) {
309 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
313 safestrncpy(floorstr,floorlist[rfloor],sizeof floorstr);
314 strprompt("Which floor",floorstr,256);
315 for (a=0; a<128; ++a) {
316 if (!strucmp(floorstr,&floorlist[a][0]))
318 if ((newfloor<0)&&(!struncmp(floorstr,
319 &floorlist[a][0],strlen(floorstr))))
321 if ((newfloor<0)&&(pattern(&floorlist[a][0],
322 floorstr)>=0)) newfloor = a;
325 printf("\n One of:\n");
326 for (a=0; a<128; ++a)
327 if (floorlist[a][0]!=0)
331 } while(newfloor < 0);
341 * .<A>ide <E>dit room
343 void editthisroom(void) {
344 char rname[ROOMNAMELEN];
354 int expire_value = 0;
356 /* Fetch the existing room config */
360 printf("%s\n",&buf[4]);
364 extract(rname,&buf[4],0);
365 extract(rpass,&buf[4],1);
366 extract(rdir, &buf[4],2);
367 rflags = extract_int(&buf[4],3);
368 rfloor = extract_int(&buf[4],4);
369 rorder = extract_int(&buf[4],5);
372 /* Fetch the name of the current room aide */
375 if (buf[0]=='2') safestrncpy(raide,&buf[4],sizeof raide);
376 else strcpy(raide,"");
377 if (strlen(raide)==0) strcpy(raide,"none");
379 /* Fetch the expire policy (this will silently fail on old servers,
380 * resulting in "default" policy)
382 serv_puts("GPEX room");
385 expire_mode = extract_int(&buf[4], 0);
386 expire_value = extract_int(&buf[4], 1);
389 /* Now interact with the user. */
390 strprompt("Room name",rname,ROOMNAMELEN-1);
392 rfloor = select_floor(rfloor);
393 rflags = set_room_attr(rflags,"Private room",QR_PRIVATE);
394 if (rflags & QR_PRIVATE)
395 rflags = set_room_attr(rflags,
396 "Accessible by guessing room name",QR_GUESSNAME);
398 /* if it's public, clear the privacy classes */
399 if ((rflags & QR_PRIVATE)==0) {
400 if (rflags & QR_GUESSNAME) rflags = rflags - QR_GUESSNAME;
401 if (rflags & QR_PASSWORDED) rflags = rflags - QR_PASSWORDED;
404 /* if it's private, choose the privacy classes */
405 if ( (rflags & QR_PRIVATE)
406 && ( (rflags & QR_GUESSNAME) == 0) ) {
407 rflags = set_room_attr(rflags,
408 "Accessible by entering a password",QR_PASSWORDED);
410 if ( (rflags & QR_PRIVATE)
411 && ((rflags&QR_PASSWORDED)==QR_PASSWORDED) ) {
412 strprompt("Room password",rpass,9);
415 if ((rflags&QR_PRIVATE)==QR_PRIVATE) {
416 rbump = boolprompt("Cause current users to forget room", 0);
419 rflags = set_room_attr(rflags,"Preferred users only",QR_PREFONLY);
420 rflags = set_room_attr(rflags,"Read-only room",QR_READONLY);
421 rflags = set_room_attr(rflags,"Directory room",QR_DIRECTORY);
422 rflags = set_room_attr(rflags,"Permanent room",QR_PERMANENT);
423 if (rflags & QR_DIRECTORY) {
424 strprompt("Directory name",rdir,14);
425 rflags = set_room_attr(rflags,"Uploading allowed",QR_UPLOAD);
426 rflags = set_room_attr(rflags,"Downloading allowed",
428 rflags = set_room_attr(rflags,"Visible directory",QR_VISDIR);
430 rflags = set_room_attr(rflags,"Network shared room",QR_NETWORK);
431 rflags = set_room_attr(rflags,
432 "Automatically make all messages anonymous",QR_ANONONLY);
433 if ( (rflags & QR_ANONONLY) == 0) {
434 rflags = set_room_attr(rflags,
435 "Ask users whether to make messages anonymous",
438 rorder = intprompt("Listing order", rorder, 1, 127);
440 /* Ask about the room aide */
442 strprompt("Room aide (or 'none')",raide,29);
443 if (!strucmp(raide,"none")) {
448 snprintf(buf,sizeof buf,"QUSR %s",raide);
451 if (buf[0]!='2') printf("%s\n",&buf[4]);
453 } while(buf[0]!='2');
455 if (!strucmp(raide,"none")) strcpy(raide,"");
458 /* Angels and demons dancing in my head... */
460 sprintf(buf, "%d", expire_mode);
461 strprompt("Message expire policy (? for list)", buf, 1);
464 printf("0. Use the default for this floor\n");
465 printf("1. Never automatically expire messages\n");
466 printf("2. Expire by message count\n");
467 printf("3. Expire by message age\n");
469 } while((buf[0]<48)||(buf[0]>51));
470 expire_mode = buf[0] - 48;
472 /* ...lunatics and monsters underneath my bed */
473 if (expire_mode == 2) {
474 sprintf(buf, "%d", expire_value);
475 strprompt("Keep how many messages online?", buf, 10);
476 expire_value = atol(buf);
479 if (expire_mode == 3) {
480 sprintf(buf, "%d", expire_value);
481 strprompt("Keep messages for how many days?", buf, 10);
482 expire_value = atol(buf);
485 /* Give 'em a chance to change their minds */
486 printf("Save changes (y/n)? ");
489 snprintf(buf,sizeof buf,"SETA %s",raide);
492 if (buf[0]!='2') printf("%s\n",&buf[4]);
494 snprintf(buf, sizeof buf, "SPEX room|%d|%d",
495 expire_mode, expire_value);
499 snprintf(buf,sizeof buf,"SETR %s|%s|%s|%d|%d|%d|%d",
500 rname,rpass,rdir,rflags,rbump,rfloor,rorder);
503 printf("%s\n",&buf[4]);
504 if (buf[0]=='2') dotgoto(rname,2);
510 * un-goto the previous room
515 if (!strcmp(ugname,"")) return;
516 snprintf(buf,sizeof buf,"GOTO %s",ugname);
520 printf("%s\n",&buf[4]);
523 sprintf(buf,"SLRP %ld",uglsn);
526 if (buf[0]!='2') printf("%s\n",&buf[4]);
527 safestrncpy(buf,ugname,sizeof buf);
533 /* Here's the code for simply transferring the file to the client,
534 * for folks who have their own clientware. It's a lot simpler than
535 * the [XYZ]modem code below...
536 * (This function assumes that a download file is already open on the server)
538 void download_to_local_disk(char *supplied_filename, long total_bytes)
542 long transmitted_bytes = 0L;
549 strcpy(filename, supplied_filename);
550 if (strlen(filename)==0) {
551 newprompt("Filename: ", filename, 250);
554 printf("Enter the name of the directory to save '%s'\n",
556 printf("to, or press return for the current directory.\n");
557 newprompt("Directory: ",dbuf,256);
558 if (strlen(dbuf)==0) strcpy(dbuf,".");
560 strcat(dbuf,filename);
562 savefp = fopen(dbuf,"w");
563 if (savefp == NULL) {
564 printf("Cannot open '%s': %s\n",dbuf,strerror(errno));
565 /* close the download file at the server */
569 printf("%s\n",&buf[4]);
573 progress(0,total_bytes);
574 while ( (transmitted_bytes < total_bytes) && (broken == 0) ) {
575 bb = total_bytes - transmitted_bytes;
576 aa = ((bb < 4096) ? bb : 4096);
577 sprintf(buf,"READ %ld|%ld",transmitted_bytes,aa);
581 printf("%s\n",&buf[4]);
584 packet = extract_int(&buf[4],0);
585 serv_read(dbuf,packet);
586 if (fwrite(dbuf,packet,1,savefp) < 1) broken = 1;
587 transmitted_bytes = transmitted_bytes + (long)packet;
588 progress(transmitted_bytes,total_bytes);
591 /* close the download file at the server */
595 printf("%s\n",&buf[4]);
602 * download() - download a file or files. The argument passed to this
603 * function determines which protocol to use.
604 * proto - 0 = paginate, 1 = xmodem, 2 = raw, 3 = ymodem, 4 = zmodem, 5 = save
606 void download(int proto)
610 long total_bytes = 0L;
613 long transmitted_bytes = 0L;
622 if ((room_flags & QR_DOWNLOAD) == 0) {
623 printf("*** You cannot download from this room.\n");
627 newprompt("Enter filename: ",filename,255);
629 snprintf(buf,sizeof buf,"OPEN %s",filename);
633 printf("%s\n",&buf[4]);
636 total_bytes = extract_long(&buf[4],0);
638 /* Save to local disk, for folks with their own copy of the client */
640 download_to_local_disk(filename, total_bytes);
645 /* Meta-download for public clients */
647 snprintf(buf,sizeof buf,"%s/%s",tempdir,filename);
650 /* We do the remainder of this function as a separate process in
651 * order to allow recovery if the transfer is aborted. If the
652 * file transfer program aborts, the first child process receives a
653 * "broken pipe" signal and aborts. We *should* be able to catch
654 * this condition with signal(), but it doesn't seem to work on all
659 /* wait for the download to finish */
660 while (wait(&b)!=a) ;;
662 /* close the download file at the server */
666 printf("%s\n",&buf[4]);
668 /* clean up the temporary directory */
673 snprintf(buf,sizeof buf,"%s/%s",tempdir,filename); /* full pathname */
675 /* The next fork() creates a second child process that is used for
676 * the actual file transfer program (usually sz).
679 if (proto_pid == 0) {
682 signal(SIGINT,SIG_DFL);
683 signal(SIGQUIT,SIG_DFL);
684 snprintf(dbuf,sizeof dbuf,"SHELL=/dev/null; export SHELL; TERM=dumb; export TERM; exec more -d <%s",buf);
690 signal(SIGINT,SIG_DFL);
691 signal(SIGQUIT,SIG_DFL);
692 if (proto==1) execlp("sx","sx",buf,NULL);
693 if (proto==2) execlp("cat","cat",buf,NULL);
694 if (proto==3) execlp("sb","sb",buf,NULL);
695 if (proto==4) execlp("sz","sz",buf,NULL);
696 execlp("cat","cat",buf,NULL);
700 tpipe = fopen(buf,"w");
702 while ( (transmitted_bytes < total_bytes) && (broken == 0) ) {
703 bb = total_bytes - transmitted_bytes;
704 aa = ((bb < 4096) ? bb : 4096);
705 sprintf(buf,"READ %ld|%ld",transmitted_bytes,aa);
709 printf("%s\n",&buf[4]);
712 packet = extract_int(&buf[4],0);
713 serv_read(dbuf,packet);
714 if (fwrite(dbuf,packet,1,tpipe) < 1) broken = 1;
715 transmitted_bytes = transmitted_bytes + (long)packet;
717 if (tpipe!=NULL) fclose(tpipe);
719 /* Hang out and wait for the file transfer program to finish */
720 while (wait(&a) != proto_pid) ;;
724 exit(0); /* transfer control back to the main program */
730 * read directory of this room
741 printf("%s\n",&buf[4]);
745 extract(comment,&buf[4],0);
746 extract(flnm,&buf[4],1);
747 printf("\nDirectory of %s on %s\n",flnm,comment);
748 printf("-----------------------\n");
749 while (serv_gets(buf), strcmp(buf,"000")) {
752 extract(comment,buf,2);
753 if (strlen(flnm)<=14)
754 printf("%-14s %8s %s\n",flnm,flsz,comment);
756 printf("%s\n%14s %8s %s\n",flnm,"",flsz,comment);
762 * add a user to a private room
765 char aaa[31],bbb[256];
767 if ((room_flags & QR_PRIVATE)==0) {
768 printf("This is not a private room.\n");
772 newprompt("Name of user? ",aaa,30);
773 if (aaa[0]==0) return;
775 snprintf(bbb,sizeof bbb,"INVT %s",aaa);
778 printf("%s\n",&bbb[4]);
783 * kick a user out of a room
786 char aaa[31],bbb[256];
788 newprompt("Name of user? ",aaa,30);
789 if (aaa[0]==0) return;
791 snprintf(bbb,sizeof bbb,"KICK %s",aaa);
794 printf("%s\n",&bbb[4]);
799 * aide command: kill the current room
801 void killroom(void) {
807 printf("%s\n",&aaa[4]);
811 printf("Are you sure you want to kill this room? ");
812 if (yesno()==0) return;
816 printf("%s\n",&aaa[4]);
817 if (aaa[0]!='2') return;
818 dotgoto("_BASEROOM_",0);
821 void forget(void) { /* forget the current room */
824 printf("Are you sure you want to forget this room? ");
825 if (yesno()==0) return;
830 printf("%s\n",&cmd[4]);
834 /* now return to the lobby */
835 dotgoto("_BASEROOM_",0);
844 char new_room_name[ROOMNAMELEN];
846 char new_room_pass[10];
854 printf("%s\n",&cmd[4]);
858 newprompt("Name for new room? ",new_room_name,ROOMNAMELEN-1);
859 if (strlen(new_room_name)==0) return;
860 for (a=0; a<strlen(new_room_name); ++a)
861 if (new_room_name[a] == '|') new_room_name[a]='_';
863 new_room_floor = select_floor((int)curr_floor);
865 IFNEXPERT formout("roomaccess");
867 printf("<?>Help\n<1>Public room\n<2>Guess-name room\n");
868 printf("<3>Passworded room\n<4>Invitation-only room\n");
869 printf("Enter room type: ");
872 } while (((b<'1')||(b>'4')) && (b!='?'));
875 formout("roomaccess");
877 } while ((b<'1')||(b>'4'));
880 new_room_type = b - 1;
881 if (new_room_type==2) {
882 newprompt("Enter a room password: ",new_room_pass,9);
883 for (a=0; a<strlen(new_room_pass); ++a)
884 if (new_room_pass[a] == '|') new_room_pass[a]='_';
886 else strcpy(new_room_pass,"");
888 printf("\042%s\042, a",new_room_name);
889 if (b==1) printf(" public room.");
890 if (b==2) printf(" guess-name room.");
891 if (b==3) printf(" passworded room, password: %s",new_room_pass);
892 if (b==4) printf("n invitation-only room.");
893 printf("\nInstall it? (y/n) : ");
897 snprintf(cmd, sizeof cmd, "CRE8 1|%s|%d|%s|%d", new_room_name,
898 new_room_type, new_room_pass, new_room_floor);
902 printf("%s\n",&cmd[4]);
906 /* command succeeded... now GO to the new room! */
907 dotgoto(new_room_name,0);
912 void readinfo(void) { /* read info file for current room */
919 if (cmd[0]!='1') return;
921 fmout(screenwidth,NULL,
922 ((userflags & US_PAGINATOR) ? 1 : 0),
928 * <W>ho knows room...
930 void whoknows(void) {
935 printf("%s\n",&buf[5]);
939 sttybbs(SB_YES_INTR);
940 while (serv_gets(buf), strncmp(buf,"000",3)) {
941 if (sigcaught==0) printf("%s\n",buf);
947 void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
951 int b,cksum,editor_exit;
954 if (strlen(editor_path)==0) {
955 printf("Do you wish to re-enter %s? ",desc);
956 if (yesno()==0) return;
959 fp = fopen(temp,"w");
962 serv_puts(check_cmd);
965 printf("%s\n",&cmd[4]);
969 if (strlen(editor_path)>0) {
973 fp = fopen(temp,"w");
974 while (serv_gets(cmd), strcmp(cmd,"000")) {
975 fprintf(fp,"%s\n",cmd);
981 cksum = file_checksum(temp);
983 if (strlen(editor_path)>0) {
988 execlp(editor_path,editor_path,temp,NULL);
991 if (editor_pid>0) do {
993 b=wait(&editor_exit);
994 } while((b!=editor_pid)&&(b>=0));
996 printf("Executed %s\n", editor_path);
1000 printf("Entering %s. ",desc);
1001 printf("Press return twice when finished.\n");
1002 fp=fopen(temp,"r+");
1007 if (file_checksum(temp) == cksum) {
1008 printf("*** Aborted.\n");
1012 serv_puts(write_cmd);
1015 printf("%s\n",&cmd[4]);
1020 while (fgets(cmd,255,fp)!=NULL) {
1021 cmd[strlen(cmd)-1] = 0;
1032 void enterinfo(void) { /* edit info file for current room */
1033 do_edit("the Info file for this room","RINF","EINF 0","EINF 1");
1036 void enter_bio(void) {
1038 snprintf(cmd,sizeof cmd,"RBIO %s",fullname);
1039 do_edit("your Bio",cmd,"NOOP","EBIO");
1043 * create a new floor
1045 void create_floor(void) {
1047 char newfloorname[256];
1049 serv_puts("CFLR xx|0");
1052 printf("%s\n",&buf[4]);
1056 newprompt("Name for new floor: ",newfloorname,255);
1057 snprintf(buf,sizeof buf,"CFLR %s|1",newfloorname);
1061 printf("Floor has been created.\n");
1064 printf("%s\n",&buf[4]);
1069 * edit the current floor
1071 void edit_floor(void) {
1073 int expire_mode = 0;
1074 int expire_value = 0;
1076 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
1078 /* Fetch the expire policy (this will silently fail on old servers,
1079 * resulting in "default" policy)
1081 serv_puts("GPEX floor");
1084 expire_mode = extract_int(&buf[4], 0);
1085 expire_value = extract_int(&buf[4], 1);
1088 /* Interact with the user */
1089 strprompt("Floor name",&floorlist[(int)curr_floor][0],255);
1091 /* Angels and demons dancing in my head... */
1093 sprintf(buf, "%d", expire_mode);
1094 strprompt("Floor default essage expire policy (? for list)",
1096 if (buf[0] == '?') {
1098 printf("0. Use the system default\n");
1099 printf("1. Never automatically expire messages\n");
1100 printf("2. Expire by message count\n");
1101 printf("3. Expire by message age\n");
1103 } while((buf[0]<48)||(buf[0]>51));
1104 expire_mode = buf[0] - 48;
1106 /* ...lunatics and monsters underneath my bed */
1107 if (expire_mode == 2) {
1108 sprintf(buf, "%d", expire_value);
1109 strprompt("Keep how many messages online?", buf, 10);
1110 expire_value = atol(buf);
1113 if (expire_mode == 3) {
1114 sprintf(buf, "%d", expire_value);
1115 strprompt("Keep messages for how many days?", buf, 10);
1116 expire_value = atol(buf);
1120 snprintf(buf, sizeof buf, "SPEX floor|%d|%d",
1121 expire_mode, expire_value);
1125 snprintf(buf,sizeof buf,"EFLR %d|%s",curr_floor,
1126 &floorlist[(int)curr_floor][0]);
1129 printf("%s\n",&buf[4]);
1137 * kill the current floor
1139 void kill_floor(void) {
1140 int floornum_to_delete,a;
1143 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
1145 floornum_to_delete = (-1);
1146 printf("(Press return to abort)\n");
1147 newprompt("Delete which floor? ",buf,255);
1148 if (strlen(buf)==0) return;
1149 for (a=0; a<128; ++a)
1150 if (!strucmp(&floorlist[a][0],buf))
1151 floornum_to_delete = a;
1152 if (floornum_to_delete < 0) {
1153 printf("No such floor. Select one of:\n");
1154 for (a=0; a<128; ++a)
1155 if (floorlist[a][0]!=0)
1156 printf("%s\n",&floorlist[a][0]);
1158 } while (floornum_to_delete < 0);
1159 sprintf(buf,"KFLR %d|1",floornum_to_delete);
1162 printf("%s\n",&buf[4]);