Initial import of the ircii-pana-1.1-final source tree.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
BIN
contrib/BX.plus.XMMS.tar.gz
Normal file
BIN
contrib/BX.plus.XMMS.tar.gz
Normal file
Binary file not shown.
1065
contrib/BitchX-1.0c14-IPv6-2.patch
Normal file
1065
contrib/BitchX-1.0c14-IPv6-2.patch
Normal file
File diff suppressed because it is too large
Load Diff
96
contrib/BitchX-1.0c14-LATIN.patch
Normal file
96
contrib/BitchX-1.0c14-LATIN.patch
Normal file
@@ -0,0 +1,96 @@
|
||||
--- BitchX.orig/include/color.h Mon Nov 22 00:47:16 1999
|
||||
+++ BitchX/include/color.h Mon Dec 27 19:21:51 1999
|
||||
@@ -419,13 +419,13 @@
|
||||
#define DEFAULT_FORMAT_476_FSET "$G [$1] You are not opped"
|
||||
|
||||
#ifdef ONLY_STD_CHARS
|
||||
-#define DEFAULT_FORMAT_ACTION_FSET "%@%K* %W$1 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_AR_FSET "%@%K* %Y$1 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET "%@%K* %Y$1/$3 %n$4-"
|
||||
-#define DEFAULT_FORMAT_ACTION_OTHER_FSET "%@%K* %n>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET "%@%K* %y>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_USER_FSET "%@%K* %n>%c$1 %n$3-"
|
||||
-#define DEFAULT_FORMAT_ACTION_USER_AR_FSET "%@%K* %y>%c$1 %n$3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%K* %W$1 %n$4-":"* $1 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%K* %Y$1 %n$4-":"* $1 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_CHANNEL_FSET ansi?"%@%K* %Y$1/$3 %n$4-":"* $1/$3 $4-"
|
||||
+#define DEFAULT_FORMAT_ACTION_OTHER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_OTHER_AR_FSET ansi?"%@%K* %y>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_USER_FSET ansi?"%@%K* %n>%c$1 %n$3-":"* >$1 $3-"
|
||||
+#define DEFAULT_FORMAT_ACTION_USER_AR_FSET ansi?"%@%K* %y>%c$1 %n$3-":"* >$1 $3-"
|
||||
#else
|
||||
#define DEFAULT_FORMAT_ACTION_FSET ansi?"%@%K<> %W$1 %n$4-":"%@<02> $1 $4-"
|
||||
#define DEFAULT_FORMAT_ACTION_AR_FSET ansi?"%@%K<> %Y$1 %n$4-":"%@<02> $1 $4-"
|
||||
@@ -668,26 +668,26 @@
|
||||
#define DEFAULT_FORMAT_WHO_FSET "%Y$[10]0 %W$[10]1%w %c$[3]2 %w$3%R@%w$4 ($6-)"
|
||||
|
||||
#ifdef ONLY_STD_CHARS
|
||||
-#define DEFAULT_FORMAT_WHOIS_AWAY_FSET "%G| %Wa%nway : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_BOT_FSET "%G| %Wb%not : A:$0 P:$1 [$2] $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET "%G| %Wc%nhannels : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET "%G| %Wf%nriend : L:$0 A:$1 P:$2 $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_HEADER_FSET "%G------------------------------------------------"
|
||||
-#define DEFAULT_FORMAT_WHOIS_IDLE_FSET "%G| %Wi%ndle : $0 hours $1 mins $2 secs (signon: $stime($3))"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SHIT_FSET "%G| %Ws%nhit : L:$0 [$1] $2 $3-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET "%K %Ws%nignon : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_NAME_FSET "%G| %Wi%nrcname : $0-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_NICK_FSET "%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)"
|
||||
-#define DEFAULT_FORMAT_WHOIS_OPER_FSET "%G| %Wo%nperator : $0 $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SERVER_FSET "%G| %Ws%nerver : $0 ($1-)"
|
||||
-#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET "%G------ %WWho %G---------------------- %WChannel%G--- %wServer %G------------- %wSeconds"
|
||||
-#define DEFAULT_FORMAT_WHOLEFT_USER_FSET "%G<>%n $[-10]0!$[20]1 $[10]2 $[20]4 $3"
|
||||
-#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET "%G-----------------------------------------------"
|
||||
-#define DEFAULT_FORMAT_WHOWAS_NICK_FSET "%G| %W$0%n was %K(%n$1@$2%K)"
|
||||
-#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET "%K| %Wa%ndmin : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET "%K| %Ws%nervice : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_HELP_FSET "%K| %Wh%nelp : $0 - $1-"
|
||||
-#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET "%K| %Wr%negister : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway : $0 - $1-":"| away : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not : A:$0 P:$1 [$2] $3-":"| bot : A:$0 P:$1 [$2] $3-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_CHANNELS_FSET ansi?"%g| %Wc%nhannels : $0-":"| channels : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_FRIEND_FSET ansi?"%g| %Wf%nriend : F:$0 $1-":"| friend : F:$0 $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ -- -":".----------------------------------------- -- -"
|
||||
+#define DEFAULT_FORMAT_WHOIS_IDLE_FSET ansi?"%K: %Wi%ndle : $0 hours $1 mins $2 secs (signon: $stime($3))":": idle : $0 hours $1 mins $2 secs (signon: $stime($3))"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SHIT_FSET ansi?"%g| %Ws%nhit : L:$0 [$1] $2 $3-":"| shit : L:$0 [$1] $2 $3-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SIGNON_FSET ansi?"%K| %Ws%nignon : $0-":"| signon : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_NAME_FSET ansi?"%G: %Wi%nrcname : $0-":": ircname : $0-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_NICK_FSET ansi?"%G| %W$0 %K(%n$1@$2%K) %K(%W$3-%K)":"| $0 ($1@$2) ($3-)"
|
||||
+#define DEFAULT_FORMAT_WHOIS_OPER_FSET ansi?"%K| %Wo%nperator : $0 $1-":"| operator : $0 $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SERVER_FSET ansi?"%K| %Ws%nerver : $0 ($1-)":"| server : $0 ($1-)"
|
||||
+#define DEFAULT_FORMAT_WHOLEFT_HEADER_FSET ansi?"%G.----- %WWho %G-----%g---%G---%g--%G-----%g--%G-- %WChannel%g--- %wServer %G-%g----%G--%g--%G----%g %wSeconds":".----- Who ---------------------- Channel--- Server ------------- Seconds"
|
||||
+#define DEFAULT_FORMAT_WHOLEFT_USER_FSET ansi?"%G|%n $[-10]0!$[20]1 $[10]2 $[20]4 $3":"| $[-10]0!$[20]1 $[10]2 $[20]4 $3"
|
||||
+#define DEFAULT_FORMAT_WHOWAS_HEADER_FSET ansi?"%G.--------%g-%G--%g--%G-%g---------%K-%g--%K--%g-%K------------ -- -":".----------------------------------------- -- -"
|
||||
+#define DEFAULT_FORMAT_WHOWAS_NICK_FSET ansi?"%G| %W$0%n was %K(%n$1@$2%K)":"| $0 was ($1@$2)"
|
||||
+#define DEFAULT_FORMAT_WHOIS_ADMIN_FSET ansi?"%K| %Wa%ndmin : $0 - $1-":"| admin : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_SERVICE_FSET ansi?"%K| %Ws%nervice : $0 - $1-":"| service : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_HELP_FSET ansi?"%K| %Wh%nelp : $0 - $1-":"| help : $0 - $1-"
|
||||
+#define DEFAULT_FORMAT_WHOIS_REGISTER_FSET ansi?"%K| %Wr%negister : $0 - $1-":"| register : $0 - $1-"
|
||||
#else
|
||||
#define DEFAULT_FORMAT_WHOIS_AWAY_FSET ansi?"%K| %Wa%nway : $0 - $1-":"| away : $0 - $1-"
|
||||
#define DEFAULT_FORMAT_WHOIS_BOT_FSET ansi?"%g| %Wb%not : A:$0 P:$1 [$2] $3-":"| bot : A:$0 P:$1 [$2] $3-"
|
||||
--- BitchX.orig/source/vars.c Tue Nov 16 05:58:01 1999
|
||||
+++ BitchX/source/vars.c Mon Dec 27 19:16:46 1999
|
||||
@@ -1392,6 +1392,9 @@
|
||||
#ifndef ONLY_STD_CHARS
|
||||
set_string_var(SHOW_NUMERICS_STR_VAR, value ? "[1;31m<31>[0m[1;37m<37>[1;31m<31>[0m" : "-:-");
|
||||
set_numeric_string(current_window, value ? "[1;31m<31>[0m[1;37m<37>[1;31m<31>[0m":"-:-", 0);
|
||||
+#else
|
||||
+ set_string_var(SHOW_NUMERICS_STR_VAR, value ? "[1;31m-[0m[1;37m:[1;31m-[0m" : "-:-");
|
||||
+ set_numeric_string(current_window, value ? "[1;31m-[0m[1;37m:[1;31m-[0m":"-:-", 0);
|
||||
#endif
|
||||
reinit_status(win, unused, value);
|
||||
}
|
||||
--- BitchX.orig/source/irc.c Thu Dec 16 12:05:39 1999
|
||||
+++ BitchX/source/irc.c Mon Dec 27 19:23:04 1999
|
||||
@@ -97,7 +97,11 @@
|
||||
* switchs are set */
|
||||
dead = 0,
|
||||
inhibit_logging = 0,
|
||||
+#ifndef ONLY_STD_CHARS
|
||||
startup_ansi = 1, /* display startup ansi */
|
||||
+#else
|
||||
+ startup_ansi = 0, /* DO NOT display startup ansi */
|
||||
+#endif
|
||||
auto_connect = 1, /* auto-connect to first server*/
|
||||
|
||||
background = 0,
|
||||
19
contrib/BitchX-configure.patch
Normal file
19
contrib/BitchX-configure.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
diff -ru BitchX/configure.in BitchX.AX/configure.in
|
||||
--- BitchX/configure.in Tue Jan 4 07:43:35 2000
|
||||
+++ BitchX.AX/configure.in Wed Jan 19 17:54:30 2000
|
||||
@@ -290,6 +290,15 @@
|
||||
|
||||
if test x"$blahhack" = x"1"; then
|
||||
blahhack=0
|
||||
+ AC_MSG_CHECKING(for tputs in ncurses/termcap.h)
|
||||
+ AC_EGREP_CPP([tputs( | |\()],[#include <ncurses/termcap.h>
|
||||
+ ], [ AC_DEFINE(HAVE_TERMCAP_H)
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ havetputs=1 AC_CHECK_HEADER(ncurses/termcap.h)], blahhack=1; AC_MSG_RESULT(no))
|
||||
+ fi
|
||||
+
|
||||
+ if test x"$blahhack" = x"1"; then
|
||||
+ blahhack=0
|
||||
AC_MSG_CHECKING(for tputs in curses.h)
|
||||
AC_EGREP_CPP([tputs( | |\()],[#include <curses.h>
|
||||
], [ AC_DEFINE(USING_CURSES)
|
||||
59
contrib/dcc.diff
Normal file
59
contrib/dcc.diff
Normal file
@@ -0,0 +1,59 @@
|
||||
*** dcc.c Wed Jul 22 17:25:39 1998
|
||||
--- dcc.c.bak Wed Jul 22 17:25:39 1998
|
||||
***************
|
||||
*** 1,4 ****
|
||||
! /*
|
||||
* dcc.c: Things dealing with client to client connections.
|
||||
*
|
||||
* Copyright(c) 1998 Colten Edwards aka panasync.
|
||||
--- 1,4 ----
|
||||
! /*
|
||||
* dcc.c: Things dealing with client to client connections.
|
||||
*
|
||||
* Copyright(c) 1998 Colten Edwards aka panasync.
|
||||
***************
|
||||
*** 1283,1304 ****
|
||||
return user;
|
||||
}
|
||||
|
||||
- /* check if supplied nick matches your current nick, if so return false */
|
||||
- int dcc_check_nick (char *nick) {
|
||||
- size_t len = 0;
|
||||
- if (current_window -> server != -1) {
|
||||
- len = strlen (nick) + 1;
|
||||
- if (my_strnicmp (nick, get_server_nickname (current_window -> server), len)) {
|
||||
- return 0;
|
||||
- } else {
|
||||
- return 1;
|
||||
- }
|
||||
- } else {
|
||||
- return 0;
|
||||
- }
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
DCC_COMMAND(dcc_chat)
|
||||
{
|
||||
char *user;
|
||||
--- 1283,1288 ----
|
||||
***************
|
||||
*** 1329,1339 ****
|
||||
{
|
||||
if (!nick || !*nick)
|
||||
break;
|
||||
! /* check to see if nick matches yours if so continue */
|
||||
! if (dcc_check_nick (nick)) {
|
||||
! put_it ("%s", convert_output_format ("$G %RDCC%n Cannot DCC chat yourself!", NULL, NULL));
|
||||
! continue;
|
||||
! }
|
||||
if ((s = find_dcc(nick, "chat", bot?DCC_BOTMODE:DCC_CHAT, 1, -1, -1)))
|
||||
{
|
||||
if ((s->flags & DCC_ACTIVE) || (s->flags & DCC_WAIT))
|
||||
--- 1313,1319 ----
|
||||
{
|
||||
if (!nick || !*nick)
|
||||
break;
|
||||
!
|
||||
if ((s = find_dcc(nick, "chat", bot?DCC_BOTMODE:DCC_CHAT, 1, -1, -1)))
|
||||
{
|
||||
if ((s->flags & DCC_ACTIVE) || (s->flags & DCC_WAIT))
|
||||
5073
contrib/misc.c
Normal file
5073
contrib/misc.c
Normal file
File diff suppressed because it is too large
Load Diff
266
contrib/parse_arg
Normal file
266
contrib/parse_arg
Normal file
@@ -0,0 +1,266 @@
|
||||
#if 0
|
||||
int ch;
|
||||
int add_servers = 0;
|
||||
strqct passwd *entry;
|
||||
struct hostent *hp;
|
||||
char *ptr = NULL;
|
||||
char *tmp_hostname = NULL;
|
||||
char *channel = NULL;
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
|
||||
*nickname = 0;
|
||||
*realname = 0;
|
||||
*username = 0;
|
||||
|
||||
/*
|
||||
* Its probably better to parse the environment variables
|
||||
* first -- that way they can be used as defaults, but can
|
||||
* still be overriden on the command line.
|
||||
*/
|
||||
#ifndef WINNT
|
||||
if ((entry = getpwuid(getuid())))
|
||||
{
|
||||
if (entry->pw_gecos && *(entry->pw_gecos))
|
||||
{
|
||||
if ((ptr = strchr(entry->pw_gecos, GECOS_DELIMITER)))
|
||||
*ptr = 0;
|
||||
strmcpy(realname, entry->pw_gecos, REALNAME_LEN);
|
||||
}
|
||||
|
||||
if (entry->pw_name && *(entry->pw_name))
|
||||
strmcpy(username, entry->pw_name, NAME_LEN);
|
||||
|
||||
if (entry->pw_dir && *(entry->pw_dir))
|
||||
malloc_strcpy(&my_path, entry->pw_dir);
|
||||
}
|
||||
#else
|
||||
{
|
||||
u_long size=NAME_LEN+1;
|
||||
if (!(ptr = getenv("IRCUSER")))
|
||||
strcpy(username, "unknown");
|
||||
else
|
||||
strcpy(username,ptr);
|
||||
}
|
||||
#endif
|
||||
if ((ptr = getenv("IRCNICK")))
|
||||
strmcpy(nickname, ptr, NICKNAME_LEN);
|
||||
|
||||
/*
|
||||
* We now allow users to use IRCUSER or USER if we couldnt get the
|
||||
* username from the password entries. For those systems that use
|
||||
* NIS and getpwuid() fails (boo, hiss), we make a last ditch effort
|
||||
* to see what LOGNAME is (defined by POSIX.2 to be the canonical
|
||||
* username under which the person logged in as), and if that fails,
|
||||
* we're really tanked, so we just let the user specify their own
|
||||
* username. I think everyone would have to agree this is the most
|
||||
* reasonable way to handle this.
|
||||
*/
|
||||
if (!*username)
|
||||
if ((ptr = getenv("LOGNAME")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
|
||||
if (!*username)
|
||||
if ((ptr = getenv("IRCUSER")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
else if (*username)
|
||||
;
|
||||
else if ((ptr = getenv("USER")) && *ptr)
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
else if ((ptr = getenv("HOME")) && *ptr)
|
||||
{
|
||||
char *ptr2 = strrchr(ptr, '/');
|
||||
if (ptr2)
|
||||
strmcpy(username, ptr2, NAME_LEN);
|
||||
else
|
||||
strmcpy(username, ptr, NAME_LEN);
|
||||
}
|
||||
else
|
||||
strmcpy(username, "Unknown", NAME_LEN);
|
||||
|
||||
|
||||
#ifdef IDENT_FAKE
|
||||
{
|
||||
char *p = NULL, *q = NULL;
|
||||
FILE *f;
|
||||
malloc_sprintf(&p, "~/%s", get_string_var(IDENT_HACK_VAR));
|
||||
q = expand_twiddle(p);
|
||||
if ((f = fopen(q, "r")))
|
||||
{
|
||||
fgets(username, NAME_LEN, f);
|
||||
if (*username && strchr(username, '\n'))
|
||||
username[strlen(username)-1] = 0;
|
||||
}
|
||||
fclose(f);
|
||||
new_free(&p); new_free(&q);
|
||||
if (!*username)
|
||||
strmcpy(username, "Unknown", NAME_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCNAME")))
|
||||
strmcpy(realname, ptr, REALNAME_LEN);
|
||||
else if ((ptr = getenv("NAME")))
|
||||
strmcpy(realname, ptr, REALNAME_LEN);
|
||||
else if (!*realname)
|
||||
strmcpy(realname, "* New BX user who didn't read BitchX.doc *", REALNAME_LEN);
|
||||
|
||||
if ((ptr = getenv("HOME")))
|
||||
malloc_strcpy(&my_path, ptr);
|
||||
else if (!my_path)
|
||||
#ifndef WINNT
|
||||
malloc_strcpy(&my_path, "/");
|
||||
#else
|
||||
malloc_strcpy(&my_path, empty_string);
|
||||
#endif
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(my_path);
|
||||
#endif
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCPORT")))
|
||||
irc_port = my_atol(ptr);
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCRC")))
|
||||
ircrc_file = m_strdup(ptr);
|
||||
else
|
||||
ircrc_file = m_2dup(my_path, IRCRC_NAME);
|
||||
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCLIB")))
|
||||
irc_lib = m_2dup(ptr, "/");
|
||||
else
|
||||
irc_lib = m_strdup(IRCLIB);
|
||||
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(irc_lib);
|
||||
#endif
|
||||
|
||||
|
||||
if ((ptr = getenv("IRCUMODE")))
|
||||
send_umode = m_strdup(ptr);
|
||||
|
||||
if ((ptr = getenv("IRCPATH")))
|
||||
irc_path = m_strdup(ptr);
|
||||
else
|
||||
irc_path = m_strdup(IRCPATH);
|
||||
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
convert_unix(irc_path);
|
||||
#endif
|
||||
|
||||
|
||||
set_string_var(LOAD_PATH_VAR, irc_path);
|
||||
new_free(&irc_path);
|
||||
|
||||
if ((ptr = getenv("IRCHOST")) && *ptr)
|
||||
tmp_hostname = ptr;
|
||||
|
||||
if (!ircservers_file)
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
malloc_strcpy(&ircservers_file, "irc-serv");
|
||||
#else
|
||||
malloc_strcpy(&ircservers_file, ".ircservers");
|
||||
#endif
|
||||
|
||||
if (!bircrc_file)
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
malloc_sprintf(&bircrc_file, "%s/bx-rc", my_path);
|
||||
#else
|
||||
malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
|
||||
#endif
|
||||
|
||||
while ((ch = getopt(argc, argv, "aBbc:dfFhH:l:L:Nn:p:r:qsvxz:")) != EOF)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case 'v': /* Outpqt ircII version */
|
||||
show_version();
|
||||
/* NOTREACHED */
|
||||
case 'p': /* Default port to use */
|
||||
irc_port = my_atol(optarg);
|
||||
break;
|
||||
|
||||
case 'f': /* Use flow control */
|
||||
use_flow_control = 1;
|
||||
break;
|
||||
|
||||
case 'F': /* dont use flow control */
|
||||
use_flow_control = 0;
|
||||
break;
|
||||
|
||||
case 'd': /* use dumb mode */
|
||||
dumb_mode = 1;
|
||||
break;
|
||||
|
||||
case 'l': /* Load some file instead of ~/.ircrc */
|
||||
case 'L': /* Same as above. Doesnt work like before */
|
||||
malloc_strcpy(&ircrc_file, optarg);
|
||||
break;
|
||||
|
||||
case 'a': /* add server, not replace */
|
||||
add_servers = 1;
|
||||
break;
|
||||
case 'r':
|
||||
add_servers = 1;
|
||||
malloc_strcpy(&ircservers_file, optarg);
|
||||
break;
|
||||
|
||||
case 'q': /* quick startup -- no .ircrc */
|
||||
quick_startup = 1;
|
||||
break;
|
||||
|
||||
case 's': /* dont connect - let user choose server */
|
||||
dont_connect = 1;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
dumb_mode = 1;
|
||||
use_input = 0;
|
||||
background = 1;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
strmcpy(nickname, optarg, NICKNAME_LEN);
|
||||
break;
|
||||
|
||||
case 'x': /* x_debug flag */
|
||||
x_debug = (unsigned long)0x0fffffff;
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
strmcpy(username, optarg, NAME_LEN);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
load_ircrc_right_away = 1;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
malloc_strcpy(&channel, optarg);
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
tmp_hostname = optarg;
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
auto_connect = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'h':
|
||||
case '?':
|
||||
fputs(switch_help, stderr);
|
||||
exit(1);
|
||||
} /* End of switch */
|
||||
}
|
||||
|
||||
|
||||
|
||||
#else /* end new parse */
|
||||
BIN
contrib/roll-1.0.tar.gz
Normal file
BIN
contrib/roll-1.0.tar.gz
Normal file
Binary file not shown.
163
contrib/vh1.c
Normal file
163
contrib/vh1.c
Normal file
@@ -0,0 +1,163 @@
|
||||
/* The New routine for getting ips and interfaces for /hostname
|
||||
Phear MHacker ;)
|
||||
|
||||
*/
|
||||
|
||||
/* added rev dns support
|
||||
Phear sideshow ;)
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#if defined(sun)
|
||||
#include <sys/sockio.h>
|
||||
#else
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <net/if.h>
|
||||
#include <netinet/in.h>
|
||||
#if !defined(linux)
|
||||
#include <netinet/in_var.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
|
||||
void check_inter (char *, char **);
|
||||
void usage (char **);
|
||||
|
||||
int main (int argc, char **argv)
|
||||
{
|
||||
int s;
|
||||
char *buffer;
|
||||
struct ifconf ifc;
|
||||
char name[100];
|
||||
struct ifreq *ifptr, *end;
|
||||
struct ifreq ifr;
|
||||
int ifflags, selectflag = -1;
|
||||
int oldbufsize, bufsize = sizeof (struct ifreq);
|
||||
if(!argv[1])
|
||||
{
|
||||
usage(argv);
|
||||
exit(0);
|
||||
}
|
||||
printf ("This program should print out valid hosts on all network devices\n");
|
||||
s = socket (AF_INET, SOCK_DGRAM, 0);
|
||||
if (s < 0)
|
||||
{
|
||||
perror ("ifconfig: socket");
|
||||
exit (1);
|
||||
}
|
||||
buffer = malloc (bufsize);
|
||||
ifc.ifc_len = bufsize;
|
||||
do
|
||||
{
|
||||
oldbufsize = ifc.ifc_len;
|
||||
bufsize += 1 + sizeof (struct ifreq);
|
||||
buffer = realloc ((void *) buffer, bufsize);
|
||||
ifc.ifc_len = bufsize;
|
||||
ifc.ifc_buf = buffer;
|
||||
if (ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
|
||||
{
|
||||
perror ("ifconfig (SIOCGIFCONF)");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
while (ifc.ifc_len > oldbufsize);
|
||||
ifflags = ifc.ifc_req->ifr_flags;
|
||||
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
|
||||
ifptr = ifc.ifc_req;
|
||||
while (ifptr < end)
|
||||
{
|
||||
sprintf (ifr.ifr_name, "%s", ifptr->ifr_name);
|
||||
sprintf (name, "%s", ifptr->ifr_name);
|
||||
close (s);
|
||||
check_inter (name, argv);
|
||||
ifptr++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
check_inter (char *interface, char **argv)
|
||||
{
|
||||
struct in_addr i;
|
||||
struct hostent *he;
|
||||
struct ifreq ifr;
|
||||
char rhost[256], fhost[30];
|
||||
int fd;
|
||||
char *ip;
|
||||
register int flags;
|
||||
ip = malloc (sizeof (ip));
|
||||
if ((fd = socket (AF_INET, SOCK_DGRAM, 0)) < 0)
|
||||
return;
|
||||
strcpy (ifr.ifr_name, interface);
|
||||
|
||||
if (ioctl (fd, SIOCGIFADDR, &ifr) < 0)
|
||||
{
|
||||
close (fd);
|
||||
return;
|
||||
}
|
||||
if (ioctl (fd, SIOCGIFFLAGS, &ifr) < 0)
|
||||
{
|
||||
close (fd);
|
||||
return;
|
||||
}
|
||||
ip = (char *) inet_ntoa (((struct sockaddr_in *) &ifr.ifr_addr)->sin_addr);
|
||||
if (ifr.ifr_flags & IFF_UP)
|
||||
{
|
||||
i.s_addr = inet_addr (ip);
|
||||
he = gethostbyaddr ((char *) &i, sizeof (struct in_addr), AF_INET);
|
||||
bzero(rhost, sizeof(rhost));
|
||||
if (he != NULL)
|
||||
{
|
||||
strncpy (rhost, he->h_name, 255);
|
||||
he = gethostbyname (rhost);
|
||||
if (he != NULL)
|
||||
sprintf (fhost, "%u.%u.%u.%u", he->h_addr[0] & 0xff, he->h_addr[1] & 0xff, he->h_addr[2] & 0xff, he->h_addr[3] & 0xff);
|
||||
|
||||
}
|
||||
if (rhost)
|
||||
{
|
||||
if (strcasecmp (ip, fhost) == 0)
|
||||
{
|
||||
if ((strcmp ("-m", argv[1]) == 0) || (strcmp ("-a", argv[1]) == 0))
|
||||
{
|
||||
printf ("Interface %s: %s %s (matching)\n", interface, ip, rhost);
|
||||
bzero (rhost, sizeof (rhost));
|
||||
bzero (fhost, sizeof (fhost));
|
||||
}
|
||||
}
|
||||
else if ((strcmp("-r", argv[1])==0) || (strcmp("-a", argv[1]) == 0))
|
||||
{
|
||||
printf ("Interface %s: %s %s\n", interface, ip, rhost);
|
||||
bzero (rhost, sizeof (rhost));
|
||||
}
|
||||
}
|
||||
else if ((strcmp("-i", argv[1]) ==0) || (strcmp("-a", argv[1]) == 0))
|
||||
printf ("Interface %s: %s\n", interface, ip);
|
||||
}
|
||||
close (fd);
|
||||
}
|
||||
|
||||
void usage(char **argv)
|
||||
{
|
||||
printf("\nVirtual Host checking system by Warren Rees\n");
|
||||
printf("Support for reverse dns and dns matching by Matt Watson\n\n");
|
||||
printf("Usage: %s [-amri]\n\n", argv[0]);
|
||||
printf("\t-a : Show all ips\n");
|
||||
printf("\t-m : Show only ips & hostname with matching forward and reverse dns\n");
|
||||
printf("\t-r : Show only ips that have reverse dns but no forward dns\n");
|
||||
printf("\t-i : Show only non-resolving ips no forward or reverse dns\n\n\n");
|
||||
}
|
||||
|
||||
238
contrib/window.and.detach.diff
Normal file
238
contrib/window.and.detach.diff
Normal file
@@ -0,0 +1,238 @@
|
||||
diff -uNr sent-upstream/as-sent-last/include/config.h ircii-pana-1.0-0c15/include/config.h
|
||||
--- sent-upstream/as-sent-last/include/config.h Sat Jan 8 04:19:04 2000
|
||||
+++ ircii-pana-1.0-0c15/include/config.h Sun Jan 9 06:40:56 2000
|
||||
@@ -571,7 +571,7 @@
|
||||
#define WANT_DETACH ON /* this is here for the detach/re-attach code
|
||||
which is essentially a mini-screen */
|
||||
#define ALLOW_DETACH ON
|
||||
-
|
||||
+#define DEFAULT_DETACH_ON_HUP ON
|
||||
|
||||
#undef OLD_RANDOM_BEHAVIOR /* semi randomness for randm() */
|
||||
|
||||
diff -uNr sent-upstream/as-sent-last/include/modval.h ircii-pana-1.0-0c15/include/modval.h
|
||||
--- sent-upstream/as-sent-last/include/modval.h Tue Jan 4 01:54:48 2000
|
||||
+++ ircii-pana-1.0-0c15/include/modval.h Sun Jan 9 06:01:54 2000
|
||||
@@ -306,6 +306,7 @@
|
||||
#define get_window_server(x) ((int) (global[GET_WINDOW_SERVER]((unsigned int)x)))
|
||||
#define set_window_server(x, y, z) ((void) (global[SET_WINDOW_SERVER]((int)x, (int)y, (int)z)))
|
||||
#define window_check_servers ((void (*)())global[WINDOW_CHECK_SERVERS])
|
||||
+#define window_close_server ((void (*)(int))global[WINDOW_CHECK_SERVERS])
|
||||
#define change_window_server(x, y) ((void) (global[CHANGE_WINDOW_SERVER]((int)x, (int)y)))
|
||||
#define set_level_by_refnum(x, y) ((void) (global[SET_LEVEL_BY_REFNUM]((unsigned int)x, (int)y)))
|
||||
#define message_to(x) ((void) (global[MESSAGE_TO]((unsigned int)x)))
|
||||
diff -uNr sent-upstream/as-sent-last/include/struct.h ircii-pana-1.0-0c15/include/struct.h
|
||||
--- sent-upstream/as-sent-last/include/struct.h Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/include/struct.h Sun Jan 9 06:13:17 2000
|
||||
@@ -593,6 +593,7 @@
|
||||
unsigned int refnum; /* the unique reference number,
|
||||
* assigned by IRCII */
|
||||
int server; /* server index */
|
||||
+ int last_server; /* previous server index */
|
||||
int top; /* The top line of the window, screen
|
||||
* coordinates */
|
||||
int bottom; /* The botton line of the window, screen
|
||||
diff -uNr sent-upstream/as-sent-last/include/vars.h ircii-pana-1.0-0c15/include/vars.h
|
||||
--- sent-upstream/as-sent-last/include/vars.h Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/include/vars.h Sun Jan 9 06:41:24 2000
|
||||
@@ -103,6 +103,7 @@
|
||||
DEOPFLOOD_TIME_VAR,
|
||||
DEOP_ON_DEOPFLOOD_VAR,
|
||||
DEOP_ON_KICKFLOOD_VAR,
|
||||
+ DETACH_ON_HUP,
|
||||
DISPATCH_UNKNOWN_COMMANDS_VAR,
|
||||
DISPLAY_VAR ,
|
||||
DISPLAY_ANSI_VAR,
|
||||
diff -uNr sent-upstream/as-sent-last/include/window.h ircii-pana-1.0-0c15/include/window.h
|
||||
--- sent-upstream/as-sent-last/include/window.h Fri Oct 22 01:48:21 1999
|
||||
+++ ircii-pana-1.0-0c15/include/window.h Sun Jan 9 06:03:52 2000
|
||||
@@ -31,6 +31,10 @@
|
||||
#define ON 1
|
||||
#define TOGGLE 2
|
||||
|
||||
+#define WINDOW_NO_SERVER -1
|
||||
+#define WINDOW_DLL -2
|
||||
+#define WINDOW_SERVER_CLOSED -3
|
||||
+
|
||||
Window *new_window (struct ScreenStru *);
|
||||
void delete_window (Window *);
|
||||
void add_to_invisible_list (Window *);
|
||||
@@ -71,7 +75,6 @@
|
||||
char *get_bound_channel (Window *);
|
||||
int get_window_server (unsigned);
|
||||
void set_window_server (int, int, int);
|
||||
- void window_check_servers (void);
|
||||
void set_level_by_refnum (unsigned, unsigned long);
|
||||
void message_to (unsigned long);
|
||||
|
||||
@@ -145,6 +148,7 @@
|
||||
const char *query_host (void);
|
||||
const char *query_cmd (void);
|
||||
void window_check_servers(void);
|
||||
+ void window_close_server(int old_server);
|
||||
void window_change_server(int, int);
|
||||
void make_window_current_by_winref(int);
|
||||
void make_window_current_by_desc(char *);
|
||||
diff -uNr sent-upstream/as-sent-last/source/commands.c ircii-pana-1.0-0c15/source/commands.c
|
||||
--- sent-upstream/as-sent-last/source/commands.c Tue Jan 4 01:43:35 2000
|
||||
+++ ircii-pana-1.0-0c15/source/commands.c Sun Jan 9 06:05:49 2000
|
||||
@@ -1075,7 +1075,7 @@
|
||||
set_server_reconnect(from_server, 1);
|
||||
close_server(from_server,(args && *args) ? args : "Reconnecting");
|
||||
clean_server_queues(from_server);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
servercmd(NULL, scommnd, empty_string, NULL);
|
||||
|
||||
}
|
||||
diff -uNr sent-upstream/as-sent-last/source/irc.c ircii-pana-1.0-0c15/source/irc.c
|
||||
--- sent-upstream/as-sent-last/source/irc.c Sat Jan 8 04:19:04 2000
|
||||
+++ ircii-pana-1.0-0c15/source/irc.c Sun Jan 9 06:49:38 2000
|
||||
@@ -543,6 +543,14 @@
|
||||
detachcmd(NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
+void set_detach_on_hup(Window *dummy, char *unused, int value)
|
||||
+{
|
||||
+ if(value)
|
||||
+ my_signal(SIGHUP, sig_detach, 0);
|
||||
+ else
|
||||
+ my_signal(SIGHUP, irc_exit_old, 0);
|
||||
+}
|
||||
+
|
||||
/* shows the version of irc */
|
||||
static void versionreply(void)
|
||||
{
|
||||
@@ -1506,7 +1514,7 @@
|
||||
#endif
|
||||
my_signal(SIGQUIT, SIG_IGN, 0);
|
||||
#ifdef WANT_DETACH
|
||||
- my_signal(SIGHUP, sig_detach, 0);
|
||||
+ set_detach_on_hup(NULL, NULL, DEFAULT_DETACH_ON_HUP);
|
||||
#else
|
||||
my_signal(SIGHUP, irc_exit_old, 0);
|
||||
#endif
|
||||
diff -uNr sent-upstream/as-sent-last/source/numbers.c ircii-pana-1.0-0c15/source/numbers.c
|
||||
--- sent-upstream/as-sent-last/source/numbers.c Sat Jan 1 19:24:50 2000
|
||||
+++ ircii-pana-1.0-0c15/source/numbers.c Sun Jan 9 06:06:34 2000
|
||||
@@ -1105,7 +1105,7 @@
|
||||
if (do_hook(current_numeric, "%s %s", from, *ArgList))
|
||||
display_msg(from, ArgList);
|
||||
close_server(from_server, empty_string);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
if (from_server == primary_server)
|
||||
get_connected(from_server + 1, from_server);
|
||||
break;
|
||||
@@ -1149,7 +1149,7 @@
|
||||
display_msg(from, ArgList);
|
||||
|
||||
close_server(from_server, empty_string);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
if (server_list_size() > 1)
|
||||
remove_from_server_list(klined);
|
||||
if (klined == primary_server && (server_list_size() > 0))
|
||||
diff -uNr sent-upstream/as-sent-last/source/parse.c ircii-pana-1.0-0c15/source/parse.c
|
||||
--- sent-upstream/as-sent-last/source/parse.c Tue Jan 4 02:30:07 2000
|
||||
+++ ircii-pana-1.0-0c15/source/parse.c Sun Jan 9 06:06:48 2000
|
||||
@@ -1166,7 +1166,7 @@
|
||||
|
||||
close_server(from_server,empty_string);
|
||||
clean_server_queues(from_server);
|
||||
- window_check_servers();
|
||||
+ window_close_server(from_server);
|
||||
set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
|
||||
if (strchr(from, '.'))
|
||||
{
|
||||
diff -uNr sent-upstream/as-sent-last/source/server.c ircii-pana-1.0-0c15/source/server.c
|
||||
--- sent-upstream/as-sent-last/source/server.c Tue Jan 4 01:43:35 2000
|
||||
+++ ircii-pana-1.0-0c15/source/server.c Sun Jan 9 06:25:16 2000
|
||||
@@ -257,6 +257,7 @@
|
||||
times = 1;
|
||||
i++;
|
||||
}
|
||||
+ window_close_server(i);
|
||||
get_connected(i, old_serv);
|
||||
break;
|
||||
}
|
||||
@@ -1162,7 +1163,7 @@
|
||||
return;
|
||||
}
|
||||
close_server(i, "closing server");
|
||||
- window_check_servers();
|
||||
+ window_close_server(i);
|
||||
}
|
||||
else
|
||||
get_connected(from_server - 1, from_server);
|
||||
@@ -2100,6 +2101,7 @@
|
||||
clear_channel_list(i);
|
||||
close_server(i, message);
|
||||
server_list[i].eof = 1;
|
||||
+ window_close_server(i);
|
||||
}
|
||||
done:
|
||||
window_check_servers();
|
||||
diff -uNr sent-upstream/as-sent-last/source/vars.c ircii-pana-1.0-0c15/source/vars.c
|
||||
--- sent-upstream/as-sent-last/source/vars.c Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/source/vars.c Sun Jan 9 06:52:18 2000
|
||||
@@ -95,6 +95,8 @@
|
||||
static void set_nat_address (Window *, char *, int);
|
||||
extern void debug_window (Window *, char *, int);
|
||||
|
||||
+extern void set_detach_on_hup (Window *, char *, int);
|
||||
+
|
||||
/*
|
||||
* irc_variable: all the irc variables used. Note that the integer and
|
||||
* boolean defaults are set here, which the string default value are set in
|
||||
@@ -199,6 +201,7 @@
|
||||
{ "DEOPFLOOD_TIME",0, INT_TYPE_VAR, DEFAULT_DEOPFLOOD_TIME, NULL, NULL, 0, VIF_BITCHX },
|
||||
{ "DEOP_ON_DEOPFLOOD",0, INT_TYPE_VAR, DEFAULT_DEOP_ON_DEOPFLOOD, NULL, NULL, 0, VIF_BITCHX },
|
||||
{ "DEOP_ON_KICKFLOOD",0, INT_TYPE_VAR, DEFAULT_DEOP_ON_KICKFLOOD, NULL, NULL, 0, VIF_BITCHX },
|
||||
+ { "DETACH_ON_HUP",0, BOOL_TYPE_VAR, DEFAULT_DETACH_ON_HUP, NULL, set_detach_on_hup, 0, 0 },
|
||||
{ "DISPATCH_UNKNOWN_COMMANDS",0,BOOL_TYPE_VAR, DEFAULT_DISPATCH_UNKNOWN_COMMANDS, NULL, NULL, 0, 0 },
|
||||
{ "DISPLAY",0, BOOL_TYPE_VAR, DEFAULT_DISPLAY, NULL, NULL, 0, 0 },
|
||||
{ "DISPLAY_ANSI",0, BOOL_TYPE_VAR, DEFAULT_DISPLAY_ANSI, NULL, toggle_reverse_status, 0, 0 },
|
||||
diff -uNr sent-upstream/as-sent-last/source/window.c ircii-pana-1.0-0c15/source/window.c
|
||||
--- sent-upstream/as-sent-last/source/window.c Tue Jan 4 02:27:26 2000
|
||||
+++ ircii-pana-1.0-0c15/source/window.c Sun Jan 9 06:18:15 2000
|
||||
@@ -1784,7 +1784,7 @@
|
||||
if ((window = get_window_by_refnum(refnum)) == NULL)
|
||||
window = current_window;
|
||||
old = window->server;
|
||||
- if (misc)
|
||||
+ if (misc || old == WINDOW_SERVER_CLOSED)
|
||||
{
|
||||
while ((traverse_all_windows(&tmp)))
|
||||
{
|
||||
@@ -1850,6 +1850,30 @@
|
||||
}
|
||||
update_all_status(current_window, NULL, 0);
|
||||
cursor_to_input();
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * window_close_server: this is like window_check_servers but it gets called
|
||||
+ * with old_server as the refnum of a server that just got closed. It marks
|
||||
+ * every window that used to be connected to old_server as WINDOW_SERVER_CLOSED
|
||||
+ * and sets last_server for those windows. It doesn't touch windows that
|
||||
+ * already had no server.
|
||||
+ */
|
||||
+
|
||||
+void window_close_server(int old_server)
|
||||
+{
|
||||
+ Window *tmp;
|
||||
+ int cnt, max, i, not_connected, prime = -1;
|
||||
+
|
||||
+ tmp = NULL;
|
||||
+ while ((traverse_all_windows(&tmp)))
|
||||
+ {
|
||||
+ if (tmp->server == old_server)
|
||||
+ {
|
||||
+ tmp->server = WINDOW_SERVER_CLOSED;
|
||||
+ tmp->last_server = old_server;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
/*
|
||||
Reference in New Issue
Block a user