$! ------------------ CUT HERE ----------------------- $! $! This archive created by VMS_SHARE Version 7.1-001 26-JUN-1989 $! On 18-AUG-1993 23:08:10.17 By user PAULW $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. ANALYZE.C;78 $! 2. ASYNC.C;43 $! 3. CHANGES.TXT;20 $! 4. COMMAND.C;76 $! 5. CREDITS.TXT;3 $! 6. ENVIRONMENT.H;12 $! 7. HEADER.H;9 $! 8. IRC.C;31 $! 9. IRC.HLP;4 $! 10. MAKE.COM;3 $! 11. MISC.C;15 $! 12. MISC.H;1 $! 13. NUMERIC.H;4 $! 14. READ.ME;9 $! 15. RECALL.C;11 $! 16. UCXDEF.H;1 $! $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ if f$getsyi("version") .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete/nolog 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete/nolog 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name"); buff:=CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(buff)) ;LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(buff));g:=0;LOOP EXITIF MARK(NONE)=END_OF(buff);x:= ERASE_CHARACTER(1);IF g = 0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x= "V" THEN APPEND_LINE;MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF; IF x="+" THEN g:=1;ERASE_LINE;ENDIF;ELSE IF x="-" THEN g:=0;ENDIF;ERASE_LINE; ENDIF;ENDLOOP;p:="`";POSITION(BEGINNING_OF(buff));LOOP r:=SEARCH(p,FORWARD); EXITIF r=0;POSITION(r);ERASE(r);COPY_TEXT(ASCII(INT(ERASE_CHARACTER(3)))); ENDLOOP;o:=GET_INFO(COMMAND_LINE,"output_file");WRITE_FILE(buff,o); ENDPROCEDURE;Unpacker;EXIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create/nolog 'f' X/*************************************************************************** V*** X X X VMS - IRC - Client part ANALYZE X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#include X#include X#include X#include "header.h" X#include "numeric.h" X#include "environment.h" X#include "misc.h" X `032 Xextern qio_send(),putbold(),putchunk(),c$cks(),c$dsc(),stricmp(), X create_status(),notify_request; Xextern time_t last_command; X X/*************************************************************************** V***/ X Xchar *nstrip(char *string) X`123 Xint nicklen; X X nicklen = strcspn(string,"!"); X string`091nicklen`093 = '\0'; X return string; X`125 X Xchar *hstrip(char *string) X`123 Xint nicklen; X X nicklen = strcspn(string,"!"); X return &string`091++nicklen`093; X`125 X X/*************************************************************************** V***/ X Xmark_notify(char *nicks) X`123 Xint i, cnt, flag; Xchar *ilp,*p`09150`093,ol1`091512`093,ol2`091512`093,ol3`091512`093; XNotifyStruct *tmp; X X strcpy(ol1,"Currently present:"); X strcpy(ol2,"Signon detected for:"); X strcpy(ol3,"Signoff detected for:"); X X`009ilp=nicks; X`009for(i=0;i<50;i++) p`091i`093=""; i=0; X`009while (*ilp && (i<50)) `123 X`009 p`091i`093=ilp; X`009 tillspace(ilp); X`009 if (*ilp) *ilp++ ='\0'; X`009 i++; X`009`125 X X for(i=0; i < 50; i++) `123 X`009if (notify_array`091i`093 != NULL) X`009 for(cnt = 0, flag = 0; cnt < 50; cnt++) `123 X`009`009if (!stricmp(notify_array`091i`093,p`091cnt`093)) `123 X`009`009 flag = 1; X`009`009 strcpy(notify_array`091i`093,p`091cnt`093); X`009`009`125 X`009 `125 X X`009tmp = queue_find(notify_list,¬ify_array`091i`093,0); X`009if (tmp == NULL) break; X`009if (strcmp(tmp->nick,notify_array`091i`093)) X`009 strcpy(tmp->nick,notify_array`091i`093); X`009if (tmp->flag == -1) `123 X`009 if (flag == 1) `123 X`009`009strcat(ol1," "); X`009`009strcat(ol1,¬ify_array`091i`093); `125 X`009 tmp->flag = flag; X`009 `125 X else if (tmp->flag == 0 && flag == 1) `123 X`009 strcat(ol2," "); X`009 strcat(ol2,¬ify_array`091i`093); X`009 tmp->flag = flag; X`009 `125 X else if (tmp->flag == 1 && flag == 0) `123 X`009 strcat(ol3," "); X`009 strcat(ol3,¬ify_array`091i`093); X`009 tmp->flag = flag; X`009 `125 X `125 X if (strcmp(ol1,"Currently present:")) putchunk(ol1,TRUE); X if (strcmp(ol2,"Signon detected for:")) putchunk(ol2,TRUE); X if (strcmp(ol3,"Signoff detected for:")) putchunk(ol3,TRUE); X`125 X X X/*************************************************************************** V***/ X Xvoid create_channel(name) Xchar *name; X`123 Xchar tmp`091256`093; Xint i,l,m; X X strcpy(&channel`091channels++`093.name,name); X#ifdef DEBUG X sprintf(tmp,"DEBUG: create_channel(%s)",name); X printf("%s\n",tmp); X#endif X`125 X X/*************************************************************************** V***/ X Xvoid join(chan) Xchar *chan; X`123 XCHANNEL tmpchan; Xint i=0; X X#ifdef DEBUG X char tmp`091256`093; X sprintf(tmp,"DEBUG: join(): %s",chan); printf("%s\n",tmp); X while(i=0); X`125 X X/*************************************************************************** V***/ X Xvoid flush_windows(param) Xint param; X`123 X X msg_refresh(); X`125 X X/*************************************************************************** V***/ X XWINDOW *chan2win(chan) XCHANNEL *chan; X`123 Xint i=0; X X/* while(strcmp(channel`091i`093.name,chan)) i++; */ X return(dispwindow); `032 X`125 X X/*************************************************************************** V***/ X XWINDOW *nrmwin() X`123 Xint i=0; X X/* while(*channel`091i`093.name=='#') i++; */ X return(dispwindow); `032 X`125 X X/*************************************************************************** V***/ X Xanalyze_ctcp(char *nick,char *ctcp) X`123 Xchar ol`091MAXNETLEN`093,*host,tmp`091256`093,*name = &tmp,*user,*txt = &tmp V; Xbool flag = 1; Xtime_t idle; X X ctcp`091strlen(ctcp)-1`093 = '\0'; X if (!strcmp(ctcp,"\001VERSION")) `123 X`009sprintf(ol, "NOTICE %s :\001VERSION VMS IRC Client %s\001\n",nick,VMSVER VSION); X `125 X else if (!strncmp(ctcp,"\001ACTION",7)) `123 X`009sprintf(ol, "*** Action: %s %s",nick, &ctcp`0918`093); X`009putchunk(ol,TRUE); flag = 0; X `125 X else if (!strcmp(ctcp,"\001FUCK_YOU")) `123 X`009sprintf(ol, "NOTICE %s :\001FUCK_YOU No you dipshit.. FUCK YOU!!@#\001\n V", nick); X `125 X else if (!strcmp(ctcp,"\001CLIENTINFO")) `123 X`009sprintf(ol, "NOTICE %s :\001CLIENTINFO ACTION CLIENTINFO ECHO ERRMSG FIN VGER PING TIME USERINFO VERSION\001\n",nick); X `125 X else if ((!strncmp(ctcp,"\001ERRMSG",7)) `124`124 (!strncmp(ctcp,"\001EC VHO",5)) `124`124 X`009 (!strncmp(ctcp,"\001PING",5))) `123 X`009sprintf(ol, "NOTICE %s :%s\001\n",nick,ctcp); X `125 X else if (!strcmp(ctcp,"\001USERINFO")) `123 X`009sprintf(ol, "NOTICE %s :\001USERINFO Huh? Who wants to know?\001\n", nic Vk); X `125 X else if (!strcmp(ctcp,"\001TIME")) `123 X`009idle = time(0); txt = ctime(&idle); txt`09124`093 = '\0'; X`009sprintf(ol, "NOTICE %s :\001TIME %s\001\n", nick,txt); X `125 X else if (!strcmp(ctcp,"\001FINGER")) `123 X#ifdef MULTINET X`009host = getenv("MULTINET_HOST_NAME"); X#elif UCX X`009host = getenv("UCX$INET_HOST"); X#elif CMU X`009host = getenv("INTERNET_HOST_NAME"); X#else X`009host = 0; X#endif X`009user = getenv("USER"); strcpy(name,get_uaf_entry()); X`009idle = time(0) - last_command; X`009if (host) X`009 sprintf(ol,"NOTICE %s :\001FINGER %s (%s@%s) Idle %d seconds\001\n", X`009`009nick,name,user,host,idle); X`009else X`009 sprintf(ol,"NOTICE %s :\001FINGER %s (%s) Idle %d seconds\001\n", X`009`009nick,name,user,idle); X `125 X else return; X if (flag) qio_send(ol); X`125 X X/*************************************************************************** V***/ X Xchar *analyze_time() X`123 Xchar tim`091`093="17-NOV-1858 00:00:00.00",t`09120`093; Xint tim_len; X X if (away_flag) `123 X`009c$cks(sys$asctim(&tim_len,c$dsc(tim),NIL,NIL)); tim`09117`093='\0'; X`009sprintf(t,"`091%s`093 ",&tim`09112`093); X `125 else t`0910`093='\0'; X return(t); X`125 X X/*************************************************************************** V***/ X Xanalyze_privmsg(nickname) Xchar *nickname; X`123 Xchar t`091256`093="\0",ol`091256`093; Xint i=0,j; X X i=0; X while (strcmp(nickname,prvrec`091i`093) && i0) `123 X`009switch(num) `123 X`009 case RPL_WELCOME: X`009 case RPL_YOURHOST: X`009 case RPL_CREATED: sprintf(ol,"*** %s",p`0913`093); putchunk(ol,FALSE V); X`009`009break; X`009 case RPL_MYINFO: X`009`009sprintf(ol,"*** Your host is %s, running version %s",p`0913`093,p`09 V14`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_TRACELINK: X`009`009sprintf(ol,"*** Link %s<%s> ==> %s",p`0910`093,p`0914`093,p`0915`093 V); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_TRACECONNECTING: X`009 case RPL_TRACEHANDSHAKE: X `009 case RPL_TRACEUNKNOWN: X`009 case RPL_TRACEOPERATOR: X`009 case RPL_TRACEUSER: X `009 case RPL_TRACESERVICE: X`009`009sprintf(ol,"*** %s Class`091%2s`093 ==> %s",p`0913`093,p`0914`093,p` V0915`093); X`009`009putchunk(ol,FALSE); break; X `009 case RPL_TRACESERVER: X`009`009sprintf(ol,"*** %s Class`091%2s`093 ==> %s %s %s",p`0913`093,p`0914` V093,p`0917`093, X`009`009 p`0915`093,p`0916`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_TRACECLASS: X`009`009sprintf(ol,"*** %s %6s Entries linked %s",p`0913`093,p`0914`093,p`09 V15`093); X`009`009putchunk(ol,FALSE); break; X `009 case RPL_STATSLINKINFO: X`009`009if (strlen(p`0913`093) > 19) p`0913`093`09120`093='\0'; X`009`009if (strlen(p`0919`093) > 19) p`0919`093`09120`093='\0'; X`009`009sprintf(ol,"%20s %3s %7s %9s %7s %8s %s",p`0913`093,p`0914`093,p`091 V5`093, X`009`009 p`0916`093,p`0917`093,p`0918`093,p`0919`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_STATSCOMMANDS: X`009`009sprintf(ol,"*** Command %8s: %10s %12s %12s",p`0913`093,p`0914`093, X`009`009 p`0915`093,p`0916`093,p`0917`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_STATSCLINE: X `009 case RPL_STATSNLINE: X `009 case RPL_STATSILINE: X `009 case RPL_STATSKLINE: X`009 case RPL_STATSQLINE: X`009 case RPL_STATSYLINE: X `009 case RPL_STATSLLINE: X `009 case RPL_STATSOLINE: X `009 case RPL_STATSHLINE: X`009`009sprintf(ol,"STATS: %s %s %s %s %s %s %s %s",p`0913`093,p`0914`093,p` V0915`093, X`009`009 p`0916`093,p`0917`093,p`0918`093,p`0919`093,p`09110`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_STATSUPTIME: sprintf(ol,"%s: %s",p`0910`093,p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_ENDOFSTATS: X`009`009break; X`009 case RPL_UMODEIS: X`009`009sprintf(ol,"*** Your user mode is set %s",analyze_mode(p`0913`093,0) V); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_SERVICEINFO: X`009`009sprintf(ol,"*** Service %s (%s)",p`0913`093,p`0912`093); X`009`009putchunk(ol,FALSE); break; X `009 case RPL_ENDOFSERVICES: X`009`009break; X`009 case RPL_LUSERME: X`009 case RPL_LUSERCLIENT: sprintf(ol,"*** %s",p`0913`093); putchunk(ol,F VALSE); X`009`009break; X`009 case RPL_LUSERUNKNOWN: X`009 case RPL_LUSEROP: sprintf(ol,"*** There are %s %s",p`0913`093,p`0914 V`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_LUSERCHANNELS: X`009`009sprintf(ol,"*** There have been %s %s",p`0913`093,p`0914`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_ADMINME: X`009 case RPL_ADMINLOC1: X`009 case RPL_ADMINLOC2: X`009 case RPL_ADMINEMAIL: X`009`009sprintf(ol,"*** %s",p`0913`093); putchunk(ol,FALSE); X`009`009break; X`009 case RPL_TRACELOG: X`009`009sprintf(ol,"*** %s %s",p`0910`093,p`0913`093); putchunk(ol,TRUE); X`009 case RPL_NONE: break; X `009 case RPL_AWAY: X`009`009if(!*p`0914`093) p`0914`093="No message (strange)"; X`009`009sprintf(ol,"*** %s is away: \042%s\042",p`0913`093,p`0914`093); X `009putchunk(ol,FALSE); break; X`009 case RPL_USERHOST: X`009`009tmp = p`0913`093; X`009`009if (*tmp) `123 X`009`009 while (*tmp != "+") tmp++; X`009`009 *--tmp = '\0'; *++tmp = '\0'; X`009`009 sprintf(ol,"*** %s is %s",p`0913`093,++tmp); X`009`009 putchunk(ol,TRUE); X`009`009`125 break; X`009 case RPL_UNAWAY: X`009 case RPL_NOWAWAY: X`009`009sprintf(ol,"*** %s",p`0913`093); putchunk(ol,TRUE); break; X `009 case RPL_WHOISUSER: X`009`009sprintf(ol,"*** %s is %s@%s (%s)",p`0913`093,p`0914`093,p`0915`093,p V`0917`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_WHOISSERVER: X`009`009if (*p`0913`093=='*' && *p`0914`093=='*') X`009`009 sprintf(ol,"*** On IRC via unknown server (server name removed b Vy gateway)"); X`009`009else if (*p`0915`093) X`009`009 sprintf(ol,"*** On IRC via server %s (%s)",p`0914`093,p`0915`093 V); X`009`009else X`009`009 sprintf(ol,"*** On IRC via server %s (%s)",p`0913`093,p`0914`093 V); X `009`009putchunk(ol,FALSE); break; X`009 case RPL_WHOISOPERATOR: X`009`009sprintf(ol,"*** %s has a connection to the twilight zone",p`0913`093 V); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_WHOWASUSER: X`009`009if (*p`0916`093=='*') p`0916`093="*PRIVATE*"; X`009`009if (*p`0916`093=='+') `123 strcpy(p6,p`0916`093); strcat(p`0916`093= Vp6,"+"); `125 X`009`009if (*p`0916`093=='#') `123 strcpy(p6,p`0916`093); strcat(p`0916`093= Vp6,"#"); `125 X`009`009sprintf(ol,"*** %s was %s@%s (%s) on channel %s",p`0913`093,p`0914`0 V93, X`009`009 p`0915`093,p`0917`093,p`0916`093); X`009`009putchunk(ol,FALSE); break; X `009 case RPL_WHOISIDLE: X`009`009sscanf(p`0914`093,"%d",&cnt); i = cnt/60; num = cnt%60; X`009`009sprintf(ol,"*** %s has been idle for %d minutes and %d seconds", X`009`009`009p`0913`093,i,num); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_ENDOFWHO: X`009`009whoop=0; break; X`009 case RPL_WHOISCHANNELS: X`009`009sprintf(ol,"*** %s is on channels %s",p`0913`093,p`0914`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_WHOISCHANOP: X`009`009sprintf(ol,"*** %s has been touched by magic forces",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_LISTSTART: X`009`009putchunk("*** Channel: Users Topic",FALSE); break; X `009 case RPL_LIST: X`009`009if (p`0913`093`0910`093=='*') p`0916`093=" Private:"; X`009`009else `123 X`009`009 strcpy(p`0916`093=p6,p`0913`093); X`009`009 if (strlen(p`0916`093)>10) `123 p`0916`093`09110`093='*'; p`0916 V`093`09111`093='\0'; `125 X`009`009 else strcat(p`0916`093,":"); X`009`009`125 X`009`009sprintf(ol,"*** %11s %5s %s",p`0916`093,p`0914`093,p`0915`093); X `009`009putchunk(ol,FALSE); break; X`009 case RPL_LISTEND: X`009`009break; X`009 case RPL_CHANNELMODEIS: X`009`009sprintf(ol,"*** Mode is set %s %s%s%s",analyze_mode(p`0914`093),*p`0 V915`093?"(max.users ":"",p`0915`093,*p`0915`093?")":""); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_NOTOPIC: X`009`009if ((!*srvnam `124`124 !strcmp(p`0910`093,srvnam)) && X`009`009 (strcmp(p`0913`093,"Bad Craziness"))) X`009`009putchunk("*** No Topic is set.",TRUE); X`009`009break; X`009 case RPL_TOPIC: X`009`009if (!*srvnam `124`124 !strcmp(p`0910`093,srvnam) `124`124 dbopt&0x10 V) `123 X`009`009 if (*p`0914`093) X`009`009`009sprintf(ol,"*** Topic on channel %s is %s",p`0913`093,p`0914`093 V); X`009`009 else X`009`009`009sprintf(ol,"*** Topic is %s",p`0913`093); X`009`009 putchunk(ol,TRUE); X`009`009`125 break; X`009 case RPL_INVITING: X`009`009sprintf(ol,"*** Inviting user %s into channel %s",p`0913`093,p`0914` V093); X`009`009putchunk(ol,TRUE); break; X`009 case RPL_SUMMONING: X`009`009sprintf(ol,"*** %s %s",p`0913`093,p`0914`093); putchunk(ol,TRUE); br Veak; X`009 case RPL_VERSION: X`009`009sprintf(ol,"*** Server %s runs IRC version %s",p`0914`093,p`0913`093 V); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_WHOREPLY: /* ===WHO,WHOOP,WHOP,WHOX=== */ X`009`009if (!strcmp(p`0913`093,"Channel") && !strcmp(p`0914`093,"User")) `12 V3 X`009`009 strcpy(t,"Channel Nickname S User@Host "); X`009`009 switch(whoop) `123 X`009`009`009case 0: sprintf(ol,"%sName",t); break; X`009`009`009case 1: sprintf(ol,"%sName (Operators only)",t); break; X`009`009`009case 2: sprintf(ol,"%sServer",t); break; X`009`009`009case 3: sprintf(ol,"%sName (pattern=%s)",t,whoinp); break; X `009`009case 4: sprintf(ol,"%sName (exclude=%s)",t,whoinp); brea Vk; X`009`009`009case 5: sprintf(ol,"%sName (Sleeping users only)",t); break; X`009`009 `125 X`009`009 putchunk(ol,FALSE); X`009`009`125 else `123 X`009`009 switch(*p`0913`093) `123 X`009`009`009case '0': if (strcmp(p`0913`093,"0")) `123 X`009`009`009 strcpy(p`0910`093=p0,p`0913`093); X`009`009`009 if (strlen(p`0910`093)>7) `123 p`0910`093`0917`093='*'; p`09 V10`093`0918`093='\0'; `125 X`009`009`009 else strcat(p`0910`093,":"); X`009`009`009 break; `125 X`009`009`009case '*': p`0910`093="Private:"; break; X`009`009`009default: strcpy(p`0910`093=p0,p`0913`093); X`009`009`009 if (strlen(p`0910`093)>7) `123 p`0910`093`0917`093='*'; p`09 V10`093`0918`093='\0'; `125 X`009`009`009 else strcat(p`0910`093,":\0"); X`009`009 `125 X`009`009 switch(whoop) `123 X`009`009`009case 0: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0919`093); X`009`009`009 putchunk(ol,FALSE); break; X`009`009`009case 1: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0919`093); X`009`009`009 if ((p`0918`093`0911`093==whoinp`0910`093 `124`124 p`0918`09 V3`0911`093==whoinp`0911`093 `124`124 X`009`009`009 p`0918`093`0912`093==whoinp`0910`093 `124`124 p`0918`093`0 V912`093==whoinp`0911`093) && p`0918`093`0911`093) X`009`009`009`009putchunk(ol,FALSE); break; X`009`009`009case 2: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0916`093); X`009`009`009 putchunk(ol,FALSE); break; X`009`009`009case 3: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0919`093); X`009`009`009 tmp = &t; X`009`009`009 sprintf(tmp,"%s %s",ol,p`0916`093); X`009`009`009 if (strimw(&whoinp,tmp)) putchunk(ol,FALSE); X`009`009`009 c$cks(1); break; X`009`009`009case 4: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0919`093); X`009`009`009 tmp = &t; X`009`009`009 sprintf(tmp,"%s %s",ol,p`0916`093); X`009`009`009 if (!strimw(&whoinp,tmp)) putchunk(ol,FALSE); X`009`009`009 c$cks(1); break; X`009`009`009case 5: sprintf(ol,"%8s %-10s%-4s%s@%s (%s)",p`0910`093,p`0917`0 V93,p`0918`093,p`0914`093,p`0915`093,p`0919`093); X`009`009`009 if (*p`0918`093=='G') putchunk(ol,FALSE); break; X`009`009 `125 X`009`009`125 break; X`009 case RPL_KILLDONE: X`009`009if (!*srvnam `124`124 !strcmp(p`0910`093,srvnam) `124`124 dbopt&0x10 V) `123 X`009`009 sprintf(ol,"*** Kill: May the soul of %s rest in peace...",p`091 V3`093); X`009`009 putchunk(ol,TRUE); X`009`009`125 break; X`009 case RPL_CLOSING: X`009 case RPL_CLOSEEND: X`009`009sprintf(ol,"*** %s %s",p`0913`093,p`0914`093); putchunk(ol,TRUE); br Veak; X`009 case RPL_LINKS: X`009`009sprintf(ol,"*** Server: %s (%s)",p`0913`093,p`0914`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_NAMREPLY: X`009`009if (*p`0913`093=='*') p`0916`093="Private:"; X`009`009else `123 X`009`009 strcpy(p`0916`093=p6,p`0914`093); X`009`009 if (strlen(p`0916`093)>7) `123 p`0916`093`0917`093='*'; p`0916`0 V93`0918`093='\0'; `125 X`009`009 else strcat(p`0916`093,":"); X`009`009`125 X`009`009sprintf(ol,"%8s %s",p`0916`093,p`0915`093); X`009`009putchunk(ol,FALSE); break; X `009 case RPL_ENDOFLINKS: X`009`009break; X`009 case RPL_ENDOFNAMES: X`009`009break; X`009 case RPL_INFOSTART: X`009 case RPL_INFO: X`009 case RPL_ENDOFINFO: X`009 case RPL_MOTDSTART: X`009 case RPL_ENDOFMOTD: X`009`009sprintf(ol,"*** %s",p`0913`093); putchunk(ol,FALSE); break; X`009 case RPL_MOTD: X`009`009sprintf(ol,"*** Motd: %s",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_YOUREOPER: X`009`009your_priv=TRUE; X`009`009sprintf(ol,"*** Good afternoon, %s. I am a VAX 9440VP running VMS 6. V0-1",p`0912`093); X`009`009putchunk(ol,TRUE); break; X`009 case RPL_REHASHING: X`009`009putchunk("*** Re-reading irc.conf - file... Hope it works nice now.. V.",FALSE); break; X`009 case RPL_TIME: X`009`009sprintf(ol,"*** Time on host %s is %s",p`0913`093,p`0914`093); X`009`009putchunk(ol,FALSE); break; X`009 case RPL_USERSSTART: X`009 case RPL_USERS: X`009 case RPL_ENDOFUSERS: X`009 case RPL_NOUSERS: X`009`009sprintf(ol,"*** %s",p`0913`093); putchunk(ol,TRUE); break; X`009 case ERR_NOSUCHNICK: X`009`009sprintf(ol,"*** Error: No such nickname (%s)",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_NOSUCHSERVER: X`009`009sprintf(ol,"*** Error: No such server (%s)",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_NOSUCHCHANNEL: X`009`009if (stricmp(p`0913`093,my_nick)) `123 X`009`009 sprintf(ol,"*** Error: No such channel (%s)",p`0913`093); X`009`009 putchunk(ol,FALSE); `125 X`009`009break; X`009 case ERR_CANNOTSENDTOCHAN: X`009`009putchunk("*** Error: Sending to that channel is forbidden from heath Vens.",FALSE); break; X`009 case ERR_NORECIPIENT: X`009`009putchunk("*** Error: Message had no recipient.",FALSE); break; X`009 case ERR_NOTEXTTOSEND: X`009`009putchunk("*** Error: No text to send, so empty message not sent.",FA VLSE); break; X`009 case ERR_UNKNOWNCOMMAND: X`009`009sprintf(ol,"*** Error `091%s`093: Unknown command (%s)",p`0910`093,p V`0913`093); putchunk(ol,FALSE); X`009`009break; X`009 case ERR_NOMOTD: putchunk(p`0913`093,TRUE); break; X`009 case ERR_NONICKNAMEGIVEN: X`009`009strncpy(my_nick,p`0912`093,MAXNICKLEN-1); my_nick`091MAXNICKLEN-1`09 V3='\0'; X`009`009create_status(); X`009`009putchunk("*** Error: No nickname given. Please choose one.",FALSE); V break; X`009 case ERR_ERRONEUSNICKNAME: X`009`009strncpy(my_nick,p`0912`093,MAXNICKLEN-1); my_nick`091MAXNICKLEN-1`09 V3='\0'; create_status(); X`009`009putchunk("*** Error: Some special characters cannot be used in nickn Vames.",FALSE); break; X`009 case ERR_NICKNAMEINUSE: X`009`009strncpy(my_nick,p`0912`093,MAXNICKLEN-1); my_nick`091MAXNICKLEN-1`09 V3='\0'; create_status(); X`009`009sprintf(ol,"*** Error: Nickname (%s) is already in use. Please choos Ve another.",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_USERNOTINCHANNEL: X`009`009if (!*srvnam `124`124 !strcmp(p`0910`093,srvnam) `124`124 dbopt&0x10 V) X`009`009putchunk("*** Error: You have not joined a channel!",FALSE); break; X`009 case ERR_NOTONCHANNEL: X`009`009sprintf(ol,"*** Error: %s",p`0914`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_SUMMONDISABLED: X`009 case ERR_USERSDISABLED: putchunk(p`0913`093,TRUE); break; X`009 case ERR_NOTREGISTERED: X`009`009putchunk("*** Error: You haven't registered yourself yet. Missing NI VCK,USER ?",FALSE); break; X`009 case ERR_NEEDMOREPARAMS: X`009`009sprintf(ol,"*** Error: %s",*p`0913`093?p`0913`093:"The command needs V more paramters..."); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_ALREADYREGISTRED: X`009`009putchunk("*** Error: You're already registered... Do you have any id Ventity problems?",FALSE); break; X`009 case ERR_NOPERMFORHOST: X`009`009putchunk("*** Error: Your host isn't among the privileged. You've lo Vst...",FALSE); break; X`009 case ERR_PASSWDMISMATCH: X`009`009putchunk("*** Error: Only real wizards do know the spells to open th Ve gates of paradise!",FALSE); break; X`009 case ERR_YOUREBANNEDCREEP: X`009`009putchunk("*** You're banned from IRC... No chance!",TRUE); break; X`009 case ERR_YOUWILLBEBANNED: X`009`009sprintf(ol,"*** Warning: You will be banned in %d minutes! *hehe*",a Vtoi(p`0913`093)); X`009`009putchunk(ol,TRUE); break; X`009 case ERR_CHANNELISFULL: X`009`009sprintf(ol,"*** Error: Sorry... Channel %s is full.",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_UNKNOWNMODE: X`009`009sprintf(ol,"*** Error: %s is unknown mode char to me... What do you V want ?",p`0913`093); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_INVITEONLYCHAN: X`009`009putchunk("*** Error: Magic locks open only with an invitation key... V",FALSE); break; X`009 case ERR_NOPRIVILEGES: X`009`009sprintf(ol,"*** Error: %s",*p`0913`093?p`0913`093:"Only few and chos Ven are granted privileges. You're not one!"); X`009`009putchunk(ol,FALSE); break; X`009 case ERR_NOOPERHOST: X`009`009putchunk("*** Error: Only few of mere mortals may try to enter twili Vght zone...",FALSE); break; X`009 case 318: X`009`009break; X`009 case 303: X`009`009if (notify_request) `123 X`009`009 notify_request = FALSE; X`009`009 mark_notify(p`0913`093); X`009`009 return; X`009`009`125 X`009 default: X`009`009sprintf(ol,"*** Numeric message: (%d) %s %s %s %s %s %s %s",num,p`09 V13`093,p`0914`093,p`0915`093,p`0917`093,p`0916`093,p`0918`093,p`0919`093); X`009`009putchunk(ol,TRUE); X`009`125 X`009if (signalmode&4) `123 printf("\007\007"); wrefresh(inpwin); `125 X `125 else X X /*------------------------------------------------------------------------ V--*/ X X if (!strcmp(p`0910`093,"ERROR") && !flag) `123 /* === ERROR === V */ X`009sprintf(ol,"*** Server error message: %s",p`0911`093); X`009putchunk(ol,FALSE); X`009if (signalmode&4) `123 printf("\007\007"); wrefresh(inpwin); `125 X `125 else X if (!strcmp(p`0910`093,"NOTICE") && !flag) `123 /* === NOTICE === V */ X`009if (notice_flag && !strncmp(p`0912`093,"*** Notice -- Received KILL",27) V) `123 X`009 para=p`0912`093+40; tmp=t; para2=t2; X`009 while (*para!=' ' && *para!=':' && *para!='.') *tmp++ = *para++; X`009 *tmp++ =' '; while (*para && *para!='(') para++; X`009 para--; if (*para==' ') para--; X`009 while (*para!='!' && *para!=' ') para--; para++; X`009 while (*para && *para!='(') `123 X`009`009if (*para!=' ') *para2++ = *para; para++; `125 X`009 while (*para) *tmp++ = *para++; *tmp='\0'; *para2='\0'; X`009 sprintf(ol,"*** Kill message from %s for %s",t2,t); X`009`009putchunk(ol,FALSE); X`009`125 else putchunk(p`0912`093,FALSE); X`009if (signalmode&4) `123 printf("\007\007"); wrefresh(inpwin); `125 X `125 else X`009if (!strcmp(p`0910`093,"PING") && !flag) `123 /* === PING === * V/ X`009sprintf(ol,"PONG %s\n\0",p`0911`093); X`009qio_send(ol); X `125 else X if (!strcmp(p`0910`093,"PONG")) `123 /* === PONG === * V/ X`009sprintf(ol,"*** %s answered your PING message for %s",p`0911`093,p`0912` V093); X`009putchunk(ol,FALSE); X `125 else `123 X X /*------------------------------------------------------------------------ V--*/ X X`009if (ignore_max) `123 X`009 ignore_flag=FALSE; wall_flag=FALSE; X`009 for(cnt=0; cnt X#include X#include X#include X#include X#include X#include "header.h" X#include "environment.h" X#include "misc.h" X Xextern analyzeout(),c$cks(),c$dsc(),putbold(),putchunk(),putwin(),qio_send() V, X recall_move(),recall_output(),rundown(),strincmp(),create_status(), X msg_refresh(),notify_request; X Xextern time_t last_command; X Xextern do_noecho(),do_default(),do_big(),do_cls(),do_oper(),do_ctcp(), X do_cmdch(),do_debug(),do_enter(),do_errlog(),do_privmsg(),do_dcl(), X do_help(),do_ignore(),do_join(),do_loadfont(),do_log(),do_quit(), X do_chunk(),do_msg(),do_nokill(),do_query(),do_quote(),do_clock(), X do_type(),do_leave(),do_who(),do_script(),do_fkey(),do_recall(), X do_nobold(),do_flags(),do_nick(),do_brdcst(),do_cd(),do_showesc(), X do_time(),do_flush(),do_comment(),do_copyright(),do_alias(),do_kill() V, X do_server(),do_srvinfo(),do_mode(),do_spawn(),do_away(),do_topic(), X do_signal(),do_redirect(),do_status(),do_inpscroll(),do_notify(), X do_squit(); X X `032 Xglobaldef struct Message msgtab`091`093 = `123 X X `123"admin", do_noecho,0,1, "ADMIN `091server`093 Show V administrative info"`125, X `123"alias",`009do_alias,0,0, "ALIAS Alias a comm Vand"`125, X `123"authors", do_copyright,0,0, "AUTHORS Displays co Vpyright message"`125, X `123"away", do_away,1,1, "AWAY `091text`093 `091R Ve`093Set away message"`125, X `123"big", do_big,0,0, "BIG <*`124nick> Send mes Vsage in big letters"`125, X `123"bold", do_nobold,0,0, "BOLD Toggle bold V text display"`125, X `123"broadcast", do_brdcst,0,0, "BROADCAST Toggle broa Vdcast window"`125, X `123"bye", do_quit,0,1, "BYE Exit IRC"`1 V25, X `123"channel", do_join,0,0, "CHANNEL Enter chann Vel"`125, X `123"cd", do_cd,0,0, "CD `091directory`124?`093 Ch Vange working directory"`125, X `123"cls", do_cls,0,0, "CLS Clear scree Vn"`125, X `123"clock", do_clock,1,0, "CLOCK Display/Rem Vove clock (what else ?)"`125, X `123"cmdch", do_cmdch,0,0, "CMDCH Change comm Vand character"`125, X `123"connect", do_default,0,1, "CONNECT Add link to V remote server (+)"`125, X `123"comment", do_comment,0,0, "COMMENT `091text`093 Comme Vnt on screen/in logfile"`125, X `123"ctcp",`009do_ctcp,0,1,`009 "CTCP `009 Client To V Client Protocol"`125, X `123"date", do_time,1,1, "DATE `091server`093 Show V local time for server"`125, X `123"dcl", do_dcl,0,0, "DCL `091command`093 Send V DCL command"`125, X `123"debug", do_debug,0,0,NIL`125, X `123"die", do_default,0,0, "DIE Shutdown ow Vn server"`125, X `123"enter", do_enter,0,0, "ENTER `091text`093 Enter V channel and print text"`125, X `123"errlog", do_errlog,0,0, "ERRLOG Enable/disa Vble error logging"`125, X `123"error", do_default,0,1, "ERROR `091text`093 Send V error message to server"`125, X `123"exit", do_quit,0,1, "EXIT Exit IRC"`1 V25, X `123"fkey", do_fkey,0,0, "FKEY `091text`093 De Vfine function key"`125, X `123NIL, NIL,0,0, " `091Keypad V 0..9, GOLD a..z`093"`125, X `123"flags", do_flags,0,0, "FLAGS Show client V settings"`125, X `123"flush", do_flush,0,0, "FLUSH Flush incom Ving messages"`125, X `123"grph", do_privmsg,1,1, "GRPH Private mes Vsage"`125, X `123"help", do_help,0,0, "HELP Surprise!"` V125, X `123"here", do_away,2,1, "HERE Reset away V message"`125, X `123"invite", do_default,0,1, "INVITE `091channel`093 Invit Ve someone to a channel"`125, X `123"info", do_noecho,0,1, "INFO Inventor's V info"`125, X `123"inpscroll", do_inpscroll,0,0,NIL`125, X `123"ignore", do_ignore,0,0, "IGNORE `091nick`124WALL`124?`093 V Ignore someones messages"`125, X `123"join", do_join,0,0, "JOIN Enter chann Vel"`125, X `123"kick", do_mode,1,0, "KICK Kick somebo Vdy from channel"`125, X `123"kill", do_kill,0,0, "KILL Kill someon Ve (+)"`125, X `123"list", do_default,0,1, "LIST List channe Vl topics"`125, X `123"leave", do_leave,0,0, "LEAVE `091time`124?`093 Se Vt alarm clock"`125, X `123"links", do_default,0,1, "LINKS `091server`093 List V connected servers"`125, X `123"loadfont", do_loadfont,0,0, "LOADFONT Load a BIG V font"`125, X `123"log", do_log,0,0, "LOG `091RECALL`093 `091filename`093 V Start/stop logfile"`125, X `123"lusers", do_noecho,0,1, "LUSERS Summarize u Vser info"`125, X `123"m", do_privmsg,3,1, "M Private mes Vsage"`125, X `123"me",`009do_ctcp,1,1,`009 "ME Sends a ctcp ac Vtion"`125, X `123"mirror", do_chunk,2,1, "MIRROR <*`124nick> Send mir Vrored text"`125, X `123"mode", do_mode,2,0, "MODE `091chan`124?`093 `091param`093 V Set mode of named chan"`125, X `123"motd", do_noecho,0,1, "MOTD `091server`093 Show V motto of the day"`125, X `123"msg", do_privmsg,3,1, "MSG Private mes Vsage"`125, X `123"names", do_noecho,0,1, "NAMES Show users' V nicknames"`125, X `123"nick", do_nick,0,1, "NICK Change your V nickname"`125, X `123"nokill", do_nokill,0,0, "NOKILL Suppress fu Vll kill messages"`125, X `123"note",`009do_default,0,1, "NOTE Use NOTE, no V help available"`125, X `123"notice", do_privmsg,2,1, "NOTICE Private mes Vsage"`125, X `123"notify",`009do_notify,1,0, "NOTIFY `091+`124-`093 Ad Vd/remove users from NOTIFY list"`125, X `123"oper", do_oper,0,1, "OPER Become oper Vator"`125, X `123"oops", do_redirect,2,0, "OOPS `091text`093 Redir Vect message and excuse"`125, X `123"part", do_join,1,1, "PART Leave a cha Vnnel"`125, X `123NIL, NIL,0,0, "(*) PASS Enter serve Vr password"`125, X `123"ping", do_ctcp,2,1, "PING Check time V for a CTCP reply"`125, X `123"privmsg", do_privmsg,3,1, "PRIVMSG Private mes Vsage"`125, X `123"query", do_query,0,0, "QUERY `091nick(s)`124?`093 `091text`0 V93 Set prefix for private messages"`125, X `123"quit", do_quit,0,1, "QUIT Exit IRC"`1 V25, X `123"quote", do_quote,0,1, "QUOTE Pass string V directly to server"`125, X `123"recall", do_recall,0,0, "RECALL `091DCL`124MSG`093 Re Vcall message to input line"`125, X `123"redirect", do_redirect,1,0, "REDIRECT Redirect me Vssage"`125, X `123"rehash", do_default,0,1, "REHASH Reconfigure V server (+)"`125, X `123"remirror", do_recall,2,0, "REMIRROR Show recent V messages mirrored"`125, X `123"rerot13", do_recall,1,0, "REROT13 Show recent V messages rot13'ed"`125, X `123"restart", do_default,0,0, "RESTART Restart ser Vver"`125, X `123"rot13", do_chunk,1,1, "ROT13 <*`124nick> Send mes Vsage rot13'ed"`125, X `123"stats", do_default,0,1, "STATS `091mode`093 `091server`093 V Show server statistics"`125, X `123NIL, NIL,0,0, " `091M: cmds V, L: links, C: config`093"`125, X `123"say", do_msg,0,1, "SAY Send messag Ve"`125, X `123"script", do_script,0,0, "SCRIPT Execute scr Viptfile"`125, X `123"server", do_server,0,0, "SERVER `091port`093 Conne Vct to another server"`125, X `123"showesc", do_showesc,0,0, "SHOWESC Display/Int Verpret escape chars"`125, X `123"signal", do_signal,0,0, "SIGNAL `091`124?`093 Si Vgnal messages"`125, X `123NIL, NIL,0,0, " `091NONE`12 V4PRIV`124MSG`124MOD`124ALL`093"`125, X `123"spawn", do_spawn,0,0, "SPAWN Shell escap Ve"`125, X `123"squit", do_squit,0,0, "SQUIT Remove link V to server (+)"`125, X `123"srvinfo", do_srvinfo,0,0, "SRVINFO `091server`093 Give V information about server"`125, X `123"status", do_status,0,0, "STATUS Toggle stat Vus line display"`125, X `123"summon", do_default,0,1, "SUMMON @ Invite user V to IRC"`125, X `123"time", do_time,2,1, "TIME `091server`093 Show V local time for server"`125, X `123"topic", do_topic,0,1, "TOPIC `091topic`093 Set/Sho Vw topic of channel"`125, X `123"trace", do_default,0,1, "TRACE `091server`093 Show V active links (+)"`125, X `123"type", do_type,0,0, "TYPE <*`124nick> Send fil Ve as messages"`125, X `123"users", do_default,0,1, "USERS `091server`093 Show V interactive users on server"`125, X `123"version", do_default,0,1, "VERSION `091server`093 Show V version of server"`125, X `123"voice", do_privmsg,4,1, "VOICE Private mes Vsage"`125, X `123"who", do_who,0,1, "WHO `091*`124channel`093 Sh Vow users on channel"`125, X `123"wall", do_default,0,1, "WALL Send messag Ve to everybody (+)"`125, X `123"wallops", do_default,0,1, "WALLOPS Send messag Ve to all op's `0912.4`093"`125, X `123"whoaway", do_who,5,1, "WHOAWAY `091*`124channel`093 Sh Vow all people who are sleeping"`125, X `123"whois", do_default,0,1, "WHOIS Detailed us Ver information"`125, X `123"whoop", do_who,1,1, "WHOOP `091@`124*`124#`093 `091*`124ch Vannel`093 Show operators/ChanOp's"`125, X `123"whop", do_who,3,1, "WHOP `091*`124chan.`093 Sh Vow users with pattern selection"`125, X `123"whox", do_who,4,1, "WHOX `091*`124chan.`093 Sh Vow users with pattern exclusion"`125, X `123"whosrv", do_who,2,1, "WHOSRV `091*`124channel`093 Sh Vow users with servers"`125, X `123"whowas", do_default,0,1, "WHOWAS Show user w Vho's gone `0912.4`093"`125, X `123"xtra", do_privmsg,5,1, "XTRA Private mes Vsage"`125 X`125; X Xint HiddenCmd=4, X AllCmd=sizeof(msgtab)/sizeof(struct Message); X X/*************************************************************************** V***/ X Xwin_refresh() X`123 X wrefresh(brdcstwin); msg_refresh(); X if (status_line) wrefresh(statwin); X if (clockwin) wrefresh(clockwin); X if (dclwin) wrefresh(dclwin); X if (tmpwin) wrefresh(tmpwin); X wrefresh(inpwin); X`125 X X/*************************************************************************** V***/ X Xshowinpline(i,linlen,flag,curs) Xchar *i; Xint linlen,flag,curs; X`123 Xint start,cnt,co; Xchar *tmp,t`091MAXCOLS+10`093,t2`091MAXCOLS`093,*tp,*tmp2; X X co=(clockwin?COLS-6:COLS); X if (flag!=1) `123 X `009start=curs-scrcurs; X`009if (scrcurs<9 && curs>8) X`009 `123 scrcurs=8+inpscroll; start=curs-8-inpscroll; `125 X`009if (scrcurs>co-10 && cursco-10 && curs>=linlen-9 && linlen>co && curs!=linlen) X`009 `123 scrcurs=co-linlen+curs; start=linlen-co; `125 X`009if (scrcurs==co && curs==linlen) X`009 `123 scrcurs=co-inpscroll; start=linlen-co+inpscroll; flag=1; `12 V5 X `125 else `123 X`009if (linlenequiv); tillspace(ilp); X`009`009if (*ilp) strcat(i,ilp); X`009 `125 X`009 else if (!cmdch`0910`093) strcpy(i,&ilp`0910`093); X`009 else strcpy(i,&ilp`0911`093); X`009`125 X`009else if (!cmdch`0910`093) strcpy(i,&ilp`0910`093); X`009else strcpy(i,&ilp`0911`093); X `125 X else if (cmdch`0910`093 && *ilp) X`009sprintf(i,"SAY %s",ilp); X ilp=i; X X cmdp=cmd; whilespace(ilp); X if (*ilp) `123 X`009while (*ilp!=' ' && *ilp) X`009 if (islower(*ilp)) *cmdp++ = toupper(*ilp++); X`009 else *cmdp++ = *ilp++; X `125 X *cmdp='\0'; whilespace(ilp); X X whoop = 0; X if (cmd`0910`093) `123 X`009for(msg=0;msg=crsr) `123 inpline`091i+1`093=inpline`091i`093 V; i--; `125 X`009`009 inpline`091crsr`093= *tp++; inpx++; crsr++; scrcurs++; X`009`009`125 else `123 X`009`009 inpline`091inpx++`093= *tp++; crsr++; scrcurs++; X`009`009 inpline`091inpx`093='\0'; X`009`009`125 X`009`009showinpline(inpline,inpx,2,crsr); X`009 `125 X`009 showinpline(inpline,inpx,0,crsr); X`009 escflag=0; break; X`009case 'D': case 'd': X`009 do_flags(); escflag=0; break; X`009case 'O': X`009 escflag=3; break; X`009case '`091': X`009 escflag=2; break; X`009default: escflag=0; X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_escmode2(inpchar) Xchar inpchar; X`123 X switch (inpchar) `123 X`009case '2': X`009 escflag=4; break; X`009case 'A': X`009 if (ringminus(histptrt,MAXHIST)!=histptr &&`032 X`009 *histbuf`091ringminus(histptrt,MAXHIST)`093) `123 X`009`009histptrt=ringminus(histptrt,MAXHIST); X`009`009memcpy(inpline,histbuf`091histptrt`093,MAXINPLEN); X`009`009inpx=strlen(inpline); crsr=inpx; X`009`009showinpline(inpline,inpx,1,crsr); X`009 `125 X`009 escflag=0; break; X`009case 'B': X`009 if (histptrt!=histptr && ringplus(histptrt,MAXHIST)!=histptr) `123 X`009`009histptrt=ringplus(histptrt,MAXHIST); X`009`009memcpy(inpline,histbuf`091histptrt`093,MAXINPLEN); X`009 `125 else `123 inpline`0910`093='\0'; histptrt=histptr; `125 X`009 inpx=strlen(inpline); crsr=inpx; X`009 showinpline(inpline,inpx,1,crsr); X`009 escflag=0; break; X`009case 'C': X`009 if (crsr!=inpx) `123 X`009`009crsr++; scrcurs++; X`009`009showinpline(inpline,inpx,0,crsr); X`009 `125 X`009 escflag=0; break; X`009case 'D': X`009 if (crsr!=0) `123 crsr--; scrcurs--; showinpline(inpline,inpx,0,crsr V); `125 X`009 escflag=0; break; X`009default: escflag=0; X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_escmode3(inpchar) Xchar inpchar; X`123 Xchar *tp; Xint i; X X switch (inpchar) `123 X`009case 'P': X`009 escflag=7; break; X`009case 'p': case 'q': case 'r': case 's': case 't': X`009case 'u': case 'v': case 'w': case 'x': case 'y': X`009 tp=fkey`091inpchar-'p'`093; fkey_pos= fkey_mode`091inpchar-'p'`093&1 V; X`009 if (fkey_mode`091inpchar-'p'`093&2) `123 X`009`009inpx=0; crsr=inpx; inpline`091inpx`093='\0'; X`009`009showinpline(inpline,inpx,1,crsr); X`009 `125 X`009 while (*tp && inpx=crsr) `123 inpline`091i+1`093=inpline`091i`093; i--; ` V125 X`009`009 inpline`091crsr`093= *tp++; inpx++; crsr++; scrcurs++; X`009`009`125 else `123 X`009`009 inpline`091inpx++`093= *tp++; crsr++; scrcurs++; inpline`091inpx V`093='\0'; X`009`009`125 X`009`009showinpline(inpline,inpx,2,crsr); X`009 `125 X`009 showinpline(inpline,inpx,0,crsr); X`009 escflag=0; break; X`009default: escflag=0; X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_escmode4(inpchar) Xchar inpchar; X`123 X switch (inpchar) `123 X`009case '8': X`009 escflag=5; break; X`009case '9': X`009 escflag=6; break; X`009default: escflag=0; X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_escmode5(inpchar) Xchar inpchar; X`123 X if (inpchar=='`126') do_help(); X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_escmode6(inpchar) Xchar inpchar; X`123 X if (inpchar=='`126') do_flags(); X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_escmode7(inpchar) Xchar inpchar; X`123 Xchar *tp; Xint i; X X if (inpchar>='0' && inpchar <='9') `123 X`009tp=prvrec`091inpchar-'0'`093; X`009while (*tp && inpx=crsr) `123 inpline`091i+1`093=inpline`091i`093; i--; `125 X`009`009inpline`091crsr`093= *tp++; inpx++; crsr++; scrcurs++; X`009 `125 else `123 X`009`009inpline`091inpx++`093= *tp++; crsr++; scrcurs++; inpline`091inpx`093 V='\0'; X`009 `125 X`009 showinpline(inpline,inpx,2,crsr); X`009`125 X`009showinpline(inpline,inpx,0,crsr); X `125 else if ((inpchar>='a' && inpchar<='z') `124`124 (inpchar>='A' && V inpchar<='Z')) `123 X`009tp=fkey`091locase(inpchar)-'a'+10`093; fkey_pos= fkey_mode`091locase(inp Vchar)-'a'+10`093&1; X`009if (fkey_mode`091locase(inpchar)-'a'+10`093&2) `123 X`009 inpx=0; crsr=inpx; inpline`091inpx`093='\0'; X`009 showinpline(inpline,inpx,1,crsr); X`009`125 X`009while (*tp && inpx=crsr) `123 inpline`091i+1`093=inpline`091i`093; i--; `125 X`009`009inpline`091crsr`093= *tp++; inpx++; crsr++; scrcurs++; X`009 `125 else `123 X`009`009inpline`091inpx++`093= *tp++; crsr++; scrcurs++; inpline`091inpx`093 V='\0'; X`009 `125 X`009 showinpline(inpline,inpx,2,crsr); X`009`125 X`009showinpline(inpline,inpx,0,crsr); X `125 X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_normal(inpchar) Xchar inpchar; X`123 Xint i; Xchar txt`091512`093; X X switch (inpchar) `123 X`009case 27: X`009 escflag=1; break; X`009case 155: X`009 escflag=2; break; X`009case '@'-64: X`009 escflag=7; break; X`009case ('U'-64): X`009case ('X'-64): X`009 crsr=inpx=0; inpline`0910`093='\0'; showinpline(inpline,inpx,1,crsr) V; X`009 break; X`009case ('F'-64): X`009 inpline`091crsr`093='\0'; crsr=inpx=strlen(inpline); X`009 showinpline(inpline,inpx,1,crsr); break; X`009case ('N'-64): X`009 if (inpx>0 && !isspace(inpline`091crsr`093)) `123 X`009`009while (crsr>0 && !isspace(inpline`091crsr-1`093)) `123 X`009`009 i=crsr; while (i!=inpx) `123 inpline`091i-1`093=inpline`091i`093 V; i++; `125 X`009`009 crsr--; scrcurs--; inpx--; inpline`091inpx`093='\0'; X`009`009 showinpline(inpline,inpx,0,crsr); X`009`009`125 X`009`009while (crsr0 && !isspace(inpline`091crsr-1`093)) `123 X`009`009scrcurs--; crsr--; showinpline(inpline,inpx,2,crsr); X`009`009while (crsr>0 && !isspace(inpline`091crsr`093)) `123 X`009`009 scrcurs--; crsr--; showinpline(inpline,inpx,2,crsr); `125 X`009 `125 X`009 while (crsr>0 && isspace(inpline`091crsr-1`093)) `123 X`009`009scrcurs--; crsr--; showinpline(inpline,inpx,2,crsr); `125 X`009 showinpline(inpline,inpx,0,crsr); X`009 break; X`009case ('K'-64): X`009 while (crsr=crsr) `123 inpline`091i+1`093=inpline`091i`093; i--; ` V125 X`009`009`009inpline`091crsr`093=inpchar; inpx++; crsr++; scrcurs++; X`009`009 `125 else `123 inpline`091inpx++`093=inpchar; crsr++; scrcurs++; X`009`009`009inpline`091inpx`093='\0'; `125 X`009`009`125 X`009`009showinpline(inpline,inpx,0,crsr); X`009 `125 X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_rec_esc1(inpchar) Xchar inpchar; X`123 X escflag=(inpchar=='`091')?2:0; X`125 X X/*************************************************************************** V***/ X Xkbd_rec_esc2(inpchar) Xchar inpchar; X`123 X switch (inpchar) `123 X`009case 'A': X`009 recall_move(-1); escflag=0; break; X`009case 'B': X`009 recall_move(1); escflag=0; break; X`009case '4': X`009 escflag=3; break; X`009case '5': X`009 escflag=4; break; X`009case '6': X`009 escflag=5; break; X`009default: escflag=0; X `125 X`125 X X/*************************************************************************** V***/ X Xkbd_rec_esc3(inpchar) Xchar inpchar; X`123 X if (inpchar=='`126') `123 recall_start=recall_num; recall_move(0); `125 X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_rec_esc4(inpchar) Xchar inpchar; X`123 X if (inpchar=='`126') recall_move(-(LINES>>1)+1); X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_rec_esc5(inpchar) Xchar inpchar; X`123 X if (inpchar=='`126') recall_move((LINES>>1)-1); X escflag=0; X`125 X X/*************************************************************************** V***/ X Xkbd_recall(inpchar) Xchar inpchar; X`123 Xint i,j; X X switch (inpchar) `123 X`009case 27: X`009 escflag=1; break; X`009case 155: X`009 escflag=2; break; X`009case ('T'-64): X`009case ('Y'-64): X`009case ('C'-64): X`009 break; X`009case ('R'-64): X`009 do_keypad_help(); break; X`009case ('B'-64): X`009 do_brdcst(); break; X`009case ('L'-64): X`009case ('W'-64): X`009 delwin(newwin(LINES,COLS,0,0)); X`009 win_refresh(); X`009 break; X`009case ('Z'-64): X`009 recall_mode=FALSE; recall_start= -1; X`009 delwin(tmpwin); tmpwin=NIL; X`009 win_refresh(); X`009 break; X case 'P': case 'p': X`009recall_move(-(LINES>>1)+1); break; X case 'L': case 'l': X`009recall_move((LINES>>1)-1); break; X case 13: X`009recall_mode=FALSE; X`009delwin(tmpwin); tmpwin=NIL; X`009win_refresh(); X`009i=(recall_start!= -1&&recall_startfirst; cnt < 50; cnt++) `123 X`009if (!tmp) break; X`009strcat(ol," "); X`009strcat(ol,tmp->nick); X`009strcpy(notify_array`091cnt`093,tmp->nick); X`009if (num_notify > 50) `123 X`009 dequeue(notify_list,tmp->nick); X`009 enqueue(notify_list,tmp); X`009 tmp = notify_list->first; `125 X`009else tmp = tmp->next; X `125 X strcat(ol,"\r\n\0"); X notify_request = TRUE; X qio_send(ol); X c$cks(sys$bintim(c$dsc(NOTIFYINTERVAL),&interval_time)); X c$cks(lib$add_times(¬ify_time,&interval_time,¬ify_time)); X c$cks(sys$setimr(NIL,¬ify_time,notify_ast,¬ify_id,NIL)); X`125 X`009`009 X/*************************************************************************** V***/ X Xclock_ast() X`123 Xquadw interval_time; Xchar tim`091`093="17-NOV-1858 00:00:00.00"; Xint tim_len; X X c$cks(sys$asctim(&tim_len,c$dsc(tim),&clock_time,NIL)); tim`09117`093='\ V0'; X if (status_line) `123 X`009mvwaddstr(statwin,0,COLS-5,&tim`09112`093); wrefresh(statwin); X`009wrefresh(inpwin); X `125 else `123 X`009mvwaddstr(clockwin,0,0,&tim`09112`093); wrefresh(clockwin); wrefresh(inp Vwin); X `125 X c$cks(sys$bintim(c$dsc(CLOCKINTERVAL),&interval_time)); X c$cks(lib$add_times(&clock_time,&interval_time,&clock_time)); X c$cks(sys$setimr(NIL,&clock_time,clock_ast,&clock_id,NIL)); X`125 X X/*************************************************************************** V***/ X Xdcl_ast() X`123 X if (dcl_mode=(dcl_out_iosb`0910`093!=SS$_ENDOFFILE)) c$cks(dcl_out_iosb` V0910`093); X dcloutbuf`091dcl_out_iosb`0911`093`093='\0'; X putwin(dclwin,dcl_size,COLS,dcloutbuf,TRUE,FALSE); X if (!*dcloutbuf) strcpy(dcloutbuf," "); X strcpy(dclbuf`091dclptr`093,dcloutbuf); dclptr=ringplus(dclptr,MAXDCLMSG V); X wrefresh(inpwin); X c$cks(sys$qio(0,dcl_chan_out,IO$_READVBLK,dcl_out_iosb, X dcl_ast,0,dcloutbuf,MAXNETLEN-1,0,0,0,0)); X`125 X X/*************************************************************************** V***/ X Xbrdcst_ast() X`123 Xchar text`091256`093,*ptr,*b; X X if (brdcstbuf`0910`093==MSG$_TRMBRDCST) `123 X`009brdcst_flag=TRUE; X`009brdcstbuf`091mbx_iosb`0911`093`093='\0'; X`009touchwin(brdcstwin); X`009if (tmpwin) `123 touchwin(tmpwin); wrefresh(tmpwin); `125 X X`009strcpy(text,&brdcstbuf`091brdcstbuf`09122`093==13?24:22`093); ptr=text; X`009while (*ptr) `123 X`009 b=ptr; while (*ptr && *ptr!=13) ptr++; X`009 if (*ptr==13) *ptr++ ='\0'; X`009 putwin(brdcstwin,BRDCSTWINHEIGHT,COLS,b,TRUE,FALSE); X`009 if (*ptr==10) ptr++; X`009`125 X`009wrefresh(inpwin); X`009brdcstbuf`0910`093='\0'; X `125 X c$cks(sys$qio(0,mbx_chan,IO$_READVBLK,mbx_iosb,brdcst_ast,0, X brdcstbuf,MAXBRDCSTLEN,0,0,0,0)); X`125 X X/*************************************************************************** V***/ X Xnet_ast() X`123 Xunsigned short *i_o_size; Xchar *cp,*il=outl; Xint bsize=MAXNETLEN-1; Xquadw now; X X i_o_size=read_iosb; X c$cks(*i_o_size); X nr_pos`091*(i_o_size+1)`093='\0'; X X c$cks(sys$gettim(&now)); X if (flush_mode && (now.l2-net_time.l2>0 `124`124 now.l1-net_time.l1>NETI VNTERVAL)) X`009flush_mode=FALSE; X net_time=now; X X cp=il; X while (cp) `123 X`009if (cp = strchr(il,'\n')) *cp='\0'; X`009if ((cp) && (*(cp-1)=='\r')) *(cp-1)='\0'; X`009if (cp) `123 cp++; analyzeout(il); il=cp; `125 X `125 X wrefresh(inpwin); X cp=outl; X while (*cp++ = *il++) --bsize; X nr_pos=cp-1; X c$cks(sys$qio(0,net_chan,IO$_READVBLK,read_iosb,net_ast,0, X nr_pos,bsize,0,0,0,0)); X`125 X X/*************************************************************************** V***/ $ CALL UNPACK ASYNC.C;43 1298312584 $ create/nolog 'f' XOk, this is something I should have been doing all along...but, here it is, Xstarting from version 1.7.3b. X XAug 12:`009Added an #ifdef to do_server(), so that IP's cannot be used under X`009Multinet. I dunno if IP's work for other packages or not, let me X`009know if it hangs on you. X X`0091.7.6 released. X XAug 3:`009Changed join messages to show "nick (user@host)" on joins. X XAug 2:`009Finished re-arranging COMMAND.C. X X`009Added do_squit function to implement /SQUIT, as described for KILL X`009below. X X`009Added kick comments (both use and display), and fixed current channel X`009tracking when /kicked. X X`009Changed the format of /ACTION commands. X XAug 1:`009Fixed the kill path shortener. In 2.8, kills are sent in slightly X`009different format. X X`009Inserted :'s in CTCP requests. I do not know of this causing any X`009problems, but it's better to be safe than sorry. X X`009Added do_kill function. This implements the /KILL command, and now X`009requires a kill comment, and properly inserts :'s before the comment. X X`009Started re-arranging COMMAND.C so that functions are in alphabetical X`009order, making them easier to find. X X XJul 30:`009Fixed 2.8 compatibility for /away and /topic. Inserted : before a Vway X`009message in /away. Made a function for /topic (do_topic), with changed X`009syntax. "/topic" shows the current topic of the current chan. X`009"/topic " changes the topic on the current chan.`032 X`009"/topic # " changes the topic on the specified channel. X XJul 4:`009Fixed WHOP and WHOX. Patterns should be specified as **, V where X`009pattern can, of course include wildcards. X XJun 4:`009Inserted : in USER before ircname, so that 2.8 properly recognizes V the X`009ircname. X X`0091.7.5a released. X XMay 28:`009Fixed /server bug (accidentally removed some required code when X`009removing code for auto-reconnects). X XMay 28:`009Fixed command parser to properly work with different cmdch's. X XMay 6:`009By request, added wildcard-based ignore, but it didn't work. Final Vly X`009finished debugging the damn thing. X X`0091.7.5 released (about time!!). X XApr 22:`009Ported vmsirc to AXP/OpenVMS (that's the Alpha). Minimal code cha Vnges, X`009but changes to the MAKE.COM were fairly extensive. Until I find a X`009portable way to include it, or people start asking for it, I won't be X`009including this modified MAKE.COM in the distribution. X XApr 8:`009Changed putparse() to use unsigned characters, so the if condition V for X`009show_esc works properly. ie 8 bit characters are now displayed X`009correctly with show_esc set. X X`0091.7.5pre3 released. X XMar 30:`009Fixed problems with input buffer not being properly cleared, so t Vhat X`009repeated pressing of could send parts of the previous command X`009to the channel. X X`009Modified the do_dcl command to only create a subprocess if a parameter X`009to the /DCL command is specified. This should allow the use of CTRL-D X`009or /DCL to remove the dcl window after logging out of the subprocess. X XMar 9:`009Changed the command parser to correctly call the SAY function rath Ver X`009than the MSG function. X XFeb 27:`009Changed the MSG command to point to do_privmsg, and SAY to point V to X`009do_msg.`032 X X`009Fixed `094D so it toggles the display of the DCL window even after the X`009subprocess has been removed. X X`0091.7.5pre2 released. X XFeb 26:`009Completed adding alias, along with slight re-organization of the X`009command parser. X X`009Pre-release of 1.7.5 distributed. X XFeb 22:`009Modified NOTIFY to send nicks in bursts of 50, rather than 20. Th Vanks X`009to phone for pointing out that this was possible. X XFeb 9-10:`009Completed 2.8 support (I hope). Removed some obsolete, X`009reduntant, useless and undocumented code. X X`009Script files are now executed as soon as the client connects to a X`009server, without waiting for a key press. X X`009CTCP changes: CTCP's to servers or hosts ($ and #) are now X`009dropped. X X`009Possible minor efficiency improvements, due to code removed/moved from X`009frequently called functions. X X`009Released 1.7.4. X XFeb 7`009Increased the size of the character array for CTCP's. This was caus Ving X`009clients to crash when sent very long (>283) CTCP's, usually actions. X X`009Changed the default state for showesc_flag to TRUE, so that control and X`009escape characters are displayed rather than interpreted. This prevents X`009the sending of screen clearing codes, backspaces etc. X X`009Added new numerics for 2.8. X X1993 Jan 31:`009Finally fixed the /part bug, once and for all. I had a X`009case-sensative copmare in the leave_channel() routine, so that when X`009doing "/j #chan", and the correct channel name had upper case letters, X`009a "/p #chan" resulted in an unterminated while condition, until the X`009strcmp found an address it couldn't read and crashed. Fixed by X`009replacing with a case-insensative compare. X X`009Fixed a bug in the CTCP routines that crashed on an unrecognized CTCP X`009request. Just added a "else return'" in the appropriate place. And yes, X`009for anyone who wonders, I feel really dumb for allowing either of the X`009above bugs to exist. :-) X X`009Released 1.7.3c. $ CALL UNPACK CHANGES.TXT;20 639729290 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client part COMMAND X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#include X#include X#include X#include X#include X#include "header.h" X#include "environment.h" X Xextern kbd_ast(),dcl_ast(),leave_ast(),clock_ast(),c$cks(),c$dsc(),putbold() V, X putchunk(),putwin(),qio_send(),quadcmp(),rundown(),stricmp(),strincmp V(), X testinpline(),win_refresh(),create_status(),msg_refresh(),msg_touch() V, X notify_ast(); Xextern char *reverse(),*rot13(); X X/*************************************************************************** V***/ X Xdo_alias(int dummy,char *ptr) X`123 Xchar`009*alias,ol`091256`093; XAliasStruct *tmp; X X if (!*ptr) `123 X`009if (alias_list) `123 X`009 putchunk("*** Aliases:",TRUE); X`009 for(tmp=alias_list; tmp; tmp = tmp->next) `123 X`009`009sprintf(ol,"*** %10s %s",tmp->alias,tmp->equiv); X`009`009putchunk(ol,TRUE); `125 X`009`125 X`009else putchunk("*** No aliases",TRUE); X `125 X else `123 X`009alias = ptr; tillspace(ptr); X`009if (!*ptr) `123 X`009 if (*alias == '-') `123 X`009`009*alias++ = '\0'; X`009`009tmp = list_remove(&alias_list,alias); X`009`009if (tmp) `123 X`009`009 sprintf(ol,"*** Alias %s removed",tmp->alias); X`009`009 new_free(tmp->alias); new_free(tmp->equiv); new_free(tmp); `125 X`009`009else sprintf(ol,"*** No such alias %s",alias); X`009`009putchunk(ol,TRUE); X`009 `125 X`009 else if (alias_list) `123 X`009`009putchunk("*** Aliases:",TRUE); X`009`009for(tmp=alias_list; tmp; tmp = tmp->next) `123 X`009`009 if (!strincmp(tmp->alias,alias,strlen(alias))) `123 X`009`009`009sprintf(ol,"*** %10s %s",tmp->alias,tmp->equiv); X`009`009`009putchunk(ol,TRUE); X`009`009 `125 X`009`009`125 X`009 `125 X`009 else putchunk("*** No aliases",TRUE); X`009`125 X`009else `123 X`009 *ptr++ = '\0'; X`009 if (alias_list) tmp = list_remove(&alias_list,alias); X`009 else tmp = NULL; X`009 if (tmp) `123 X`009`009strcpy(tmp->equiv,ptr); X`009`009list_insert(&alias_list,tmp); `125 X`009 else `123 X`009`009tmp = (AliasStruct *) malloc(sizeof(AliasStruct)); X`009`009tmp->next = NULL; X`009`009tmp->alias = (AliasStruct *) malloc(strlen(alias)+2); X`009`009tmp->equiv = (AliasStruct *) malloc(strlen(ptr)+2); X`009`009strcpy(tmp->alias,alias); strcpy(tmp->equiv,ptr); X`009`009list_insert(&alias_list,tmp); X`009 `125 X`009 sprintf(ol,"*** Alias %s added",tmp->alias); putchunk(ol,TRUE); X`009`125 X `125 X`125`009 `032 X X/*************************************************************************** V***/ X Xdo_away(num,ptr) Xint num; Xchar *ptr; X`123 X char ol`091256`093; X X if (num==1) `123 sprintf(ol,"away %s",ptr); putbold(ol); away_flag= *ptr; V `125 X if (num==2) `123 putbold("here",FALSE); away_flag=FALSE; `125 X sprintf(inpline,"AWAY :%s",ptr); inpx=strlen(inpline); X create_status(); X`125 X X/*************************************************************************** V***/ X Xdo_big(dummy,ptr,line) Xint dummy; Xchar *ptr,*line; X`123 X char mode,*tp,*txtp,txt`091256`093,txt2`091256`093,big`091MAXFONTHEIGHT`09 V3`091256`093; X int cnt; X bool flag; X X if (font_mode) `123 X tp=ptr; mode=(*ptr=='*'); X tillspace(ptr); txtp=ptr; whilespace(ptr); X for(cnt=0;cnt70) X putchunk("*** Error: BIG text (probably) too long...",FALSE); X else `123 X putbold(cmdch`0910`093?line:&line`0911`093,TRUE); X *txtp='\0'; X for(cnt=0;cnt *%s* %s",tp,big`091cnt`093); X sprintf(txt,"PRIVMSG %s :%s\r\n",tp,*big`091cnt`093?big`091cnt`093 V:" "); X putchunk(txt2,TRUE); qio_send(txt); X `125 X `125 X `125 X `125 else putchunk("*** Error: No font loaded...",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_brdcst() X`123 X if(!brdcst_flag) `123 X touchwin(brdcstwin); wrefresh(brdcstwin); X `125 else `123 X msg_touch(); X if (status_line) `123 touchwin(statwin); wrefresh(statwin); `1 V25 X if (dclwin && dcl_visible) `123 touchwin(dclwin); wrefresh(dclwin); `125 X if (recall_mode) `123 touchwin(tmpwin); wrefresh(tmpwin); `125 X msg_refresh(); X `125 X wrefresh(inpwin); X brdcst_flag= !brdcst_flag; X`125 X X/*************************************************************************** V***/ X Xdo_cd(num,ptr) Xint num; Xchar *ptr; X`123 X char *disk,tmp`091512`093,dir`091256`093; X int dir_len; X $DESCRIPTOR(dirdesc,dir); X X if (*ptr && *ptr!='?') X if(chdir(ptr)) `123 X putchunk("*** Error: The specified directory does not exist.",FALSE); X `125 else `123 X c$cks(sys$setddir(0,&dir_len,&dirdesc)); X disk=getenv("SYS$DISK"); X sprintf(dirpath,"%s%s",disk,dir); X disk=dirpath; while(*disk) `123 *disk=locase(*disk); disk++; `125 X sprintf(tmp,"*** Changed WorkingDIR to %s",dirpath); putchunk(tmp,FALS VE); X `125 X else `123 sprintf(tmp,"*** Actual WorkingDIR is %s",dirpath); putchunk(tmp V,FALSE); `125 X`125 X X/*************************************************************************** V***/ X Xdo_chunk(flag,ptr,line) Xint flag; Xchar *ptr,*line; X`123 X char *tp,mode; X X tp=ptr; mode=(*ptr=='*'); X tillspace(ptr); if (*ptr) *ptr++ ='\0'; whilespace(ptr); X if (mode) tp=ptr; X if (flag==1) rot13(ptr); X if (flag==2) reverse(ptr); X putbold(cmdch`0910`093?line:&line`0911`093,TRUE); X if (mode) sprintf(inpline,"PRIVMSG %s :%s",my_chan,*tp?tp:" "); X else sprintf(inpline,"PRIVMSG %s :%s",tp,*ptr?ptr:" "); X inpx=strlen(inpline); X`125 X X/*************************************************************************** V***/ X Xdo_clock(num) Xint num; X`123 X char tim`091`093="17-NOV-1858 00:00:00.00"; X int tim_len; X X if (num==0 && status_line) `123 X if (clock_mode) `123 X clock_mode=2; X if (clockwin) `123 X delwin(clockwin); clockwin=NIL; X delwin(inpwin); inpwin=newwin(1,COLS,LINES-1,0); X `125 X `125 else `123 X c$cks(sys$gettim(&clock_time)); X c$cks(sys$asctim(&tim_len,c$dsc(tim),&clock_time,NIL)); X strcpy(&tim`09118`093,"00.00"); X c$cks(sys$bintim(c$dsc(tim),&clock_time)); X c$cks(sys$setimr(NIL,&clock_time,clock_ast,&clock_id,NIL)); X clock_mode=1; X `125 X `125 else `123 X if (clock_mode) `123 X if (status_line) `123 X clock_mode=3-clock_mode; X `125 else `123 X if (clock_mode==1) `123 X if (clockwin) `123 X delwin(clockwin); clockwin=NIL; X delwin(inpwin); inpwin=newwin(1,COLS,LINES-1,0); X `125 X c$cks(sys$cantim(&clock_id,NIL)); X clock_mode=0; X `125 else `123 X delwin(inpwin); inpwin=newwin(1,COLS-6,LINES-1,0); X clockwin=newwin(1,5,LINES-1,COLS-5); X wclear(clockwin); if (bold_flag) wsetattr(clockwin,_BOLD); X wrefresh(clockwin); X clock_mode=1; X `125 X `125 X `125 else `123 X clock_mode=1; X delwin(inpwin); inpwin=newwin(1,COLS-6,LINES-1,0); X clockwin=newwin(1,5,LINES-1,COLS-5); X wclear(clockwin); if (bold_flag) wsetattr(clockwin,_BOLD); X wrefresh(clockwin); X c$cks(sys$gettim(&clock_time)); X c$cks(sys$asctim(&tim_len,c$dsc(tim),&clock_time,NIL)); X strcpy(&tim`09118`093,"00.00"); X c$cks(sys$bintim(c$dsc(tim),&clock_time)); X c$cks(sys$setimr(NIL,&clock_time,clock_ast,&clock_id,NIL)); X `125 X `125 X if (bold_flag) wsetattr(inpwin,_BOLD); X wclear(inpwin); wrefresh(inpwin); X`125 X X/*************************************************************************** V***/ X Xdo_cls() X`123 X int i; X X wclear(dispwindow); X msg_refresh(); X`125 X X/*************************************************************************** V***/ X Xdo_cmdch(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char line`091256`093,*tp; X int i; X X if (*ptr!=cmdch`0910`093) X for(i=0;i "); X putchunk(line,FALSE); X create_status(); X`125 X X/*************************************************************************** V***/ X Xdo_comment(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char tmp`091256`093; X X if (*ptr) sprintf(tmp,"*** Comment: %s",ptr); X else sprintf(tmp,"*** Comment"); X putchunk(tmp,TRUE); X`125 X X/*************************************************************************** V***/ X Xdo_ctcp(int flag,char *ptr) X`123 Xchar ol`091512`093,*nick,*query,*tmp = &ol,tim`091`093="17-NOV-1858 00:00:00 V.00"; Xint i; Xquadw curtim; X Xswitch (flag) X `123 X case 0: X`009nick = ptr; tillspace(ptr); ptr`0910`093 = '\0'; X `009query = tmp = ++ptr; tillspace(ptr); X`009if (strlen(ptr)) `123 ptr`0910`093 = '\0'; ptr++; `125 X`009while(*tmp) `123 *tmp = toupper(*tmp); tmp++; `125 X`009putchunk(inpline,TRUE); X`009if (*ptr) X`009 sprintf(inpline,"PRIVMSG %s :\001%s %s\001",nick, X`009`009`009query,ptr); X`009else X`009 sprintf(inpline,"PRIVMSG %s :\001%s\001",nick,query); X`009break; X case 1: X`009sprintf(tmp,"* %s %s",my_nick,ptr); putchunk(tmp, TRUE); X`009if (query_max) `123 X`009 tmp`0910`093='\0'; X`009 for(i=0;i>1),COLS,0,0); X wsetattr(dclwin,_REVERSE); wclear(dclwin); wmove(dclwin,0,0); X dcl_visible=TRUE; brdcst_flag=FALSE; X `125 X if (*ptr) `123 X if (!dcl_mode) `123 X if (!dcl_mbx) `123 X c$cks(sys$crembx(0,&dcl_chan_in,MAXNETLEN-1,0,0xff00L,0,c$dsc("DCLMB VXIN"))); X c$cks(sys$crembx(0,&dcl_chan_out,MAXNETLEN-1,0,0xff00L,0,c$dsc("DCLM VBXOUT"))); X `125 X c$cks(lib$spawn(c$dsc("SET NOON"),c$dsc("DCLMBXIN"),c$dsc("DCLMBXOUT") V,&flags,0,&dcl_pid,0,0,0,0,0,0)); X dcl_mode=TRUE; X if (!dcl_mbx) `123 X c$cks(sys$qio(0,dcl_chan_out,IO$_READVBLK,dcl_out_iosb,dcl_ast,0, X dcloutbuf,MAXNETLEN-1,0,0,0,0)); X dcl_mbx=TRUE; X `125 X `125 X if (!dcl_visible) `123 X msg_touch(); touchwin(dclwin); if (status_line) touchwin(statwin); X dcl_visible=TRUE; brdcst_flag=FALSE; X `125 X if (!stricmp(ptr,"`094")) strcpy(txt2," "); X else `123 sprintf(txt,"$ %s",ptr); putwin(dclwin,dcl_size,COLS,txt,TRUE, VFALSE); X strcpy(txt2,ptr); `125 X strcpy(dclbuf`091dclptr`093,txt); dclptr=ringplus(dclptr,MAXDCLMSG); X c$cks(sys$qiow(0,dcl_chan_in,IO$_WRITEVBLK,dcl_in_iosb,0,0,txt2, X strlen(txt2),0,0,0,0)); X c$cks(dcl_in_iosb`0910`093); X `125 else X if (!dcl_visible) `123 X msg_touch(); touchwin(dclwin); wrefresh(dclwin); X if (status_line) touchwin(statwin); X dcl_visible=TRUE; brdcst_flag=FALSE; X `125 else `123 X touchwin(brdcstwin); msg_touch(); msg_refresh(); X if (status_line) `123 touchwin(statwin); wrefresh(statwin); `125 X if (brdcst_flag) `123 touchwin(brdcstwin); wrefresh(brdcstwin); `125 X dcl_visible=FALSE; X `125 X wrefresh(inpwin); X`125 X X/*************************************************************************** V***/ X Xdo_debug(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char ol`091256`093; X X if (*ptr=='?') `123 X putchunk("DEBUG - Internal online debugging *oerks*",FALSE); X putchunk("DEBUG bit 0 - Incoming server messages, echo all given command Vs",FALSE); X putchunk("DEBUG bit 1 - Pre-parsed messages (p`0910`093..p`0917`093)",FA VLSE); X putchunk("DEBUG bit 2 - echo input line, $qio to network/server",FALSE); X putchunk("DEBUG bit 3 - font load status, script commands",FALSE); X putchunk("DEBUG bit 4 - External error message handling",FALSE); X putchunk("DEBUG bit 5 - Ignore flags, leave timer",FALSE); X putchunk("DEBUG bit 6 - ",FALSE); X putchunk("DEBUG bit 7 - PrivmsgRecall buffer",FALSE); X sprintf(ol,"DEBUG - Actual value is %02x",(unsigned char) dbopt); X putchunk(ol,FALSE); X `125 else `123 X if (*ptr) dbopt=atoi(ptr); else dbopt=0; X if (!dbopt) putchunk("*** Disabled debugging mode (Wow, you've found the V bug)",FALSE); X else putchunk("*** Enabled debugging mode (urgs, you enter the problem a Vrea)",FALSE); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_default(num,dummy,line) Xint num; Xchar *dummy,*line; X`123 X strcpy(inpline,&line`0911`093); inpx=strlen(inpline); X putbold(cmdch`0910`093?line:&line`0911`093,FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_enter(dummy,ptr,line) Xint dummy; Xchar *ptr,*line; X`123 X char *txtp,txt`091256`093,tmp`091256`093; X X txtp=txt; copyspace(ptr,txtp); whilespace(ptr); X putbold(cmdch`0910`093?line:&line`0911`093,TRUE); X sprintf(tmp,"JOIN %s\r\n\0",txt); X qio_send(tmp); X if (*ptr) `123 X sprintf(tmp,"PRIVMSG %s :%s\r\n",txt,ptr); X strcpy(txtp,ptr); `125 X else `123 X strcpy(txtp,":appears in a cloud of orange smoke on this channel...\007" V); X sprintf(tmp,"PRIVMSG %s\r\n",txt); `125 X qio_send(tmp); X sprintf(tmp,"> %s",txtp); putbold(tmp,TRUE); X`125 X X/*************************************************************************** V***/ X Xdo_errlog() X`123 X errlog_flag = !errlog_flag; X if (errlog_flag) putchunk("*** Disabled error message logging",TRUE); X else putchunk("*** Enabled error message logging",TRUE); X`125 X X/*************************************************************************** V***/ X Xdo_fkey(dummy,ptr,line) Xint dummy; Xchar *ptr,*line; X`123 X char *tp=ptr,txt`091256`093,mode; X int cnt; X X if (*ptr `124`124 fkey_pos) X if (*ptr=='?' `124`124 fkey_pos) `123 X if (COLS<70 `124`124 LINES<13) X putchunk("*** My, whadda cute little window we have here. Sorry, no V FKEY info for hobbits.",FALSE); X else `123 X if (!fkey_pos) `123 X tmpwin=newwin(13,70,(LINES-13)>>1,(COLS-70)>>1); X wsetattr(tmpwin,bold_flag?_REVERSE`124_BOLD:_REVERSE); X `125 X if (inpchar!=26) `123 X wclear(tmpwin); wmove(tmpwin,0,0); X for(cnt=fkey_pos;cnt `091!`0 V93\n"); X wprintw(tmpwin," Bit 0: Automatic command execution (added ) V on fkey\n"); X wprintw(tmpwin," Bit 1: Delete line before insertion of fkey tex Vt\n"); X `125 X wrefresh(tmpwin); wrefresh(inpwin); X `125 else `123 delwin(tmpwin); msg_refresh(); wrefresh(inpwin); tmpw Vin=NIL; `125 X fkey_pos=(fkey_pos==26 `124`124 inpchar==26)?0:fkey_pos+13; X `125 X `125 else if ((isdigit(*ptr) `124`124 isalpha(*ptr)) && (ptr`0911`093==' V ' `124`124 !(ptr`0911`093))) X if (ptr`0911`093) `123 X do tp++; while(*tp==' '); X if (*tp=='!' && (('0'<= *(tp+1) && *(tp+1)<='3') `124`124 *(tp+1)==' V!')) `123 X tp++; X if (*tp!='!') `123 fkey_mode`091locase(*ptr)-(isdigit(*ptr)?'0':'a V'-10)`093= *tp-'0'; tp++; `125 X `125 X strcpy(fkey`091locase(*ptr)-(isdigit(*ptr)?'0':'a'-10)`093,tp); X sprintf(txt,"*** Fkey %c set to '%s'",locase(*ptr),tp); putchunk(txt V,FALSE); X `125 else `123 X *fkey`091locase(*ptr)-(isdigit(*ptr)?'0':'a'-10)`093='\0'; X fkey_mode`091locase(*ptr)-(isdigit(*ptr)?'0':'a'-10)`093=0; X sprintf(txt,"*** Fkey %c disabled",locase(*ptr)); putchunk(txt,FALSE V); X `125 X else putchunk("*** Error: Incorrect definition of a Fkey",FALSE); X else putchunk("*** Error: No Fkey modified",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_flush() X`123 X putchunk("*** Flushing incoming text...",FALSE); X flush_mode=TRUE; X`125 X X/*************************************************************************** V***/ X Xdo_ignore(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char *txtp,txt`091256`093; X int cnt; X X if (*ptr=='?') X if (ignore_max) `123 X strcpy(txt,"*** Ignore is "); X for(cnt=0;cnt80) putchunk("*** Error: Value for INPSCROLL not a Vllowed. Value should be `0911..80`093",FALSE); X else inpscroll=cnt; X`125 X X/*************************************************************************** V***/ X Xdo_join(flag,ptr) Xint flag; Xchar *ptr; X`123 X`009char pre,*tmp; X X/*`009pre=(*ptr!='0' && atoi(ptr)==0 && *ptr!='+')?' ':' '; X`009sprintf(tmp,"%c%s",pre,ptr); */ X`009if (flag==0) X`009`009`123 X`009`009if (on_channel(ptr)) join(ptr); X`009`009else `123 X`009`009 sprintf(inpline,"JOIN %s\r\n",ptr); X`009`009 qio_send(inpline); `125 X`009`009`125 X`009else if (flag==1) `123 sprintf(inpline,"PART %s",ptr); X`009 inpx=strlen(inpline); `125 X`009if (status_line) create_status(); X`125 X X/*************************************************************************** V***/ X Xdo_kill(int dummy, char *ptr) X`123 Xchar *tmp, ol`091512`093; X X tmp = ptr; X tillspace(ptr); X if (strlen(ptr)) `123 X`009*ptr = '\0'; ptr++; X`009sprintf(&ol,"KILL %s :%s\r\n", tmp, ptr); X`009qio_send(&ol); X `125 X else putchunk("*** Reason required for /KILL.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_leave(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char txt`091256`093,tim`091`093="17-NOV-1858 00:00:00.00"; X int tim_len; X quadw new_time,now_time; X X if (*ptr!='?') `123 X if (!(*ptr)) `123 X if (leave_time.l2 `124`124 leave_time.l1) c$cks(sys$cantim(&leave_id,N VIL)); X leave_time.l2=0; leave_time.l1=0; X `125 else X if (!(sys$bintim(c$dsc(ptr),&new_time) & 1)) X putchunk("*** Sorry, there is something wrong...",FALSE); X else `123 X if (leave_time.l2 `124`124 leave_time.l1) c$cks(sys$cantim(&leave_id V,NIL)); X c$cks(sys$gettim(&now_time)); X if (new_time.l2<0) c$cks(lib$add_times(&now_time,&new_time,&new_time V)); X if (quadcmp(&new_time,&now_time)<0) X putchunk("*** Sorry, you can't specify a time before now!",FALSE); X else `123 X leave_time=new_time; X c$cks(sys$setimr(NIL,&leave_time,leave_ast,&leave_id,NIL)); X `125 X `125 X `125 X if (leave_time.l2 `124`124 leave_time.l1) `123 X c$cks(sys$asctim(&tim_len,c$dsc(tim),&leave_time,NIL)); X sprintf(txt,"*** Leave time is set to %s",tim); X `125 X else sprintf(txt,"*** No leave time set..."); X putchunk(txt,FALSE); X if (dbopt&0x20) `123 sprintf(txt,"DEBUG: `091leave`093%08X %08X",leave_tim Ve.l2,leave_time.l1); putchunk(txt,FALSE); `125 X`125 X X/*************************************************************************** V***/ X Xdo_loadfont(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char buffer`091256`093,*pnt,*end,tmp`091256`093,t`091256`093; X unsigned char c; X int cnt,maxlen; X FILE *fontfile; X X strcpy(tmp,ptr); X if (!(fontfile=fopen(tmp,"r"))) `123 X sprintf(tmp,"%s.fnt",ptr); X if (!(fontfile=fopen(tmp,"r"))) `123 X putchunk("*** Loadfont: Cannot open fontfile",FALSE); X return; `125 X `125 X if (!fgets(buffer,sizeof(buffer),fontfile)) `123 X putchunk("*** Loadfont: Unexpected end of file",FALSE); return; `125 X if (*(pnt=buffer+strlen(buffer)-1)=='\n') *pnt='\0'; X if ((fontheight=atoi(buffer))>MAXFONTHEIGHT) `123 X putchunk("*** Loadfont: Fontheight too large",FALSE); return; `125 X if (!fgets(buffer,sizeof(buffer),fontfile)) `123 X putchunk("*** Loadfont: Unexpected end of file",FALSE); return; `125 X if (*(pnt=buffer+strlen(buffer)-1)=='\n') *pnt='\0'; X if ((fontwidth=atoi(buffer))>MAXFONTWIDTH) `123 X putchunk("*** Loadfont: Fontwidth too large",FALSE); return; `125 X font_mode=FALSE; X for(c=0;c<255;c++) for(cnt=0;cntfontwidth) `123 X putchunk("*** Loadfont: Character width too large",FALSE); return; ` V125 X maxlen=max(maxlen,strlen(buffer)); X strcpy(font`091c`093`091cnt`093,buffer); X `125 X for (cnt=0;cnt %s",ptr); putbold(txt,TRUE); X txt`0910`093='\0'; X for(cnt=0;cnt %s",ptr); putbold(tmp,TRUE); X sprintf(lastmsg,"* %s",ptr); X sprintf(inpline,"PRIVMSG %s :%s",my_chan,ptr); inpx=strlen(inpline); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_query(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char *txtp,txt`091256`093; X int cnt; X X if (*ptr=='?') X if (query_max) `123 X strcpy(txt,"*** Query is "); X for(cnt=0;cnt *%s* %s",tp,txt); X sprintf(tmp,"PRIVMSG %s :%s\r\n",tp,*txt?txt:" "); X putchunk(tmp2,TRUE); qio_send(tmp); X `125 X `125 X fclose(typefile); X `125 X else putchunk("*** Error: No filename given. Please specify.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_mode(flag,ptr) Xint flag; Xchar *ptr; X`123 Xchar ol`091256`093,com`09120`093,p`091256`093,*p1,*p2; X bool chantype; X X if (*ptr=='?') `123 X `009if (COLS<55 `124`124 LINES<15) X`009 putchunk("*** Huh? What a small window... Sorry, no mode info for ho Vbbits...",FALSE); X`009else `123 X`009 tmpwin=newwin(15,55,(LINES-13)>>1,(COLS-55)>>1); X `009 wsetattr(tmpwin,bold_flag?_REVERSE`124_BOLD:_REVERSE); X `009 wclear(tmpwin); wmove(tmpwin,0,0); X `009 wprintw(tmpwin," MODE info for VMS IRC Client %s\n\n",VMSVERSI VON); X`009 wprintw(tmpwin," +`124- add`124remove modes on named channels\n"); X `009 wprintw(tmpwin," p private mode\n"); X `009 wprintw(tmpwin," s secret mode (invisible channel)\n"); X `009 wprintw(tmpwin," a anonymous mode `091users are invisible`09 V3\n"); X `009 wprintw(tmpwin," t topic limit (Set only by ChanOp)\n"); X `009 wprintw(tmpwin," m moderated channel (ChanOp-MSGs only)\n"); X `009 wprintw(tmpwin," i INVITE only channel\n"); X `009 wprintw(tmpwin," n no PRIVMSGs on this channel\n"); X`009 wprintw(tmpwin," l limited channel \n"); X`009 wsetattr(tmpwin,_UNDERLINE); X `009 wprintw(tmpwin," o add/remove channel operator %s\n",s Vpc); X `009 wclrattr(tmpwin,_UNDERLINE); X `009 wprintw(tmpwin," PRIVMSG +channel Message to all on channel\n V"); X`009 wprintw(tmpwin," PRIVMSG #host Message to all on host\n"); X`009 wprintw(tmpwin," PRIVMSG $server Message to all on server\n"); X`009 wrefresh(tmpwin); wrefresh(inpwin); X `009`125 X `125 else `123 X `009chantype=(atoi(my_chan)==0 && *my_chan!='0'); X`009switch (flag) `123 X `009 case 1: strcpy(com,"kick"); X`009`009if (*ptr == '+' `124`124 *ptr == '#' `124`124 *ptr == '&') X`009`009 `123 sprintf(ol,"%s %s",com,ptr); `125 X`009`009else `123 sprintf(ol,"%s %s %s",com,my_chan,ptr); `125 X`009`009p1 = &ol; tillspace(p1); p1++; X`009`009tillspace(p1); p1++; tillspace(p1); X`009`009if (strlen(p1)) `123 X`009`009 *p1 = '\0'; p1++; sprintf(p,"%s :%s",&ol,p1); `125 X`009`009else strcpy(p,ol); X`009`009break; X `009 case 2: strcpy(com,"mode"); X`009`009p1=ol; copyspace(ptr,p1); whilespace(ptr); p2=ptr; X`009`009if ((!*p2 && (*ol=='-' `124`124 *ol=='+')) `124`124 X`009`009 (*p2 && *p2!='-' && *p2!='+')) X`009`009 sprintf(p,"%s %s %s %s",com,my_chan,ol,p2); X`009`009else X`009`009 sprintf(p,"%s %s %s",com,ol,p2); X`009`009break; X`009 default: ; X `009`125 X `009if (cmdch`0910`093) sprintf(ol,"%c%s",cmdch`0910`093,p); else strcpy V(ol,p); X `009putbold(ol,TRUE); strcat(p,"\n\r\0"); qio_send(p); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_nobold() X`123 X bold_flag = !bold_flag; X if (bold_flag) `123 X putchunk("*** Enabled BOLD text output",FALSE); wsetattr(inpwin,_BOLD); X if (clockwin) `123 wsetattr(clockwin,_BOLD); wrefresh(clockwin); `125 X `125 else `123 X putchunk("*** Disabled BOLD text output",FALSE); wclrattr(inpwin,_BOLD); X if (clockwin) `123 wclrattr(clockwin,_BOLD); wrefresh(clockwin); `125 X `125 X`125 X X/*************************************************************************** V***/ X Xdo_noecho(num,dummy,line) Xint num; Xchar *dummy,*line; X`123 X strcpy(inpline,&line`0911`093); inpx=strlen(inpline); X if (dbopt&1) putbold(cmdch`0910`093?line:&line`0911`093,FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_nokill() X`123 X notice_flag = !notice_flag; X if (notice_flag) putchunk("*** Disabled full KILL messages",FALSE); X else putchunk("*** Enabled full KILL messages",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_nick(num,ptr,line) Xint num; Xchar *ptr,*line; X`123 X char *p,*n; X int i=0; X X p=ptr; n=my_nick; X while (i++nick); X`009`009`009`009new_free(&new); X`009`009`009`009sprintf(ol,"*** %s removed from notification list", nick); X`009`009`009`009putchunk(ol,FALSE); X`009`009`009`009num_notify = num_notify - 1; X`009`009`009`125 else `123 X`009`009`009`009sprintf(ol,"*** %s is not on the notification list", nick); X`009`009`009`009putchunk(ol,FALSE); `125 X`009`009`125 else X`009`009`009show_notify_list(0); X`009`125 else `123 X`009`009if (*nick == '+') `123 X`009`009`009nick++; ptr--; `125 X`009`009if (*nick) `123 X`009`009`009if (strcspn(nick, "*") != strlen(nick)) X`009`009`009`009putchunk("*** Wildcards not allowed in NOTIFY nicknames!"); X`009`009`009else if (new = (NotifyStruct *) dequeue(notify_list, nick)) `123 X`009`009`009`009new_free(new->nick); X`009`009`009`009new_free(&new); X`009`009`009`009num_notify = num_notify - 1; X`009`009`009`125 X`009`009`009new = (NotifyStruct *) malloc(sizeof(NotifyStruct)); X`009`009`009new->next = (NotifyStruct *)NULL; X`009`009`009new->nick = (NotifyStruct *) malloc(strlen(nick)+2); X`009`009`009strcpy(new->nick, nick); X`009`009`009new->flag = -1; X`009`009`009enqueue(notify_list, new); X`009`009`009sprintf(ol,"*** %s added to the notification list", new->nick); X`009`009`009putchunk(ol,FALSE); X`009`009`009num_notify = num_notify + 1; X`009`009`125 else X`009`009`009show_notify_list(0); X`009`125 X`009nick = &nick`091ptr`093; X`125 Xif (no_nicks) X`009show_notify_list(1); Xif (num_notify) `123 X`009c$cks(sys$cantim(¬ify_id,NIL)); X`009c$cks(sys$gettim(¬ify_time)); X`009c$cks(sys$asctim(&tim_len,c$dsc(tim),¬ify_time,NIL)); X/*`009strcpy(&tim`09118`093,"00.00"); */ X`009c$cks(sys$bintim(c$dsc(tim),¬ify_time)); X`009c$cks(sys$setimr(NIL,¬ify_time,notify_ast,¬ify_id,NIL)); X`009`125 Xelse X`009c$cks(sys$cantim(¬ify_id,NIL)); X`125 X Xshow_notify_list(all) Xint all; X`123 X NotifyStruct *tmp; X char list1`091512`093,list2`091512`093,ol`091512`093; X X strcpy(list1, "\0"); strcpy(list2, "\0"); X for (tmp = notify_list->first; tmp; tmp = tmp->next) `123 X`009if (tmp->flag == 1) `123 X`009`009strcat(list1, " "); X`009`009strcat(list1, tmp->nick); X`009`125 X`009if (all && tmp->flag == 0) `123 X`009`009 strcat(list2, " "); X`009`009 strcat(list2, tmp->nick); X`009`125 X `125 X if (*list1) `123 X`009sprintf(ol,"*** Currently present:%s", list1); putchunk(ol,FALSE); X new_free(&list1); X `125 X if (*list2) `123 X`009sprintf(ol,"*** Currently absent:%s", list2); putchunk(ol,FALSE); X new_free(&list1); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_oper(num,dummy,line) Xint num; Xchar *dummy,*line; X`123 X if (!your_priv) strcpy(oppwd,dummy); X strcpy(inpline,&line`0911`093); inpx=strlen(inpline); X if (histptr) histptr--; else histptr=MAXHIST-1; X histptrt=histptr; X`125 X X/*************************************************************************** V***/ X Xdo_privmsg(flag,ptr) Xint flag; Xchar *ptr; X`123 X char *tp,txt`091512`093,line`09120`093; X X tp=ptr; tillspace(ptr); if (*ptr) *ptr++ ='\0'; whilespace(ptr); X switch (flag) `123 X case 1: strcpy(line,"PRIVMSG"); break; X case 2: strcpy(line,"NOTICE"); break; X case 3: strcpy(line,"PRIVMSG"); break; X case 4: strcpy(line,"PRIVMSG"); break; X case 5: strcpy(line,"PRIVMSG"); break; X `125 X sprintf(inpline,"%s %s :%s",line,tp,*ptr?ptr:" "); inpx=strlen(inpline); X if (flag == 2) `123 sprintf(txt,"-> -%s- %s",tp,ptr); putbold(txt,TRUE); ` V125 X else `123 sprintf(txt,"-> *%s* %s",tp,ptr); putbold(txt,TRUE); `125 X sprintf(lastmsg,"%s %s",tp,ptr); X`125 X X/*************************************************************************** V***/ X Xdo_quit(int dummy, char *ptr) X`123 X char line`09120`093; X X anti_kill=0; X if (*ptr) X sprintf(&line,"quit :%s",ptr); X else X sprintf(&line,"quit Leaving"); X putbold(&line,FALSE); strcat(&line,"\r\n\0"); X qio_send(&line); X rundown(0); X`125 X X/*************************************************************************** V***/ X Xdo_quote(dummy,ptr,line) Xint dummy; Xchar *ptr,*line; X`123 X putbold(cmdch`0910`093?line:&line`0911`093,TRUE); X strcpy(inpline,ptr);inpx=strlen(inpline); X`125 X X/*************************************************************************** V***/ X Xdo_redirect(opt,ptr) Xint opt; Xchar *ptr; X`123 X char line`091512`093,msg`091512`093,txt`091256`093,txt2`091256`093,otxt`09 V1256`093,*lptr,*lnick,*txtp; X X if (*ptr) `123 X if (*lastmsg) `123 X lptr=lastmsg; lnick=txt; copyspace(lptr,lnick); whilespace(lptr); X X txtp=txt2; copyspace(ptr,txtp); whilespace(ptr); X if (opt==2) `123 X if (!*ptr) `123 strcpy(otxt,"Oops, please ignore..."); ptr=otxt; `12 V5 X if (!strcmp(txt,"*")) `123 X sprintf(line,"PRIVMSG %s :%s\r\n",my_chan,ptr); X sprintf(msg,"> %s",ptr); X `125 else `123 X sprintf(line,"PRIVMSG %s :%s\r\n",txt,ptr); X sprintf(msg,"-> *%s* %s",txt,ptr); X `125 X putchunk(msg,TRUE); qio_send(line);`032 X `125 X if (!strcmp(txt2,"*")) `123 X sprintf(line,"PRIVMSG %s :%s\r\n",my_chan,lptr); X sprintf(msg,"> %s",lptr); X `125 else `123 X sprintf(line,"PRIVMSG %s :%s\r\n",txt2,lptr); X sprintf(msg,"-> *%s* %s",txt2,lptr); X `125 X putbold(msg,TRUE); qio_send(line); X `125 else putchunk("*** Sorry, you have no message to redirect...",FALSE V); X `125 else putchunk("*** Missing nickname for command REDIRECT.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_script(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char *tp,txt`091MAXINPLEN`093,tmp`091256`093; X FILE *scriptfile; X X if (*ptr) `123 X strcpy(tmp,ptr); X if (!(scriptfile=fopen(tmp,"r"))) `123 X sprintf(tmp,"%s.irc",ptr); X if (!(scriptfile=fopen(tmp,"r"))) `123 X sprintf(txt,"*** Error: Cannot execute %s",ptr); putchunk(txt,FALSE) V; X return; `125 X `125 X sprintf(txt,"***** Executing file %s *****",tmp); putchunk(txt,FALSE); X while (fgets(txt,sizeof(txt),scriptfile)) `123 X if (*(tp=txt+strlen(txt)-1)=='\n') *tp='\0'; X if (strlen(txt) && txt`0910`093!=';') X if (testinpline(txt)) `123 X if (dbopt&8) `123 sprintf(txt,"DEBUG: `091script`093 `124%s`124",i Vnpline); putchunk(txt,FALSE); `125 X inpline`091inpx++`093=13; inpline`091inpx++`093=10; inpline`091inp Vx`093=0; X qio_send(inpline); X `125 X `125 X fclose(scriptfile); X sprintf(txt,"***** Finished scriptfile %s *****",tmp); putchunk(txt,FALS VE); X inpline`0910`093='\0'; inpx=0; X `125 X else putchunk("*** Error: No filename given. Please specify.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_server(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char *txtp,txt`091256`093,ol`091256`093; X X txtp=txt; copyspace(ptr,txtp); whilespace(ptr); X if (!*txt) `123 X sprintf(ol,"%s",server); X putchunk(ol,FALSE);`032 X return; `125 X#ifdef MULTINET X else if (!atoi(txt)) `123 X sprintf(ol,"Sorry, only IP adresses work at this stage."); X putchunk(ol,FALSE); X return; `125 X#endif X else `123 X strcpy(server,txt); if (*ptr) srvport=atoi(ptr); X anti_kill`124=2; your_priv=FALSE; oppwd`0910`093='\0'; avenger=FALSE; X rundown(1); `125 X`125 X X/*************************************************************************** V***/ X Xdo_showesc() X`123 X showesc_flag = !showesc_flag; X ctrl_flag = showesc_flag; X if (showesc_flag) putchunk("*** Enabled display of escape characters",FALS VE); X else putchunk("*** Enabled interpretation of escape characters",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_signal(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char txt`09180`093,ol`091256`093; X X if (!strcmp(ptr,"?")) `123 X txt`0910`093='\0'; X if (signalmode&1) strcat(txt,"private,"); X if (signalmode&2) strcat(txt,"public,"); X if (signalmode&4) strcat(txt,"modification,"); X if (signalmode==0) strcpy(txt,"no,"); X if (signalmode==7) strcpy(txt,"all,"); X txt`091strlen(txt)-1`093='\0'; X sprintf(ol,"*** Message signals are enabled for %s messages.",txt); X putchunk(ol,FALSE); X `125 else X if (!stricmp(ptr,"none")) `123 X signalmode=0; putchunk("*** All message signals disabled.",FALSE); X `125 else X if (!stricmp(ptr,"priv")) `123 X signalmode`124=1; putchunk("*** Message signals enabled for private mess Vages.",FALSE); X `125 else X if (!stricmp(ptr,"msg")) `123 X signalmode`124=2; putchunk("*** Message signals enabled for public messa Vges.",FALSE); X `125 else X if (!stricmp(ptr,"mod")) `123 X signalmode`124=4; putchunk("*** Message signals enabled for modification V messages.",FALSE); X `125 else X if (!stricmp(ptr,"all")) `123 X signalmode=7; putchunk("*** All message signals enabled.",FALSE); X `125 else X putchunk("*** Unknown command qualifier for SIGNAL specified.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_spawn() X`123 X struct dsc$descriptor cdsc; X struct dsc$descriptor *cdscp; X int i; X long substatus; X X printf("\n-----------------------------------\n"); X printf("Reenter IRC with the command LOGOUT\n"); X printf("-----------------------------------\n"); X sys$cancel(mbx_chan); X sys$cancel(chan); X c$cks(sys$qiow(0,chan,IO$_SETMODE,iosb,0,0,oldmode,sizeof(oldmode),0,0,0,0 V)); X sys$dassgn(chan); X cdscp=0; kbd_fin=1; X lib$spawn(cdscp,0,0,0,0,0,&substatus,0,0,0); X i=MAXBRDCSTLEN; c$cks(lib$asn_wth_mbx(c$dsc("TT:"),&i,&i,&chan,&mbx_chan)) V; X c$cks(sys$qiow(0,chan,IO$_SETMODE,iosb,0,0,newmode,sizeof(newmode),0,0,0,0 V)); X delwin(newwin(LINES,COLS,0,0)); X win_refresh(); X c$cks(sys$qio(0,chan,IO$_READVBLK+IO$M_NOFILTR+IO$M_NOECHO,iosb,kbd_ast,0, X &inpchar,1,0,0,0,0)); X`125 X X/*************************************************************************** V***/ X Xdo_squit(int dummy, char *ptr) X`123 Xchar *tmp,ol`091512`093; X X tmp = ptr; X tillspace(ptr); X if (strlen(ptr)) `123 X`009*ptr = '\0'; ptr++; X`009sprintf(&ol,"SQUIT %s :%s\r\n", tmp, ptr); X`009qio_send(&ol); X `125 X else putchunk("*** Reason required for /SQUIT.",FALSE); X`125 X X/*************************************************************************** V***/ X Xdo_srvinfo(dummy,ptr) Xint dummy; Xchar *ptr; X`123 X char txt`091256`093; X X sprintf(txt,"VERSION %s\r\n",ptr); qio_send(txt); X sprintf(txt,"TIME %s\r\n",ptr); qio_send(txt); X sprintf(txt,"ADMIN %s\r\n",ptr); qio_send(txt); X sprintf(txt,"MOTD %s\r\n",ptr); qio_send(txt); X`125 X X/*************************************************************************** V***/ X Xdo_status() X`123 X char txt`091256`093; X extern do_clock(); X X status_line= !status_line; X if (status_line) `123 X scroll(msgwin); X statwin=newwin(1,COLS,LINES-2,0); wsetattr(statwin,_REVERSE); wclear(sta Vtwin); X msg_refresh(); X create_status(); X do_clock(0); X `125 else `123 X mvwaddstr(msgwin,LINES-2,0,"*** Statusline removed again."); X delwin(statwin); X msg_refresh(); X do_clock(0); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_time(flag,ptr) Xint flag; Xchar *ptr; X`123 X char line`091256`093; X X line`0910`093=cmdch`0910`093; X if (flag==1) sprintf(&line`0911`093,"date %s",ptr); X if (flag==2) sprintf(&line`0911`093,"time %s",ptr); X sprintf(inpline,"time %s",ptr); inpx=strlen(inpline); X putbold(cmdch`0910`093?line:&line`0911`093,TRUE); X`125 X X/*************************************************************************** V***/ X Xdo_who(flag,ptr,line) Xint flag; Xchar *ptr,*line; X`123 X char *tp; X X if (flag == 0 && (!strcmp(ptr,"*"))) strcpy(ptr,my_chan); X else if (flag==1) switch (*ptr) `123 X case '@': strcpy(whoinp,"@ "); ptr++; whilespace(ptr); break; X case '*': strcpy(whoinp,"* "); ptr++; whilespace(ptr); break; X case '#': strcpy(whoinp,"*@"); ptr++; whilespace(ptr); break; X default: strcpy(whoinp,"* "); if (*ptr) ptr++; whilespace(ptr); X `125 X else if (flag==3 `124`124 flag==4) `123 X tp=whoinp; copyspace(ptr,tp); X `125 X sprintf(inpline,"WHO %s",ptr); inpx=strlen(inpline); X whoop = flag; X`125 X X/*************************************************************************** V***/ $ CALL UNPACK COMMAND.C;76 941564786 $ create/nolog 'f' XCopyright 1990 by Very Mad Students, University of Karlsruhe, FRG X XOriginal program written by Bernd Onasch, Andreas Ley, and Michael Pall of t Vhe XUniversity of Karlsruhe, Germany. X XModified, and currently maintained by GrayElf: Paul Williams Xpaul@coombs.anu.edu.au. X XThanks to Elon College Academic Computing (Elon College,NC USA) for`032 Xthe help and support: XMatthew Harttree (Harttree@vax1.elon.edu) (IRC: SnOOzn) XTerri Kirchen (Kirchen@vax1.elon.edu) X XThanks also to Herman Fredriksson for his CTCP code, Elight and Tychy for th Veir X2.8 patches, and everyone who has submitted bug reports, bug fixes, Xsuggestions, complaints, and other feedback. $ CALL UNPACK CREDITS.TXT;3 1930125219 $ create/nolog 'f' X/************************************/ X/* Version number of IRC Client / X/************************************/ X`032 X#define VMSVERSION "1.7.6" X`032 X/*****************************************/ X/* Default server/port of IRC Client */ X/*****************************************/ X`032 X#define DEFSERVER "" X#define DEFPORT "6667" $ CALL UNPACK ENVIRONMENT.H;12 1852471074 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client HEADER file X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#include curses X#include time X X#ifdef CMU X#define TRANSPORT "CMU-tek" X#endif X#ifdef WIN X#define TRANSPORT "Wollongong" X#endif X#ifdef UCX X#define TRANSPORT "UCX" X#endif X#ifdef PSC X#define TRANSPORT "TCPware" X#endif X#ifdef MULTINET X#undef TRANSPORT X#define TRANSPORT "Multinet" X#endif X X#undef`009STATUS`009`009`009`009/* Status line on by default */ X#define UAI$_OWNER`00912`009`009/* Needed part of */ X X#define MAXFONTHEIGHT 10`009`009/* Maximum height for font characters */ X#define MAXFONTWIDTH 7`009`009`009/* Maximum width of a font character */ X#define MAXHIST 20`009`009`009/* Size of the history buffer */ X#define MAXPARA 15`009`009`009/* Maximum # of param's from server */ X#define MAXNICKLEN 10`009`009`009/* Maximum length of a nickname */ X#define PRIVREC 10`009`009`009/* Buffersize for PRIVMSG nicknames */ X#define MAXINPLEN 238`009`009`009/* Size of input line buffer */ X#define MAXNETLEN 1024`009`009`009/* Size of buffer for net read */ X#define MAXBRDCSTLEN 256`009`009/* Maximum size of broadcasts */ X#define BRDCSTWINHEIGHT 4`009`009/* Height of broadcast window */ X#define MAXCOLS 250`009`009`009/* Max. column # of the terminal */ X#define MINCOLS 80`009`009`009/* Min. column # of the terminal*/ X#define MINLINES 6`009`009`009/* Min. line # of the terminal */ X#define MAXSAVMSG 200`009`009`009/* Size of message recall buffer */ X#define MAXDCLMSG 50`009`009`009/* Size of DCL recall buffer */ X#define CLOCKINTERVAL "0 00:01:00.00"`009/* Timer interval used for the CLOC VK */ X#define INTERVAL "0 00:01:00.00"`009/* Timer interval used for LEAVE */ X#define NOTIFYINTERVAL "0 00:01:00.00"`009/* Timer interval used for NOTIFY V */ X#define NETINTERVAL 30000000`009`009/* Timer interval of FLUSH (100ns) */ X#define RECONNECTDELAY 2`009`009/* Network shutdown timeout delay */ X#define MAXCHANNELS 16`009`009`009/* Maximum Multichannels allowed */ X#define MAXCHNUSR 256`009`009`009/* Maximum users on a channel */ X X/*************************************************************************** V***/ X X#ifndef NULL X#define NULL 0 X#endif X#ifdef NODCL X#undef NODCL X#undef MAXDCLMSG X#define MAXDCLMSG 5 X#endif X X#ifdef NOMEM X#undef NOMEM X#undef MAXDCLMSG X#undef MAXSAVMSG X#define MAXDCLMSG 5 X#define MAXSAVMSG 20 X#endif X X#ifdef MAXBUF X#undef MAXSAVMSG X#define MAXSAVMSG MAXBUF X#endif X X#ifdef HIST X#undef MAXHIST X#define MAXHIST HIST X#endif X X/*************************************************************************** V***/ X Xtypedef char fonttyp`091256`093`091MAXFONTHEIGHT`093`091MAXFONTWIDTH+1`093; X#ifndef bool Xtypedef char bool; X#endif Xtypedef struct `123 unsigned long l1; long l2; `125 quadw; Xtypedef struct `123 X/* WINDOW *window; */ X char name`091256`093; X int lines,start; X struct `123 char name`091MAXNICKLEN`093; bool chanop; `125 user`091MAXCHNU VSR`093; X`125 CHANNEL; X X/* NotifyQ: the structure for the notify stuff */ Xtypedef struct notify_stru `123 X struct notify_stru *next;`009/* pointer to next notify person */ X char *nick;`009`009`009/* nickname of person to notify about */ X int flag;`009`009`009/* 1=person on irc, 0=person not on irc */ X`125`009NotifyStruct; X Xtypedef struct notify_lis `123 X struct NotifyStruct *first; X struct NotifyStruct *last; X`125`009NotifyList; X XNotifyList *notify_list; X Xtypedef struct alias_struct `123 X struct alias_struct *next; X char *alias; X char *equiv; X`125`009AliasStruct; X XAliasStruct *alias_list; X Xstruct Message `123 X char *command; X int (* funct)(); X int varpar; X int returncode; X char *helptext; X`125; X X/*************************************************************************** V***/ X Xglobalref struct Message msgtab`091`093; Xglobalref char spc`091`093,spcchars`091`093,trmchars`091`093; X Xextern unsigned short chan,net_chan,dcl_chan_in,dcl_chan_out,mbx_chan; Xextern unsigned short dcl_in_iosb`0914`093,dcl_out_iosb`0914`093,mbx_iosb`09 V14`093; Xextern unsigned int iosb`0912`093,read_iosb`0912`093,oldmode`0913`093,newm Vode`0913`093; Xextern char persname`09180`093,my_nick`091MAXNICKLEN`093,server`09180`093, X`009 lfilename`091160`093,fontnam`091160`093,dirpath`091160`093,inpline`0 V91256`093,inpchar, X`009 cmdch`091`093,oppwd`091256`093,histbuf`091MAXHIST`093`091256`093,fke Vy`09136`093`091256`093, X`009 savbuf`091MAXSAVMSG`093`091MAXNETLEN`093,recbuf`091MAXSAVMSG+1`093`0 V91MAXNETLEN`093, X`009 outl`091MAXNETLEN`093,*nr_pos,dcloutbuf`091MAXNETLEN`093,*dcl_pos, X`009 brdcstbuf`091MAXBRDCSTLEN`093,query`091256`093,*query_ptr`09132`093, Vignore`091256`093, X`009 *ignore_ptr`09132`093,srvnam`09180`093,script`091160`093,whoinp`0918 V0`093, X`009 whoop,dbopt,signalmode,lastmsg`091256`093,notify_array`09150`093`091 V10`093, X`009 prvrec`091PRIVREC`093`091MAXNICKLEN+1`093,dclbuf`091MAXDCLMSG`093`09 V1MAXNETLEN`093; Xextern bool anti_kill,kbd_fin,edit_mode,away_flag,status_line, X`009 notice_flag,errlog_flag,your_priv,ctrl_flag,showesc_flag, X`009 ignore_flag,font_mode,flush_mode,avenger,clock_mode,dcl_mode, X`009 dcl_mbx,brdcst_flag,recall_mode,bold_flag,dcl_visible; Xextern int inpx,crsr,scrcurs,escflag,histptr,histptrt,savptr,dclptr,srvport, X`009 fontheight,fontwidth,dcl_size,recpos`091MAXSAVMSG+1`093,fkey_mode`091 V36`093, X`009 net_chan_tcp,query_max,ignore_max,userlen,help_num,recall_num, X`009 recall_start,fkey_pos,inpscroll,channels,HiddenCmd,AllCmd, X num_notify; Xextern long leave_id,clock_id,dcl_pid,notify_id; Xextern quadw leave_time,clock_time,net_time,notify_time; Xextern FILE *logfile; Xextern fonttyp font; Xextern CHANNEL channel`091MAXCHANNELS`093; Xextern WINDOW *dispwindow,*inpwin,*clockwin,*brdcstwin,*tmpwin,*dclwin,*t2wi Vn, X`009 *statwin; Xextern time_t last_command; X X/*************************************************************************** V***/ X X#define NIL`009`009((void *) 0) X#define min(a,b)`009((a)<(b)?(a):(b)) X#define max(a,b)`009((a)>(b)?(a):(b)) X#define upcase(c)`009(islower(c)?toupper(c):(c)) X#define locase(c)`009(isupper(c)?tolower(c):(c)) X#ifndef isspace X#define isspace(c)`009(strchr(spcchars,(c))!=0) X#endif X#define isterminator(c)`009(strchr(trmchars,(c))!=0) X#define ringplus(a,b)`009(((a)<(b)-1)?(a)+1:0) X#define ringminus(a,b)`009((a)?(a)-1:(b)-1) X#define tillspace(a)`009while (*(a)!=' ' && *(a)) *(a)++; X#define whilespace(a)`009while (*(a)==' ') *(a)++; X#define copyspace(a,b)`009while (*(a)!=' ' && *(a)) *(b)++ = *(a)++; *(b)='\ V0'; X#define WORKLINES`009(LINES-(status_line?2:1)) X X/*************************************************************************** V***/ X X#define msgwin dispwindow X#define my_chan channel`0910`093.name $ CALL UNPACK HEADER.H;9 912317956 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client version 1.7.6 X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X You may freely distribute this software provided that the above copyright X notice remains unchanged in all copies. You are free to make your own chang Ves X to the code but only unmodified copies may be redistributed. X X E-Mail contact for bug-reports: paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#ifdef WIN X#include X#include X#include X#include X#include X#include X#include Xstruct hostent *dest_host; Xstruct sockaddr_in data_socket = `1230`125; X#endif X#ifdef MULTINET Xextern noshare int h_errno; X#endif X#ifdef UCX X#include X#include X#include X#include X#include "ucxdef.h" Xstruct hostent *dest_host; X#endif X#ifdef PSC X#include X#include X#include X#include Xstruct hostent *dest_host; Xstruct sockaddr_in data_socket = `1230`125; Xstruct descriptor `123long int len; X char *adr;`125 ecb_desc, hn_desc; Xstruct itemlist `123short int param_id; X long int param_val;`125 ecb`0912`093; Xlong int host_addr; X#endif X#include "header.h" X#include "environment.h" X X/*-------------------------------------------------------------------------- V--*/ X Xextern net_ast(),kbd_ast(),brdcst_ast(),msg_refresh(); X X/*-------------------------------------------------------------------------- V--*/ X Xglobaldef char spcchars`091`093=" .,:;()`091`093`123`125<>", trmchars`091`09 V3=" ?!.,;:-", X`009 spc`091`093=" V "; Xunsigned short chan,net_chan,dcl_chan_in,dcl_chan_out,mbx_chan; Xunsigned short dcl_in_iosb`0914`093,dcl_out_iosb`0914`093,mbx_iosb`0914`093; Xunsigned int iosb`0912`093,read_iosb`0912`093, X oldmode`0913`093,newmode`0913`093; Xchar persname`09180`093,my_nick`091MAXNICKLEN`093,server`09180`093, X lfilename`091160`093="\0",fontnam`091160`093="\0",dirpath`091160`093, X inpline`091256`093,inpchar='\0',cmdch`091`093="/OPER",oppwd`091256`093= V"\0", X histbuf`091MAXHIST`093`091256`093,fkey`09136`093`091256`093,dclbuf`091M VAXDCLMSG`093`091MAXNETLEN`093, X savbuf`091MAXSAVMSG`093`091MAXNETLEN`093,recbuf`091MAXSAVMSG+1`093`091M VAXNETLEN`093, X outl`091MAXNETLEN`093,*nr_pos=outl,dcloutbuf`091MAXNETLEN`093,*dcl_pos= Vdcloutbuf, X brdcstbuf`091MAXBRDCSTLEN`093, X query`091256`093,*query_ptr`09132`093,ignore`091256`093,*ignore_ptr`091 V32`093, X prvrec`091PRIVREC`093`091MAXNICKLEN+1`093, X srvnam`09180`093="\0",script`091160`093,whoinp`09180`093,whoop,dbopt='\ V0',signalmode='\0', X killer`091MAXNICKLEN`093="\0",lastmsg`091256`093="\0"; Xbool anti_kill=0,kbd_fin=0,edit_mode=0, X notice_flag=TRUE,errlog_flag=FALSE,your_priv=FALSE,ctrl_flag=FALSE, X showesc_flag=TRUE,away_flag=FALSE,status_line=FALSE, X ignore_flag=FALSE,font_mode=FALSE,flush_mode=FALSE,avenger=FALSE, X clock_mode=FALSE,dcl_mode=FALSE,dcl_mbx=FALSE,brdcst_flag=FALSE, X recall_mode=FALSE,bold_flag=FALSE,dcl_visible; Xint inpx=0,crsr,scrcurs,escflag,histptr=0,histptrt=0,savptr=0,dclptr=0, X srvport,fontheight,fontwidth,dcl_size,recpos`091MAXSAVMSG+1`093,fkey_mod Ve`09136`093, X net_chan_tcp=0,query_max=0,ignore_max=0,userlen=80,help_num=0, X recall_num=0,recall_start= -1,fkey_pos=0,inpscroll=65,windows,num_notify V; Xlong leave_id,clock_id,dcl_pid=0; Xquadw leave_time=`1230,0`125,clock_time=`1230,0`125,net_time=`1230,0`125; XFILE *logfile=NULL; Xfonttyp font; XCHANNEL channel`091MAXCHANNELS`093; XWINDOW *inpwin,*brdcstwin,*statwin, X *clockwin=NIL,*tmpwin=NIL,*dclwin=NIL,*t2win=NIL; X X/*************************************************************************** V***/ X Xdump(adr,len) Xchar *adr; Xint len; X`123 X int cnt; X char tmp`091256`093,hex`09116`093; X X while(len>0) `123 X tmp`0910`093='\0'; X for(cnt=16;cnt && len--;cnt--) `123 X sprintf(hex,cnt==8?"%02x-":"%02x ",(unsigned char)*adr++); X strcat(tmp,hex); `125 X putbold(tmp,FALSE); X `125 X`125 X X/*************************************************************************** V***/ X Xint stricmp(src1,src2) Xchar *src1,*src2; X`123 X while(*src1) `123 X if (!(*src2)) return(upcase(*src1)); X if (upcase(*src1)!=upcase(*src2)) X return(upcase(*src1)-upcase(*src2)); X src1++; src2++; X `125 X return(-upcase(*src2)); X`125 X X/*************************************************************************** V***/ X Xint strincmp(src1,src2,cnt) Xchar *src1,*src2; Xint cnt; X`123 X while(*src1 && cnt--) `123 X if (!*src2) return(upcase(*src1)); X if (upcase(*src1) != upcase(*src2)) X return(upcase(*src1)-upcase(*src2)); X src1++; src2++; X `125 X return(cnt?-upcase(*src2):0); X`125 X X/*************************************************************************** V***/ X Xint quadcmp(tim1,tim2) Xquadw *tim1,*tim2; X`123 X if (tim1->l2==tim2->l2) return(tim1->l1-tim2->l1); X else return(tim1->l2-tim2->l2); X`125 X X/*************************************************************************** V***/ X Xint *c$_tmphead = (int *) 0; X Xint *c$alloc_tmp(size) Xint size; X`123 X int *tmp; X X tmp=malloc(size+4); *tmp=c$_tmphead; c$_tmphead=tmp; X return(c$_tmphead+1); X`125 X X/*************************************************************************** V***/ X Xc$dsc(c$_str) Xchar *c$_str; X`123 X struct dsc$descriptor *c$_tmpdesc; X X c$_tmpdesc = c$alloc_tmp(8); X c$_tmpdesc->dsc$w_length = strlen(c$_str); X c$_tmpdesc->dsc$b_dtype = DSC$K_DTYPE_T; X c$_tmpdesc->dsc$b_class = DSC$K_CLASS_S; X c$_tmpdesc->dsc$a_pointer= c$_str; X return(c$_tmpdesc); X`125 X X/*************************************************************************** V***/ X Xc$cks(c$_status) Xint c$_status; X`123 X int *c$_tmp; X X if (!(c$_status&1) && c$_status!=0) X if (c$_status==SS$_ABORT `124`124 c$_status==SS$_VCCLOSED) rundown(0); X#ifdef UCX X else if (c$_status==SS$_LINKEXIT `124`124 c$_status==SS$_LINKDISCON) run Vdown(0); X#endif X else if (c$_status == 33200) `123 X printf("Connection terminated by server."); X rundown(0); `125 X else `123 printf("\nError #%d\n",c$_status); lib$stop(c$_status); `125 X while (c$_tmphead) `123 X c$_tmp= *c$_tmphead; free(c$_tmphead); c$_tmphead=c$_tmp; X `125 X return(c$_status); X`125 X X/*************************************************************************** V***/ X Xqio_send(text) Xchar *text; X`123 X char tmp`091MAXNETLEN`093; X unsigned short *i_o_size; X extern putchunk(); X X if (dbopt&4) `123 sprintf(tmp,"DEBUG: `091$qio`093 `124%s`124",text); putc Vhunk(tmp,FALSE); `125 X strcpy(tmp,text); X i_o_size=iosb; X#if CMU `124`124 WIN `124`124 PSC X c$cks(sys$qiow(0,net_chan,IO$_WRITEVBLK,iosb,0,0,tmp,strlen(tmp),0,net_cha Vn_tcp,0,0)); X#endif X#ifdef UCX X c$cks(sys$qiow(3,net_chan,IO$_WRITEVBLK,iosb,0,0,tmp,strlen(tmp),0,0,0,0)) V; X#endif X c$cks(*i_o_size); X`125 X X/*************************************************************************** V***/ X Xputwin(win,lines,col,txt,flag,flag2) XWINDOW *win; Xint lines,col; Xchar *txt; Xbool flag,flag2; X`123 X int len=strlen(txt); X char tmp`091256`093; X X if (!len) `123 scroll(win); if (flag) wrefresh(win); `125 X while (len>col) `123 X memcpy(tmp,txt,col); tmp`091col`093='\0'; X scroll(win); mvwaddstr(win,lines-1,0,tmp); if (flag) wrefresh(win); X txt+=col; len-=col; X `125 X if (len) `123 X if (!flag2) scroll(win); X mvwaddstr(win,lines-1,0,txt); X if (flag2) scroll(win); X if (flag) wrefresh(win); X `125 X`125 X X/*************************************************************************** V***/ X Xputparse(il) Xunsigned char *il; X`123 X`009unsigned char ol`091256`093,*ilp,l`091MAXNETLEN`093,*lp; X`009int i,pos; X`009ilp=il; lp=l; X X`009while (*ilp) X`009`009if (showesc_flag && (*ilp<32 `124`124 (*ilp>127 && *ilp<160))) `123 X`009`009`009*lp++ = '`094'; *lp++ = (*ilp++)+64; X`009`009`125 else *lp++ = *ilp++; X`009*lp='\0'; X X`009ilp=l; X`009while (*ilp) X`009`009`123 X`009`009i=0; pos=0; lp=ilp; X`009`009while (ih_addr)); X `125 X data_socket.sin_family=AF_INET; X data_socket.sin_port=htons(srvport); X c$cks(sys$qiow(0,net_chan,IO$_CONNECT,iosb,0,0,&data_socket,sizeof(data_so Vcket),0,0,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X#endif X/*-------------------------------------------------------------------------- V--*/ X#ifdef PSC X c$cks(sys$assign(c$dsc("TCP0:"),&net_chan,0,0)); X hn_desc.adr=tmpline; X hn_desc.len=strlen(tmpline); X if (hns_lookuphost(&hn_desc,&host_addr)!=SS$_NORMAL) `123 X printf("\045IRC-F-HOST, Host %s not defined by TCP\n",tmpline); X sys$exit(1); X `125 X ecb`0910`093.param_id =2; ecb`0911`093.param_id =3; X ecb`0910`093.param_val=host_addr; ecb`0911`093.param_val=srvport; X ecb_desc.len= sizeof(ecb); X ecb_desc.adr= &ecb; X c$cks(sys$qiow(0,net_chan,IO$_SETMODE`124IO$M_CTRL`124IO$M_STARTUP,iosb,0, V0,0,&ecb_desc,0,0,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X#endif X/*-------------------------------------------------------------------------- V--*/ X#ifdef UCX X sck_parm`0910`093=INET$C_TCP; X sck_parm`0911`093=INET_PROTYP$C_STREAM; X X lhst_adrs.lgth= sizeof(local_host); X lhst_adrs.hst= &local_host; X lhst_il3.lgth= sizeof(local_host); X lhst_il3.hst= &local_host; X lhst_il3.retlth=sizeof(local_host); X lsck_adrs.lgth= 16; X lsck_adrs.rmt_adrs= &local_hostaddr; X lsck_adrs.retlth= &l_retlen; X X rhst_adrs.lgth= sizeof(remote_host); X rhst_adrs.hst= &remote_host; X rsck_adrs.lgth= 16; X rsck_adrs.rmt_adrs= &remote_hostaddr; X rsck_adrs.retlth= &r_retlen; X X local_host.inet_family=INET$C_AF_INET; X local_host.inet_port=0; X local_host.adrs`0910`093=0; local_host.adrs`0912`093=0; X local_host.adrs`0911`093=0; local_host.adrs`0913`093=0; X X remote_host.inet_family=INET$C_AF_INET; X remote_host.inet_port=htons(srvport); X X if (isdigit(tmpline`0910`093)) `123 X ip=inet_addr(tmpline); X for (i=0;i<4;i++) `123 remote_host.adrs`091i`093=ip&0xff; ip>>=8; `125 X `125 else `123 X if ((dest_host=gethostbyname(tmpline))==NULL) `123 X printf("\045IRC-F-HOST, Host %s not defined by TCP\n",tmpline); sys$ex Vit(1); `125 X ip= *((unsigned long *)(dest_host->h_addr)); X for (i=0;i<4;i++) `123 remote_host.adrs`091i`093=ip&0xff; ip>>=8; `125 X `125 X X c$cks(sys$assign(c$dsc("BG:"),&net_chan,0,0)); X c$cks(sys$qiow(3,net_chan,IO$_SETMODE,iosb,0,0,&sck_parm,0x01000000`124SOC VKOPT$M_REUSEADDR,&lhst_adrs,0,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X c$cks(sys$qiow(3,net_chan,IO$_SENSEMODE,iosb,0,0,0,0,&lsck_adrs,0,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X c$cks(sys$qiow(3,net_chan,IO$_ACCESS,iosb,0,0,0,0,&rhst_adrs,0,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X c$cks(sys$qiow(3,net_chan,IO$_SENSEMODE,iosb,0,0,0,0,0,&rsck_adrs,0,0)); X if (!(*ioptr & 1)) `123 X if (*ioptr==SS$_ABORT) sys$exit(iosb`0911`093); X else sys$exit(*ioptr); X `125 X#endif X/*-------------------------------------------------------------------------- V--*/ X X if (inpchar) `123 putchunk(" ",TRUE); putchunk(" ",TRUE); putchunk(" ",TRU VE); `125 X else `123 X sprintf(tmpline,"*** Local VMS IRC Client version %s",VMSVERSION); putch Vunk(tmpline,TRUE); X sprintf(tmpline,"*** This Client was last modified %s %s",__DATE__,__TIM VE__); putchunk(tmpline,TRUE); X `125 X wrefresh(inpwin); X usrptr=getenv("USER"); X sprintf(tmpline,"USER %s x y :<%s>\r\n",usrptr,persname); qio_send(tmpline V); X if (nick`0910`093) `123 sprintf(tmpline,"NICK %s\r\n",nick); qio_send(tmpl Vine); `125 X if (*oppwd && your_priv && anti_kill&1) `123 sprintf(tmpline,"OPER %s\n",o Vppwd); qio_send(tmpline); X `125 else `123 oppwd`0910`093='\0'; your_priv=FALSE; `125 X if (avenger && your_priv) `123 sprintf(tmpline,"KILL %s *reKILL*\n",nstrip V(killer)); qio_send(tmpline); `125 X if (strcmp(chan_name,"0")) `123 X i = channels - 2; X while (i+1) `123 X`009sprintf(tmpline,"JOIN %s\n",channel`091i`093.name); X`009qio_send(tmpline); i--; `125 X `125 X killer`0910`093='\0'; away_flag=FALSE; X srvnam`0910`093='\0'; X X c$cks(sys$gettim(&net_time)); X c$cks(sys$qio(0,net_chan,IO$_READVBLK,read_iosb,net_ast,0, X outl,MAXNETLEN-1,0,0,0,0)); X`125 X X/*************************************************************************** V***/ X Xmain(argc,argv) Xint argc; Xchar *argv`091`093; X`123 X char *c,tmpline`091256`093,*userptr,*nickptr,*servptr,*scriptptr,*portptr, Viport`09140`093, X usr`09140`093; X short *ioptr=iosb; X int i,lin,col,dev,error, X nicklen=sizeof(my_nick),servlen=sizeof(server),scriptlen=sizeof(script V), X portlen=sizeof(iport); X FILE *srvfile; X X#ifdef DEBUG X dbopt=0xff; X#endif X X alias_list = NULL; X notify_list = malloc(sizeof(NotifyList)); X notify_list->first = NULL; notify_list->last = NULL; X c=getenv("PATH"); sprintf(dirpath,"%s",c); X for (i=0;iMAXCOLS `124`124 dev==0 V) `123 X sys$cancel(mbx_chan); sys$cancel(chan); sys$dassgn(chan); X if (dev==0) printf("This client does not support unknown terminal types! V\n"); X else if (col>MAXCOLS) printf("Wow! Your terminal is really large, but to Vo large for IRC...\n"); X else printf("Your terminal is really too small for IRC!\n"); X sys$exit(1); X `125 X X /*------------------------------------------------------------------------ V--*/ X X if (argc>1) nickptr=argv`0911`093; X else if (getenv("IRCNICK")) nickptr=getenv("IRCNICK"); X else nickptr=getenv("USER"); X if (nickptr) `123 strncpy(my_nick,nickptr,nicklen); my_nick`091nicklen-1`0 V93='\0'; `125 X else my_nick`0910`093='\0'; X if (argc>2) servptr=argv`0912`093; else servptr=getenv("IRCSERVER"); X if (servptr) `123 strncpy(server,servptr,servlen); server`091servlen-1`093 V='\0'; `125 X else if ((servptr=getenv("IRCSRVLIS")) `124`124 !(access("SYS$LOGIN:IRCSRV V.DAT",0))) X server`0910`093='\0'; X else if (strlen(DEFSERVER)) strcpy(server,DEFSERVER); X else `123 X printf("You have not specified an IRC server. To do this, simply edit\n" V); X printf("your LOGIN.COM to include the command line, or type it in\n"); X printf("each time you login before using IRC:\n\n"); X printf("$ DEFINE IRCSERVER %c%c\n\n",34,34); X printf("If you do not know the server closest to you, please ftp the\n") V; X printf("READ.ME text file from the same place as this program, and check V\n"); X printf("the brief list of servers in there. Once on IRC, ask an IRC\n"); X printf("Operator which is the closest server for you.\n"); X exit(0);`032 X `125 X if (argc>3) portptr=argv`0913`093; else portptr=getenv("IRCPORT"); X if (portptr) `123 strncpy(iport,portptr,portlen); iport`091portlen-1`093=' V\0'; `125 X else strcpy(iport,DEFPORT); X srvport=atoi(iport); X if (scriptptr=getenv("IRCLOGIN")) `123 X strncpy(script,scriptptr,scriptlen); script`091scriptlen-1`093='\0'; `12 V5 X else if (!access("SYS$LOGIN:LOGIN.IRC",0)) X sprintf(script,"SYS$LOGIN:LOGIN.IRC"); X else script`0910`093='\0'; X if (userptr=getenv("IRCNAME")) `123 X strncpy(persname,userptr,userlen); persname`091userlen-1`093='\0'; `125 X else `123 X strcpy(usr,get_uaf_entry()); X printf("\n\n\nInternet Relay Chat - VMS Client %s\n",VMSVERSION); X printf("===================\n\n"); X printf("Use DEFINE IRCNAME \042Your real name\042 to predefine this...\n V\n"); X printf("Personal name? `091%s`093 ",usr); X c$cks(sys$qiow(0,chan,IO$_READVBLK,iosb,0,0,persname,80,0,0,0,0)); X c$cks(*ioptr); X persname`091*(ioptr+1)`093='\0'; X if (!*persname) strcpy(persname,usr); X c$cks(lib$set_logical(c$dsc("IRCNAME"),c$dsc(persname),0,0,0)); X `125 X X /*------------------------------------------------------------------------ V--*/ X X initscr(); X brdcstwin=newwin(BRDCSTWINHEIGHT,COLS,0,0); wsetattr(brdcstwin,_REVERSE); V wclear(brdcstwin); X windows=0; create_channel("0"); X dispwindow=newwin(WORKLINES,COLS,0,0); X wclear(dispwindow); wrefresh(dispwindow); X inpwin=newwin(1,COLS,LINES-1,0); wclear(inpwin); X if (bold_flag) wsetattr(inpwin,_BOLD); X#ifdef STATUS X do_status(); X#endif X X c$cks(sys$qiow(0,chan,IO$_SENSEMODE,iosb,0,0,oldmode,sizeof(oldmode),0,0,0 V,0)); X newmode`0910`093=oldmode`0910`093; X newmode`0911`093=oldmode`0911`093 `124 TT$M_NOBRDCST; X newmode`0912`093=oldmode`0912`093 `124 TT2$M_BRDCSTMBX; X c$cks(sys$qiow(0,chan,IO$_SETMODE,iosb,0,0,newmode,sizeof(newmode),0,0,0,0 V)); X X /*------------------------------------------------------------------------ V--*/ X X if ((*server != NULL) && !(srvfile=getenv("IRCSRVLIS"))) X startnet(persname,my_nick,server,srvport,"0"); X X c$cks(sys$qio(0,chan,IO$_READVBLK+IO$M_NOFILTR+IO$M_NOECHO,iosb,kbd_ast,0, X &inpchar,1,0,0,0,0)); X c$cks(sys$qio(0,mbx_chan,IO$_READVBLK,mbx_iosb,brdcst_ast,0, X brdcstbuf,MAXBRDCSTLEN,0,0,0,0)); X X sys$setast(0); X if (script`0910`093) `123 do_script(0,script); script`0910`093='\0'; `125 X sys$setast(1); X sys$hiber(); X`125 X X/*************************************************************************** V***/ $ CALL UNPACK IRC.C;31 41185313 $ create/nolog 'f' X1 IRC X XIRC, or Internet Relay Chat, is a server-client based conferencing Xsystem. If defined with X X`009IRC :== $ X Xthen IRC can be run as follows: X X`009IRC X Xwhere is the nickname to be used, is the address, Xeither IP or alphanumeric, of the server to connect to, and is Xthe TCP/IP port number on the server to connect to, which is usually X6667. X X2 ADMIN X XThe ADMIN command show administrative information about the current Xserver, or the server specified in the command line: X X`009ADMIN `091server`093 X X2 ALIAS X XThe ALIAS command allows the defining of new commands. These commands Xwill take precedence over hard-coded commands. Currently, only direct Xstring substitution is supported. No parameters to aliases, no special Xcharacters for current channel, nickname etc. X X`009ALIAS `091-`093`091alias`093 `091equivalence string`093 X XWithout parameters, lists all ALIASes. A - in front of an alias name Xremoves that alias. With an alias name, but no equivalence string, Xlists that alias, or all aliases beginning with that prefix. X X2 AUTHORS X XThe AUTHORS command lists the authors of the client, and a copyright Xmessage. X X2 AWAY X XThe AWAY command sets/clears the AWAY flag, and associated message. If Xyou are AWAY, then anyone sending you a private message (eg by /MSG or X/PRIVMSG) will receive the text you specify. AWAY with no parameters Xclears the AWAY flag: X X`009AWAY `091text`093 X X2 BOLD X XThe BOLD command toggles bold mode...in bold mode, all text entered in Xthe input window is bold, as well as input from the user displayed in Xthe output window. X X2 BROADCAST X XWhen the terminal receives a broadcast message from the system, eg Xnew mail arriving, a message from sysadmin, or someone calling on Xphone, it is put in a broadcast window. The BROADCAST command toggles Xthe display of this window, which has the same effect as . X X2 BYE X XThe BYE command exits IRC. If `091text`093 is specified, the signoff message Xcontains `091text`093. X X`009BYE `091text`093 X X2 CHANNEL X XThe CHANNEL command is synonomous with the JOIN command, and joins one Xor more channels seperated by commas: X X`009CHANNEL `091chan1`093`091,chan2`093`091,chan3`093`091...`093 X X2 CD X XThe CD command changes the current working directory: X X`009CD `091device:`093`091`091directory`093`093 X X2 CLS X XCLS clears the output screen. X X2 CLOCK X XCLOCK displays a clock in the lower right-hand corner of the screen, Xin hours and minutes. X X2 CMDCH X XCMDCH changes the command character. This is / by default, but can be Xchanged to anything. CMDCH on it's own resets the command character to Xnothing: X X`009CMDCH `091cmd-char`093 X X2 CONNECT X XCONNECT is an operator-only command, which tells a local or remote Xserver to try to connect to another server: X X`009CONNECT server `091port`093 `091remote-server`093 X X2 COMMENT X XCOMMENT puts a comment on the screen, and in the log file, if one is Xopen. X X`009COMMENT `091text`093 X X2 CTCP X XThe CTCP (Client To Client Protocol) command sends a CTCP request to Xthe specified nickname or channel. Some standard CTCP requests are: X X`009CTCP nick request `091other arguments`093 X X3 Requests X XCLIENTINFO ACTION TIME FINGER USERINFO VERSION X X3 CLIENTINFO X XLists valid CTCP requests for that client. X X3 ACTION X XSends an action, by appending the specified text to your name.`032 XSee also ME. X X3 TIME X XRequests the time on the client's system. X X3 FINGER X XShows account name, and idle time of the client. X X3 USERINFO X XDoes very little, usually just sends a stupid reply. X X3 VERSION X XReturns client version. X X2 DATE X XDATE returns the time and date on the specified server, or the current Xserver if none is specified: X X`009DATE `091server`093 X X2 DCL X XDCL creates a subprocess, and executes a command in that process, Xdisplaying the output in a reverse video window in the top half of the Xscreen. It is possible, although not recommended, to read mail in this Xway. "DCL mail" will enter the mail utility, then "DCL read/new" will Xread new messages, and so on. DCL with no parameters toggles the Xdisplay of the DCL window: X X`009DCL `091command`093 X X2 DIE X XDIE kills the current server. Requires IRC Operator status.`032 X X2 ENTER X XENTER joins a channel, with an optional message being sent to the Xchannel on joining: X X`009ENTER channel `091text`093 X X2 ERRLOG X XCurrently does very little, but toggles logging of errors to the Xlogfile. X X2 ERROR X XSends an error message to the local server: X X`009ERROR text X X2 EXIT X XExits IRC, with an optional message to be sent to those on any Xchannels you're on: X X`009EXIT `091text`093 X X2 FKEY X XThe FKEY commands allows defining of keys as commands, but this Xrequires a decent VT terminal emulator. Keys that can be defined are Xthe numbers on the numeric keypad, when the terminal is in application Xkeypad mode, and normal alphabetic keys, accessed by pressing the XGOLD, or PF1 key (or it's equivalent in your emulator), then the Xletter you have defined. If the first characters of the definition are X"!1", then the command specified is executed immediately, without Xwaiting for a return: X X`009FKEY key definition X X`009FKEY ?`032 X X`009shows the current key definitions. X X3 Examples X X`009FKEY 1 !1/quit X XThis defines the keypad key "1" as /quit, and executes the command Ximmediately. This can be accessed by simply pressing one, assuming the Xterminal is in application keypad mode, which is set when the client Xruns. X X`009FKEY h /msg hottub`032 X XThis defines as "/msg #hottub ", and waits until return is Xpressed before executing the command. This can be useful when you Xregularly use several channels. To access this definition, press the XGOLD or PF1 key, which is the first of four keys just above the Xnumeric keypad, on a genuine VT-series terminal, and then the "h" key. X X2 FLAGS X XThe FLAGS command displays various settings in the client, such as log Xfile, nickname, current channel, and much more. X X2 FLUSH X XFlushes incoming text that has not yet been displayed. Useful during Xmass server kills, netsplits, etc. Also accessable from CTRL-\. X X2 HELP X XDisplay on-screen help. This lists each command, and a short Xdescription of that command, in a series of screens. Type any Xcharacter to go onto the next screen, or CTRL-Z to exit help. Note, Xthis is VERY slow at modem speeds (ie 2400 and below). X X2 HERE X XThe HERE command resets the AWAY flag and message. Equivalent to Xtyping in the AWAY command with no parameter. X X2 INVITE X XInvites a user to a channel: X X`009INVITE nick channel X X2 INFO X XDisplays the information about the authors/contributors to the IRC Xserver. X X2 INPSCROLL X XThe INPSCROLL command sets the number of characters to move the input Xline back by when the line reaches the edge of the screen. The default Xis 65, which works fairly well in general, but you should experiment Xto see which value suits you best. Note that the smaller the number, Xthe slower scrolling is: X X`009INPSCROLL num X X2 IGNORE X XThis allows a user to IGNORE all messages from a particular Xnick!user@host, whether it's a /msg, join messages, kills, etc. This Xwill be modified in future to allow users to ignore a particular type Xof message, rather than all messages: X X`009IGNORE `091user@host `124 nick`093`091,...`093 X X2 JOIN X XThe JOIN command tells the server you wish to JOIN a channel, Xproviding the channel has been set up to allow anyone to join, or you Xhave been invited: X X`009JOIN channel`091,channel`093`091,...`093 X X2 KICK X XIf you are a channel operator, you can KICK someone off the channel. XIf no channel is specified, it defaults to the current channel: X X`009KICK `091channel`093 X X2 KILL X XKILL removes someone from IRC. This command should be used with Xcaution, as it can be the cause of problems between operators if Xmisused. Requires IRC Operator status.`032 X X`009KILL X X2 LIST X XShows the topic for a public channel, if set, and the number of X(visible) people on that channel. If no channel is specified, all Xpublic channels are listed: X X`009LIST `091channel`093 X X2 LEAVE X XThe LEAVE command allows you to set an alarm to tell you when to get Xoff IRC. The format is a valid VMS delta or absolute time, eg: Xdd-mmm-yyyy hh:mm:ss for absolute, or d hh:mm:ss for delta time, where Xall fields must be included, but can be empty. eg, "-- 12::", Xspecifies 12pm, and whatever the current minutes and seconds are. XLEAVE with no time cancels an alarm: X X`009LEAVE `091time`093 X2 LINKS X XThe LINKS command lists servers currently on the net, excluding those Xthat are behind host-masks. You can specify a particular server, or Xuse wildcards: X X`009LINKS `091server`093 X X2 LOG X XLOG turns logging of the IRC session on or off. If you specify a Xfile-name, and logging is currently off, the client will open that Xfile and log output to it. If no file is specified, logging will be Xturned off: X X`009LOG `091file`093 X X2 LUSERS X XThe LUSERS command displays current stats for IRC. It shows the number Xof users on IRC, the number of operators, channels and servers, and Xthe number of users and server connected to the server. If a server is Xspecified, then stats for that server/wildcard is displayed, or if two Xservers are specified, then the first server is used to get stats on Xthe server(s) specified in the second parameter: X X`009LUSERS `091server`093 `091server`093 X X2 ME X XME sends an ACTION to the current channel.`032 X X`009ME X X2 MIRROR X XSends text reversed end-to-end to or the current channel. X X`009MIRROR `124* X X2 MODE X XMODE sets the mode of a channel, or your nick. MODE ? brings up`032 Xa window describing the various modes you can use. X X`009MODE `091param`093 X`009MODE `091param`093 X MODE ? X X3 Modes X X+`124- add`124remove modes on named channels Xp private mode Xs secret mode (invisible channel) Xa anonymous mode `091users are invisible`093 Xt topic limit (Set only by ChanOp) Xm moderated channel (ChanOp-MSGs only) Xi INVITE only channel Xn no PRIVMSGs on this channel Xl limited channel Xo add/remove channel operator X X X2 MOTD X XMOTD shows the message-of-the-day text for your current server, or the Xserver specified in `091server`093. X X`009MOTD `091server`093 X X2 MSG X XSee PRIVMSG. X X2 NAMES X XNAMES shows the names of all the people that are on irc and are not Xinvisible.`032 X X2 NICK X XNICK changes your nick to the new nickname you specify. X X`009NICK X X2 NOKILL X XNOKILL toggles printing full KILL messages or shortened KILL messages. X X2 NOTICE X XSends a private message to the nicknames or list of nicknames Xspecified. NOTICE messages`032 X X`009NOTICE `091,...`093 X X2 NOTIFY X XNOTIFY adds or deletes users from a list of nicknames to watch for.`032 XNOTIFY without any arguments shows a list of nicknames present (if Xany) and a list of nicknames absent (if any).`032 X X`009NOTIFY `091<+`124->nick `091+nick2...`093`093 X X2 OPER X XOPER enables IRC Operator privileges. It requires an id and a Xpassword.`032 X X`009OPER X X2 OOPS X XOOPS resends the text of the last MSG you sent to the nickname X. If `091text`093 isn't specified it sends a "MSG Oops, Xplease ignore..." the the recipient of the last message; if `091text`093 Xis specified, `091text`093 is sent instead.`032 X X`009OOPS `091text`093 X X2 PART X XPART leaves your current channel, or the channel specified. X X`009PART `091channel`093 X X2 PING`032 X XPING sends a CTCP PING to . Use PING to see if there is lag Xbetween you and X X`009PING X X2 QUERY`032 X XQUERY sends everything that isn't a command to , without having Xto type "/MSG `091text`093" every time. QUERY ? shows who you are Xcurrently querying. X X`009QUERY X`009QUERY ? X X2 QUIT`032 X XThe QUIT command exits IRC. If `091text`093 is specified, the signoff messag Ve Xcontains `091text`093. Defaults to "Leaving". X X`009QUIT `091text`093 X X2 QUOTE`032 X XQUOTE passes all of it's arguments to the current server. X X2 RECALL`032 X XRECALL brings up a window from which you can select lines to echo on Xthe commandlne.`032 X XWhile in RECALL, use the following keys: X X`009PrevScr or P Move to the previous page X`009NextScr or L Move to the next page X`009Crsr Up/Down Move one line up/down X`009Select or S Select buffer for pasting X`009SPACE Send actual line to channel X`009Return Send selected buffer and exit RECALL X`009Ctrl-Z Exit RECALL without pasting X`009Ctrl-L,Ctrl-W Redraw screen X`009Ctrl-R Recall help X`009Ctrl-B Toggle broadcast window X X2 REDIRECT`032 X XREDIRECT sends the last line of text sent to a channel to X X2 REHASH`032 X XReloads the current server's configuration file. Requires IRC`032 XOperator status. X X X2 REMIRROR`032 X XShows recent messages reversed end-to-end, like /MIRROR.`032 X X2 REROT13`032 X XShows recent messages ROT13'd, like /ROT13. X X2 ROT13`032 X XROT13 does simple encryption (A-M,B-N,C-O, etc) on and sends Xit to or the current channel. X X`009ROT13 `124* X X2 STATS`032 X XSTATS shows server statistics.`032 X X`009STATS `091mode`093 `091server`093 X X3 Mode X XM - commands XL - links XC - C:/N: lines XK - K: lines XI - I: lines XY - Y: lines X X2 SCRIPT`032 X XSCRIPT loads a file of VMS IRC commands. X X`009SCRIPT X X2 SERVER`032 X XSERVER changes your current server to . If `091port`093 is Xspecified, the client connects to that port of . Currently, Xthis is limited to IP addresses, due to a TCP/IP bug. X X`009SERVER `091port`093 X X2 SHOWESC`032 X XSHOWESC toggles between interpreting escape characters and displaying Xthem. X XWarning: When interpretation of escape characters is enabled, Xpeople can send you messages containing screen clearing codes, backspace Xcharacters to erase their nick and display someone else's nickname, Xa server notice, etc. It is STRONGLY recommended that you accept the Xdefault setting, which is to display control characters. In future Xversions, `094G will be dealt with as a special case, but currently `094G X(bell) is treated as any other control character. X X2 SIGNAL`032 X XSIGNAL turns on beeping for a specified type of message. SIGNAL ? Xshows the types of messages being signalled. X X`009SIGNAL X`009SIGNAL ? X X3 Message Types X XNONE - don't beep on any messages XPRIV - beep on private messages XMSG - same as PRIV XMOD - `091broken!`093 XALL - beep on all messages X X2 SPAWN`032 X XSPAWN starts a DCL subprocess from which you may execute any VMS Xcommand. X X2 SQUIT`032 X XSQUIT removes a link from a server. Requires IRC Operator status.`032 X X`009SQUIT X X2 SRVINFO`032 X XSRVINFO shows information about the current server.`032 X X`009SRVINFO `091server`093 X X2 STATUS`032 X XSTATUS toggles the display of a status line, showing the time, your Xnickname, current channel, and some other things.`032 X X2 SUMMON`032 X XSUMMON sends a message to the user@host specified requesting them to Xjoin you on irc. Note: works only for users on the same machine as a Xserver. X X`009SUMMON X X2 TIME`032 X XTIME shows the local time for the current server, or `091server`093, if Xspecified. X X`009TIME `091server`093 X X2 TOPIC`032 X XTOPIC with no arguments shows the topic of the current channel. With Xan argument of `091text`093, TOPIC sets the topic on the current channel to X`091text`093. X X`009TOPIC `091text`093 X X2 TRACE`032 X XTRACE shows active links for the current server, or `091server`093, if Xspecified.`032 X X`009TRACE `091server`093 X X2 TYPE`032 X XSends to or the current channel.`032 X X`009TYPE `124* X X2 USERS`032 X XUSERS shows the users logged in on the machine the current server is Xon. If `091server`093 is specificed, USERS shows the users logged in to the Xmachine that server is on. X X`009USERS `091server`093 X X2 VERSION`032 X XVERSION shows the version of the current server, or `091server`093, if Xspecified. X X`009VERSION `091server`093 X X2 WHO`032 X XWHO shows the users on the current channel, or on a specific channel. X X`009WHO <*>`124 X X2 WHOAWAY X XWHOAWAY shows everyone who is /AWAY.`032 X X2 WHOIS`032 X XWHOIS gives detailed information on X X`009WHOIS X X2 WHOOP`032 X XWHOOP is like WHO, but only shows operators for the current channel, Xor a specified channel. X X`009WHOOP <*>`124 X X3 Operator Type X X`009@ shows channel operators only. X`009* shows IRC Operators only. X`009# shows both channel operators and IRC Operators.`032 X X2 WHOSRV`032 X XWHOSRV shows nicknames with the server they're on. X X2 WHOWAS X XWHOWAS shows WHOIS-type information for nicknames that are no longer Xon irc.`032 X X`009WHOWAS $ CALL UNPACK IRC.HLP;4 1450775710 $ create/nolog 'f' X$!************************************************************************** V**** X$! X$! VMS - IRC - Client DCL MAKE file X$! X$! Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X$! CMU/tek, UCX, Wollongong or Multinet TCP/IP X$! X$! Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X$! X$!************************************************************************** V**** X$! X$! X$ IF P1 .NES. "?" THEN GOTO NoHelp X$ TYPE sys$input X XSupported TCP/IP-Implementations X-CMU tek TCP/IP`009`009`009-Multinet TCP/IP X-UCX (DEC)`009`009`009-Process Software (TCPware) X-Wollongong TCP/IP X XParameter 'P1' for MAKE: X? This HELP-page X% Do not delete object-files after compilation X*`009Compile IRC with debugging on (keep object files) X XCC/DEF=() X NODCL`009`009Compile with small DCL recallbuffer X NOMEM`009`009Compile IRC for small memory contents (without Recallbuffer) X DEBUG`009`009Compile with IRC internal debugging on X MAXBUF= Compile with special size of Recallbuffer X HIST=`009Compile with special size of command history buffer X X$ EXIT X$NoHelp: X$!-------------------------------------------------------------------------- V---- X$ Message = F$ENVIRONMENT("MESSAGE") X$ SET MESSAGE/NOTEXT/NOSEVERITY/NOIDENTIFICATION/NOFACILITY X$ cmu := "***" X$ win := "***" X$ ucx := "***" X$ psc := "***" X$ keep := "YES" X$ cmu = F$GETDVI("IP0:","DEVNAM") X$ win = F$GETDVI("INET0:","DEVNAM") X$ ucx = F$GETDVI("BG0:","DEVNAM") X$ psc = F$GETDVI("TCP0:","DEVNAM") X$ multinet = F$LENGTH(F$TRNLNM("MULTINET_ROOT","LNM$SYSTEM")) X$ SET MESSAGE'Message' X$!-------------------------------------------------------------------------- V---- X$ Transport="***" X$ IF cmu .NES. "***" THEN Transport="CMU" X$ IF win .NES. "***" THEN Transport="WIN" X$ IF ucx .NES. "***" THEN Transport="UCX" X$ IF psc .NES. "***" THEN Transport="PSC" X$ IF multinet .EQ. 0 THEN GOTO NoMultinet X$ DEFINE/NOLOG VAXC$INCLUDE multinet_root:`091multinet.include`093,sys$lib Vrary X$ DEFINE/NOLOG VMS multinet_root:`091multinet.include.vms`093 X$ DEFINE/NOLOG ARPA multinet_root:`091multinet.include.arpa`093 X$ Transport=Transport+",MULTINET" X$ IF (ucx .EQS. "***") .OR. (win .EQS. "***") THEN GOTO NoMultinet X$Nochmal: X$ INQUIRE/NOPUNCT flag "You use Multinet TCP/IP with which Transport ? `09 V1WIN/UCX`093" X$ IF (flag .NES. "WIN") .AND. (flag .NES. "UCX") THEN GOTO Nochmal X$ IF (FLAG .EQS. "WIN") THEN UCX := "***" X$ IF (FLAG .EQS. "UCX") THEN WIN := "***" X$ Transport="''flag',MULTINET" X$NoMultinet: X$ IF (Transport .EQS. "***")! .OR. ((Transport.NES."CMU").AND.(P1.EQS."MINI" V)) X$ THEN X$ TYPE sys$input X XYou do not have CMU, UCX, Wollongong, Process Software or Multinet TCP/UP... X XSo there is no IRC available! X X$ EXIT 8308 X$ ELSE X$ IF multinet .EQ. 0 X$ THEN X$ DEFINE/NOLOG VAXC$INCLUDE twg$tcp:`091netdist.include`093,sys$library X$ DEFINE/NOLOG VMS twg$tcp:`091netdist.include.vms`093 X$ DEFINE/NOLOG ARPA twg$tcp:`091netdist.include.arpa`093 X$ ENDIF X$ WRITE sys$output "Creating IRC for ''Transport' TCP/IP ..." X$ ENDIF X$ Exe="IRC.EXE" X$!-------------------------------------------------------------------------- V---- X$ IF P1 .NES. "*" THEN GOTO NoStar X$ WRITE sys$output "Compiling debugger version of IRC ..." X$ Keep="YES" X$ IF P2 .EQS. "" X$ THEN X$! P1="DEBUG" X$ P1="" X$ ELSE X$! P1="DEBUG,"+P2 X$ P1=+P2 X$ ENDIF X$ Qual1="/NOOPT/DEBUG" X$ Qual2="/DEBUG/TRACE" X$ Exe="I.EXE" X$NoStar: X$!-------------------------------------------------------------------------- V---- X$ IF P1 .NES. "%" THEN GOTO NoPercent X$ P1=P2 X$ Keep="YES" X$NoPercent: X$ IF P1 .NES. "" THEN P1 = "/DEF=(''P1',''Transport')" X$ IF P1 .EQS. "" THEN P1 = "/DEF=(''Transport')" X$!-------------------------------------------------------------------------- V---- X$ WRITE sys$output "Compiling all five parts of IRC `091''P1'`093" X$ CALL CompileIt ANALYZE 'P1' 'Qual1' X$ CALL CompileIt ASYNC 'P1' 'Qual1' X$ CALL CompileIt COMMAND 'P1' 'Qual1' X$ CALL CompileIt IRC 'P1' 'Qual1' X$ CALL CompileIt MISC 'P1' 'Qual1' X$ CALL CompileIt RECALL 'P1' 'Qual1' X$ DEFINE/NOLOG lnk$library sys$library:vaxccurse X$!-------------------------------------------------------------------------- V---- X$! sys$library:neterror is optional (only for error message texts) X$!-------------------------------------------------------------------------- V---- X$ WRITE sys$output "Linking ''Exe' ..." X$ LFile := "" X$ IF F$SEARCH("sys$library:neterror.obj") .NES. "" THEN - X`009`009`009LFile := ",sys$library:neterror.obj" X$!-------------------------------------------------------------------------- V---- X$ IF ucx .EQS. "***" THEN GOTO NoUCX X$ IF multinet .EQ. 0 X$ THEN X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE,sys$library:ucx$ipc/LIBRARY X$ ELSE X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE,sys$library:ucx$ipc/LIBRARY,multinet:multinet_sock Vet_library/SHARE X$ ENDIF X$ GOTO LinkReady X$!-------------------------------------------------------------------------- V---- X$NoUCX: X$ IF psc .EQS. "***" THEN GOTO NoPSC X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE,tcpip_root:socklib/LIBRARY X$ GOTO LinkReady X$!-------------------------------------------------------------------------- V---- X$NoPSC: X$ IF win .EQS. "***" THEN GOTO NoWIN X$ IF multinet .GT. 0 THEN GOTO NoWIN X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE,twg$tcp:`091netdist.lib`093twglib/LIBRARY X$ GOTO LinkReady X$!-------------------------------------------------------------------------- V---- X$NoWIN: X$ IF multinet .EQ. 0 X$ THEN X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE X$ ELSE X$ LINK/EXE='Exe''Qual2' irc.obj,async.obj,analyze.obj, misc.obj, - X`009`009`009`009`009command.obj,recall.obj'LFile', - X`009`009`009`009`009sys$input/OPT Xsys$library:vaxcrtl/SHARE,multinet:multinet_socket_library/SHARE X$ ENDIF X$!-------------------------------------------------------------------------- V---- X$LinkReady: X$ PURGE/NOLOG 'Exe' X$ PURGE/NOLOG environment.h X$ IF Keep .NES. "YES" X$ THEN X$ DELETE/NOCONF *.obj;* X$ ELSE X$ PURGE/NOLOG *.obj X$ ENDIF X$ EXIT X$! X$! X$! X$!-------------------------------------------------------------------------- V---- X$! CALL CompileIt X$!-------------------------------------------------------------------------- V---- X$CompileIt: X$ SUBROUTINE X$ Source = F$CVTIME(F$FILE_ATTR("''P1'.C","CDT")) X$ IF F$SEARCH("''P1'.OBJ") .EQS. "" THEN GOTO DoObject X$ Object = F$CVTIME(F$FILE_ATTR("''P1'.OBJ","CDT")) X$ Header = F$CVTIME(F$FILE_ATTR("HEADER.H","CDT")) X$ IF Source .LTS. Header THEN GOTO DoObject1 X$ IF Source .LTS. Object THEN GOTO NoObject X$ GOTO DoObject X$DoObject1: X$ COPY/NOCONF/NOLOG 'P1'.c 'P1'.c X$ PURGE/NOLOG 'P1'.c X$DoObject: X$ WRITE sys$output "...compiling ''P1'" X$ CC/NODEBUG'P3' 'P1' 'P2 X$ GOTO EndSub X$NoObject: X$ WRITE sys$output "...allready uptodate ''P1'" X$EndSub: X$ EXIT X$ ENDSUBROUTINE $ CALL UNPACK MAKE.COM;3 1629711258 $ create/nolog 'f' X/* Miscelaneous functions */ X X#include X#include X#include "header.h" X#include "misc.h" X#include "environment.h" X Xstatic int total_explicit; X X/* strimw: Case-insensative wildcard matching. X * X * Parameters: X *`009str1 is a pointer to the string (possibly) with wildcards. X *`009str2 is a pointer to a string to be compared to str1. X * X * Returned: 1 if str2 matches str1 X * 0 otherwise X */ Xbool strimw(char *str1, char *str2) X`123 Xchar *ptr1, *ptr2; Xbool retval; X X ptr1 = malloc(strlen(str1)+1); X ptr2 = malloc(strlen(str2)+1); X strcpy(ptr1,str1); strcpy (ptr2,str2); X str$upcase(c$dsc(ptr1),c$dsc(str1)); X str$upcase(c$dsc(ptr2),c$dsc(str2)); X if (str$match_wild(c$dsc(ptr2),c$dsc(ptr1)) == STR$_MATCH) X`009retval = 1; X else retval = 0; X free(ptr1); free(ptr2); X return(retval); X`125 X X/* X * list_insert: Insert a new element into a list. X * X * Parameters: "list" which is a pointer to a list.. "new" X * which is a pre-allocated element to be added to the list. `032 X */ Xvoid list_insert(list, new) XList **list; XList *new; X`123 X if (*list != NULL) X`009`123 X`009new->next = *list; X`009*list = new; X`009`125 X else X`009`123 X`009*list = new; X`009new->next = NULL; X`009`125 X`125 X X X/* X * list_find: This looks up the given name in the given list. List and X * name are as described above. If wild is true, each name in the list is X * used as a wild card expression to match name... otherwise, normal matchin Vg X * is done`032 X */ XList *list_find(list, name, wild) XList *list; Xchar *name; Xint wild; X`123 X List *tmp; X int best_match, current_match; X X best_match=0; X if (wild) `123 X`009List *match = (List *)NULL; X X`009for (tmp = list; tmp; tmp = tmp->next) `123 X`009 if ((current_match=wild_match(tmp->name, name))>best_match) X`009 `123 X`009`009match = tmp; X`009`009best_match=current_match; X`009 `125 X`009`125 X`009return (match); X `125 else `123 X`009for (tmp = list; tmp; tmp = tmp->next) `123 X`009 if (stricmp(tmp->name, name) == 0) X`009`009return (tmp); X`009`125 X `125 X return ((List *)NULL); X`125 X X/* X * list_remove: this removes the given name from the given list (again as X * described above). If found, it is removed from the list and returned X * (memory is not deallocated). If not found, null is returned.`032 X */ XList *list_remove(list, name) XList **list; Xchar *name; X`123 X List *tmp, *prev; X X for (tmp = *list, prev = *list; tmp; tmp = tmp->next) `123 X`009if (stricmp(tmp->name, name) == 0) `123 X`009 prev->next = tmp->next; X`009 if ((tmp == *list) && (tmp->next == NULL)) *list = NULL; X`009 else if (tmp == *list) *list = tmp->next; X`009 return (tmp); X`009 `125 X`009prev = tmp; X `125 X return ((List *)NULL); X`125 X X/* X * list_lookup: this routine just consolidates list_remove and X * list_find. I did this cause it fit better with some alread existing X * code`032 X */ XList *list_lookup(list, name, wild, delete) XList *list; Xchar *name; Xint wild; Xint delete; X`123 X List *tmp; X X if (delete) X`009tmp = list_remove(list, name); X else X`009tmp = list_find(list, name, wild); X return (tmp); X`125 X X/* X * parse_it: parse the next valid expression from the given string. Because X * we have terrible trivial expressions (either a series of characters or an X * asterisk) this is a damn easy thing to do. If a wild card is found, the X * function value is null, otherwise, it is the next series of characters to X * be matched. An asterisk preceeded by a backslash is considered quoted an Vd X * treated as a character rather than an asterisk`032 X */ Xstatic char *parse_it(str, space) Xchar *str; Xchar *space; X`123 X char *ptr, X *start; X X if (*str == '*') `123 X`009strcpy(str, str + 1); X`009return ((char *)NULL); X `125 X ptr = space; X start = str; X *space = (char)NULL; X while (*str) `123 X`009if (*str == '\\') X`009 str++; X`009else if (*str == '*') X`009 break; X`009total_explicit++; X`009*(ptr++) = *(str++); X `125 X *ptr = (char)NULL; X strcpy(start, str); X return (space); X`125 X `032 X/* X * wild_match: matches the expression 'match' which may contain wildcards, X * with the str. Returns 1 on match, 0 otherwise`032 X */ Xint old_wild_match(match, str) Xchar *match, X *str; X`123 X char *ptr, X *match_str = (char *)NULL, X *space; X int len; X X if ((match == (char *)NULL) `124`124 (str == (char *)NULL)) X`009return (0); X space = (char *) malloc(strlen(match) + 1);`009/* never need more than X match_str = (char *) malloc(strlen(match) + 1);`009* this */ X strcpy(match_str, match); X while (strlen(match_str)) `123 X`009if (ptr = parse_it(match_str, space)) `123 X`009 len = strlen(ptr); X`009 if (strncmp(ptr, str, len)) `123 X`009`009new_free(&space); X`009`009new_free(&match_str); X`009`009return (0); X`009 `125 X`009 str += len; X`009`125 else `123 X`009 while ((ptr = parse_it(match_str, space)) == (char *)NULL); X`009 if ((len = strlen(ptr)) == 0) `123 X`009`009new_free(&space); X`009`009new_free(&match_str); X`009`009return (1); X`009 `125 X`009 while (1) `123 X`009`009if (strncmp(ptr, str, len) == 0) `123 X`009`009 if (old_wild_match(match_str, str + len)) `123 X`009`009`009new_free(&match_str); X`009`009`009new_free(&space); X`009`009`009return (1); X`009`009 `125 X`009`009 str++; X`009`009`125 else `123 X`009`009 if (*(str++) == (char)NULL) `123 X`009`009`009new_free(&match_str); X`009`009`009new_free(&space); X`009`009`009return (0); X`009`009 `125 X`009`009`125 X`009 `125 X`009`125 X `125 X/* No path exists to these statements... says my optimizer...*/ X new_free(&match_str); X new_free(&space); X if (strlen(str)) X`009return (0); X else X`009return (1); X`125 X X/* This version of wild_match returns 1 + the count of characters X * explicitly matched if a match occurs. That way we can look for X * the best match in a list X */ Xint wild_match(match, str) X`123 X total_explicit=0; X if (old_wild_match(match, str)) X`009return total_explicit+1; X else X`009return 0; X`125 X X/* X * enqueue: Insert a new element into a queue. X * X * Parameters: "queue" which is a pointer to a structure containing X * pointers to the first and last entries in the queue. "new" X * which is a pre-allocated element to be added to the queue. `032 X */ Xvoid enqueue(queue, new) XQueue *queue; XQElt *new; X`123 X QElt *tmp; X X tmp = queue->last; X if (tmp != NULL) X`009`123 X`009tmp->next = new; X`009queue->last = new; X`009new->next = NULL; X`009`125 X else X`009`123 X`009queue->last = new; X`009queue->first = new; X`009new->next = NULL; X`009`125 X`125 X X X/* X * queue_find: This looks up the given name in the given queue. Queue and X * name are as described above. If wild is true, each name in the queue is X * used as a wild card expression to match name... otherwise, normal matchin Vg X * is done`032 X */ XQElt *queue_find(queue, name, wild) XQueue *queue; Xchar *name; Xint wild; X`123 X QElt *tmp; X int best_match, current_match; X X best_match=0; X if (wild) `123 X`009QElt *match = (QElt *)NULL; X X`009for (tmp = queue->first; tmp; tmp = tmp->next) `123 X`009 if ((current_match=wild_match(tmp->name, name))>best_match) X`009 `123 X`009`009match = tmp; X`009`009best_match=current_match; X`009 `125 X`009`125 X`009return (match); X `125 else `123 X`009for (tmp = queue->first; tmp; tmp = tmp->next) `123 X`009 if (stricmp(tmp->name, name) == 0) X`009`009return (tmp); X`009`125 X `125 X return ((QElt *)NULL); X`125 X X/* X * dequeue: this removes the given name from the given queue (again as X * described above). If found, it is removed from the queue and returned X * (memory is not deallocated). If not found, null is returned.`032 X */ XQElt *dequeue(queue, name) XQueue *queue; Xchar *name; X`123 X QElt *tmp, *prev; X X for (tmp = queue->first, prev = NULL; tmp; tmp = tmp->next) `123 X`009if (stricmp(tmp->name, name) == 0) `123 X`009 if (tmp == queue->first) queue->first = tmp->next; X`009 else prev->next = tmp->next; X`009 if (tmp == queue->last) queue->last = prev; X`009 return (tmp); X`009 `125 X`009prev = tmp; X `125 X return ((QElt *)NULL); X`125 $ CALL UNPACK MISC.C;15 1461262663 $ create/nolog 'f' Xtypedef struct list_stru `123 X struct list_stru *next; X char *name; X`125 List; X Xextern void list_insert(); Xextern List *list_find(); Xextern List *list_remove(); Xextern List *list_lookup(); X Xtypedef struct q_struct `123 X struct q_struct *next; X char *name; X`125 QElt; X Xtypedef struct queue_head `123 X struct QElt *first; X struct QElt *last; X`125`009Queue; X Xextern void enqueue(); Xextern QElt *queue_find(); Xextern QElt *dequeue(); X X#define REMOVE_FROM_LIST 1 X#define USE_WILDCARDS 1 $ CALL UNPACK MISC.H;1 235953353 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client NUMERIC file X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#define`009RPL_WELCOME 001 /* 2.8 */ X#define`009RPL_YOURHOST 002 /* 2.8 */ X#define`009RPL_CREATED 003 /* 2.8 */ X#define`009RPL_MYINFO 004 /* 2.8 */ X X#define RPL_TRACELINK 200 X#define RPL_TRACECONNECTING 201 X#define RPL_TRACEHANDSHAKE 202 X#define RPL_TRACEUNKNOWN 203 X#define RPL_TRACEOPERATOR 204 X#define RPL_TRACEUSER 205 X#define RPL_TRACESERVER 206 X#define RPL_TRACESERVICE 207 X#define RPL_TRACENEWTYPE 208 X#define RPL_TRACECLASS 209 X X#define RPL_STATSLINKINFO 211 X#define RPL_STATSCOMMANDS 212 X#define RPL_STATSCLINE 213 X#define RPL_STATSNLINE 214 X#define RPL_STATSILINE 215 X#define RPL_STATSKLINE 216 X#define RPL_STATSQLINE 217 X#define RPL_STATSYLINE 218 X#define RPL_ENDOFSTATS 219 X X#define RPL_UMODEIS 221 X X#define RPL_SERVICEINFO 231 X#define RPL_ENDOFSERVICES 232 X#define`009RPL_SERVICE 233 /* 2.8 */ X#define RPL_SERVLIST 234 /* 2.8 */ X#define RPL_SERVLISTEND 235 /* 2.8 */ X X#define RPL_STATSLLINE 241 X#define`009RPL_STATSUPTIME 242 /* 2.8 */ X#define`009RPL_STATSOLINE 243 /* 2.8 */ X#define`009RPL_STATSHLINE 244 /* 2.8 */ X X#define`009RPL_LUSERCLIENT 251 /* 2.8 */ X#define RPL_LUSEROP 252 /* 2.8 */ X#define`009RPL_LUSERUNKNOWN 253 /* 2.8 */ X#define`009RPL_LUSERCHANNELS 254 /* 2.8 */ X#define`009RPL_LUSERME 255 /* 2.8 */ X#define`009RPL_ADMINME 256 /* 2.8 */ X#define`009RPL_ADMINLOC1 257 /* 2.8 */ X#define`009RPL_ADMINLOC2 258 /* 2.8 */ X#define`009RPL_ADMINEMAIL 259 /* 2.8 */ X X#define`009RPL_TRACELOG 261 /* 2.8 */ X X#define`009RPL_NONE 300 /* 2.8 */ X#define RPL_AWAY 301 X#define RPL_USERHOST 302 X#define RPL_ISON 303 X#define RPL_TEXT 304 X#define`009RPL_UNAWAY 305 /* 2.8 */ X#define`009RPL_NOWAWAY 306 /* 2.8 */ X X#define RPL_WHOISUSER 311 X#define RPL_WHOISSERVER 312 X#define RPL_WHOISOPERATOR 313 X#define RPL_WHOWASUSER 314 /* 2.4 */ X#define RPL_ENDOFWHO 315 /* 2.4 */ X#define RPL_WHOISCHANOP 316 /* 2.5 */ X#define RPL_WHOISIDLE 317 /* 2.6 */ X#define RPL_ENDOFWHOIS 318 X#define RPL_WHOISCHANNELS 319 X X#define RPL_LISTSTART 321 X#define RPL_LIST 322 X#define RPL_LISTEND 323 /* 2.4 */ X#define RPL_CHANNELMODEIS 324 /* 2.5 */ X X#define RPL_NOTOPIC 331 X#define RPL_TOPIC 332 X X#define RPL_INVITING 341 X#define`009RPL_SUMMONING 342 /* 2.8 */ X X#define RPL_VERSION 351 X#define RPL_WHOREPLY`009 352 X#define RPL_NAMREPLY 353 X X#define RPL_KILLDONE 361 X#define`009RPL_CLOSING 362 /* 2.8 */ X#define RPL_CLOSEEND 363 /* 2.8 */ X#define RPL_LINKS 364 X#define RPL_ENDOFLINKS 365 /* 2.4 */ X#define RPL_ENDOFNAMES 366 /* 2.4 */ X#define RPL_BANLIST 367 X#define RPL_ENDOFBANLIST 368 X X#define RPL_INFOSTART 371 /* 2.8 */ X#define RPL_INFO 372 /* 2.8 */ X#define`009RPL_ENDOFINFO 373 /* 2.8 */ X#define`009RPL_MOTDSTART 374 /* 2.8 */ X#define`009RPL_MOTD 375 /* 2.8 */ X#define`009RPL_ENDOFMOTD 376 /* 2.8 */ X X#define RPL_YOUREOPER 381 X#define RPL_REHASHING 382 X#define RPL_YOURESERVICE 383 /* 2.8 */ X#define RPL_MYPORTIS 384 X#define RPL_NOTOPERANYMORE 385 X X#define RPL_TIME 391 X#define`009RPL_USERSSTART 392 /* 2.8 */ X#define`009RPL_USERS 393 /* 2.8 */ X#define`009RPL_ENDOFUSERS 394 /* 2.8 */ X#define`009RPL_NOUSERS 395 /* 2.8 */ X X#define ERR_NOSUCHNICK 401 X#define ERR_NOSUCHSERVER 402 X#define ERR_NOSUCHCHANNEL 403 X#define ERR_CANNOTSENDTOCHAN 404 /* 2.5 */ X#define ERR_TOOMANYCHANNELS 405 X#define ERR_WASNOSUCHNICK 406 X#define ERR_TOOMANYTARGETS 407 X#define ERR_NOSUCHSERVICE 408 X#define`009ERR_NOORIGIN 409 /* 2.8 */ X X#define ERR_NORECIPIENT 411 X#define ERR_NOTEXTTOSEND 412 X#define ERR_NOTOPLEVEL 413 X#define ERR_WILDTOPLEVEL 414 X X#define ERR_UNKNOWNCOMMAND 421 X#define`009ERR_NOMOTD 422 /* 2.8 */ X#define`009ERR_NOADMININFO 423 /* 2.8 */ X#define`009ERR_FILEERROR 424 /* 2.8 */ X X#define ERR_NONICKNAMEGIVEN 431 X#define ERR_ERRONEUSNICKNAME 432 X#define ERR_NICKNAMEINUSE 433 X#define ERR_SERVICENAMEINUSE 434 X#define ERR_SERVICECONFUSED 435 X#define`009ERR_NICKCOLLISION 436 /* 2.8 */ X X#define ERR_USERNOTINCHANNEL 441 X#define ERR_NOTONCHANNEL 442 /* 2.5 */ X#define`009ERR_USERONCHANNEL 443 /* 2.8 */ X#define ERR_NOLOGIN 444 /* 2.8 */ X#define`009ERR_SUMMONDISABLED 445 /* 2.8 */ X#define ERR_USERSDISABLED 446 /* 2.8 */ X X#define ERR_NOTREGISTERED 451 X X#define ERR_NEEDMOREPARAMS 461 X#define ERR_ALREADYREGISTRED 462 X#define ERR_NOPERMFORHOST 463 X#define ERR_PASSWDMISMATCH 464 X#define ERR_YOUREBANNEDCREEP 465 X#define ERR_YOUWILLBEBANNED 466 /* 2.5 */ X#define`009ERR_KEYSET 467 /* 2.8 */ X X#define ERR_CHANNELISFULL 471 X#define ERR_UNKNOWNMODE 472 /* 2.5 */ X#define ERR_INVITEONLYCHAN 473 /* 2.5 */ X#define ERR_BANNEDFROMCHAN 474 X#define`009ERR_BADCHANNELKEY 475 /* 2.8 */ X#define`009ERR_BADCHANMASK 476 /* 2.8 */ X X#define ERR_NOPRIVILEGES 481 X#define ERR_CHANOPRIVSNEEDED 482 /* 2.8 */ X#define`009ERR_CANTKILLSERVER 483 /* 2.8 */ X X#define ERR_NOOPERHOST 491 X#define ERR_NOSERVICEHOST 492 X X#define ERR_UMODEUNKNOWNFLAG 501 X#define ERR_USERSDONTMATCH 502 $ CALL UNPACK NUMERIC.H;4 1316280427 $ create/nolog 'f' XCompiling: X XCompiling the program for the first time is easy. After ftp'ing the .com fil Ve Xas ASCII text (if you mail me asking why you get an error msg: 512 byte reco Vrd Xtoo large for users buffer", I'll tell you to read the readme file next time V), Xsimply type "@", eg @irc176 for this version, and all appropriate Xfiles will be compiled for you. If you have any problems, feel free to mail V me Xat paul@coombs.anu.edu.au, or paulw@vax1.elon.edu. X XThis code should compile unmodified on an Alpha VMS system. However, the Xcompiler needs to be told to use vaxc compatibility mode, and libraries are V a Xlittle different. So, the commands to compile and link are different. I have V a Xmodified MAKE.COM for the Alpha, but I don't think it's worth including at t Vhis Xstage, as only one person has mentioned using this client on an Alpha to me. XThis file is available by request from me. And I might just stick it on coom Vbs Xas well... X XKnown Bugs/Deficiencies: X X- /server only works with IP (numeric) addresses, not name adresses. I am X not sure if this is a Multinet problem, or a coding fault in the client. X I haven't tested it on non-Multinet systems recently. X X- /ignore gets kinda confused on multiple ignores X XGee, it's nice to see the list of bugs getting so short...:-) X XFuture changes/improvements: X X- Rectifying of all the above bugs, and those discovered by the beta testers V. X X- Numerous features from ircII, including /on, /set, windows, and others. X X- Updating the server list that follows. X XList of servers, by country: X XIsrael X X decscc.tau.ac.il 2.7.2g Tel-Aviv University, Israel X XJapan X X utsun.s.u-tokyo.ac.jp 2.7.2g University of Tokyo, Japan X XKorea X X kum.kaist.ac.kr 2.7.2g KAIST, Seoul, Korea X XSingapore X X nuscc.nus.sg 2.7.1d The Lion "gum-free" City Server - SINGA VPORE X X-----< Australia >---------------------------------------------------------- X X mullian.ee.mu.OZ.AU 2.7.2g University of Melbourne, Australian Hub X violet.cs.uq.oz.au 2.7.1e.geggle.fnord.fnord.fnord BananaLand IRC (On V'ya Ozzie!) UQ, QLD, Australi X X-----< Europe >------------------------------------------------------------- X XAustria X X itc.univie.ac.at 2.7.1e University of Vienna, Austria X XDenmark X X papegoje.iesd.auc.dk 2.7.1d Aalborg university, IESD, Denmark X XFinland X X nic.funet.fi 2.7.1e+1msa1 Finnish University and Research Netwo Vrk (FUNET) X serifos.Helsinki.FI 2.6.2f University of Helsinki, Finland X hkkk.fi 2.7 Helsinki School of Economics, Finland X tel4.tel.vtt.fi 2.7.1e+1msa1 Technical Research Centre of Finlan X XFrance X X poly.polytechnique.fr 2.7.1e+1.Nap Ecole Polytechnique, Palaiseau, FRAN X fifi.univ-lyon1.fr 2.7.1e+1 INSA de Lyon , France X XGermany X X noc.belwue.de 2.7.1d-argv1 BELWUE, Germany `0912.7.1d-argv1`093 X rwth-aachen.de 2.7.1e Aachen, Germany `0912.7.1e`093 X tu-berlin.de 2.7.1d Technical University of Berlin, Ger X TU-Muenchen.DE 2.7.1d-argv1 TU Muenchen, Germany X uni-erlangen.de 2.7.1d University of Erlangen, Germany X XIceland X X isgate.is 2.7.1e ISnet, Iceland X XItaly X X cdc835.cdc.polimi.it 2.7.1e Polytechnic of Milan, Italy X sapienza.roma.it 2.7.1e Universita' di Roma, Italia X XThe Netherlands X X ircserver.et.tudelft.nl 2.7.1e Delft University of Technology X XNorway X X kvart.ifi.uio.no 2.7.1d.1 The University of Oslo Server X flipper.pvv.unit.no 2.7.1d University of Trondheim, Norway X XSpain X X buho.dit.upm.es 2.6.2e Telecommunication U of Madrid , Spain < V> X XSweden X X irc.lysator.liu.se 2.7.1d Lysator CC at Link`124ping University, V Sweden X Minsk.DoCS.UU.SE 2.7.1d DoCS, Uppsala University, Sweden X XSwitzerland X X disuns2.epfl.ch 2.7.1e Ecole Polytechnique Federale de Lausann Ve, Suisse X vesuv.unisg.ch 2.7.1e+ Uni St.Gallen, Switzerland X XUnited Kingdom X X stork.doc.ic.ac.uk 2.7.1d Department of Computing, Imperial Colle Vge, London X cent1.lancs.ac.uk 2.7.1d Lancaster, UK X X-----< North America (except US) >----------------------------------------- X XCanada X X ug.cs.dal.ca 2.6.2f Eastern Canada's Main IRC Router X asimov.cc.umanitoba.ca 2.7.1e University of Manitoba X mars.info.uqam.ca 2.7.1e The Montreal' STONE Server, Can X venus.info.uqam.ca 2.7.1e The Montreal' JAZZ Server, Canada X XMexico X X hp9k.lag.itesm.mx 2.7.1d ITESM Campus Laguna, Torreon, Mexico X mtecv2.mty.itesm.mx 2.7.1d ITESM Campus Monterrey. Mexico X X-----< United States >----------------------------------------------------- X X Engr.uark.edu 2.6.2f University of Arkansas Server X wiretap.Spies.COM 2.7.1d <-- looking for a fight X badger.ugcs.caltech.edu 2.6.2f California Institute of Technology X UCSD.EDU 2.7.1d Univ of Calif San Diego X ucsu.colorado.EDU 2.7.1e.dae University of Colorado Server X h.ece.uiuc.edu 2.7.1e UofIllinois Hub Server X silver.ucs.indiana.edu 2.7.1d Indiana University Server X csd.bu.edu 2.6.2f Boston University, Boston, MA X irc.mit.edu 2.6.2b MIT Project Athena, Massachusetts, X mingin.engin.umich.edu 2.7.1e University of Michigan, USA X phoenix.princeton.edu 2.7.1e+2.Snoopy&Nap Princeton U., NJ X vesta.unm.edu 2.7.1e.dae+1 The Lobo Server -- the Wolf Totem X azure.acsu.buffalo.edu 2.7.1e+1.0 University at Buffalo, Buffalo NY, USA X logic.camp.clarkson.edu 2.7.1eOff Clarkson U. server X close.cs.columbia.edu 2.7.1d Columbia University - The Harlem C X fairhope.andrew.cmu.edu 2.6.2f Carnegie Mellon Server Generic X ccwf.cc.utexas.edu 2.7.1b University of Texas Server, Austin X Turing.ACS.Virginia.EDU 2.7.1d The University, Charlottesville, Va. X byron.u.washington.edu 2.7.1d University of Washington IRC server $ CALL UNPACK READ.ME;9 1600607394 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client part RECALL X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X Modified for IRC 2.7 by GrayElf, paul@coombs.anu.edu.au X X *************************************************************************** V***/ X X#include X#include X#include "header.h" X#include "environment.h" X Xextern putchunk(),putwin(),qio_send(),stricmp(),c$dsc(),c$cks(),win_refresh( V); X X/*************************************************************************** V***/ X Xmsg_refresh() X`123 X int i; X X/* for(i=0;i"); X for(count=0;countrecall_start && recall_start!= -1)?recall_start:recall_num V; X end=(recall_num>recall_start)?recall_num:recall_start; X cnt=0; while (recpos`091cnt+1`093<=start) cnt++; X i=0; X if (recpos`091cnt`093size) *(ilp+(size-j)*COLS)='\0'; X if (anf<=recpos`091cnt-1`093 && recpos`091cnt-1`093<=end && !flag) wseta Vttr(tmpwin,_UNDERLINE); X putwin(tmpwin,LINES>>1,COLS,ilp,FALSE,FALSE); wclrattr(tmpwin,_UNDERLINE V); X `125 X wrefresh(tmpwin); wrefresh(inpwin); X`125 X X/*************************************************************************** V***/ X Xrecall_move(delta) Xint delta; X`123 X int i,anf; X X i=0; while (*recbuf`091i`093) i++; X recall_num+=delta; X if (recall_num<0) recall_num=0; X else if (recall_num>recpos`091i`093-1) recall_num=recpos`091i-1`093; X else `123 X anf=1; while (recpos`091anf`093<=recall_num) anf++; X recall_num=recpos`091(anf!=i && delta>0 && recall_num!=recpos`091anf-1`0 V93)?anf:anf-1`093; X `125 X if (recpos`091i`093<=(LINES>>1)) `123 anf=0; wclear(tmpwin); `125 X else if (recall_num<=(LINES>>2)) anf=0; X else if (recpos`091i`093-recall_num<=(LINES>>2)) anf=recpos`091i`093-(LINE VS>>1); X else anf=recall_num-(LINES>>2); X recall_display(anf,LINES>>1,0); X`125 X X/*************************************************************************** V***/ X Xrecall_output(start,finish) Xint start,finish; X`123 X int i; X char ol`091MAXNETLEN`093,t`09180`093,*ptr,ibuf`091MAXINPLEN`093; X bool flag=TRUE; X X strcpy(ibuf,inpline); X i=0; while (start!=recpos`091i`093) i++; X while (flag) `123 X ptr=recbuf`091i`093; X while (strlen(ptr)) `123 X if (strlen(ptr)>70) `123 strncpy(t,ptr,70); t`09170`093='\0'; ptr+=70; V `125 X else `123 strcpy(t,ptr); ptr+=strlen(ptr); `125 X do_msg(0,t); inpline`091inpx++`093=13; inpline`091inpx++`093=10; inpli Vne`091inpx`093=0; X qio_send(inpline); X `125 X i++; if (finish==recpos`091i-1`093) flag=FALSE; X `125 X strcpy(inpline,ibuf); inpx=strlen(inpline); X`125 X X/*************************************************************************** V***/ X Xdo_recall(flag,ptr) Xint flag; Xchar *ptr; X`123 X int cnt,i,size,mode; X X mode=0; X if (*ptr && !flag) `123 X if (!stricmp(ptr,"msg")) mode=1; X if (!stricmp(ptr,"dcl")) mode=2; X `125 else mode=1; X X if (LINES<8 `124`124 mode==0) `123 X if (LINES<8) X putchunk("*** Huh? This window is to small for RECALL/REDRAW channels. V..",FALSE); X else X putchunk("*** Error: Wrong parameter for RECALL given...",FALSE); X `125 else `123 X for (i=0;i<(mode==1?MAXSAVMSG:MAXDCLMSG);i++) recpos`091i`093=0; X if (mode==1) `123 X i=0; cnt=savptr; while(!*savbuf`091cnt`093) cnt=ringplus(cnt,MAXSAVMSG V); X strcpy(recbuf`091i++`093,savbuf`091cnt`093); cnt=ringplus(cnt,MAXSAVMS VG); X while (cnt!=savptr) `123 X strcpy(recbuf`091i`093,savbuf`091cnt`093); X recpos`091i`093=recpos`091i-1`093+(strlen(recbuf`091i-1`093)+COLS-1) V/COLS; X i++; cnt=ringplus(cnt,MAXSAVMSG); X `125 X `125 else `123 X i=0; cnt=dclptr; while(!*dclbuf`091cnt`093) cnt=ringplus(cnt,MAXDCLMSG V); X strcpy(recbuf`091i++`093,dclbuf`091cnt`093); cnt=ringplus(cnt,MAXDCLMS VG); X while (cnt!=dclptr) `123 X strcpy(recbuf`091i`093,dclbuf`091cnt`093); X recpos`091i`093=recpos`091i-1`093+(strlen(recbuf`091i-1`093)+COLS-1) V/COLS; X i++; cnt=ringplus(cnt,MAXDCLMSG); X `125 X `125 X X recbuf`091i`093`0910`093='\0'; recpos`091i`093=recpos`091i-1`093+(strlen V(recbuf`091i-1`093)+COLS-1)/COLS; X recall_num=recpos`091i-1`093; size=(LINES>>1); X tmpwin=newwin(LINES>>1,COLS,0,0); wsetattr(tmpwin,_REVERSE); wclear(tmpw Vin); X recall_display(recpos`091i`093-size,size,flag); X recall_mode= !flag; X `125 X`125 X X/*************************************************************************** V***/ X Xdo_keypad_help() X`123 X if (COLS<(recall_mode?52:59) `124`124 LINES<(recall_mode?12:15)) X putchunk("*** My, whadda cute little window we have here. Sorry, no HELP V for dwarves...",FALSE); X else `123 X if (recall_mode) `123 X t2win=newwin(12,52,(LINES-11)>>1,(COLS-52)>>1); X wsetattr(t2win,bold_flag?_REVERSE`124_BOLD:_REVERSE); X wclear(t2win); wmove(t2win,0,0); X wprintw(t2win," RECALL Help for VMS IRC Client %s\n\n",VMSVERSION); X wprintw(t2win," PrevScr or P Move to the previous page\n"); X wprintw(t2win," NextScr or L Move to the next page\n"); X wprintw(t2win," Crsr Up/Down Move one line up/down\n"); X wprintw(t2win," Select or S Select buffer for pasting\n"); X wprintw(t2win," SPACE Send actual line to channel\n"); X wprintw(t2win," Return Send selected buffer and exit RECALL\n") V; X wprintw(t2win," Ctrl-Z Exit RECALL without pasting\n"); X wprintw(t2win," Ctrl-L,Ctrl-W Redraw screen\n"); X wprintw(t2win," Ctrl-R Recall help\n"); X wprintw(t2win," Ctrl-B Toggle broadcast window\n"); X wrefresh(t2win); wrefresh(inpwin); X `125 else `123 X tmpwin=newwin(15,59,(LINES-15)>>1,(COLS-59)>>1); X wsetattr(tmpwin,bold_flag?_REVERSE`124_BOLD:_REVERSE); X wclear(tmpwin); wmove(tmpwin,0,0); X wprintw(tmpwin," Keypad HELP for VMS IRC Client %s\n\n",VMSVERSION); X wprintw(tmpwin," Ctrl-L Redraw screen `124 Ctrl-B Broadcast w Vindow\n"); X wprintw(tmpwin," Ctrl-W Redraw screen `124 Ctrl-D DCL window\ Vn"); X wprintw(tmpwin," Ctrl-X Delete line `124 Ctrl-`093 Recall w Vindow\n"); X wprintw(tmpwin," Ctrl-U Delete line `124 Ctrl-R Keypad help V window\n"); X wprintw(tmpwin," Ctrl-H Beginning of line `124 HELP Command hel Vp\n"); X wprintw(tmpwin," Ctrl-E End of line `124 DO Setup infor Vmation\n"); X wprintw(tmpwin," Ctrl-K 1 word right `124 ESC D Setup infor Vmation\n"); X wprintw(tmpwin," Ctrl-J 1 word left `124 KP 0..9 Defined FKe Vy\n"); X wprintw(tmpwin," Ctrl-N Delete word `124 ESC 0..9 Defined FKe Vy\n"); X wprintw(tmpwin," Ctrl-F Erase to EOLN `124 GOLD a..z Defined FKe Vy\n"); X wprintw(tmpwin," Ctrl-A Toggle edit mode `124 GOLD 0..9 Last PRIVMS VG nicks\n"); X wprintw(tmpwin," Ctrl-V Toggle CtrlKey mode `124\n"); X wprintw(tmpwin," Ctrl-\\ Flush messages `124 GOLD = Ctrl- V@ or PF1\n"); X wrefresh(tmpwin); wrefresh(inpwin); X `125 X `125 X`125 X X/*************************************************************************** V***/ X Xdo_help() X`123 X int cnt,height,needed; X X needed=AllCmd-HiddenCmd; X height=LINES>1,(COLS-63)>>1); X wsetattr(tmpwin,bold_flag?_REVERSE`124_BOLD:_REVERSE); X `125 X if (help_num0;cnt--) `123 X while(!(msgtab`091help_num`093.helptext)) help_num++; X wprintw(tmpwin," %s\n",msgtab`091help_num`093.helptext); X if (++help_num>=AllCmd) break; X `125 X `125 X if (inpchar!=26 && help_num>=AllCmd) `123 X wmove(tmpwin,height-2,0); X wprintw(tmpwin," (*) These commands are only available with QUOTE \n"); X wprintw(tmpwin," + Not yet implemented commands... *sorry*"); X `125 X if (help_num>=AllCmd) help_num=0; X if (inpchar==26) `123 X delwin(tmpwin); help_num=0; msg_refresh(); tmpwin=NIL; X if (brdcst_flag) wrefresh(brdcstwin); X if (clockwin) wrefresh(clockwin); X if (status_line) wrefresh(statwin); X `125 else wrefresh(tmpwin); X wrefresh(inpwin); X`125 X X/*************************************************************************** V***/ X Xdo_flags() X`123 X char s`09180`093,tmp`09180`093,tmp2`09180`093,tmp3`09120`093,cmd`09110`093 V, X tim`091`093="17-NOV-1858 00:00:00.00"; X int tim_len,num; X X if (dbopt) sprintf(s,"DBG $%02x,",(unsigned char) dbopt); else s`0910 V`093='\0'; X if (anti_kill) strcat(s,"Reconnect,"); X if (avenger) strcat(s,"ReKill,"); X if (away_flag) strcat(s,"Away,"); X if (signalmode) strcat(s,"Signal,"); X if (flush_mode) strcat(s,"Flush,"); X if (query_max) strcat(s,"Query,"); X if (ignore_max) strcat(s,"Ignore,"); X if (status_line) strcat(s,"StatLine,"); X if (*s) s`091strlen(s)-1`093='\0'; X if (COLS<60 `124`124 LINES<(*s?15:14)) X putchunk("*** My, whadda cute little window you have. Sorry this client V isn't for gnomes.",FALSE); X else `123 X if (leave_time.l2 `124`124 leave_time.l1) `123 c$cks(sys$asctim(&tim_len V,c$dsc(tim),&leave_time,NIL)); strcpy(tmp,tim); X `125 else strcpy(tmp,"(none)"); X if (*cmdch) sprintf(cmd,"'%c'",cmdch`0910`093); else strcpy(cmd,"(none) V"); X if (dcl_pid) sprintf(tmp2,"%08X",dcl_pid); else strcpy(tmp2,"(none)"); X num=atoi(channel`0910`093.name); X if (num==0 && !strcmp(channel`0910`093.name,"0")) strcpy(tmp3,"entry"); X else if (num>=1 && num<=999) strcpy(tmp3,"public"); X else if (num>=1000) strcpy(tmp3,"hidden"); X else if (num<0) strcpy(tmp3,"secret"); X else strcpy(tmp3,"named"); X tmpwin=newwin(*s?15:14,60,(LINES-(*s?15:14))>>1,(COLS-60)>>1); X wsetattr(tmpwin,bold_flag?_REVERSE`124_BOLD:_REVERSE); X wclear(tmpwin); wmove(tmpwin,0,0); X wprintw(tmpwin," VAX/VMS IRC Client version %s\n\n",VMSVERSION); X wprintw(tmpwin," Server: %s (%d)\n",server,srvport); X wprintw(tmpwin," Nickname: %s\n",*my_nick?my_nick:"(none)"); X wprintw(tmpwin," Channel: %s `091%s channel`093\n",channel`0910`093.nam Ve,tmp3); X wsetattr(tmpwin,_UNDERLINE); X wprintw(tmpwin," Username: %s%s\n",*persname?persname:"(none)",spc); X wclrattr(tmpwin,_UNDERLINE); X wprintw(tmpwin," Commandchar: %-12s ErrMsg's for Log: %s\n",cmd,errlo Vg_flag?"ignore":"write"); X wprintw(tmpwin," Edit mode: %-12s ControlKey Input: %s\n",edit_mode V?"overwrite":"insert",ctrl_flag?"'`094' ":"direct"); X wprintw(tmpwin," Message mode: %-12s Visible CtrlCodes: %s\n",bold_flag V?"bold":"normal",showesc_flag?"display":"interpret"); X wsetattr(tmpwin,_UNDERLINE); X wprintw(tmpwin," Kill messages: %-12s Subprocess: %s%s\n",your_pr Viv?(notice_flag?"short":"full"):"none",tmp2,spc); X wclrattr(tmpwin,_UNDERLINE); X wprintw(tmpwin," WorkingDIR: %s\n",dirpath); X wprintw(tmpwin," BIG font: %s\n",*fontnam?fontnam:"(none)"); X wprintw(tmpwin," Logfile: %s\n",*lfilename?lfilename:"(none)"); X wprintw(tmpwin," Alarmclock: %s\n",tmp); X if (*s) wprintw(tmpwin," %s\n",s); X wrefresh(tmpwin); wrefresh(inpwin); X `125 X`125 X X/*************************************************************************** V***/ X Xdo_copyright() X`123 X char tmp`091256`093; X X putchunk("***",FALSE); X sprintf(tmp,"*** This is the VAX/VMS IRC Client version v%s using %s TCP/I VP",VMSVERSION,TRANSPORT); putchunk(tmp,FALSE); X sprintf(tmp,"*** This Client was last modified %s %s",__DATE__,__TIME__); V putchunk(tmp,FALSE); X putchunk("***",FALSE); X putchunk("*** Copyright 1990 by Very Mad Students, University of Karlsruhe V, FRG",FALSE); X putchunk("*** You may freely distribute this software provided that this c Vopyright",FALSE); X putchunk("*** notice remains unchanged in all copies.",FALSE); X putchunk("***",FALSE); X putchunk("*** This IRC Client was programmed by",FALSE); X putchunk("*** GrayElf Paul Williams paul@coombs.anu.edu.au",FALSE); X putchunk("*** Uranus Bernd Onasch ONASCH@ira.uka.de",FALSE); X putchunk("*** Andy Andreas Ley S_LEY@irav1.ira.uka.de",FALSE); X putchunk("*** Mike Michael Pall S_PALL@irav1.ira.uka.de",FALSE) V; X putchunk("***",FALSE); X putchunk("*** Thanks to all those who helped with bug reports and suggesti Vons.",FALSE); X putchunk("***",FALSE); X putchunk("*** Look out for new versions of the famous VMS IRC Client...",F VALSE); X putchunk("***",FALSE); X`125 X X/*************************************************************************** V***/ $ CALL UNPACK RECALL.C;11 1025435997 $ create/nolog 'f' X/*************************************************************************** V*** X X VMS - IRC - Client UCXDEF file X X Internet Relay Chat - Client for VAX/VMS V5.x with VT-Terminals using X CMU/tek, UCX, Wollongong or Multinet TCP/IP X X Copyright 1990 by Very Mad Students, University of Karlsruhe, FRG X X *************************************************************************** V***/ X X#define htons(a) ((unsigned short)(((a)<<8)`124((a)>>8))) X Xstruct sockaddr `123 X short inet_family; X short inet_port; X char adrs`0914`093; X char blkb`0918`093; X`125 ; X Xstruct itlst `123 X int lgth; X struct sockaddr *hst; X`125 ; X Xstruct itlst_1 `123 X int lgth; X char *rmt_adrs; X int *retlth; X`125 ; X Xstruct itlst_3 `123 X int lgth; X struct sockaddr *hst; X int *retlth; X`125 ; X Xshort sck_parm`0912`093; Xstatic struct sockaddr prototype_sockaddr; Xstruct itlst lhst_adrs,rhst_adrs; Xstruct itlst_1 lsck_adrs,rsck_adrs; Xint retval,l_retlen,r_retlen; Xchar remote_hostaddr`09116`093,local_hostaddr`09116`093; Xstruct itlst_3 lhst_il3; $ CALL UNPACK UCXDEF.H;1 544152542 $ say := WRITE sys$output $ Message = F$ENVIRONMENT("MESSAGE") $ SET MESSAGE/NOTEXT/NOSEVERITY/NOIDENTIFICATION/NOFACILITY $ cmu := "***" $ win := "***" $ ucx := "***" $ psc := "***" $ cmu = F$GETDVI("IP0:","DEVNAM") $ win = F$GETDVI("INET0:","DEVNAM") $ ucx = F$GETDVI("BG0:","DEVNAM") $ psc = F$GETDVI("TCP0:","DEVNAM") $ SET MESSAGE'Message' $! $ IF (cmu .NES. "***") .OR. (win .NES. "***") .OR. (ucx .NES. "***") - .OR. (psc .NES. "***") THEN GOTO ProtocolOK $! $ TYPE sys$input -------------------------------------------------------------------------------- Sorry, but this version of VMS IRC works only with CMU/tek, Wollongong, UCX, Process Software or Multinet TCP/IP ... You don't have one of those TCP/IP implementations above and so it's unnecessary to compile this IRC client... BTW: Which TCP/IP implementation do you use? Uranus -------------------------------------------------------------------------------- $ EXIT $! $ProtocolOK: $ say "-------------------- Creating IRC Image --------------------" $ INQUIRE/NOPUNCT Server "What's your default server? " $ INQUIRE/NOPUNCT Port "And what is the IRC port on this server? [6667] " $ IF Port .EQS. "" THEN Port=6667 $! $ say "Creating new ENVIRONMENT.H file..." $ OPEN/READ fd environment.h $ OPEN/WRITE fd2 env_new.h $ReadLoop: $ READ fd Line $ IF F$LOCATE("#define DEFSERVER",Line) .EQ. 0 THEN GOTO ReadReady $ WRITE fd2 Line $ GOTO ReadLoop $ReadReady: $ WRITE fd2 "#define DEFSERVER ""''Server'""" $ WRITE fd2 "#define DEFPORT ""''Port'""" $ CLOSE fd2 $ CLOSE fd $ RENAME env_new.h environment.h $! $ @make $! $ INQUIRE/NOPUNCT YesNo "Do you want to delete the source now again? [y] " $ IF (YesNo .EQS. "NO") .OR. (YesNo .EQS. "N") THEN GOTO NoDelete $ DELETE/NOCONF irc.c; $ DELETE/NOCONF analyze.c; $ DELETE/NOCONF async.c; $ DELETE/NOCONF command.c; $ DELETE/NOCONF recall.c; $ DELETE/NOCONF make.com; $ DELETE/NOCONF environment.h; $ DELETE/NOCONF header.h; $ DELETE/NOCONF numeric.h; $ DELETE/NOCONF ucxdef.h; $ DELETE/NOCONF misc.h; $ DELETE/NOCONF misc.c; $NoDelete: $! $ TYPE sys$input -------------------- IRC Image created -------------------- Now you have to define a symbol in your LOGIN.COM as following: $ IRC :== $IRC You can pre-define your Nickname,Personal Name,IRCserver,IRCport and a kind of SCRIPTFILE with the logicals: $ DEFINE ircnick "" $ DEFINE ircname "" Optional: $ DEFINE ircserver "" $ DEFINE ircport "" $ DEFINE irclogin "" Start IRC by typing on DCL level: IRC [nickname] [server] [port] $! $ EXIT .