of other functions, and replaced the old, cumbersome pagination with the
new, easy, API-based one in everything except message output.
+ Revision 570.18 2000/04/10 01:47:22 ajc
+ * More paginator changes. Shuffled code around, added pagination to a bunch
+ of other functions, and replaced the old, cumbersome pagination with the
+ new, easy, API-based one in everything except message output.
+
Revision 570.17 2000/04/09 17:51:18 ajc
* Added pprintf() (paginated version of printf) to the client-side API. Now
any client side function can be paginated simply by changing all of the
Revision 570.17 2000/04/09 17:51:18 ajc
* Added pprintf() (paginated version of printf) to the client-side API. Now
any client side function can be paginated simply by changing all of the
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
+/*
+ * Check to see if we need to pause at the end of a screen.
+ * If we do, we have to disable server keepalives during the pause because
+ * we are probably in the middle of a server operation and the NOOP command
+ * would confuse everything.
+ */
+int checkpagin(int lp, int pagin, int height)
+{
+ if (!pagin) return(0);
+ if (lp>=(height-1)) {
+ set_keepalives(KA_NO);
+ hit_any_key();
+ set_keepalives(KA_YES);
+ return(0);
+ }
+ return(lp);
+ }
+
+
+
+
/*
* pprintf() ... paginated version of printf()
*/
/*
* pprintf() ... paginated version of printf()
*/
char keymenu(char *menuprompt, char *menustring);
void async_ka_start(void);
void async_ka_end(void);
char keymenu(char *menuprompt, char *menustring);
void async_ka_start(void);
void async_ka_end(void);
+int checkpagin(int lp, int pagin, int height);
void pprintf(const char *format, ...);
void pprintf(const char *format, ...);
extern int num_urls;
extern char urls[MAXURLS][256];
extern char rc_url_cmd[256];
extern int num_urls;
extern char urls[MAXURLS][256];
extern char rc_url_cmd[256];
int pattern(char *search, char *patn);
int file_checksum(char *filename);
int nukedir(char *dirname);
int pattern(char *search, char *patn);
int file_checksum(char *filename);
int nukedir(char *dirname);
-int checkpagin(int lp, int pagin, int height);
extern unsigned room_flags;
extern char room_name[];
extern unsigned room_flags;
extern char room_name[];
extern char floorlist[128][256];
extern char floorlist[128][256];
void load_floorlist(void) {
int a;
void load_floorlist(void) {
int a;
if ((c + strlen(rmname) + 4) > screenwidth) {
/* line break, check the paginator */
if ((c + strlen(rmname) + 4) > screenwidth) {
/* line break, check the paginator */
- printf("\n");
- knlinecount = knlinecount + 1;
- knlinecount = checkpagin(knlinecount,
- ((userflags & US_PAGINATOR) ? 1 : 0),
- screenheight);
-
c = 1;
}
if (f & QR_MAILBOX) {
c = 1;
}
if (f & QR_MAILBOX) {
else {
color(DIM_WHITE);
}
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 = 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) {
c = 1;
for (a=0; a<128; ++a) if ((strlen(floorlist[a])>0)&&(a!=curr_floor)) {
if ((c + strlen(floorlist[a]) + 4) > screenwidth) {
- printf("%s: ",floorlist[a]);
+ pprintf("%s: ",floorlist[a]);
c = c + strlen(floorlist[a]) + 3;
}
}
c = c + strlen(floorlist[a]) + 3;
}
}
if (kn_floor_mode == 0) {
color(BRIGHT_CYAN);
if (kn_floor_mode == 0) {
color(BRIGHT_CYAN);
- printf("\n Rooms with unread messages:\n");
- knlinecount = knlinecount + 2;
+ pprintf("\n Rooms with unread messages:\n");
listrms("LKRN");
color(BRIGHT_CYAN);
listrms("LKRN");
color(BRIGHT_CYAN);
- printf("\n\n No unseen messages in:\n");
- knlinecount = knlinecount + 3;
+ pprintf("\n\n No unseen messages in:\n");
- printf("\n");
- knlinecount = knlinecount + 1;
}
if (kn_floor_mode == 1) {
color(BRIGHT_CYAN);
}
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]);
floorlist[(int)curr_floor]);
- knlinecount = knlinecount + 2;
- sprintf(buf,"LKRN %d",curr_floor);
+ sprintf(buf,"LKRN %d", curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
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]);
floorlist[(int)curr_floor]);
- knlinecount = knlinecount + 3;
sprintf(buf,"LKRO %d",curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
sprintf(buf,"LKRO %d",curr_floor);
listrms(buf);
color(BRIGHT_CYAN);
- printf("\n\n Other floors:\n");
- knlinecount = knlinecount + 3;
+ pprintf("\n\n Other floors:\n");
- printf("\n");
- knlinecount = knlinecount + 1;
}
if (kn_floor_mode == 2) {
for (a=0; a<128; ++a) if (floorlist[a][0]!=0) {
color(BRIGHT_CYAN);
}
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]);
- knlinecount = knlinecount + 2;
+ pprintf("\n Rooms on %s:\n",floorlist[a]);
sprintf(buf,"LKRA %d",a);
listrms(buf);
sprintf(buf,"LKRA %d",a);
listrms(buf);
- printf("\n");
- knlinecount = knlinecount + 1;
void listzrooms(void) { /* list public forgotten rooms */
color(BRIGHT_CYAN);
void listzrooms(void) { /* list public forgotten rooms */
color(BRIGHT_CYAN);
- printf("\n Forgotten public rooms:\n");
+ pprintf("\n Forgotten public rooms:\n");
color(DIM_WHITE);
IFNEXPERT hit_any_key();
}
color(DIM_WHITE);
IFNEXPERT hit_any_key();
}
serv_puts("WHOK");
serv_gets(buf);
if (buf[0]!='1') {
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)) {
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);
-/*
- * Check to see if we need to pause at the end of a screen.
- * If we do, we have to disable server keepalives during the pause because
- * we are probably in the middle of a server operation and the NOOP command
- * would confuse everything.
- */
-int checkpagin(int lp, int pagin, int height)
-{
- if (!pagin) return(0);
- if (lp>=(height-1)) {
- set_keepalives(KA_NO);
- hit_any_key();
- set_keepalives(KA_YES);
- return(0);
- }
- return(lp);
- }
-
-
void strproc(char *string)
{
int a;
void strproc(char *string)
{
int a;
void edituser(void);
void interr(int errnum);
int struncmp(char *lstr, char *rstr, int len);
void edituser(void);
void interr(int errnum);
int struncmp(char *lstr, char *rstr, int len);
-int checkpagin(int lp, int pagin, int height);
int pattern(char *search, char *patn);
void enter_config(int mode);
void locate_host(char *hbuf);
int pattern(char *search, char *patn);
void enter_config(int mode);
void locate_host(char *hbuf);
serv_puts("LBIO");
serv_gets(buf);
if (buf[0] != '1') {
serv_puts("LBIO");
serv_gets(buf);
if (buf[0] != '1') {
- printf("%s\n", &buf[4]);
+ pprintf("%s\n", &buf[4]);
return;
}
while (serv_gets(buf), strcmp(buf, "000")) {
if ((pos + strlen(buf) + 5) > screenwidth) {
return;
}
while (serv_gets(buf), strcmp(buf, "000")) {
if ((pos + strlen(buf) + 5) > screenwidth) {
pos = pos + strlen(buf) + 2;
}
pos = pos + strlen(buf) + 2;
}
- printf("%c%c \n\n", 8, 8);
+ pprintf("%c%c \n\n", 8, 8);
do {
newprompt("Read bio for who ('?' for list) : ", who, 25);
do {
newprompt("Read bio for who ('?' for list) : ", who, 25);
if (!strcmp(who, "?"))
list_bio();
} while (!strcmp(who, "?"));
if (!strcmp(who, "?"))
list_bio();
} while (!strcmp(who, "?"));
serv_puts(buf);
serv_gets(buf);
if (buf[0] != '1') {
serv_puts(buf);
serv_gets(buf);
if (buf[0] != '1') {
- printf("%s\n", &buf[4]);
+ pprintf("%s\n", &buf[4]);
return;
}
while (serv_gets(buf), strcmp(buf, "000")) {
return;
}
while (serv_gets(buf), strcmp(buf, "000")) {