-/* Citadel/UX support routines */
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Client-side support functions.
+ *
+ */
#include "sysdep.h"
#include <stdlib.h>
extern char rc_floor_mode;
extern int rc_ansi_color;
-int struncmp(char *lstr, char *rstr, int len)
-{
- int pos = 0;
- char lc,rc;
- while (pos<len) {
- lc=tolower(lstr[pos]);
- rc=tolower(rstr[pos]);
- if ((lc==0)&&(rc==0)) return(0);
- if (lc<rc) return(-1);
- if (lc>rc) return(1);
- pos=pos+1;
- }
- return(0);
- }
-
-
-
void back(int spaces) /* Destructive backspace */
{
-int a;
+ int a;
for (a=1; a<=spaces; ++a) {
putc(8,stdout); putc(32,stdout); putc(8,stdout);
}
*/
void enter_config(int mode)
{
- int width,height,flags;
+ int width, height, flags, filter;
char buf[128];
sprintf(buf,"GETU");
width = extract_int(&buf[4],0);
height = extract_int(&buf[4],1);
flags = extract_int(&buf[4],2);
+ filter = extract_int(&buf[4],3);
if ((mode==0)||(mode==1)) {
flags = set_attr(flags,
"Enable color support",US_COLOR);
}
+
+ filter = intprompt("Moderation filter level", filter, -63, 63);
+
}
if (mode==2) {
}
}
- sprintf(buf,"SETU %d|%d|%d",width,height,flags);
+ sprintf(buf,"SETU %d|%d|%d|%d",width,height,flags,filter);
serv_puts(buf);
serv_gets(buf);
if (buf[0]!='2') printf("%s\n",&buf[4]);
{
int a,b;
for (a=0; a<strlen(search); ++a)
- { b=struncmp(&search[a],patn,strlen(patn));
+ { b=strncasecmp(&search[a],patn,strlen(patn));
if (b==0) return(b);
}
return(-1);
-/*
- * 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!=1) 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;