-/* Citadel/UX room-oriented routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ *
+ * Client-side functions which perform room operations
+ *
+ */
#include "sysdep.h"
#include <stdlib.h>
#include "rooms.h"
#include "commands.h"
#include "tools.h"
+#include "messages.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
#endif
int yesno(void);
void strprompt(char *prompt, char *str, int len);
void newprompt(char *prompt, char *str, int len);
-int struncmp(char *lstr, char *rstr, int len);
void dotgoto(char *towhere, int display_name);
void serv_read(char *buf, int bytes);
void formout(char *name);
int inkey(void);
int fmout(int width, FILE *fp, char pagin, int height, int starting_lp, char subst);
-void citedit(FILE *fp, long int base_pos);
void progress(long int curr, long int cmax);
int pattern(char *search, char *patn);
int file_checksum(char *filename);
strcpy(rmname, rp->rlname);
f = rp->rlflags;
if ((c + strlen(rmname) + 4) > screenwidth) {
- printf("\n");
+
+ /* line break, check the paginator */
+ pprintf("\n");
c = 1;
}
if (f & QR_MAILBOX) {
else {
color(DIM_WHITE);
}
- printf("%s",rmname);
- if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) printf("} ");
- else if (f & QR_DIRECTORY) printf("] ");
- else if (f & QR_NETWORK) printf(") ");
- else printf("> ");
+ pprintf("%s",rmname);
+ if ((f & QR_DIRECTORY) && (f & QR_NETWORK)) pprintf("} ");
+ else if (f & QR_DIRECTORY) pprintf("] ");
+ else if (f & QR_NETWORK) pprintf(") ");
+ else pprintf("> ");
c = c + strlen(rmname) + 3;
}
c = 1;
for (a=0; a<128; ++a) if ((strlen(floorlist[a])>0)&&(a!=curr_floor)) {
if ((c + strlen(floorlist[a]) + 4) > screenwidth) {
- printf("\n");
+ pprintf("\n");
c = 1;
}
- printf("%s: ",floorlist[a]);
+ pprintf("%s: ",floorlist[a]);
c = c + strlen(floorlist[a]) + 3;
}
}
if (kn_floor_mode == 0) {
color(BRIGHT_CYAN);
- printf("\n Rooms with unread messages:\n");
+ pprintf("\n Rooms with unread messages:\n");
listrms("LKRN");
color(BRIGHT_CYAN);
- printf("\n\n No unseen messages in:\n");
+ pprintf("\n\n No unseen messages in:\n");
listrms("LKRO");
- printf("\n");
+ pprintf("\n");
}
if (kn_floor_mode == 1) {
color(BRIGHT_CYAN);
- printf("\n Rooms with unread messages on %s:\n",
+ pprintf("\n Rooms with unread messages on %s:\n",
floorlist[(int)curr_floor]);
- sprintf(buf,"LKRN %d",curr_floor);
+ sprintf(buf,"LKRN %d", curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
- printf("\n\n Rooms with no new messages on %s:\n",
+ pprintf("\n\n Rooms with no new messages on %s:\n",
floorlist[(int)curr_floor]);
sprintf(buf,"LKRO %d",curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
- printf("\n\n Other floors:\n");
+ pprintf("\n\n Other floors:\n");
list_other_floors();
- printf("\n");
+ pprintf("\n");
}
if (kn_floor_mode == 2) {
for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
color(BRIGHT_CYAN);
- printf("\n Rooms on %s:\n",floorlist[a]);
+ pprintf("\n Rooms on %s:\n",floorlist[a]);
sprintf(buf,"LKRA %d",a);
listrms(buf);
- printf("\n");
+ pprintf("\n");
}
}
void listzrooms(void) { /* list public forgotten rooms */
color(BRIGHT_CYAN);
- printf("\n Forgotten public rooms:\n");
+ pprintf("\n Forgotten public rooms:\n");
listrms("LZRM");
- printf("\n");
+ pprintf("\n");
color(DIM_WHITE);
IFNEXPERT hit_any_key();
}
safestrncpy(floorstr,floorlist[rfloor],sizeof floorstr);
strprompt("Which floor",floorstr,256);
for (a=0; a<128; ++a) {
- if (!strucmp(floorstr,&floorlist[a][0]))
+ if (!strcasecmp(floorstr,&floorlist[a][0]))
newfloor = a;
- if ((newfloor<0)&&(!struncmp(floorstr,
+ if ((newfloor<0)&&(!strncasecmp(floorstr,
&floorlist[a][0],strlen(floorstr))))
newfloor = a;
if ((newfloor<0)&&(pattern(&floorlist[a][0],
/* Ask about the room aide */
do {
strprompt("Room aide (or 'none')",raide,29);
- if (!strucmp(raide,"none")) {
+ if (!strcasecmp(raide,"none")) {
strcpy(raide,"");
strcpy(buf,"200");
}
}
} while(buf[0]!='2');
- if (!strucmp(raide,"none")) strcpy(raide,"");
+ if (!strcasecmp(raide,"none")) strcpy(raide,"");
/* Angels and demons dancing in my head... */
serv_puts("RDIR");
serv_gets(buf);
if (buf[0]!='1') {
- printf("%s\n",&buf[4]);
+ pprintf("%s\n",&buf[4]);
return;
}
extract(comment,&buf[4],0);
extract(flnm,&buf[4],1);
- printf("\nDirectory of %s on %s\n",flnm,comment);
- printf("-----------------------\n");
+ pprintf("\nDirectory of %s on %s\n",flnm,comment);
+ pprintf("-----------------------\n");
while (serv_gets(buf), strcmp(buf,"000")) {
extract(flnm,buf,0);
extract(flsz,buf,1);
extract(comment,buf,2);
if (strlen(flnm)<=14)
- printf("%-14s %8s %s\n",flnm,flsz,comment);
+ pprintf("%-14s %8s %s\n",flnm,flsz,comment);
else
- printf("%s\n%14s %8s %s\n",flnm,"",flsz,comment);
+ pprintf("%s\n%14s %8s %s\n",flnm,"",flsz,comment);
}
}
serv_puts("WHOK");
serv_gets(buf);
if (buf[0]!='1') {
- printf("%s\n",&buf[5]);
+ pprintf("%s\n",&buf[5]);
return;
}
sigcaught = 0;
sttybbs(SB_YES_INTR);
while (serv_gets(buf), strncmp(buf,"000",3)) {
- if (sigcaught==0) printf("%s\n",buf);
+ if (sigcaught==0) pprintf("%s\n",buf);
}
sttybbs(SB_NO_INTR);
}
printf("Entering %s. ",desc);
printf("Press return twice when finished.\n");
fp=fopen(temp,"r+");
- citedit(fp,0);
+ citedit(fp);
fclose(fp);
}
newprompt("Delete which floor? ",buf,255);
if (strlen(buf)==0) return;
for (a=0; a<128; ++a)
- if (!strucmp(&floorlist[a][0],buf))
+ if (!strcasecmp(&floorlist[a][0],buf))
floornum_to_delete = a;
if (floornum_to_delete < 0) {
printf("No such floor. Select one of:\n");