From: brael@yabbs To: all@yabbs Subject: 3733t c0de Date: Sat Aug 6 02:54:08 1994 Bongfilter $Revision: 2.3 $ (C) Copyleft Junya Ho. (of the GNU flavour) This is bongfilter $Revision: 2.3 $. Character substitutions can be made easily by substituting into the table caps[] and lowr[] below - a few substitutions have already been made as a demonstration. There is now an alternate character substitution list which will substitute multicharacter strings for certain characters, e.g., For usage information, type bongfilt without any arguments. The revision log is at the end of the source. (more usage information) - bongfilter can take input from the command line, or it can take info from a pipe, eg: "ls -al | bongfilt -none -alw" - the option -none adds no characters for inverse/underline/bold. - the option -alw always substitutes, and -ran substitutes sometimes. - for your ircII clients, probably the easiest way to incorporate bongfilter is to add an alias: /ALIAS bongf exec -out [path]/bongfilt -irc -ran (or -alw instead of -ran, its up to you) and invoking it by: /bongf text here from within your ircII client. */ #include #include #include #define NOEMU 0 #define IRCEMU 1 #define VT100EMU 2 #define ALWAYS 0 #define RANDOM 1 static char id[]="$Id: bongfilt.c,v 2.3 1994/05/07 21:31:34 hojunya Exp hojunya $"; static char caps[]="ABCD3FGHiJKLMN0PQRSTUVWXYZ"; static char lowr[]="abCd3fghijk1mn0pqrsTuvwxyz"; static char *alt[26]; void init_alt() { register int count; for(count=0;count<26;count++) alt[count]=NULL; { alt['a'-'a']=(char *)strdup("/\\"); alt['d'-'a']=(char *)strdup("/>"); alt['h'-'a']=(char *)strdup("|-|"); alt['k'-'a']=(char *)strdup("/<"); alt['l'-'a']=(char *)strdup("|_"); alt['n'-'a']=(char *)strdup("/\\/"); alt['o'-'a']=(char *)strdup("()"); alt['u'-'a']=(char *)strdup("|_|"); alt['v'-'a']=(char *)strdup("\\/"); alt['w'-'a']=(char *)strdup("\\/\\/"); } } int mangle(char *ch, char from, int freq) { struct timeval tp; gettimncpy(ch, alt[from-'A'], strlen(alt[from-'A'])); return(strlen(alt[from-'A']));} else { strncpy(ch,&caps[from-'A'],1); return(1);} else if (islower(from)) if ((tp.tv_usec%3) && (alt[from-'a'] != NULL) &&(freq==RANDOM)) { strncpy(ch, alt[from-'a'],strlen(alt[from\n"heck_options(int argc, char **argv, int *emu, int *freq) { if (argc < 3) { print_usage(); exit(1);} if (!strcmp(argv[1],"-none")) *emu=NOEMU; else if(!stprint_usage(); exit(1);} if (!strcmp(argv[2],"-ran")) *freq=RANDOM; else if(!strcmp(argv[2],"-alw")) *freq