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 *filename, long total_bytes)
542 long transmitted_bytes = 0L;
548 printf("Enter the name of the directory to save '%s'\n",
550 printf("to, or press return for the current directory.\n");
551 newprompt("Directory: ",dbuf,256);
552 if (strlen(dbuf)==0) strcpy(dbuf,".");
554 strcat(dbuf,filename);
556 savefp = fopen(dbuf,"w");
557 if (savefp == NULL) {
558 printf("Cannot open '%s': %s\n",dbuf,strerror(errno));
559 /* close the download file at the server */
563 printf("%s\n",&buf[4]);
567 progress(0,total_bytes);
568 while ( (transmitted_bytes < total_bytes) && (broken == 0) ) {
569 bb = total_bytes - transmitted_bytes;
570 aa = ((bb < 4096) ? bb : 4096);
571 sprintf(buf,"READ %ld|%ld",transmitted_bytes,aa);
575 printf("%s\n",&buf[4]);
578 packet = extract_int(&buf[4],0);
579 serv_read(dbuf,packet);
580 if (fwrite(dbuf,packet,1,savefp) < 1) broken = 1;
581 transmitted_bytes = transmitted_bytes + (long)packet;
582 progress(transmitted_bytes,total_bytes);
585 /* close the download file at the server */
589 printf("%s\n",&buf[4]);
596 * download() - download a file or files. The argument passed to this
597 * function determines which protocol to use.
598 * proto - 0 = paginate, 1 = xmodem, 2 = raw, 3 = ymodem, 4 = zmodem, 5 = save
600 void download(int proto)
604 long total_bytes = 0L;
607 long transmitted_bytes = 0L;
616 if ((room_flags & QR_DOWNLOAD) == 0) {
617 printf("*** You cannot download from this room.\n");
621 newprompt("Enter filename: ",filename,255);
623 snprintf(buf,sizeof buf,"OPEN %s",filename);
627 printf("%s\n",&buf[4]);
630 total_bytes = extract_long(&buf[4],0);
632 /* Save to local disk, for folks with their own copy of the client */
634 download_to_local_disk(filename, total_bytes);
639 /* Meta-download for public clients */
641 snprintf(buf,sizeof buf,"%s/%s",tempdir,filename);
644 /* We do the remainder of this function as a separate process in
645 * order to allow recovery if the transfer is aborted. If the
646 * file transfer program aborts, the first child process receives a
647 * "broken pipe" signal and aborts. We *should* be able to catch
648 * this condition with signal(), but it doesn't seem to work on all
653 /* wait for the download to finish */
654 while (wait(&b)!=a) ;;
656 /* close the download file at the server */
660 printf("%s\n",&buf[4]);
662 /* clean up the temporary directory */
667 snprintf(buf,sizeof buf,"%s/%s",tempdir,filename); /* full pathname */
669 /* The next fork() creates a second child process that is used for
670 * the actual file transfer program (usually sz).
673 if (proto_pid == 0) {
676 signal(SIGINT,SIG_DFL);
677 signal(SIGQUIT,SIG_DFL);
678 snprintf(dbuf,sizeof dbuf,"SHELL=/dev/null; export SHELL; TERM=dumb; export TERM; exec more -d <%s",buf);
684 signal(SIGINT,SIG_DFL);
685 signal(SIGQUIT,SIG_DFL);
686 if (proto==1) execlp("sx","sx",buf,NULL);
687 if (proto==2) execlp("cat","cat",buf,NULL);
688 if (proto==3) execlp("sb","sb",buf,NULL);
689 if (proto==4) execlp("sz","sz",buf,NULL);
690 execlp("cat","cat",buf,NULL);
694 tpipe = fopen(buf,"w");
696 while ( (transmitted_bytes < total_bytes) && (broken == 0) ) {
697 bb = total_bytes - transmitted_bytes;
698 aa = ((bb < 4096) ? bb : 4096);
699 sprintf(buf,"READ %ld|%ld",transmitted_bytes,aa);
703 printf("%s\n",&buf[4]);
706 packet = extract_int(&buf[4],0);
707 serv_read(dbuf,packet);
708 if (fwrite(dbuf,packet,1,tpipe) < 1) broken = 1;
709 transmitted_bytes = transmitted_bytes + (long)packet;
711 if (tpipe!=NULL) fclose(tpipe);
713 /* Hang out and wait for the file transfer program to finish */
714 while (wait(&a) != proto_pid) ;;
718 exit(0); /* transfer control back to the main program */
724 * read directory of this room
735 printf("%s\n",&buf[4]);
739 extract(comment,&buf[4],0);
740 extract(flnm,&buf[4],1);
741 printf("\nDirectory of %s on %s\n",flnm,comment);
742 printf("-----------------------\n");
743 while (serv_gets(buf), strcmp(buf,"000")) {
746 extract(comment,buf,2);
747 if (strlen(flnm)<=14)
748 printf("%-14s %8s %s\n",flnm,flsz,comment);
750 printf("%s\n%14s %8s %s\n",flnm,"",flsz,comment);
756 * add a user to a private room
759 char aaa[31],bbb[256];
761 if ((room_flags & QR_PRIVATE)==0) {
762 printf("This is not a private room.\n");
766 newprompt("Name of user? ",aaa,30);
767 if (aaa[0]==0) return;
769 snprintf(bbb,sizeof bbb,"INVT %s",aaa);
772 printf("%s\n",&bbb[4]);
777 * kick a user out of a room
780 char aaa[31],bbb[256];
782 newprompt("Name of user? ",aaa,30);
783 if (aaa[0]==0) return;
785 snprintf(bbb,sizeof bbb,"KICK %s",aaa);
788 printf("%s\n",&bbb[4]);
793 * aide command: kill the current room
795 void killroom(void) {
801 printf("%s\n",&aaa[4]);
805 printf("Are you sure you want to kill this room? ");
806 if (yesno()==0) return;
810 printf("%s\n",&aaa[4]);
811 if (aaa[0]!='2') return;
812 dotgoto("_BASEROOM_",0);
815 void forget(void) { /* forget the current room */
818 printf("Are you sure you want to forget this room? ");
819 if (yesno()==0) return;
824 printf("%s\n",&cmd[4]);
828 /* now return to the lobby */
829 dotgoto("_BASEROOM_",0);
838 char new_room_name[ROOMNAMELEN];
840 char new_room_pass[10];
848 printf("%s\n",&cmd[4]);
852 newprompt("Name for new room? ",new_room_name,ROOMNAMELEN-1);
853 if (strlen(new_room_name)==0) return;
854 for (a=0; a<strlen(new_room_name); ++a)
855 if (new_room_name[a] == '|') new_room_name[a]='_';
857 new_room_floor = select_floor((int)curr_floor);
859 IFNEXPERT formout("roomaccess");
861 printf("<?>Help\n<1>Public room\n<2>Guess-name room\n");
862 printf("<3>Passworded room\n<4>Invitation-only room\n");
863 printf("Enter room type: ");
866 } while (((b<'1')||(b>'4')) && (b!='?'));
869 formout("roomaccess");
871 } while ((b<'1')||(b>'4'));
874 new_room_type = b - 1;
875 if (new_room_type==2) {
876 newprompt("Enter a room password: ",new_room_pass,9);
877 for (a=0; a<strlen(new_room_pass); ++a)
878 if (new_room_pass[a] == '|') new_room_pass[a]='_';
880 else strcpy(new_room_pass,"");
882 printf("\042%s\042, a",new_room_name);
883 if (b==1) printf(" public room.");
884 if (b==2) printf(" guess-name room.");
885 if (b==3) printf(" passworded room, password: %s",new_room_pass);
886 if (b==4) printf("n invitation-only room.");
887 printf("\nInstall it? (y/n) : ");
891 snprintf(cmd, sizeof cmd, "CRE8 1|%s|%d|%s|%d", new_room_name,
892 new_room_type, new_room_pass, new_room_floor);
896 printf("%s\n",&cmd[4]);
900 /* command succeeded... now GO to the new room! */
901 dotgoto(new_room_name,0);
906 void readinfo(void) { /* read info file for current room */
913 if (cmd[0]!='1') return;
915 fmout(screenwidth,NULL,
916 ((userflags & US_PAGINATOR) ? 1 : 0),
922 * <W>ho knows room...
924 void whoknows(void) {
929 printf("%s\n",&buf[5]);
933 sttybbs(SB_YES_INTR);
934 while (serv_gets(buf), strncmp(buf,"000",3)) {
935 if (sigcaught==0) printf("%s\n",buf);
941 void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd)
945 int b,cksum,editor_exit;
948 if (strlen(editor_path)==0) {
949 printf("Do you wish to re-enter %s? ",desc);
950 if (yesno()==0) return;
953 fp = fopen(temp,"w");
956 serv_puts(check_cmd);
959 printf("%s\n",&cmd[4]);
963 if (strlen(editor_path)>0) {
967 fp = fopen(temp,"w");
968 while (serv_gets(cmd), strcmp(cmd,"000")) {
969 fprintf(fp,"%s\n",cmd);
975 cksum = file_checksum(temp);
977 if (strlen(editor_path)>0) {
982 execlp(editor_path,editor_path,temp,NULL);
985 if (editor_pid>0) do {
987 b=wait(&editor_exit);
988 } while((b!=editor_pid)&&(b>=0));
990 printf("Executed %s\n", editor_path);
994 printf("Entering %s. ",desc);
995 printf("Press return twice when finished.\n");
1001 if (file_checksum(temp) == cksum) {
1002 printf("*** Aborted.\n");
1006 serv_puts(write_cmd);
1009 printf("%s\n",&cmd[4]);
1014 while (fgets(cmd,255,fp)!=NULL) {
1015 cmd[strlen(cmd)-1] = 0;
1026 void enterinfo(void) { /* edit info file for current room */
1027 do_edit("the Info file for this room","RINF","EINF 0","EINF 1");
1030 void enter_bio(void) {
1032 snprintf(cmd,sizeof cmd,"RBIO %s",fullname);
1033 do_edit("your Bio",cmd,"NOOP","EBIO");
1037 * create a new floor
1039 void create_floor(void) {
1041 char newfloorname[256];
1043 serv_puts("CFLR xx|0");
1046 printf("%s\n",&buf[4]);
1050 newprompt("Name for new floor: ",newfloorname,255);
1051 snprintf(buf,sizeof buf,"CFLR %s|1",newfloorname);
1055 printf("Floor has been created.\n");
1058 printf("%s\n",&buf[4]);
1063 * edit the current floor
1065 void edit_floor(void) {
1067 int expire_mode = 0;
1068 int expire_value = 0;
1070 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
1072 /* Fetch the expire policy (this will silently fail on old servers,
1073 * resulting in "default" policy)
1075 serv_puts("GPEX floor");
1078 expire_mode = extract_int(&buf[4], 0);
1079 expire_value = extract_int(&buf[4], 1);
1082 /* Interact with the user */
1083 strprompt("Floor name",&floorlist[(int)curr_floor][0],255);
1085 /* Angels and demons dancing in my head... */
1087 sprintf(buf, "%d", expire_mode);
1088 strprompt("Floor default essage expire policy (? for list)",
1090 if (buf[0] == '?') {
1092 printf("0. Use the system default\n");
1093 printf("1. Never automatically expire messages\n");
1094 printf("2. Expire by message count\n");
1095 printf("3. Expire by message age\n");
1097 } while((buf[0]<48)||(buf[0]>51));
1098 expire_mode = buf[0] - 48;
1100 /* ...lunatics and monsters underneath my bed */
1101 if (expire_mode == 2) {
1102 sprintf(buf, "%d", expire_value);
1103 strprompt("Keep how many messages online?", buf, 10);
1104 expire_value = atol(buf);
1107 if (expire_mode == 3) {
1108 sprintf(buf, "%d", expire_value);
1109 strprompt("Keep messages for how many days?", buf, 10);
1110 expire_value = atol(buf);
1114 snprintf(buf, sizeof buf, "SPEX floor|%d|%d",
1115 expire_mode, expire_value);
1119 snprintf(buf,sizeof buf,"EFLR %d|%s",curr_floor,
1120 &floorlist[(int)curr_floor][0]);
1123 printf("%s\n",&buf[4]);
1131 * kill the current floor
1133 void kill_floor(void) {
1134 int floornum_to_delete,a;
1137 if (floorlist[(int)curr_floor][0]==0) load_floorlist();
1139 floornum_to_delete = (-1);
1140 printf("(Press return to abort)\n");
1141 newprompt("Delete which floor? ",buf,255);
1142 if (strlen(buf)==0) return;
1143 for (a=0; a<128; ++a)
1144 if (!strucmp(&floorlist[a][0],buf))
1145 floornum_to_delete = a;
1146 if (floornum_to_delete < 0) {
1147 printf("No such floor. Select one of:\n");
1148 for (a=0; a<128; ++a)
1149 if (floorlist[a][0]!=0)
1150 printf("%s\n",&floorlist[a][0]);
1152 } while (floornum_to_delete < 0);
1153 sprintf(buf,"KFLR %d|1",floornum_to_delete);
1156 printf("%s\n",&buf[4]);