Far-reaching changes to make BitchX compatible with 64 bit architectures
like x86-64, where sizeof(int) != sizeof (void *). This involves correctly casting every function pointer from the global table to the correct function type, which has the added benefit of allowing type-checking of function arguments and return values. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@26 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -743,7 +743,7 @@ void destroy_arglist (ArgList *arglist)
|
||||
new_free(&arglist->vars[i]);
|
||||
new_free(&arglist->defaults[i]);
|
||||
}
|
||||
new_free((char **)&arglist);
|
||||
new_free(&arglist);
|
||||
}
|
||||
|
||||
void prepare_alias_call (void *al, char **stuff)
|
||||
@@ -1707,7 +1707,7 @@ char ** glob_cmd_alias (char *name, int *howmany)
|
||||
|
||||
len = strlen(name);
|
||||
*howmany = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
|
||||
for (cnt = 0; cnt < cmd_alias.max; cnt++)
|
||||
{
|
||||
@@ -1749,7 +1749,7 @@ char ** glob_assign_alias (char *name, int *howmany)
|
||||
|
||||
len = strlen(name);
|
||||
*howmany = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
|
||||
for (cnt = 0; cnt < var_alias.max; cnt++)
|
||||
{
|
||||
@@ -1790,7 +1790,7 @@ char ** pmatch_cmd_alias (char *name, int *howmany)
|
||||
|
||||
len = strlen(name);
|
||||
*howmany = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
|
||||
for (cnt = 0; cnt < cmd_alias.max; cnt++)
|
||||
{
|
||||
@@ -1826,7 +1826,7 @@ char ** pmatch_assign_alias (char *name, int *howmany)
|
||||
|
||||
len = strlen(name);
|
||||
*howmany = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
|
||||
for (cnt = 0; cnt < var_alias.max; cnt++)
|
||||
{
|
||||
@@ -1873,7 +1873,7 @@ char ** get_subarray_elements (char *root, int *howmany, int type)
|
||||
|
||||
len = strlen(root);
|
||||
*howmany = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
for (cnt = 0; cnt < as->max; cnt++)
|
||||
{
|
||||
len2 = strlen(as->list[cnt]->name);
|
||||
|
||||
@@ -280,21 +280,21 @@ extern void move_index (an_array *array, long oldindex, long newindex)
|
||||
*/
|
||||
extern long find_index (an_array *array, long item)
|
||||
{
|
||||
long search = 0;
|
||||
long i = 0;
|
||||
|
||||
if (array->size >= ARRAY_THRESHOLD)
|
||||
{
|
||||
search = find_item(*array, array->item[item]);
|
||||
while (search >= 0 && !strcmp(array->item[array->index[search]], array->item[item]))
|
||||
search--;
|
||||
search++;
|
||||
i = find_item(*array, array->item[item]);
|
||||
while (i >= 0 && !strcmp(array->item[array->index[i]], array->item[item]))
|
||||
i--;
|
||||
i++;
|
||||
}
|
||||
while(array->index[search] != item && search < array->size)
|
||||
search++;
|
||||
while(array->index[i] != item && i < array->size)
|
||||
i++;
|
||||
|
||||
if (search == array->size)
|
||||
if (i == array->size)
|
||||
say("ERROR in find_index()");
|
||||
return search;
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -350,7 +350,7 @@ extern void delete_array (char *name)
|
||||
}
|
||||
array_info.item = (char**)RESIZE(array_info.item, char *, array_info.size);
|
||||
array_info.index = (long *)RESIZE(array_info.index, long, array_info.size);
|
||||
array_array = (an_array *)RESIZE(array_array, an_array, array_info.size);
|
||||
RESIZE(array_array, an_array, array_info.size);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -680,7 +680,7 @@ BUILT_IN_FUNCTION(function_setitem)
|
||||
if (item == 0)
|
||||
{
|
||||
if (array_info.size)
|
||||
array_array = (an_array*)RESIZE(array_array, an_array, (array_info.size + 1));
|
||||
RESIZE(array_array, an_array, (array_info.size + 1));
|
||||
else
|
||||
array_array = (an_array*)new_malloc(sizeof(an_array));
|
||||
array = &array_array[array_info.size];
|
||||
|
||||
@@ -776,7 +776,7 @@ DCC_int *n;
|
||||
ch = lookup_channel(chan, from_server, 0);
|
||||
else
|
||||
ch = lookup_channel(get_current_channel_by_refnum(0), from_server, 0);
|
||||
if (!nick || !ch || !ch->chop) { dcc_printf(idx, "No Nick specified or not on that channel or not chop\n"); return TCL_ERROR; }
|
||||
if (!nick || !ch || !ch->have_op) { dcc_printf(idx, "No Nick specified, not on that channel or not channel op\n"); return TCL_ERROR; }
|
||||
while ((n1 = next_in_comma_list(nick, &nick)))
|
||||
{
|
||||
if (!n1 || !*n1) break;
|
||||
|
||||
@@ -1128,7 +1128,7 @@ BUILT_IN_COMMAND(my_clear)
|
||||
if (scrollback)
|
||||
clear_scrollback(get_window_by_refnum(0));
|
||||
if (unhold)
|
||||
hold_mode(NULL, OFF, 1);
|
||||
set_hold_mode(NULL, OFF, 1);
|
||||
clear_window_by_refnum(0);
|
||||
}
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
@@ -3393,7 +3393,7 @@ extern int MODE_TOPIC;
|
||||
my_send_to_server(server, "TOPIC %s :", chan->channel);
|
||||
return;
|
||||
}
|
||||
if (arg && (!(chan->mode & MODE_TOPIC) || chan->chop))
|
||||
if (arg && (!(chan->mode & MODE_TOPIC) || chan->have_op))
|
||||
{
|
||||
if (is_channel(arg))
|
||||
{
|
||||
@@ -3429,7 +3429,7 @@ BUILT_IN_COMMAND(do_mtopic)
|
||||
int count = 0;
|
||||
for (chan = get_server_channels(from_server); chan; chan = chan->next)
|
||||
{
|
||||
if (!chan->chop)
|
||||
if (!chan->have_op)
|
||||
continue;
|
||||
send_to_server("TOPIC %s :%s", chan->channel, args ? args : empty_string);
|
||||
count++;
|
||||
@@ -5020,7 +5020,7 @@ BUILT_IN_COMMAND(sendlinecmd)
|
||||
void irc_clear_screen(char key, char *ptr)
|
||||
{
|
||||
|
||||
hold_mode(NULL, OFF, 1);
|
||||
set_hold_mode(NULL, OFF, 1);
|
||||
my_clear(NULL, empty_string, empty_string, NULL);
|
||||
}
|
||||
|
||||
@@ -5117,7 +5117,7 @@ BUILT_IN_COMMAND(me)
|
||||
}
|
||||
else if (!my_stricmp(command, "qme"))
|
||||
{
|
||||
target = (char *)query_nick();
|
||||
target = current_window->query_nick;
|
||||
if (!target)
|
||||
{
|
||||
Window *tmp = NULL;
|
||||
|
||||
@@ -406,7 +406,7 @@ char buffer[BIG_BUFFER_SIZE+1];
|
||||
}
|
||||
modelock++;
|
||||
}
|
||||
if (chan && chan->chop && buffer)
|
||||
if (chan && chan->have_op && buffer)
|
||||
send_to_server("MODE %s %s", chan->channel, buffer);
|
||||
new_free(&save);
|
||||
new_free(&save1);
|
||||
|
||||
@@ -1267,7 +1267,7 @@ void set_channel_limit(ChannelList *channel, int currentlimit, int add, int numu
|
||||
|
||||
void check_channel_limit(ChannelList *chan)
|
||||
{
|
||||
if (chan && chan->csets && chan->csets->set_auto_limit && chan->chop)
|
||||
if (chan && chan->csets && chan->csets->set_auto_limit && chan->have_op)
|
||||
{
|
||||
int count = 0;
|
||||
NickList *nick;
|
||||
|
||||
@@ -598,7 +598,7 @@ int server;
|
||||
return NULL;
|
||||
}
|
||||
sprintf(ban, "%s!%s", from, FromUserHost);
|
||||
if (chan && chan->chop)
|
||||
if (chan && chan->have_op)
|
||||
{
|
||||
if ((b = ban_is_on_channel(ban, chan)))
|
||||
{
|
||||
|
||||
68
source/dcc.c
68
source/dcc.c
@@ -198,28 +198,28 @@ typedef struct
|
||||
DCC_dllcommands *dcc_dllcommands = NULL;
|
||||
|
||||
|
||||
DCC_COMMAND(dcc_chat);
|
||||
DCC_COMMAND(BX_dcc_filesend);
|
||||
DCC_COMMAND(BX_dcc_resend);
|
||||
DCC_COMMAND(dcc_getfile);
|
||||
DCC_COMMAND(dcc_regetfile);
|
||||
DCC_COMMAND(dcc_glist);
|
||||
DCC_COMMAND(dcc_resume);
|
||||
DCC_COMMAND(dcc_rename);
|
||||
void dcc_chat(char *command, char *args);
|
||||
void BX_dcc_filesend(char *command, char *args);
|
||||
void BX_dcc_resend(char *command, char *args);
|
||||
void dcc_getfile(char *command, char *args);
|
||||
void dcc_regetfile(char *command, char *args);
|
||||
void dcc_glist(char *command, char *args);
|
||||
void dcc_resume(char *command, char *args);
|
||||
void dcc_rename(char *command, char *args);
|
||||
|
||||
DCC_COMMAND(dcc_show_active);
|
||||
DCC_COMMAND(dcc_set_quiet);
|
||||
DCC_COMMAND(dcc_set_paths);
|
||||
DCC_COMMAND(dcc_tog_rename);
|
||||
DCC_COMMAND(dcc_tog_resume);
|
||||
DCC_COMMAND(dcc_overwrite_toggle);
|
||||
DCC_COMMAND(dcc_tog_auto);
|
||||
DCC_COMMAND(dcc_stats);
|
||||
DCC_COMMAND(dcc_close);
|
||||
DCC_COMMAND(dcc_closeall);
|
||||
DCC_COMMAND(dcc_help1);
|
||||
DCC_COMMAND(dcc_exempt);
|
||||
DCC_COMMAND(dcc_ftpopen);
|
||||
void dcc_show_active(char *command, char *args);
|
||||
void dcc_set_quiet(char *command, char *args);
|
||||
void dcc_set_paths(char *command, char *args);
|
||||
void dcc_tog_rename(char *command, char *args);
|
||||
void dcc_tog_resume(char *command, char *args);
|
||||
void dcc_overwrite_toggle(char *command, char *args);
|
||||
void dcc_tog_auto(char *command, char *args);
|
||||
void dcc_stats(char *command, char *args);
|
||||
void dcc_close(char *command, char *args);
|
||||
void dcc_closeall(char *command, char *args);
|
||||
void dcc_help1(char *command, char *args);
|
||||
void dcc_exempt(char *command, char *args);
|
||||
void dcc_ftpopen(char *command, char *args);
|
||||
|
||||
DCC_commands dcc_commands[] =
|
||||
{
|
||||
@@ -1516,7 +1516,7 @@ char *user = NULL;
|
||||
return user;
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_chat)
|
||||
void dcc_chat(char *command, char *args)
|
||||
{
|
||||
char *user;
|
||||
char *nick;
|
||||
@@ -2005,7 +2005,7 @@ void real_file_send(char *nick, char *filename, char *passwd, char *port, int td
|
||||
new->blocksize = blocksize;
|
||||
}
|
||||
|
||||
DCC_COMMAND(BX_dcc_filesend)
|
||||
void BX_dcc_filesend(char *command, char *args)
|
||||
{
|
||||
char *user;
|
||||
char *nick;
|
||||
@@ -2044,7 +2044,7 @@ DCC_COMMAND(BX_dcc_filesend)
|
||||
doing_multi = 0;
|
||||
}
|
||||
|
||||
DCC_COMMAND(BX_dcc_resend)
|
||||
void BX_dcc_resend(char *command, char *args)
|
||||
{
|
||||
char *user;
|
||||
char *nick;
|
||||
@@ -2205,7 +2205,7 @@ char *nick;
|
||||
}
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_getfile)
|
||||
void dcc_getfile(char *command, char *args)
|
||||
{
|
||||
char *user;
|
||||
|
||||
@@ -2284,7 +2284,7 @@ char *nick;
|
||||
}
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_regetfile)
|
||||
void dcc_regetfile(char *command, char *args)
|
||||
{
|
||||
char *user;
|
||||
char *passwd = NULL;
|
||||
@@ -2354,7 +2354,7 @@ static char *_dcc_offer[12] = {"%K
|
||||
}
|
||||
|
||||
|
||||
DCC_COMMAND(dcc_glist)
|
||||
void dcc_glist(char *command, char *args)
|
||||
{
|
||||
char *dformat =
|
||||
"#$[3]0 $[6]1%Y$2%n $[11]3 $[25]4 $[7]5 $6-";
|
||||
@@ -2985,7 +2985,7 @@ BUILT_IN_COMMAND(chat)
|
||||
}
|
||||
|
||||
|
||||
DCC_COMMAND(dcc_exempt)
|
||||
void dcc_exempt(char *command, char *args)
|
||||
{
|
||||
int remove;
|
||||
List *nptr = NULL;
|
||||
@@ -3314,7 +3314,7 @@ unsigned long flags;
|
||||
return;
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_close)
|
||||
void dcc_close(char *command, char *args)
|
||||
{
|
||||
char *type;
|
||||
char *file;
|
||||
@@ -3413,7 +3413,7 @@ int num = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_closeall)
|
||||
void dcc_closeall(char *command, char *args)
|
||||
{
|
||||
close_all_dcc();
|
||||
}
|
||||
@@ -3499,7 +3499,7 @@ struct stat sb;
|
||||
new_free(&tmp);
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_resume)
|
||||
void dcc_resume(char *command, char *args)
|
||||
{
|
||||
char *user, *nick;
|
||||
char *filename = NULL;
|
||||
@@ -3596,7 +3596,7 @@ int blocksize = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
DCC_COMMAND(dcc_help1)
|
||||
void dcc_help1(char *command, char *args)
|
||||
{
|
||||
char *comm;
|
||||
int i, c;
|
||||
@@ -4061,7 +4061,7 @@ FILE *f;
|
||||
return dir ? m_strdup(dir) : NULL;
|
||||
}
|
||||
|
||||
DCC_COMMAND(dcc_ftpopen)
|
||||
void dcc_ftpopen(char *command, char *args)
|
||||
{
|
||||
char u[] = "anonymous";
|
||||
char p[] = "- bxuser@";
|
||||
@@ -4155,7 +4155,7 @@ SocketList *s;
|
||||
}
|
||||
|
||||
|
||||
DCC_COMMAND(dcc_rename)
|
||||
void dcc_rename(char *command, char *args)
|
||||
{
|
||||
DCC_List *tmp;
|
||||
DCC_int *n;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE /* Needed for strsignal from string.h on GLIBC systems */
|
||||
|
||||
#include "irc.h"
|
||||
static char cvsrevision[] = "$Id$";
|
||||
CVS_REVISION(exec_c)
|
||||
@@ -86,7 +88,7 @@ extern char *next_expr (char **, char);
|
||||
|
||||
/*
|
||||
* A nice array of the possible signals. Used by the coredump trapping
|
||||
* routines and in the exec.c package
|
||||
* routines and in the exec.c package.
|
||||
*/
|
||||
#if !defined(SYS_SIGLIST_DECLARED) && !defined(_SYS_SIGLIST_DECLARED) && !defined(__QNX__)
|
||||
#if defined(WINNT) || defined(__EMX__)
|
||||
@@ -96,7 +98,7 @@ char *sys_siglist[] = { "ZERO", "SIGINT", "SIGKILL", "SIGPIPE", "SIGFPE",
|
||||
"SIGBUS", "SIGLOST", "SIGSTOP", "SIGABRT", "SIGUSR1",
|
||||
"SIGUSR2", "SIGCHLD", "SIGTTOU", "SIGTTIN", "SIGCONT" };
|
||||
#elif defined(__GLIBC__)
|
||||
#define _GNU_SOURCE
|
||||
#define USING_STRSIGNAL
|
||||
/* use strsignal() from <string.h> */
|
||||
#include <string.h>
|
||||
#else
|
||||
@@ -432,7 +434,7 @@ BUILT_IN_COMMAND(execcmd)
|
||||
*/
|
||||
for (sig = 1; sig < NSIG-1; sig++)
|
||||
{
|
||||
#if defined(_GNU_SOURCE)
|
||||
#if defined(USING_STRSIGNAL)
|
||||
if (strsignal(sig) && !my_strnicmp(strsignal(sig), flag, len))
|
||||
#else
|
||||
if (sys_siglist[sig] && !my_strnicmp(sys_siglist[sig], flag, len))
|
||||
@@ -1162,7 +1164,7 @@ static void cleanup_dead_processes (void)
|
||||
if (dead->termsig > 0 && dead->termsig < NSIG)
|
||||
say("Process %d (%s) terminated with signal %s (%d)",
|
||||
dead->index, dead->name,
|
||||
#if defined(_GNU_SOURCE)
|
||||
#if defined(USING_STRSIGNAL)
|
||||
strsignal(dead->termsig),
|
||||
#else
|
||||
sys_siglist[dead->termsig],
|
||||
@@ -1260,7 +1262,7 @@ void kill_process (int kill_index, int sig)
|
||||
}
|
||||
|
||||
say("Sending signal %s (%d) to process %d: %s",
|
||||
#if defined(_GNU_SOURCE)
|
||||
#if defined(USING_STRSIGNAL)
|
||||
strsignal(sig),
|
||||
#else
|
||||
sys_siglist[sig],
|
||||
|
||||
@@ -1518,9 +1518,7 @@ char *BX_alias_special_char(char **buffer, char *ptr, const char *args, char *qu
|
||||
pad_char = 0;
|
||||
register unsigned char c;
|
||||
|
||||
int upper,
|
||||
lower,
|
||||
length;
|
||||
int length;
|
||||
|
||||
length = 0;
|
||||
if ((c = *ptr) == LEFT_BRACKET)
|
||||
@@ -1723,6 +1721,8 @@ register unsigned char c;
|
||||
*/
|
||||
if (isdigit(c) || (c == '-') || c == '~')
|
||||
{
|
||||
int first, last;
|
||||
|
||||
*args_flag = 1;
|
||||
|
||||
/*
|
||||
@@ -1731,7 +1731,7 @@ register unsigned char c;
|
||||
*/
|
||||
if (c == '~')
|
||||
{
|
||||
lower = upper = EOS;
|
||||
first = last = EOS;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
@@ -1748,10 +1748,10 @@ register unsigned char c;
|
||||
*/
|
||||
else if (c == '-')
|
||||
{
|
||||
lower = SOS;
|
||||
first = SOS;
|
||||
ptr++;
|
||||
upper = parse_number(&ptr);
|
||||
if (upper == -1)
|
||||
last = parse_number(&ptr);
|
||||
if (last == -1)
|
||||
return empty_string; /* error */
|
||||
}
|
||||
|
||||
@@ -1761,16 +1761,16 @@ register unsigned char c;
|
||||
*/
|
||||
else
|
||||
{
|
||||
lower = parse_number(&ptr);
|
||||
first = parse_number(&ptr);
|
||||
if (*ptr == '-')
|
||||
{
|
||||
ptr++;
|
||||
upper = parse_number(&ptr);
|
||||
if (upper == -1)
|
||||
upper = EOS;
|
||||
last = parse_number(&ptr);
|
||||
if (last == -1)
|
||||
last = EOS;
|
||||
}
|
||||
else
|
||||
upper = lower;
|
||||
last = first;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1785,7 +1785,7 @@ register unsigned char c;
|
||||
if (!args)
|
||||
tmp2 = m_strdup(empty_string);
|
||||
else
|
||||
tmp2 = extract2(args, lower, upper);
|
||||
tmp2 = extract2(args, first, last);
|
||||
|
||||
TruncateAndQuote(buffer, tmp2, length, quote_em, pad_char);
|
||||
new_free(&tmp2);
|
||||
|
||||
@@ -460,7 +460,7 @@ ChannelList *chan = NULL;
|
||||
for (chan = get_server_channels(from_server); chan; chan = chan->next)
|
||||
if ((Nick = find_nicklist_in_channellist(nick, chan, 0)))
|
||||
break;
|
||||
if (chan && chan->chop && get_cset_int_var(chan->csets, CTCP_FLOOD_BAN_CSET) && Nick)
|
||||
if (chan && chan->have_op && get_cset_int_var(chan->csets, CTCP_FLOOD_BAN_CSET) && Nick)
|
||||
{
|
||||
if (!Nick->userlist || (Nick->userlist && !(Nick->userlist->flags & ADD_FLOOD)))
|
||||
{
|
||||
@@ -509,7 +509,7 @@ int kick_on_flood = 1;
|
||||
kick_on_flood = get_cset_int_var(chan->csets, PUBFLOOD_CSET);
|
||||
if (kick_on_flood && (Nick = find_nicklist_in_channellist(nick, chan, 0)))
|
||||
{
|
||||
if (chan->chop && (!Nick->userlist || (Nick->userlist && !(Nick->userlist->flags & ADD_FLOOD))))
|
||||
if (chan->have_op && (!Nick->userlist || (Nick->userlist && !(Nick->userlist->flags & ADD_FLOOD))))
|
||||
if (!nick_isop(Nick) || get_cset_int_var(chan->csets, KICK_OPS_CSET))
|
||||
send_to_server("KICK %s %s :\002%s\002 flooder", chan->channel, nick, type);
|
||||
}
|
||||
@@ -524,7 +524,7 @@ int kick_on_flood = 1;
|
||||
{
|
||||
for (chan = get_server_channels(from_server); chan; chan = chan->next)
|
||||
{
|
||||
if (chan->chop && (Nick = find_nicklist_in_channellist(nick, chan, 0)))
|
||||
if (chan->have_op && (Nick = find_nicklist_in_channellist(nick, chan, 0)))
|
||||
{
|
||||
if ((!Nick->userlist || (Nick->userlist && !(Nick->userlist->flags & ADD_FLOOD))))
|
||||
if (!nick_isop(Nick) || get_cset_int_var(chan->csets, KICK_OPS_CSET))
|
||||
|
||||
@@ -1021,13 +1021,15 @@ IrcVariable *return_fset_var(int nummer)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This is a horrible hack so that the standard List functions can be used
|
||||
* for the numeric list.
|
||||
*/
|
||||
int compare_number(List *item1, List *item2)
|
||||
{
|
||||
if ((int)item1->name == (int)(item2->name))
|
||||
return 0;
|
||||
else if ((int)item1->name > (int)(item2->name))
|
||||
return 1;
|
||||
return -1;
|
||||
FsetNumber *real1 = (FsetNumber *)item1;
|
||||
FsetNumber *real2 = (FsetNumber *)item2;
|
||||
|
||||
return real1->numeric - real2->numeric;
|
||||
}
|
||||
|
||||
char *find_numeric_fset(int numeric)
|
||||
|
||||
@@ -954,7 +954,7 @@ BuiltInDllFunctions *dll = NULL;
|
||||
|
||||
len = strlen(name);
|
||||
*cnt = 0;
|
||||
matches = RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
while (built_in_functions[i].func && i <= NUMBER_OF_FUNCTIONS)
|
||||
{
|
||||
if (strncmp(name, built_in_functions[i].name, len) == 0)
|
||||
@@ -965,7 +965,7 @@ BuiltInDllFunctions *dll = NULL;
|
||||
if (++(*cnt) == matches_size)
|
||||
{
|
||||
matches_size += 5;
|
||||
matches = (char **) RESIZE(matches, char *, matches_size);
|
||||
RESIZE(matches, char *, matches_size);
|
||||
}
|
||||
}
|
||||
else if (*cnt)
|
||||
@@ -1173,7 +1173,7 @@ static char *alias_serverport (void)
|
||||
static char *alias_query_nick (void)
|
||||
{
|
||||
char *tmp;
|
||||
return m_strdup((tmp = (char *)query_nick()) ? tmp : empty_string);
|
||||
return m_strdup((tmp = current_window->query_nick) ? tmp : empty_string);
|
||||
}
|
||||
|
||||
static char *alias_target (void)
|
||||
@@ -1950,7 +1950,7 @@ BUILT_IN_FUNCTION(function_before, word)
|
||||
if (numint < 0 && strlen(word))
|
||||
pointer = word + strlen(word) - 1;
|
||||
|
||||
pointer = search(word, &pointer, chars, numint);
|
||||
pointer = strsearch(word, pointer, chars, numint);
|
||||
|
||||
if (!pointer)
|
||||
RETURN_EMPTY;
|
||||
@@ -1985,7 +1985,7 @@ BUILT_IN_FUNCTION(function_after, word)
|
||||
if (numint < 0 && strlen(word))
|
||||
pointer = word + strlen(word) - 1;
|
||||
|
||||
pointer = search(word, &pointer, chars, numint);
|
||||
pointer = strsearch(word, pointer, chars, numint);
|
||||
|
||||
if (!pointer || !*pointer)
|
||||
RETURN_EMPTY;
|
||||
|
||||
@@ -1189,7 +1189,7 @@ BUILT_IN_KEYBINDING(send_line)
|
||||
if (!(cmdchar = get_string_var(CMDCHARS_VAR)))
|
||||
cmdchar = "/";
|
||||
malloc_strcpy(&tmp, line);
|
||||
if (line && (*line != *cmdchar) && get_int_var(NICK_COMPLETION_VAR) && !query_nick())
|
||||
if (line && (*line != *cmdchar) && get_int_var(NICK_COMPLETION_VAR) && !current_window->query_nick)
|
||||
{
|
||||
char auto_comp_char;
|
||||
char *p;
|
||||
@@ -1319,7 +1319,7 @@ BUILT_IN_KEYBINDING(type_text)
|
||||
*/
|
||||
BUILT_IN_KEYBINDING(clear_screen)
|
||||
{
|
||||
hold_mode(NULL, OFF, 1);
|
||||
set_hold_mode(NULL, OFF, 1);
|
||||
clear_window_by_refnum(0);
|
||||
}
|
||||
|
||||
@@ -1721,7 +1721,7 @@ BUILT_IN_KEYBINDING(cpu_saver_on)
|
||||
|
||||
BUILT_IN_KEYBINDING(input_unclear_screen)
|
||||
{
|
||||
hold_mode(NULL, OFF, 1);
|
||||
set_hold_mode(NULL, OFF, 1);
|
||||
unclear_window_by_refnum(0);
|
||||
}
|
||||
|
||||
@@ -2702,7 +2702,7 @@ do_more_tab:
|
||||
{
|
||||
char **completes = NULL;
|
||||
int c = 0, matches = count;
|
||||
completes = RESIZE(completes, char *, count+1);
|
||||
RESIZE(completes, char *, count+1);
|
||||
if (wcount > 1)
|
||||
{
|
||||
if (!got_space)
|
||||
|
||||
@@ -93,13 +93,13 @@ void * n_malloc (size_t size, const char *module, const char *file, const int li
|
||||
/*
|
||||
* new_free: Why do this? Why not? Saves me a bit of trouble here and there
|
||||
*/
|
||||
void * n_free(void **ptr, const char *module, const char *file, const int line)
|
||||
void * n_free(void *ptr, const char *module, const char *file, const int line)
|
||||
{
|
||||
if (*ptr)
|
||||
if (ptr)
|
||||
{
|
||||
#ifdef FREE_DEBUG
|
||||
/* Check to make sure its not been freed before */
|
||||
if (alloc_size(*ptr) == FREED_VAL)
|
||||
if (alloc_size(ptr) == FREED_VAL)
|
||||
{
|
||||
yell("free()ing a already free'd pointer, giving up!");
|
||||
putlog(LOG_ALL, "*", "*** failed free %s %s (%d)", module?module:empty_string, file, line);
|
||||
@@ -107,42 +107,41 @@ void * n_free(void **ptr, const char *module, const char *file, const int line)
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
alloc_size(*ptr) = FREED_VAL;
|
||||
alloc_size(ptr) = FREED_VAL;
|
||||
|
||||
#ifdef MEM_DEBUG
|
||||
_free_leap(file, line, (void *)alloc_start(*ptr));
|
||||
_free_leap(file, line, (void *)alloc_start(ptr));
|
||||
#else
|
||||
free((void *)alloc_start(*ptr));
|
||||
free((void *)alloc_start(ptr));
|
||||
#endif
|
||||
*ptr = NULL;
|
||||
ptr = NULL;
|
||||
}
|
||||
return (*ptr);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void * n_realloc (void **ptr, size_t size, const char *module, const char *file, const int line)
|
||||
void * n_realloc (void *ptr, size_t size, const char *module, const char *file, const int line)
|
||||
{
|
||||
char *ptr2 = NULL;
|
||||
|
||||
if (*ptr)
|
||||
if (ptr)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
size_t msize = alloc_size(*ptr);
|
||||
size_t msize = alloc_size(ptr);
|
||||
|
||||
if (msize >= size)
|
||||
return *ptr;
|
||||
return ptr;
|
||||
|
||||
ptr2 = n_malloc(size, module, file, line);
|
||||
memmove(ptr2, *ptr, msize);
|
||||
memmove(ptr2, ptr, msize);
|
||||
n_free(ptr, module, file, line);
|
||||
return ((*ptr = ptr2));
|
||||
return ptr2;
|
||||
}
|
||||
n_free(ptr, module, file, line);
|
||||
return NULL;
|
||||
return n_free(ptr, module, file, line);
|
||||
}
|
||||
else if (size)
|
||||
ptr2 = n_malloc(size, module, file, line);
|
||||
return ((*ptr = ptr2));
|
||||
return ptr2;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -155,14 +154,14 @@ void * n_realloc (void **ptr, size_t size, const char *module, const char *file,
|
||||
char * n_malloc_strcpy (char **ptr, const char *src, const char *module, const char *file, const int line)
|
||||
{
|
||||
if (!src)
|
||||
return n_free((void **)ptr, module, file, line);
|
||||
return *ptr = n_free(*ptr, module, file, line);
|
||||
if (ptr && *ptr)
|
||||
{
|
||||
if (*ptr == src)
|
||||
return *ptr;
|
||||
if (alloc_size(*ptr) > strlen(src))
|
||||
return strcpy(*ptr, src);
|
||||
n_free((void **)ptr, module, file, line);
|
||||
*ptr = n_free(*ptr, module, file, line);
|
||||
}
|
||||
*ptr = n_malloc(strlen(src) + 1, module, file, line);
|
||||
return strcpy(*ptr, src);
|
||||
@@ -179,7 +178,7 @@ char * n_malloc_strcat (char **ptr, const char *src, const char *module, const c
|
||||
if (!src)
|
||||
return *ptr;
|
||||
msize = strlen(*ptr) + strlen(src) + 1;
|
||||
n_realloc((void **)ptr, sizeof(char)*msize, module, file, line);
|
||||
*ptr = n_realloc(*ptr, sizeof(char)*msize, module, file, line);
|
||||
return strcat(*ptr, src);
|
||||
}
|
||||
return (*ptr = n_m_strdup(src, module, file, line));
|
||||
@@ -867,7 +866,7 @@ char * n_m_strcat_ues(char **dest, char *src, int unescape, const char *module,
|
||||
total_length += strlen(src);
|
||||
|
||||
/* RESIZE(*dest, char, total_length + 2);*/
|
||||
n_realloc((void **)dest, sizeof(char) * (total_length + 2), module, file, line);
|
||||
*dest = n_realloc(*dest, sizeof(char) * (total_length + 2), module, file, line);
|
||||
if (z == 0)
|
||||
**dest = 0;
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ int kick_count = 0;
|
||||
UserList *user = NULL;
|
||||
|
||||
|
||||
if (channel && (tmp = lookup_channel(channel, from_server, CHAN_NOUNLINK)) && tmp->chop && tmp->max_idle && tmp->check_idle)
|
||||
if (channel && (tmp = lookup_channel(channel, from_server, CHAN_NOUNLINK)) && tmp->have_op && tmp->max_idle && tmp->check_idle)
|
||||
{
|
||||
NickList *nick;
|
||||
for (nick = next_nicklist(tmp, NULL); nick; nick = next_nicklist(tmp, nick))
|
||||
@@ -738,7 +738,7 @@ int t = 0;
|
||||
}
|
||||
if (!splitter)
|
||||
{
|
||||
if (chan->chop && is_other_flood(chan, nick, JOIN_FLOOD, &t))
|
||||
if (chan->have_op && is_other_flood(chan, nick, JOIN_FLOOD, &t))
|
||||
{
|
||||
if (get_cset_int_var(chan->csets, JOINFLOOD_CSET) && get_cset_int_var(chan->csets, KICK_ON_JOINFLOOD_CSET) && !nick->kickcount++)
|
||||
{
|
||||
@@ -816,7 +816,7 @@ int t = 0;
|
||||
if (nick) nick->stat_dops++;
|
||||
}
|
||||
|
||||
if (chan->chop && is_other_flood(chan, nick, DEOP_FLOOD, &t))
|
||||
if (chan->have_op && is_other_flood(chan, nick, DEOP_FLOOD, &t))
|
||||
{
|
||||
if (get_cset_int_var(chan->csets, DEOP_ON_DEOPFLOOD_CSET) < get_cset_int_var(chan->csets, KICK_ON_DEOPFLOOD_CSET))
|
||||
send_to_server("MODE %s -o %s", chan->channel, nick->nick);
|
||||
@@ -2184,7 +2184,6 @@ static int ar_remrequest(struct reslist *old)
|
||||
{
|
||||
for (; *s; s++)
|
||||
new_free(s);
|
||||
new_free(&rptr->re_he.h_aliases);
|
||||
}
|
||||
if (rptr->re_rinfo.ri_ptr)
|
||||
new_free(&rptr->re_rinfo.ri_ptr);
|
||||
@@ -4794,7 +4793,7 @@ ChannelList *chan = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
if (need_op == NEED_OP && chan && !chan->chop && !chan->hop)
|
||||
if (need_op == NEED_OP && chan && !chan->have_op && !chan->hop)
|
||||
{
|
||||
set_display_target(chan->channel, LOG_CRAP);
|
||||
error_not_opped(chan->channel);
|
||||
|
||||
@@ -202,7 +202,7 @@ static int already_done = 0;
|
||||
global_table[RANDOM_NUMBER] = (Function_ptr) BX_random_number;
|
||||
|
||||
/* words.c reg.c */
|
||||
global_table[SEARCH] = (Function_ptr) BX_search;
|
||||
global_table[STRSEARCH] = (Function_ptr) BX_strsearch;
|
||||
global_table[MOVE_TO_ABS_WORD] = (Function_ptr) BX_move_to_abs_word;
|
||||
global_table[MOVE_WORD_REL] = (Function_ptr) BX_move_word_rel;
|
||||
global_table[EXTRACT] = (Function_ptr) BX_extract;
|
||||
@@ -364,7 +364,6 @@ static int already_done = 0;
|
||||
global_table[TRAVERSE_ALL_WINDOWS] = (Function_ptr) BX_traverse_all_windows;
|
||||
global_table[ADD_TO_INVISIBLE_LIST] = (Function_ptr) BX_add_to_invisible_list;
|
||||
global_table[ADD_TO_WINDOW_LIST] = (Function_ptr) BX_add_to_window_list;
|
||||
global_table[REMOVE_WINDOW_FROM_SCREEN] = (Function_ptr) BX_remove_window_from_screen;
|
||||
global_table[RECALCULATE_WINDOW_POSITIONS]= (Function_ptr) BX_recalculate_window_positions;
|
||||
global_table[MOVE_WINDOW] = (Function_ptr) BX_move_window;
|
||||
global_table[REDRAW_ALL_WINDOWS] = (Function_ptr) BX_redraw_all_windows;
|
||||
@@ -388,9 +387,9 @@ static int already_done = 0;
|
||||
global_table[STATUS_UPDATE] = (Function_ptr) BX_status_update;
|
||||
global_table[SET_PROMPT_BY_REFNUM] = (Function_ptr) BX_set_prompt_by_refnum;
|
||||
global_table[GET_PROMPT_BY_REFNUM] = (Function_ptr) BX_get_prompt_by_refnum;
|
||||
global_table[QUERY_NICK] = (Function_ptr) BX_query_nick;
|
||||
global_table[QUERY_HOST] = (Function_ptr) BX_query_host;
|
||||
global_table[QUERY_CMD] = (Function_ptr) BX_query_cmd;
|
||||
global_table[QUERY_NICK] = (Function_ptr) null_function; /* DEFUNCT */
|
||||
global_table[QUERY_HOST] = (Function_ptr) null_function; /* DEFUNCT */
|
||||
global_table[QUERY_CMD] = (Function_ptr) null_function; /* DEFUNCT */
|
||||
global_table[GET_TARGET_BY_REFNUM] = (Function_ptr) BX_get_target_by_refnum;
|
||||
global_table[GET_TARGET_CMD_BY_REFNUM] = (Function_ptr) BX_get_target_cmd_by_refnum;
|
||||
global_table[GET_WINDOW_TARGET_BY_DESC] = (Function_ptr) BX_get_window_target_by_desc;
|
||||
@@ -425,7 +424,7 @@ static int already_done = 0;
|
||||
global_table[SCROLLBACK_BACKWARDS] = (Function_ptr) BX_scrollback_backwards;
|
||||
global_table[SCROLLBACK_END] = (Function_ptr) BX_scrollback_end;
|
||||
global_table[SCROLLBACK_START] = (Function_ptr) BX_scrollback_start;
|
||||
global_table[HOLD_MODE] = (Function_ptr) BX_hold_mode;
|
||||
global_table[SET_HOLD_MODE] = (Function_ptr) BX_set_hold_mode;
|
||||
global_table[UNHOLD_WINDOWS] = (Function_ptr) BX_unhold_windows;
|
||||
global_table[FUNC_UNSTOP_ALL_WINDOWS] = (Function_ptr) BX_unstop_all_windows;
|
||||
global_table[RESET_LINE_CNT] = (Function_ptr) BX_reset_line_cnt;
|
||||
@@ -504,7 +503,7 @@ static int already_done = 0;
|
||||
global_table[GET_CHANNEL_KEY] = (Function_ptr) BX_get_channel_key;
|
||||
global_table[FUNC_RECREATE_MODE] = (Function_ptr) BX_recreate_mode;
|
||||
#ifdef COMPRESS_MODES
|
||||
global_table[FUNC_COMPRESS_MODES] = (Function_ptr) BX_compress_modes;
|
||||
global_table[FUNC_COMPRESS_MODES] = (Function_ptr) BX_do_compress_modes;
|
||||
#endif
|
||||
global_table[FUNC_GOT_OPS] = (Function_ptr) BX_got_ops;
|
||||
global_table[GET_CHANNEL_BANS] = (Function_ptr) BX_get_channel_bans;
|
||||
@@ -674,7 +673,7 @@ static int already_done = 0;
|
||||
global_table[DLL_CTCP] = (Function_ptr) &dll_ctcp;
|
||||
#endif
|
||||
global_table[WINDOW_DISPLAY] = (Function_ptr) &window_display;
|
||||
global_table[STATUS_UPDATE_FLAG] = (Function_ptr) status_update_flag;
|
||||
global_table[STATUS_UPDATE_FLAG] = (Function_ptr) &status_update_flag;
|
||||
global_table[TABKEY_ARRAY] = (Function_ptr) &tabkey_array;
|
||||
global_table[AUTOREPLY_ARRAY] = (Function_ptr) &autoreply_array;
|
||||
global_table[IDENTD_SOCKET] = (Function_ptr) &identd;
|
||||
|
||||
@@ -260,7 +260,7 @@ ChannelList * BX_add_channel(char *channel, int server, int refnum)
|
||||
get_time(&new->join_time);
|
||||
add_server_channels(server, new);
|
||||
}
|
||||
new->chop = 0;
|
||||
new->have_op = 0;
|
||||
new->voice = 0;
|
||||
new->hop = 0;
|
||||
|
||||
@@ -351,7 +351,7 @@ ChannelList *BX_add_to_channel(char *channel, char *nick, int server, int oper,
|
||||
if (!my_stricmp(nick, get_server_nickname(server)))
|
||||
{
|
||||
check_mode_list_join(channel, server);
|
||||
chan->chop = 1;
|
||||
chan->have_op = 1;
|
||||
}
|
||||
}
|
||||
if (!(new = find_nicklist_in_channellist(nick, chan, 0)))
|
||||
@@ -549,7 +549,7 @@ typedef struct _UserChanModes {
|
||||
*
|
||||
* Written by Jordy (jordy@wserv.com)
|
||||
*/
|
||||
char *BX_compress_modes(ChannelList *chan, int server, char *channel, char *modes) {
|
||||
char *BX_do_compress_modes(ChannelList *chan, int server, char *channel, char *modes) {
|
||||
int add = 0,
|
||||
isbanned = 0,
|
||||
isopped = 0,
|
||||
@@ -821,13 +821,13 @@ NickList *tnl = NULL;
|
||||
|
||||
int BX_got_ops(int add, ChannelList *channel)
|
||||
{
|
||||
int chop = 0;
|
||||
int have_op = 0;
|
||||
register NickList *tmp;
|
||||
int in_join = 0;
|
||||
in_join = in_join_list(channel->channel, from_server);
|
||||
if (add && add != channel->chop && !in_join)
|
||||
if (add && add != channel->have_op && !in_join)
|
||||
{
|
||||
chop = channel->chop = add;
|
||||
have_op = channel->have_op = add;
|
||||
#ifdef WANT_USERLIST
|
||||
for(tmp = next_nicklist(channel, NULL); tmp; tmp = next_nicklist(channel, tmp))
|
||||
check_auto(channel->channel,tmp, channel);
|
||||
@@ -835,19 +835,19 @@ int in_join = 0;
|
||||
if ((get_server_version(from_server) == Server2_8hybrid6))
|
||||
send_to_server("MODE %s e", channel->channel);
|
||||
}
|
||||
else if (!add && add != channel->chop && !in_join)
|
||||
else if (!add && add != channel->have_op && !in_join)
|
||||
{
|
||||
for(tmp = next_nicklist(channel, NULL); tmp; tmp = next_nicklist(channel, tmp))
|
||||
tmp->sent_reop = tmp->sent_deop = tmp->sent_voice = 0;
|
||||
}
|
||||
return chop;
|
||||
return have_op;
|
||||
}
|
||||
|
||||
/*
|
||||
* decifer_mode: This will figure out the mode string as returned by mode
|
||||
* commands and convert that mode string into a one byte bit map of modes
|
||||
*/
|
||||
static int decifer_mode(char *from, char *mode_str, ChannelList **channel, unsigned long *mode, char *chop, char *voice, char **key)
|
||||
static int decifer_mode(char *from, char *mode_str, ChannelList **channel, unsigned long *mode, char *have_op, char *voice, char **key)
|
||||
{
|
||||
|
||||
char *limit = 0;
|
||||
@@ -951,8 +951,8 @@ static int decifer_mode(char *from, char *mode_str, ChannelList **channel, unsig
|
||||
person = get_server_nickname(from_server);
|
||||
if (!my_stricmp(person, get_server_nickname(from_server)))
|
||||
{
|
||||
*chop = (char)got_ops(add, *channel);
|
||||
(*channel)->chop = add;
|
||||
*have_op = (char)got_ops(add, *channel);
|
||||
(*channel)->have_op = add;
|
||||
if (add)
|
||||
do_hook(CHANOP_LIST, "%s", (*channel)->channel);
|
||||
}
|
||||
@@ -973,7 +973,7 @@ static int decifer_mode(char *from, char *mode_str, ChannelList **channel, unsig
|
||||
ThisNick->sent_deop--;
|
||||
}
|
||||
|
||||
if (!its_me && (*channel)->chop)
|
||||
if (!its_me && (*channel)->have_op)
|
||||
{
|
||||
if (add && splitter)
|
||||
check_hack(person, *channel, ThisNick, from);
|
||||
@@ -1052,7 +1052,7 @@ static int decifer_mode(char *from, char *mode_str, ChannelList **channel, unsig
|
||||
malloc_strcpy(&new->setby, from?from:get_server_name(from_server));
|
||||
new->time = now;
|
||||
#ifdef WANT_USERLIST
|
||||
if (!its_me && (*channel)->chop)
|
||||
if (!its_me && (*channel)->have_op)
|
||||
check_prot(from, person, *channel, new, ThisNick);
|
||||
#endif
|
||||
}
|
||||
@@ -1169,7 +1169,7 @@ void update_channel_mode(char *from, char *channel, int server, char *mode, Chan
|
||||
|
||||
if (tmp || (channel && (tmp = lookup_channel(channel, server, CHAN_NOUNLINK))))
|
||||
{
|
||||
if ((limit = decifer_mode(from, mode, &(tmp), &(tmp->mode), &(tmp->chop), &(tmp->voice), &(tmp->key))) != -1)
|
||||
if ((limit = decifer_mode(from, mode, &(tmp), &(tmp->mode), &(tmp->have_op), &(tmp->voice), &(tmp->key))) != -1)
|
||||
tmp->limit = limit;
|
||||
}
|
||||
}
|
||||
@@ -1368,7 +1368,7 @@ void BX_rename_nick(char *old_nick, char *new_nick, int server)
|
||||
if ((tmp = find_nicklist_in_channellist(old_nick, chan, REMOVE_FROM_LIST)))
|
||||
{
|
||||
tmp->stat_nicks++;
|
||||
if (chan->chop && !isme(new_nick))
|
||||
if (chan->have_op && !isme(new_nick))
|
||||
{
|
||||
if (is_other_flood(chan, tmp, NICK_FLOOD, &t))
|
||||
handle_nickflood(old_nick, new_nick, tmp, chan, t);
|
||||
@@ -1684,7 +1684,7 @@ int BX_get_channel_oper(char *channel, int server)
|
||||
|
||||
|
||||
if ((chan = lookup_channel(channel, server, CHAN_NOUNLINK)))
|
||||
return chan->chop;
|
||||
return chan->have_op;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2062,7 +2062,7 @@ ChannelList *chan;
|
||||
{
|
||||
for (chan = get_server_channels(i); chan; chan = chan->next)
|
||||
{
|
||||
if (!chan->chop || !chan->csets || !chan->csets->set_auto_limit)
|
||||
if (!chan->have_op || !chan->csets || !chan->csets->set_auto_limit)
|
||||
continue;
|
||||
if (chan->totalnicks + chan->csets->set_auto_limit != chan->limit)
|
||||
my_send_to_server(i, "MODE %s +l %d", chan->channel, chan->totalnicks + chan->csets->set_auto_limit);
|
||||
|
||||
@@ -378,7 +378,7 @@ UserList *tmp = NULL;
|
||||
{
|
||||
NickList *n = NULL;
|
||||
n = find_nicklist_in_channellist(nick, chan, 0);
|
||||
if (!n && chan->chop && get_cset_int_var(chan->csets, AINV_CSET) && (tmp->flags & ADD_INVITE) && get_cset_int_var(chan->csets, AINV_CSET))
|
||||
if (!n && chan->have_op && get_cset_int_var(chan->csets, AINV_CSET) && (tmp->flags & ADD_INVITE) && get_cset_int_var(chan->csets, AINV_CSET))
|
||||
{
|
||||
bitchsay("Auto-inviting %s to %s", nick, chan->channel);
|
||||
send_to_server("NOTICE %s :Auto-invite from %s", nick, get_server_nickname(from_server));
|
||||
|
||||
@@ -248,8 +248,6 @@ void display_msg(char *from, char **ArgList)
|
||||
char *ptr,
|
||||
*s,
|
||||
*rest;
|
||||
int drem;
|
||||
|
||||
|
||||
rest = PasteArgs(ArgList, 0);
|
||||
if ((s = find_numeric_fset(-current_numeric)))
|
||||
@@ -266,16 +264,14 @@ void display_msg(char *from, char **ArgList)
|
||||
else
|
||||
ptr = NULL;
|
||||
|
||||
drem = (int)(from) /*&& (!get_int_var(SUPPRESS_FROM_REMOTE_SERVER))*/;
|
||||
|
||||
put_it("%s %s%s%s%s%s%s",
|
||||
numeric_banner(),
|
||||
strlen(rest) ? rest : empty_string,
|
||||
strlen(rest) ? space : empty_string,
|
||||
ptr ? ptr : empty_string,
|
||||
drem ? "(from " : empty_string,
|
||||
drem ? from : empty_string,
|
||||
drem ? ")" : empty_string
|
||||
from ? "(from " : empty_string,
|
||||
from ? from : empty_string,
|
||||
from ? ")" : empty_string
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1049,7 +1049,7 @@ static void p_channel(char *from, char **ArgList)
|
||||
else
|
||||
put_it("%s",convert_output_format(fget_string_var(FORMAT_JOIN_FSET), "%s %s %s %s %s",update_clock(GET_TIME),from,FromUserHost?FromUserHost:"UnKnown",channel, extra));
|
||||
|
||||
if (!its_me && chan && chan->chop)
|
||||
if (!its_me && chan && chan->have_op)
|
||||
{
|
||||
char lame_chars[] = "\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a";
|
||||
register char *p;
|
||||
@@ -1367,7 +1367,7 @@ char *n = NULL;
|
||||
time_t right_now;
|
||||
|
||||
|
||||
if (!from || !chan || (chan && (!get_cset_int_var(chan->csets, BITCH_CSET) || !chan->chop)))
|
||||
if (!from || !chan || (chan && (!get_cset_int_var(chan->csets, BITCH_CSET) || !chan->have_op)))
|
||||
return;
|
||||
if (!get_int_var(HACK_OPS_VAR) && wild_match("%.%", from))
|
||||
return;
|
||||
@@ -1442,7 +1442,7 @@ static void p_mode(char *from, char **ArgList)
|
||||
chan = (ChannelList *)find_in_list((List **)&chan2, channel, 0);
|
||||
if (chan && get_cset_int_var(chan->csets, COMPRESS_MODES_CSET))
|
||||
{
|
||||
tmpbuf = compress_modes(chan, from_server, channel, line);
|
||||
tmpbuf = do_compress_modes(chan, from_server, channel, line);
|
||||
if (tmpbuf)
|
||||
strcpy(line, tmpbuf);
|
||||
else
|
||||
@@ -1653,7 +1653,7 @@ static void p_kick(char *from, char **ArgList)
|
||||
if (!itsme)
|
||||
{
|
||||
f_nick = find_nicklist_in_channellist(who, chan, 0);
|
||||
if (chan->chop && tmpnick && is_other_flood(chan, tmpnick, KICK_FLOOD, &t))
|
||||
if (chan->have_op && tmpnick && is_other_flood(chan, tmpnick, KICK_FLOOD, &t))
|
||||
{
|
||||
if (get_cset_int_var(chan->csets, KICK_ON_KICKFLOOD_CSET) > get_cset_int_var(chan->csets, DEOP_ON_KICKFLOOD_CSET))
|
||||
send_to_server("MODE %s -o %s", chan->channel, from);
|
||||
|
||||
@@ -97,7 +97,7 @@ static LookupStruct channel_struct[] = {
|
||||
|
||||
{ "LIMIT", offsetof(ChannelList, limit), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "KEY", offsetof(ChannelList, key), STR_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "CHOP", offsetof(ChannelList, chop), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "CHOP", offsetof(ChannelList, have_op), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "HOP", offsetof(ChannelList, hop), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "VOICE", offsetof(ChannelList, voice), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
{ "BOUND", offsetof(ChannelList, bound), INT_TYPE_VAR, VAR_READ_ONLY },
|
||||
|
||||
@@ -970,7 +970,7 @@ char *p = (char *) arg; /* original args unmodified so we can free them */
|
||||
if ((serv_num = next_arg(args, &args)))
|
||||
this_server = my_atol(serv_num);
|
||||
chan = lookup_channel(channel, this_server, 0);
|
||||
if (chan && is_on_channel(channel, this_server, from) && chan->chop)
|
||||
if (chan && is_on_channel(channel, this_server, from) && chan->have_op)
|
||||
{
|
||||
NickList *nick;
|
||||
for (nick = next_nicklist(chan, NULL); nick; nick = next_nicklist(chan, nick))
|
||||
@@ -1077,7 +1077,7 @@ char *ban;
|
||||
if (!chan_ptr)
|
||||
return NULL;
|
||||
|
||||
if (!chan_ptr->chop)
|
||||
if (!chan_ptr->have_op)
|
||||
return nicklist;
|
||||
userptr = nicklist->userlist;
|
||||
shitptr = nicklist->shitlist;
|
||||
@@ -1254,7 +1254,7 @@ char *nick = NULL, *userhost = NULL, *p;
|
||||
}
|
||||
}
|
||||
|
||||
if (get_cset_int_var(chan->csets, USERLIST_CSET) && chan->chop && ((n && n->userlist) ||
|
||||
if (get_cset_int_var(chan->csets, USERLIST_CSET) && chan->have_op && ((n && n->userlist) ||
|
||||
(tmp && tmp->userlist)))
|
||||
{
|
||||
UserList *user = NULL;
|
||||
@@ -1352,7 +1352,7 @@ char *nick = NULL, *userhost = NULL, *p;
|
||||
void check_shit(ChannelList *chan)
|
||||
{
|
||||
ShitList *Bans;
|
||||
if (!chan || !chan->chop || !shitlist_list || chan->server <= -1 || !get_cset_int_var(chan->csets, SHITLIST_CSET))
|
||||
if (!chan || !chan->have_op || !shitlist_list || chan->server <= -1 || !get_cset_int_var(chan->csets, SHITLIST_CSET))
|
||||
return;
|
||||
if (!check_channel_match(get_string_var(PROTECT_CHANNELS_VAR), chan->channel))
|
||||
return;
|
||||
|
||||
@@ -116,6 +116,7 @@ Window *BX_new_window(Screen *screen)
|
||||
new = (Window *) new_malloc(sizeof(Window));
|
||||
|
||||
new->output_func = default_output_function;
|
||||
new->update_status = NULL;
|
||||
|
||||
tmp = NULL;
|
||||
while ((traverse_all_windows(&tmp)))
|
||||
@@ -1028,8 +1029,8 @@ void BX_update_all_windows()
|
||||
if (full_window || fast_window)
|
||||
repaint_window(tmp, tmp->repaint_start, tmp->repaint_end);
|
||||
|
||||
if (tmp->update_window_status)
|
||||
(tmp->update_window_status)(tmp);
|
||||
if (tmp->update_status)
|
||||
(tmp->update_status)(tmp);
|
||||
else if (r_status)
|
||||
update_window_status(tmp, 1);
|
||||
else if (u_status)
|
||||
@@ -1443,24 +1444,6 @@ char *BX_get_prompt_by_refnum(unsigned int refnum)
|
||||
return (empty_string);
|
||||
}
|
||||
|
||||
|
||||
/* query_nick: Returns the query nick for the current channel */
|
||||
const char * BX_query_nick (void)
|
||||
{
|
||||
return (current_window->query_nick);
|
||||
}
|
||||
|
||||
/* query_nick: Returns the query nick for the current channel */
|
||||
const char * BX_query_host (void)
|
||||
{
|
||||
return (current_window->query_host);
|
||||
}
|
||||
|
||||
const char * BX_query_cmd (void)
|
||||
{
|
||||
return (current_window->query_cmd);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_target_by_refnum: returns the target for the window with the given
|
||||
* refnum (or for the current window). The target is either the query nick
|
||||
@@ -1882,34 +1865,6 @@ void BX_window_check_servers(int unused)
|
||||
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 BX_window_close_server(int old_server)
|
||||
{
|
||||
Window *tmp;
|
||||
|
||||
tmp = NULL;
|
||||
if (old_server < 0)
|
||||
return;
|
||||
while ((traverse_all_windows(&tmp)))
|
||||
{
|
||||
if (tmp->server < 0)
|
||||
continue;
|
||||
if (tmp->server == old_server)
|
||||
{
|
||||
close_server(tmp->server, NULL);
|
||||
tmp->server = WINDOW_SERVER_CLOSED;
|
||||
tmp->last_server = old_server;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Changes any windows that are currently using "old_server" to instead
|
||||
* use "new_server".
|
||||
@@ -2382,7 +2337,7 @@ void BX_clear_all_windows(int unhold, int scrollback)
|
||||
while (traverse_all_windows(&tmp))
|
||||
{
|
||||
if (unhold)
|
||||
hold_mode(tmp, OFF, 1);
|
||||
set_hold_mode(tmp, OFF, 1);
|
||||
if (scrollback)
|
||||
clear_scrollback(tmp);
|
||||
clear_window(tmp);
|
||||
@@ -2434,7 +2389,7 @@ void unclear_all_windows (int unhold, int visible, int hidden)
|
||||
continue;
|
||||
|
||||
if (unhold)
|
||||
hold_mode(tmp, OFF, 1);
|
||||
set_hold_mode(tmp, OFF, 1);
|
||||
unclear_window(tmp);
|
||||
}
|
||||
}
|
||||
@@ -3759,7 +3714,7 @@ Window *window_query (Window *window, char **args, char *usage)
|
||||
}
|
||||
if ((nick = window->query_nick))
|
||||
{
|
||||
say("Ending conversation with %s", query_nick());
|
||||
say("Ending conversation with %s", current_window->query_nick);
|
||||
window->update |= UPDATE_STATUS;
|
||||
while ((ptr = next_in_comma_list(nick, &nick)))
|
||||
{
|
||||
@@ -4692,7 +4647,7 @@ void BX_scrollback_start (char dumb, char *dumber)
|
||||
* this will also update the status line, if needed, to display the hold mode
|
||||
* state. If update is false, only the internal flag is set.
|
||||
*/
|
||||
void BX_hold_mode (Window *window, int flag, int update)
|
||||
void BX_set_hold_mode (Window *window, int flag, int update)
|
||||
{
|
||||
if (window == NULL)
|
||||
window = current_window;
|
||||
@@ -4752,7 +4707,7 @@ void BX_unstop_all_windows (char dumb, char *dumber)
|
||||
Window *tmp = NULL;
|
||||
|
||||
while (traverse_all_windows(&tmp))
|
||||
hold_mode(tmp, OFF, 1);
|
||||
set_hold_mode(tmp, OFF, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4770,7 +4725,7 @@ void BX_reset_line_cnt (Window *win, char *unused, int value)
|
||||
/* toggle_stop_screen: the BIND function TOGGLE_STOP_SCREEN */
|
||||
void BX_toggle_stop_screen (char unused, char *not_used)
|
||||
{
|
||||
hold_mode(NULL, TOGGLE, 1);
|
||||
set_hold_mode(NULL, TOGGLE, 1);
|
||||
update_all_windows();
|
||||
}
|
||||
|
||||
@@ -4818,7 +4773,7 @@ void BX_flush_everything_being_held (Window *window)
|
||||
ircpanic("erf. fix this.");
|
||||
|
||||
window->holding_something = 0;
|
||||
hold_mode(window, OFF, 1);
|
||||
set_hold_mode(window, OFF, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -4908,8 +4863,8 @@ void BX_set_screens_current_window (Screen *screen, Window *window)
|
||||
void BX_make_window_current (Window *window)
|
||||
{
|
||||
Window *old_current_window = current_window;
|
||||
int old_screen, old_window;
|
||||
int new_screen, new_window;
|
||||
int old_screen, old_win;
|
||||
int new_screen, new_win;
|
||||
|
||||
if (!window)
|
||||
current_window = last_input_screen->current_window;
|
||||
@@ -4922,22 +4877,22 @@ void BX_make_window_current (Window *window)
|
||||
return;
|
||||
|
||||
if (!old_current_window)
|
||||
old_screen = old_window = -1;
|
||||
old_screen = old_win = -1;
|
||||
else if (!old_current_window->screen)
|
||||
old_screen = -1, old_window = old_current_window->refnum;
|
||||
old_screen = -1, old_win = old_current_window->refnum;
|
||||
else
|
||||
old_screen = old_current_window->screen->screennum,
|
||||
old_window = old_current_window->refnum;
|
||||
old_win = old_current_window->refnum;
|
||||
|
||||
new_window = current_window->refnum;
|
||||
new_win = current_window->refnum;
|
||||
if (!current_window->screen)
|
||||
new_screen = -1;
|
||||
else
|
||||
new_screen = current_window->screen->screennum;
|
||||
|
||||
do_hook(WINDOW_FOCUS_LIST, "%d %d %d %d",
|
||||
old_screen, old_window,
|
||||
new_screen, new_window);
|
||||
old_screen, old_win,
|
||||
new_screen, new_win);
|
||||
}
|
||||
|
||||
void BX_clear_scrollback(Window *window)
|
||||
@@ -4960,10 +4915,10 @@ void BX_clear_scrollback(Window *window)
|
||||
|
||||
void make_to_window_by_desc (char *desc)
|
||||
{
|
||||
Window *new_window = get_window_by_desc(desc);
|
||||
Window *new_win = get_window_by_desc(desc);
|
||||
|
||||
if (new_window)
|
||||
target_window = new_window;
|
||||
if (new_win)
|
||||
target_window = new_win;
|
||||
else
|
||||
say("Window [%s] doesn't exist any more. Punting.", desc);
|
||||
}
|
||||
@@ -4985,23 +4940,23 @@ int get_winref_by_desc (const char *desc)
|
||||
|
||||
void make_window_current_by_desc (char *desc)
|
||||
{
|
||||
Window *new_window = get_window_by_desc(desc);
|
||||
Window *new_win = get_window_by_desc(desc);
|
||||
|
||||
if (new_window)
|
||||
make_window_current(new_window);
|
||||
if (new_win)
|
||||
make_window_current(new_win);
|
||||
else
|
||||
say("Window [%s] doesn't exist any more. Punting.", desc);
|
||||
}
|
||||
|
||||
void make_window_current_by_winref (int refnum)
|
||||
{
|
||||
Window *new_window;
|
||||
Window *new_win;
|
||||
|
||||
if (refnum == -1)
|
||||
return;
|
||||
|
||||
if ((new_window = get_window_by_refnum(refnum)))
|
||||
make_window_current(new_window);
|
||||
if ((new_win = get_window_by_refnum(refnum)))
|
||||
make_window_current(new_win);
|
||||
else
|
||||
say("Window [%d] doesn't exist any more. Punting.", refnum);
|
||||
}
|
||||
|
||||
@@ -18,25 +18,25 @@ CVS_REVISION(words_c)
|
||||
/*
|
||||
* search() looks for a character forward or backward from mark
|
||||
*/
|
||||
extern char *BX_search(register char *start, char **mark, char *chars, int how)
|
||||
extern char *BX_strsearch(register char *start, char *mark, char *chars, int how)
|
||||
{
|
||||
if (!mark || !*mark)
|
||||
*mark = start;
|
||||
if (!mark)
|
||||
mark = start;
|
||||
|
||||
if (how > 0) /* forward search */
|
||||
{
|
||||
*mark = sindex(*mark, chars);
|
||||
mark = sindex(mark, chars);
|
||||
how--;
|
||||
for (;(how > 0) && *mark && **mark;how--)
|
||||
*mark = sindex(*mark+1, chars);
|
||||
for (; how > 0 && mark && *mark; how--)
|
||||
mark = sindex(mark + 1, chars);
|
||||
}
|
||||
|
||||
else if (how == 0)
|
||||
return (char *) 0;
|
||||
return NULL;
|
||||
|
||||
else /* how < 0 */
|
||||
{
|
||||
*mark = rsindex(*mark, start, chars, -how);
|
||||
mark = rsindex(mark, start, chars, -how);
|
||||
#if 0
|
||||
how++;
|
||||
for (;(how < 0) && *mark && **mark;how++)
|
||||
@@ -44,7 +44,7 @@ extern char *BX_search(register char *start, char **mark, char *chars, int how)
|
||||
#endif
|
||||
}
|
||||
|
||||
return *mark;
|
||||
return mark;
|
||||
}
|
||||
|
||||
/* Move to an absolute word number from start */
|
||||
|
||||
Reference in New Issue
Block a user