mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-17 15:36:50 +00:00
2018 cleanup update
This commit is contained in:
parent
723ac1f91e
commit
e5ad9bb990
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,3 +18,4 @@ mech.pid
|
|||||||
root.zone*
|
root.zone*
|
||||||
trick.conf
|
trick.conf
|
||||||
|
|
||||||
|
conf
|
||||||
|
|||||||
5
VERSIONS
5
VERSIONS
@ -1,3 +1,8 @@
|
|||||||
|
3.0.99p4 -- February, 2018.
|
||||||
|
|
||||||
|
* Fixed: Strlen/Strlen2 code cleanup.
|
||||||
|
* Fixed: Various compiler warnings.
|
||||||
|
|
||||||
3.0.99p3 -- July 24th, 2009.
|
3.0.99p3 -- July 24th, 2009.
|
||||||
|
|
||||||
* Added: Python scripting support (supplied by S.Marquis)
|
* Added: Python scripting support (supplied by S.Marquis)
|
||||||
|
|||||||
@ -68,7 +68,7 @@ char *cipher(char *arg)
|
|||||||
|
|
||||||
if (!arg || !*arg)
|
if (!arg || !*arg)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
B1a = B2a = B3a = B4a = 0;
|
B1a = B2a = B3a = B4a = 0;
|
||||||
B1b = B2b = B3b = B4b = 0;
|
B1b = B2b = B3b = B4b = 0;
|
||||||
ptr = arg;
|
ptr = arg;
|
||||||
@ -447,3 +447,9 @@ listcheck:
|
|||||||
}
|
}
|
||||||
to_user(from,"You are now officially immortal");
|
to_user(from,"You are now officially immortal");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MD5CRYPT
|
||||||
|
void do_md5(COMMAND_ARGS)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* MD5CRYPT */
|
||||||
|
|||||||
@ -295,8 +295,7 @@ Ban *make_ban(Ban **banlist, char *from, char *banmask, time_t when)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
sz = sizeof(Ban) + Strlen2(from,banmask);
|
sz = sizeof(Ban) + Strlen2(from,banmask); // banmask is never NULL
|
||||||
//sz = sizeof(Ban) + strlen(from) + strlen(banmask);
|
|
||||||
|
|
||||||
set_mallocdoer(make_ban);
|
set_mallocdoer(make_ban);
|
||||||
new = (Ban*)Calloc(sz);
|
new = (Ban*)Calloc(sz);
|
||||||
@ -478,7 +477,7 @@ void channel_massmode(Chan *chan, char *pattern, int filtmode, char mode, char t
|
|||||||
|
|
||||||
if (i)
|
if (i)
|
||||||
{
|
{
|
||||||
if ((Strlen2(deopstring,burst)) >= MSGLEN-2)
|
if ((Strlen2(deopstring,burst)) >= MSGLEN-2) // burst is never NULL
|
||||||
{
|
{
|
||||||
write(current->sock,burst,strlen(burst));
|
write(current->sock,burst,strlen(burst));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
@ -168,13 +168,13 @@ int write_session(void)
|
|||||||
varval = varval->proc_var;
|
varval = varval->proc_var;
|
||||||
if (IsChar(j))
|
if (IsChar(j))
|
||||||
{
|
{
|
||||||
if ((int)VarName[j].setto != varval->char_var)
|
if (VarName[j].v.num != varval->char_var)
|
||||||
to_file(sf,"set %s %c\n",VarName[j].name,varval->char_var);
|
to_file(sf,"set %s %c\n",VarName[j].name,varval->char_var);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (IsNum(j))
|
if (IsNum(j))
|
||||||
{
|
{
|
||||||
if ((int)VarName[j].setto != varval->int_var)
|
if (VarName[j].v.num != varval->int_var)
|
||||||
to_file(sf,"set %s %i\n",VarName[j].name,varval->int_var);
|
to_file(sf,"set %s %i\n",VarName[j].name,varval->int_var);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -200,7 +200,7 @@ int write_session(void)
|
|||||||
varval = &chan->setting[j];
|
varval = &chan->setting[j];
|
||||||
if (IsNum(j))
|
if (IsNum(j))
|
||||||
{
|
{
|
||||||
if ((int)VarName[j].setto != varval->int_var)
|
if (VarName[j].v.num != varval->int_var)
|
||||||
to_file(sf,"set %s %i\n",VarName[j].name,varval->int_var);
|
to_file(sf,"set %s %i\n",VarName[j].name,varval->int_var);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -156,7 +156,7 @@ int dcc_sendfile(char *target, char *filename)
|
|||||||
struct sockaddr_in sai;
|
struct sockaddr_in sai;
|
||||||
Client *client;
|
Client *client;
|
||||||
int s,f,sz;
|
int s,f,sz;
|
||||||
char tempfile[Strlen2(filename,DCC_PUBLICFILES)+2];
|
char tempfile[strlen(filename)+strlen(DCC_PUBLICFILES)+2]; // strlen(DCC_PUBLICFILES) evaluates at compile time to a constant.
|
||||||
|
|
||||||
Strcpy(tempfile,DCC_PUBLICFILES);
|
Strcpy(tempfile,DCC_PUBLICFILES);
|
||||||
Strcat(tempfile,filename);
|
Strcat(tempfile,filename);
|
||||||
@ -177,7 +177,7 @@ int dcc_sendfile(char *target, char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_mallocdoer(dcc_sendfile);
|
set_mallocdoer(dcc_sendfile);
|
||||||
client = (Client*)Calloc(sizeof(Client) + Strlen2(filename,target));
|
client = (Client*)Calloc(sizeof(Client) + Strlen2(filename,target)); // target is never NULL
|
||||||
|
|
||||||
client->fileno = f;
|
client->fileno = f;
|
||||||
client->sock = s;
|
client->sock = s;
|
||||||
@ -608,7 +608,7 @@ void ctcp_dcc(char *from, char *to, char *rest)
|
|||||||
|
|
||||||
if (1)
|
if (1)
|
||||||
{
|
{
|
||||||
char tempname[Strlen2(filename,DCC_PUBLICINCOMING)+1];
|
char tempname[strlen(filename)+strlen(DCC_PUBLICINCOMING)+1]; // strlen(DCC_PUBLICINCOMING) evaluates to a constant during compile.
|
||||||
|
|
||||||
Strcpy(Strcpy(tempname,DCC_PUBLICINCOMING),filename);
|
Strcpy(Strcpy(tempname,DCC_PUBLICINCOMING),filename);
|
||||||
|
|
||||||
@ -620,7 +620,7 @@ void ctcp_dcc(char *from, char *to, char *rest)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
set_mallocdoer(ctcp_dcc);
|
set_mallocdoer(ctcp_dcc);
|
||||||
client = (Client*)Calloc(sizeof(Client) + Strlen2(filename,from));
|
client = (Client*)Calloc(sizeof(Client) + Strlen2(filename,from)); // from is never NULL
|
||||||
client->fileno = f;
|
client->fileno = f;
|
||||||
client->fileend = filesz;
|
client->fileend = filesz;
|
||||||
client->sock = s;
|
client->sock = s;
|
||||||
|
|||||||
36
src/debug.c
36
src/debug.c
@ -154,7 +154,7 @@ LS struct
|
|||||||
#ifdef PYTHON
|
#ifdef PYTHON
|
||||||
{ python_hook, "python_hook" },
|
{ python_hook, "python_hook" },
|
||||||
{ python_unhook, "python_unhook" },
|
{ python_unhook, "python_unhook" },
|
||||||
#endif /* PYTHON */
|
#endif /* PYTHON */
|
||||||
#ifdef RAWDNS
|
#ifdef RAWDNS
|
||||||
{ rawdns, "rawdns" },
|
{ rawdns, "rawdns" },
|
||||||
{ parse_query, "parse_query" },
|
{ parse_query, "parse_query" },
|
||||||
@ -196,12 +196,12 @@ LS const DEFstruct SCRIPTdefs[] =
|
|||||||
{ HOOK_BOTNET, "HOOK_BOTNET" },
|
{ HOOK_BOTNET, "HOOK_BOTNET" },
|
||||||
{ HOOK_DCC_COMPLETE, "HOOK_DCC_COMPLETE" },
|
{ HOOK_DCC_COMPLETE, "HOOK_DCC_COMPLETE" },
|
||||||
#ifdef TCL
|
#ifdef TCL
|
||||||
{ (int)tcl_timer_jump, "tcl_timer_jump" },
|
{ .v.func=tcl_timer_jump, "tcl_timer_jump" },
|
||||||
{ (int)tcl_parse_jump, "tcl_parse_jump" },
|
{ .v.func=tcl_parse_jump, "tcl_parse_jump" },
|
||||||
#endif /* TCL */
|
#endif /* TCL */
|
||||||
#ifdef PYTHON
|
#ifdef PYTHON
|
||||||
{ (int)python_timer_jump, "python_timer_jump" },
|
{ .v.func=python_timer_jump, "python_timer_jump" },
|
||||||
{ (int)python_parse_jump, "python_parse_jump" },
|
{ .v.func=python_parse_jump, "python_parse_jump" },
|
||||||
#endif /* PYTHON */
|
#endif /* PYTHON */
|
||||||
{ 0, }};
|
{ 0, }};
|
||||||
#endif /* SCRIPTING */
|
#endif /* SCRIPTING */
|
||||||
@ -301,9 +301,9 @@ void strflags(char *dst, const DEFstruct *flagsstruct, int flags)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
*dst = 0;
|
*dst = 0;
|
||||||
for(i=0;(flagsstruct[i].id);i++)
|
for(i=0;(flagsstruct[i].v.id);i++)
|
||||||
{
|
{
|
||||||
if (flagsstruct[i].id & flags)
|
if (flagsstruct[i].v.id & flags)
|
||||||
{
|
{
|
||||||
if (*dst)
|
if (*dst)
|
||||||
Strcat(dst,"|");
|
Strcat(dst,"|");
|
||||||
@ -318,7 +318,19 @@ const char *strdef(const DEFstruct *dtab, int num)
|
|||||||
|
|
||||||
for(i=0;(dtab[i].idstr);i++)
|
for(i=0;(dtab[i].idstr);i++)
|
||||||
{
|
{
|
||||||
if (dtab[i].id == num)
|
if (dtab[i].v.id == num)
|
||||||
|
return(dtab[i].idstr);
|
||||||
|
}
|
||||||
|
return("UNKNOWN");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *funcdef(const DEFstruct *dtab, void *func)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for(i=0;(dtab[i].idstr);i++)
|
||||||
|
{
|
||||||
|
if (dtab[i].v.func == func)
|
||||||
return(dtab[i].idstr);
|
return(dtab[i].idstr);
|
||||||
}
|
}
|
||||||
return("UNKNOWN");
|
return("UNKNOWN");
|
||||||
@ -468,7 +480,7 @@ void debug_settings(UniVar *setting, int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tpad = STREND(tabs);
|
tpad = STREND(tabs);
|
||||||
n = 24 - (Strlen2(pad,VarName[i].name) + 2);
|
n = 24 - (Strlen2(pad,VarName[i].name) + 2); // VarName[i].name is never NULL
|
||||||
while(n >= 8)
|
while(n >= 8)
|
||||||
{
|
{
|
||||||
n = n - 8;
|
n = n - 8;
|
||||||
@ -1161,7 +1173,7 @@ void debug_rawdns(void)
|
|||||||
|
|
||||||
#endif /* RAWDNS */
|
#endif /* RAWDNS */
|
||||||
|
|
||||||
#if defined(TCL) || defined(PYTHON)
|
#if defined(TCL) || defined(PYTHON)
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -1174,7 +1186,7 @@ typedef struct
|
|||||||
ulong minute2; //:30;
|
ulong minute2; //:30;
|
||||||
ulong hour; //:24;
|
ulong hour; //:24;
|
||||||
ulong weekday; //:7;
|
ulong weekday; //:7;
|
||||||
|
|
||||||
} HookTimer;
|
} HookTimer;
|
||||||
#endif /* 0 */
|
#endif /* 0 */
|
||||||
|
|
||||||
@ -1213,7 +1225,7 @@ void debug_scripthook(void)
|
|||||||
for(h=hooklist;h;h=h->next)
|
for(h=hooklist;h;h=h->next)
|
||||||
{
|
{
|
||||||
memtouch(h);
|
memtouch(h);
|
||||||
debug(" ; func\t\t"mx_pfmt" %s\n",(mx_ptr)h->func,strdef(SCRIPTdefs,(int)h->func));
|
debug(" ; func\t\t"mx_pfmt" %s\n",(mx_ptr)h->func,funcdef(SCRIPTdefs,h->func));
|
||||||
debug(" ; guid\t\t%i\n",h->guid);
|
debug(" ; guid\t\t%i\n",h->guid);
|
||||||
debug(" ; flags\t\t%s (%i)\n",strdef(SCRIPTdefs,h->flags),h->flags);
|
debug(" ; flags\t\t%s (%i)\n",strdef(SCRIPTdefs,h->flags),h->flags);
|
||||||
if (h->flags == HOOK_TIMER)
|
if (h->flags == HOOK_TIMER)
|
||||||
|
|||||||
@ -176,7 +176,7 @@ void Free(char **mem)
|
|||||||
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
int Strlen(const char *first, ...)
|
const int Strlen(const char *first, ...)
|
||||||
{
|
{
|
||||||
const char *s,*o;
|
const char *s,*o;
|
||||||
int n;
|
int n;
|
||||||
@ -200,7 +200,7 @@ int Strlen(const char *first, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
__attr(CORE_SEG,__regparm(2))
|
__attr(CORE_SEG,__regparm(2))
|
||||||
int Strlen2(const char *one, const char *two)
|
const int Strlen2(const char *one, const char *two)
|
||||||
{
|
{
|
||||||
const char *s1,*s2;
|
const char *s1,*s2;
|
||||||
|
|
||||||
|
|||||||
8
src/h.h
8
src/h.h
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#define ischannel(x) (*x == '#')
|
#define ischannel(x) (*x == '#')
|
||||||
|
|
||||||
#define nullstr(x) (x) ? x : NULLSTR
|
#define nullstr(x) ((x)) ? (x) : NULLSTR
|
||||||
#define nullbuf(x) (x && *x) ? x : NULLSTR
|
#define nullbuf(x) (x && *x) ? x : NULLSTR
|
||||||
|
|
||||||
#define chkhigh(x) if (x > hisock) { hisock = x; }
|
#define chkhigh(x) if (x > hisock) { hisock = x; }
|
||||||
@ -107,6 +107,7 @@
|
|||||||
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
LS Chan *find_channel(char *, int) __attr(CORE_SEG, __regparm (2) );
|
||||||
LS Chan *find_channel_ac(char *) __attr(CORE_SEG, __regparm (1) );
|
LS Chan *find_channel_ac(char *) __attr(CORE_SEG, __regparm (1) );
|
||||||
LS Chan *find_channel_ny(char *) __attr(CORE_SEG, __regparm (1) );
|
LS Chan *find_channel_ny(char *) __attr(CORE_SEG, __regparm (1) );
|
||||||
LS ChanUser *find_chanuser(Chan *, const char *) __attr(CORE_SEG, __regparm (2) );
|
LS ChanUser *find_chanuser(Chan *, const char *) __attr(CORE_SEG, __regparm (2) );
|
||||||
@ -208,8 +209,8 @@ LS ulong stringhash(char *) __page(CORE_SEG);
|
|||||||
*/
|
*/
|
||||||
LS void *Calloc(int) __attr(CORE_SEG, __regparm (1) );
|
LS void *Calloc(int) __attr(CORE_SEG, __regparm (1) );
|
||||||
LS void Free(char **) __attr(CORE_SEG, __regparm (1) );
|
LS void Free(char **) __attr(CORE_SEG, __regparm (1) );
|
||||||
LS int Strlen(const char *, ...) __page(CORE_SEG);
|
LS const int Strlen(const char *, ...) __page(CORE_SEG);
|
||||||
LS int Strlen2(const char *, const char *) __attr(CORE_SEG, __regparm (2) );
|
LS const int Strlen2(const char *, const char *) __attr(CORE_SEG, __regparm (2) );
|
||||||
LS int matches(const char *, const char *) __att2(CORE_SEG, const, __regparm (2) );
|
LS int matches(const char *, const char *) __att2(CORE_SEG, const, __regparm (2) );
|
||||||
LS int num_matches(const char *, const char *) __att2(CORE_SEG, const, __regparm (2) );
|
LS int num_matches(const char *, const char *) __att2(CORE_SEG, const, __regparm (2) );
|
||||||
LS int a2i(char *) __attr(CORE_SEG, __regparm (1) );
|
LS int a2i(char *) __attr(CORE_SEG, __regparm (1) );
|
||||||
@ -527,6 +528,7 @@ LS void select_bounce(void) __page(CORE_SEG);
|
|||||||
|
|
||||||
LS void do_chanban(COMMAND_ARGS) __page(CMD1_SEG);
|
LS void do_chanban(COMMAND_ARGS) __page(CMD1_SEG);
|
||||||
LS void process_chanbans(void) __page(CORE_SEG);
|
LS void process_chanbans(void) __page(CORE_SEG);
|
||||||
|
LS void chanban_action(char *, char *, Shit *) __page(CORE_SEG);
|
||||||
|
|
||||||
#endif /* CHANBAN */
|
#endif /* CHANBAN */
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ void make_ireq(int t, char *from, char *nick)
|
|||||||
char *pt;
|
char *pt;
|
||||||
|
|
||||||
set_mallocdoer(make_ireq);
|
set_mallocdoer(make_ireq);
|
||||||
ir = (IReq*)Calloc(sizeof(IReq) + Strlen2(from,nick));
|
ir = (IReq*)Calloc(sizeof(IReq) + Strlen(from,nick,NULL)); // can not use Strlen2() if 2nd arg might be NULL, Strlen() handles NULLs.
|
||||||
|
|
||||||
ir->t = t;
|
ir->t = t;
|
||||||
ir->when = now;
|
ir->when = now;
|
||||||
|
|||||||
@ -770,7 +770,7 @@ restart_die:
|
|||||||
LS char *bad_exe = "init: Error: Improper executable name\n";
|
LS char *bad_exe = "init: Error: Improper executable name\n";
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
int main(int argc, char **argv, char **envp) __attribute__ ((__noreturn__, __sect(INIT_SEG)));
|
int main(int argc, char **argv, char **envp) __attribute__ ((__sect(INIT_SEG)));
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -338,7 +338,7 @@ void basicAuth(BotNet *bn, char *rest)
|
|||||||
case BNAUTH_MD5:
|
case BNAUTH_MD5:
|
||||||
if (linkpass && *linkpass)
|
if (linkpass && *linkpass)
|
||||||
{
|
{
|
||||||
char *enc,temppass[24 + Strlen2(pass,linkpass)];
|
char *enc,temppass[24 + Strlen2(pass,linkpass)]; // linkpass is never NULL
|
||||||
|
|
||||||
/* "mypass theirpass REMOTEsid LOCALsid" */
|
/* "mypass theirpass REMOTEsid LOCALsid" */
|
||||||
sprintf(temppass,"%s %s %i %i",linkpass,pass,bn->rsid,bn->lsid);
|
sprintf(temppass,"%s %s %i %i",linkpass,pass,bn->rsid,bn->lsid);
|
||||||
@ -546,7 +546,7 @@ void basicBanner(BotNet *bn, char *rest)
|
|||||||
if (cfg->pass && *cfg->pass)
|
if (cfg->pass && *cfg->pass)
|
||||||
{
|
{
|
||||||
char *enc,salt[8];
|
char *enc,salt[8];
|
||||||
char temppass[24 + Strlen2(cfg->pass,linkpass)];
|
char temppass[24 + Strlen2(cfg->pass,linkpass)]; // linkpass(procvar) is not NULL
|
||||||
|
|
||||||
/* "theirpass mypass LOCALsid REMOTEsid" */
|
/* "theirpass mypass LOCALsid REMOTEsid" */
|
||||||
sprintf(temppass,"%s %s %i %i",cfg->pass,linkpass,bn->lsid,bn->rsid);
|
sprintf(temppass,"%s %s %i %i",cfg->pass,linkpass,bn->lsid,bn->rsid);
|
||||||
@ -1498,7 +1498,7 @@ usage:
|
|||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
set_mallocdoer(do_link);
|
set_mallocdoer(do_link);
|
||||||
cfg = (NetCfg*)Calloc(sizeof(NetCfg) + Strlen2(pass,host));
|
cfg = (NetCfg*)Calloc(sizeof(NetCfg) + Strlen(pass,host,NULL)); // host might be NULL, Strlen() handles NULLs, Strlen2() does not.
|
||||||
|
|
||||||
cfg->guid = iguid;
|
cfg->guid = iguid;
|
||||||
cfg->port = iport;
|
cfg->port = iport;
|
||||||
|
|||||||
@ -244,7 +244,7 @@ void catch_whois(char *nick, char *userhost, char *realname)
|
|||||||
* put in a new log entry
|
* put in a new log entry
|
||||||
*/
|
*/
|
||||||
set_mallocdoer(catch_whois);
|
set_mallocdoer(catch_whois);
|
||||||
nlog = (nfLog*)Calloc(sizeof(nfLog) + Strlen2(userhost,realname));
|
nlog = (nfLog*)Calloc(sizeof(nfLog) + Strlen2(userhost,realname)); // realname is never NULL
|
||||||
nlog->signon = now;
|
nlog->signon = now;
|
||||||
nlog->next = nf->log;
|
nlog->next = nf->log;
|
||||||
nf->log = nlog;
|
nf->log = nlog;
|
||||||
@ -306,7 +306,7 @@ int notifylog_callback(char *rest)
|
|||||||
pp = &(*pp)->next;
|
pp = &(*pp)->next;
|
||||||
}
|
}
|
||||||
set_mallocdoer(notifylog_callback);
|
set_mallocdoer(notifylog_callback);
|
||||||
nlog = (nfLog*)Calloc(sizeof(nfLog) + Strlen2(userhost,rest));
|
nlog = (nfLog*)Calloc(sizeof(nfLog) + Strlen2(userhost,rest)); // rest is never NULL
|
||||||
nlog->signon = on;
|
nlog->signon = on;
|
||||||
nlog->signoff = off;
|
nlog->signoff = off;
|
||||||
nlog->next = *pp;
|
nlog->next = *pp;
|
||||||
|
|||||||
@ -61,7 +61,6 @@ int perl_parse_jump(char *from, char *rest, Hook *hook)
|
|||||||
|
|
||||||
SPAGAIN; /* Rehash stack, it's probably been clobbered */
|
SPAGAIN; /* Rehash stack, it's probably been clobbered */
|
||||||
return(POPi); /* Pop an int */
|
return(POPi); /* Pop an int */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -83,7 +82,7 @@ XS(XS_perl_parse_hook)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* translate *name and *sub from perl variables to C strings
|
* translate *name and *sub from perl variables to C strings
|
||||||
* SvPV(ST(0)) returns a string(char) pointer to the first arg.
|
* SvPV(ST(0)) returns a string(char) pointer to the first arg.
|
||||||
* but I don't know if it's safe to point directly in to perl
|
* but I don't know if it's safe to point directly in to perl
|
||||||
* space like that.
|
* space like that.
|
||||||
*/
|
*/
|
||||||
@ -100,7 +99,7 @@ XS(XS_perl_parse_hook)
|
|||||||
* make a Hook struct and link it into the parse hook list
|
* make a Hook struct and link it into the parse hook list
|
||||||
*/
|
*/
|
||||||
set_mallocdoer(perl_parse_hook);
|
set_mallocdoer(perl_parse_hook);
|
||||||
hook = (Hook*)Calloc(sizeof(Hook) + Strlen2(name,sub));
|
hook = (Hook*)Calloc(sizeof(Hook) + Strlen2(name,sub)); // sub is never NULL
|
||||||
hook->func = perl_parse_jump;
|
hook->func = perl_parse_jump;
|
||||||
hook->next = hooklist;
|
hook->next = hooklist;
|
||||||
hooklist = hook;
|
hooklist = hook;
|
||||||
|
|||||||
@ -51,7 +51,7 @@ void send_kick(Chan *chan, const char *nick, const char *format, ...)
|
|||||||
pp = &(*pp)->next;
|
pp = &(*pp)->next;
|
||||||
|
|
||||||
set_mallocdoer(send_kick);
|
set_mallocdoer(send_kick);
|
||||||
*pp = new = (qKick*)Calloc(sizeof(qKick) + Strlen2(nick,gsockdata));
|
*pp = new = (qKick*)Calloc(sizeof(qKick) + Strlen2(nick,gsockdata)); // gsockdata is never NULL
|
||||||
/* Calloc sets to zero new->next = NULL; */
|
/* Calloc sets to zero new->next = NULL; */
|
||||||
|
|
||||||
new->reason = Strcpy(new->nick,nick) + 1;
|
new->reason = Strcpy(new->nick,nick) + 1;
|
||||||
|
|||||||
@ -25,8 +25,13 @@
|
|||||||
#define DEFAULTCMDCHAR '-'
|
#define DEFAULTCMDCHAR '-'
|
||||||
|
|
||||||
#define ZERO 0
|
#define ZERO 0
|
||||||
#define INTCAST(x) (void*)((int)x)
|
#define INTCAST(x) .v.num=x
|
||||||
#define CHARCAST (void*)((int)DEFAULTCMDCHAR)
|
#define CMDCHAR .v.chr=DEFAULTCMDCHAR
|
||||||
|
#define VNULL .v.str=NULL
|
||||||
|
#define TOGPROC(x) .v.numptr=&x
|
||||||
|
#define CHRPROC(x) .v.str=&x
|
||||||
|
#define INTPROC(x) .v.numptr=&x
|
||||||
|
#define STRPROC(x) .v.strptr=&x
|
||||||
|
|
||||||
LS const Setting VarName[SIZE_VARS] =
|
LS const Setting VarName[SIZE_VARS] =
|
||||||
{
|
{
|
||||||
@ -44,10 +49,10 @@ LS const Setting VarName[SIZE_VARS] =
|
|||||||
{ INT_VAR, 40, 0, ZERO, "CKL", 20 },
|
{ INT_VAR, 40, 0, ZERO, "CKL", 20 },
|
||||||
{ TOG_VAR, 40, 0, ZERO, "CTL", 1 },
|
{ TOG_VAR, 40, 0, ZERO, "CTL", 1 },
|
||||||
#ifdef DYNAMODE
|
#ifdef DYNAMODE
|
||||||
{ STR_VAR, 40, 0, NULL, "DYNLIMIT", 1 }, /* settings for dynamode: `delay:window:minwin' */
|
{ STR_VAR, 40, 0, VNULL, "DYNLIMIT", 1 }, /* settings for dynamode: `delay:window:minwin' */
|
||||||
#endif /* DYNAMODE */
|
#endif /* DYNAMODE */
|
||||||
{ TOG_VAR, 40, 0, ZERO, "ENFM", 1 },
|
{ TOG_VAR, 40, 0, ZERO, "ENFM", 1 },
|
||||||
{ STR_VAR, 40, 0, NULL, "ENFMODES" }, /* modes to enforce, +ENFM to enable */
|
{ STR_VAR, 40, 0, VNULL, "ENFMODES" }, /* modes to enforce, +ENFM to enable */
|
||||||
{ INT_VAR, 40, 0, INTCAST(6), "FL", 20 }, /* number of lines that counts as a text flood */
|
{ INT_VAR, 40, 0, INTCAST(6), "FL", 20 }, /* number of lines that counts as a text flood */
|
||||||
{ INT_VAR, 40, 0, ZERO, "FPL", 2 },
|
{ INT_VAR, 40, 0, ZERO, "FPL", 2 },
|
||||||
{ INT_VAR, 40, 0, INTCAST(0), "IKT", 40320 }, /* idle-kick: minutes of idle-time (max 4 weeks) */
|
{ INT_VAR, 40, 0, INTCAST(0), "IKT", 40320 }, /* idle-kick: minutes of idle-time (max 4 weeks) */
|
||||||
@ -65,7 +70,7 @@ LS const Setting VarName[SIZE_VARS] =
|
|||||||
{ TOG_VAR, 40, 0, INTCAST(1), "SHIT", 1 }, /* shitlist enable */
|
{ TOG_VAR, 40, 0, INTCAST(1), "SHIT", 1 }, /* shitlist enable */
|
||||||
{ TOG_VAR, 40, 0, ZERO, "SO", 1 }, /* safe-op enable */
|
{ TOG_VAR, 40, 0, ZERO, "SO", 1 }, /* safe-op enable */
|
||||||
#ifdef STATS
|
#ifdef STATS
|
||||||
{ STR_VAR, 80, 0, NULL, "STATS" }, /* statistics log file */
|
{ STR_VAR, 80, 0, VNULL, "STATS" }, /* statistics log file */
|
||||||
#endif /* STATS */
|
#endif /* STATS */
|
||||||
{ TOG_VAR, 40, 0, ZERO, "TOP", 1 },
|
{ TOG_VAR, 40, 0, ZERO, "TOP", 1 },
|
||||||
/*
|
/*
|
||||||
@ -73,33 +78,33 @@ LS const Setting VarName[SIZE_VARS] =
|
|||||||
*/
|
*/
|
||||||
/* TYPE UACCES MIN DEFAULT NAME MAX */
|
/* TYPE UACCES MIN DEFAULT NAME MAX */
|
||||||
{ INT_GLOBAL, 40, 0, ZERO, "AAWAY", 1440 }, /* set auto-away after ___ minutes */
|
{ INT_GLOBAL, 40, 0, ZERO, "AAWAY", 1440 }, /* set auto-away after ___ minutes */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "ALTNICK" }, /* alternative nick */
|
{ STR_GLOBAL, 90, 0, VNULL, "ALTNICK" }, /* alternative nick */
|
||||||
#ifdef BOTNET
|
#ifdef BOTNET
|
||||||
{ TOG_PROC, 90, 0, (&autolink), "AUTOLINK", 1 }, /* establish links automagically */
|
{ TOG_PROC, 90, 0, TOGPROC(autolink), "AUTOLINK", 1 }, /* establish links automagically */
|
||||||
#endif /* BOTNET */
|
#endif /* BOTNET */
|
||||||
#ifdef BOUNCE
|
#ifdef BOUNCE
|
||||||
{ INT_PROC, 100, 0, (&bounce_port), "BNCPORT", 65535, (&new_port_bounce) }, /* irc proxy port to listen on */
|
{ INT_PROC, 100, 0, INTPROC(bounce_port), "BNCPORT", 65535, (&new_port_bounce) }, /* irc proxy port to listen on */
|
||||||
#endif /* BOUNCE */
|
#endif /* BOUNCE */
|
||||||
{ TOG_GLOBAL, 90, 0, INTCAST(1), "CC", 1 }, /* require command char */
|
{ TOG_GLOBAL, 90, 0, INTCAST(1), "CC", 1 }, /* require command char */
|
||||||
{ CHR_GLOBAL, 90, 1, CHARCAST, "CMDCHAR", 255 }, /* command char */
|
{ CHR_GLOBAL, 90, 1, CMDCHAR, "CMDCHAR", 255 }, /* command char */
|
||||||
#ifdef CTCP
|
#ifdef CTCP
|
||||||
{ TOG_GLOBAL, 90, 0, INTCAST(1), "CTCP", 1 }, /* ctcp replies enable */
|
{ TOG_GLOBAL, 90, 0, INTCAST(1), "CTCP", 1 }, /* ctcp replies enable */
|
||||||
#endif /* CTCP */
|
#endif /* CTCP */
|
||||||
{ INT_PROC, 100, 10, (&ctimeout), "CTIMEOUT", 3600 }, /* how long to wait between connect attempts */
|
{ INT_PROC, 100, 10, INTPROC(ctimeout), "CTIMEOUT", 3600 }, /* how long to wait between connect attempts */
|
||||||
#ifdef DCC_FILE
|
#ifdef DCC_FILE
|
||||||
{ INT_GLOBAL, 80, 0, ZERO, "DCCANON", 100 }, /* anonymous (non user) DCC slots */
|
{ INT_GLOBAL, 80, 0, ZERO, "DCCANON", 100 }, /* anonymous (non user) DCC slots */
|
||||||
{ STR_GLOBAL, 80, 0, NULL, "DCCFILES" }, /* string with space separated masks for auto-accepted filenames */
|
{ STR_GLOBAL, 80, 0, VNULL, "DCCFILES" }, /* string with space separated masks for auto-accepted filenames */
|
||||||
{ INT_GLOBAL, 80, 0, INTCAST(4), "DCCUSER", 100 }, /* user DCC slots */
|
{ INT_GLOBAL, 80, 0, INTCAST(4), "DCCUSER", 100 }, /* user DCC slots */
|
||||||
#endif /* DCC_FILE */
|
#endif /* DCC_FILE */
|
||||||
{ TOG_GLOBAL, 80, 0, ZERO, "ENFPASS", 1 }, /* disallow users with no passwords */
|
{ TOG_GLOBAL, 80, 0, ZERO, "ENFPASS", 1 }, /* disallow users with no passwords */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "IDENT" }, /* register with this in the `user' field */
|
{ STR_GLOBAL, 90, 0, VNULL, "IDENT" }, /* register with this in the `user' field */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "IRCNAME" }, /* register with this in the `real name' field */
|
{ STR_GLOBAL, 90, 0, VNULL, "IRCNAME" }, /* register with this in the `real name' field */
|
||||||
#ifdef NOTIFY
|
#ifdef NOTIFY
|
||||||
{ INT_GLOBAL, 80, 10, INTCAST(30), "ISONDELAY", 600 }, /* seconds between each ISON */
|
{ INT_GLOBAL, 80, 10, INTCAST(30), "ISONDELAY", 600 }, /* seconds between each ISON */
|
||||||
#endif /* NOTIFY */
|
#endif /* NOTIFY */
|
||||||
#ifdef BOTNET
|
#ifdef BOTNET
|
||||||
{ STR_PROC, 90, 0, (&linkpass), "LINKPASS" }, /* local process linkpass */
|
{ STR_PROC, 90, 0, STRPROC(linkpass), "LINKPASS" }, /* local process linkpass */
|
||||||
{ INT_PROC, 100, 0, (&linkport), "LINKPORT", 65535 }, /* listen on <linkport> for botnet connections */
|
{ INT_PROC, 100, 0, INTPROC(linkport), "LINKPORT", 65535 }, /* listen on <linkport> for botnet connections */
|
||||||
#endif /* BOTNET */
|
#endif /* BOTNET */
|
||||||
{ INT_GLOBAL, 80, 1, INTCAST(3), "MODES", 20 }, /* max number of channel modes to send */
|
{ INT_GLOBAL, 80, 1, INTCAST(3), "MODES", 20 }, /* max number of channel modes to send */
|
||||||
#ifdef BOTNET
|
#ifdef BOTNET
|
||||||
@ -107,36 +112,36 @@ LS const Setting VarName[SIZE_VARS] =
|
|||||||
#endif /* BOTNET */
|
#endif /* BOTNET */
|
||||||
{ TOG_GLOBAL, 80, 0, ZERO, "NOIDLE", 1 }, /* dont idle */
|
{ TOG_GLOBAL, 80, 0, ZERO, "NOIDLE", 1 }, /* dont idle */
|
||||||
#ifdef NOTIFY
|
#ifdef NOTIFY
|
||||||
{ STR_GLOBAL, 80, 0, NULL, "NOTIFYFILE" }, /* read notify settings from <notifyfile> */
|
{ STR_GLOBAL, 80, 0, VNULL, "NOTIFYFILE" }, /* read notify settings from <notifyfile> */
|
||||||
#endif /* NOTIFY */
|
#endif /* NOTIFY */
|
||||||
{ TOG_GLOBAL, 90, 0, ZERO, "ONOTICE", 1 }, /* ircd has /notice @#channel */
|
{ TOG_GLOBAL, 90, 0, ZERO, "ONOTICE", 1 }, /* ircd has /notice @#channel */
|
||||||
#ifdef TRIVIA
|
#ifdef TRIVIA
|
||||||
{ CHR_PROC, 80, 0, (&triv_qchar), "QCHAR" }, /* use <qchar> as mask char when displaying answer */
|
{ CHR_PROC, 80, 0, CHRPROC(triv_qchar), "QCHAR" }, /* use <qchar> as mask char when displaying answer */
|
||||||
{ INT_PROC, 80, 1, (&triv_qdelay), "QDELAY", 3600 }, /* seconds between each question */
|
{ INT_PROC, 80, 1, INTPROC(triv_qdelay), "QDELAY", 3600 }, /* seconds between each question */
|
||||||
{ STR_PROC, 80, 0, (&triv_qfile), "QFILE" }, /* load questions from <qfile> */
|
{ STR_PROC, 80, 0, STRPROC(triv_qfile), "QFILE" }, /* load questions from <qfile> */
|
||||||
#endif /* TRIVIA */
|
#endif /* TRIVIA */
|
||||||
#ifdef CTCP
|
#ifdef CTCP
|
||||||
{ TOG_GLOBAL, 80, 0, ZERO, "RF", 1 }, /* random ctcp finger reply */
|
{ TOG_GLOBAL, 80, 0, ZERO, "RF", 1 }, /* random ctcp finger reply */
|
||||||
{ TOG_GLOBAL, 80, 0, ZERO, "RV", 1 }, /* random ctcp version reply */
|
{ TOG_GLOBAL, 80, 0, ZERO, "RV", 1 }, /* random ctcp version reply */
|
||||||
#endif /* CTCP */
|
#endif /* CTCP */
|
||||||
#ifdef SEEN
|
#ifdef SEEN
|
||||||
{ STR_PROC, 90, 0, (&seenfile), "SEENFILE" }, /* load/save seen database from <seenfile> */
|
{ STR_PROC, 90, 0, STRPROC(seenfile), "SEENFILE" }, /* load/save seen database from <seenfile> */
|
||||||
#endif /* SEEN */
|
#endif /* SEEN */
|
||||||
{ STR_GLOBAL, 80, 0, NULL, "SERVERGROUP" }, /* connect bot to a certain group of servers */
|
{ STR_GLOBAL, 80, 0, VNULL, "SERVERGROUP" }, /* connect bot to a certain group of servers */
|
||||||
{ TOG_GLOBAL, 90, 0, ZERO, "SPY", 1 }, /* send info about executed commands to status channel */
|
{ TOG_GLOBAL, 90, 0, ZERO, "SPY", 1 }, /* send info about executed commands to status channel */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "UMODES" }, /* send these modes on connect */
|
{ STR_GLOBAL, 90, 0, VNULL, "UMODES" }, /* send these modes on connect */
|
||||||
#ifdef UPTIME
|
#ifdef UPTIME
|
||||||
{ STR_PROC, 100, 0, (&uptimehost), "UPHOST" }, /* send uptime packets to <uphost> */
|
{ STR_PROC, 100, 0, STRPROC(uptimehost), "UPHOST" }, /* send uptime packets to <uphost> */
|
||||||
{ STR_PROC, 100, 0, (&uptimenick), "UPNICK" }, /* send <upnick> as identifier instead of bots nick */
|
{ STR_PROC, 100, 0, STRPROC(uptimenick), "UPNICK" }, /* send <upnick> as identifier instead of bots nick */
|
||||||
{ INT_PROC, 100, 0, (&uptimeport), "UPPORT", 65535 }, /* send packets to port <upport> */
|
{ INT_PROC, 100, 0, INTPROC(uptimeport), "UPPORT", 65535 }, /* send packets to port <upport> */
|
||||||
#endif /* UPTIME */
|
#endif /* UPTIME */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "USERFILE" }, /* what file to load/save userlist from/to */
|
{ STR_GLOBAL, 90, 0, VNULL, "USERFILE" }, /* what file to load/save userlist from/to */
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "VIRTUAL", 0, (&var_resolve_host) }, /* visual host */
|
{ STR_GLOBAL, 90, 0, VNULL, "VIRTUAL", 0, (&var_resolve_host) }, /* visual host */
|
||||||
#ifdef WEB
|
#ifdef WEB
|
||||||
{ INT_PROC, 100, 0, (&webport), "WEBPORT", 65535 }, /* httpd should listen on... */
|
{ INT_PROC, 100, 0, INTPROC(webport), "WEBPORT", 65535 }, /* httpd should listen on... */
|
||||||
#endif /* WEB */
|
#endif /* WEB */
|
||||||
#ifdef WINGATE
|
#ifdef WINGATE
|
||||||
{ STR_GLOBAL, 90, 0, NULL, "WINGATE", 0, (&var_resolve_host) }, /* wingate hostname */
|
{ STR_GLOBAL, 90, 0, VNULL, "WINGATE", 0, (&var_resolve_host) }, /* wingate hostname */
|
||||||
{ INT_GLOBAL, 90, 0, ZERO, "WINGPORT", 65535 }, /* wingate port */
|
{ INT_GLOBAL, 90, 0, ZERO, "WINGPORT", 65535 }, /* wingate port */
|
||||||
#endif /* WINGATE */
|
#endif /* WINGATE */
|
||||||
{ 0, }};
|
{ 0, }};
|
||||||
|
|||||||
@ -82,7 +82,12 @@ typedef struct
|
|||||||
|
|
||||||
typedef struct DEFstruct
|
typedef struct DEFstruct
|
||||||
{
|
{
|
||||||
int id;
|
union
|
||||||
|
{
|
||||||
|
int id;
|
||||||
|
void *func;
|
||||||
|
|
||||||
|
} v;
|
||||||
char *idstr;
|
char *idstr;
|
||||||
|
|
||||||
} DEFstruct;
|
} DEFstruct;
|
||||||
@ -168,7 +173,16 @@ typedef struct Setting
|
|||||||
uchar type;
|
uchar type;
|
||||||
uchar uaccess; /* user access to touch/view this setting */
|
uchar uaccess; /* user access to touch/view this setting */
|
||||||
short min;
|
short min;
|
||||||
void *setto; /* type-casted to whatever */
|
union
|
||||||
|
{
|
||||||
|
int num;
|
||||||
|
int *numptr;
|
||||||
|
char chr;
|
||||||
|
char *str;
|
||||||
|
char **strptr;
|
||||||
|
|
||||||
|
} v;
|
||||||
|
//void *setto; /* type-casted to whatever */
|
||||||
char *name;
|
char *name;
|
||||||
int max;
|
int max;
|
||||||
void (*func)(const struct Setting *);
|
void (*func)(const struct Setting *);
|
||||||
@ -565,7 +579,7 @@ typedef struct Mech
|
|||||||
|
|
||||||
#ifdef IDWRAP
|
#ifdef IDWRAP
|
||||||
char *identfile;
|
char *identfile;
|
||||||
#endif /* IDWRAP */
|
#endif /* IDWRAP */
|
||||||
|
|
||||||
/* big buffers at the end */
|
/* big buffers at the end */
|
||||||
UniVar setting[SIZE_VARS]; /* global vars + channel defaults */
|
UniVar setting[SIZE_VARS]; /* global vars + channel defaults */
|
||||||
|
|||||||
11
src/tcl.c
11
src/tcl.c
@ -173,8 +173,7 @@ int tcl_parse_jump(char *from, char *rest, Hook *hook)
|
|||||||
Tcl_GetIntFromObj(energymech_tcl,tcl_result,&i);
|
Tcl_GetIntFromObj(energymech_tcl,tcl_result,&i);
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (energymech_tcl->result && *energymech_tcl->result)
|
debug("(tcl_parse_jump) result = %i\n",i);
|
||||||
debug("(tcl_parse_jump) result = %s\n",nullstr(energymech_tcl->result));
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
@ -199,8 +198,7 @@ void tcl_dcc_complete(Client *client, int cps)
|
|||||||
Tcl_ObjSetVar2(energymech_tcl,vname,NULL,obj,TCL_GLOBAL_ONLY);
|
Tcl_ObjSetVar2(energymech_tcl,vname,NULL,obj,TCL_GLOBAL_ONLY);
|
||||||
Tcl_VarEval(energymech_tcl,hook->self," $_filetarget $_filename $_cps",NULL);
|
Tcl_VarEval(energymech_tcl,hook->self," $_filetarget $_filename $_cps",NULL);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (energymech_tcl->result && *energymech_tcl->result)
|
debug("(tcl_dcc_complete) filetarget %s, filename %s\n",client->whom,client->filename);
|
||||||
debug("(tcl_dcc_complete) result = %s\n",nullstr(energymech_tcl->result));
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -335,7 +333,7 @@ int tcl_debug(void *foo, Tcl_Interp *I, int objc, Tcl_Obj *CONST objv[])
|
|||||||
return(TCL_ERROR);
|
return(TCL_ERROR);
|
||||||
|
|
||||||
debug("(tcl_debug) %s\n",text);
|
debug("(tcl_debug) %s\n",text);
|
||||||
|
|
||||||
return(TCL_OK);
|
return(TCL_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,8 +474,7 @@ int tcl_dns_jump(char *host, char *resolved, Hook *hook)
|
|||||||
Tcl_GetIntFromObj(energymech_tcl,tcl_result,&i);
|
Tcl_GetIntFromObj(energymech_tcl,tcl_result,&i);
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if (energymech_tcl->result && *energymech_tcl->result)
|
debug("(tcl_dns_jump) result = %i\n",i);
|
||||||
debug("(tcl_dns_jump) result = %s\n",nullstr(energymech_tcl->result));
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
return(i);
|
return(i);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -716,7 +716,7 @@ User *add_user(char *handle, char *pass, int axs)
|
|||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
set_mallocdoer(add_user);
|
set_mallocdoer(add_user);
|
||||||
user = (User*)Calloc(sizeof(User) + Strlen2(handle,pass));
|
user = (User*)Calloc(sizeof(User) + Strlen(handle,pass,NULL)); // Strlen() tolerates pass being NULL, Strlen2() does not.
|
||||||
user->x.x.access = axs;
|
user->x.x.access = axs;
|
||||||
user->next = current->userlist;
|
user->next = current->userlist;
|
||||||
current->userlist = user;
|
current->userlist = user;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ void copy_vars(UniVar *dst, UniVar *src)
|
|||||||
{
|
{
|
||||||
dst[i].int_var = src[i].int_var;
|
dst[i].int_var = src[i].int_var;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_binarydefault(UniVar *dst)
|
void set_binarydefault(UniVar *dst)
|
||||||
@ -87,7 +87,7 @@ void set_binarydefault(UniVar *dst)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i=0;VarName[i].name;i++)
|
for(i=0;VarName[i].name;i++)
|
||||||
dst[i].str_var = VarName[i].setto;
|
dst[i].str_var = VarName[i].v.str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void delete_vars(UniVar *vars, int which)
|
void delete_vars(UniVar *vars, int which)
|
||||||
@ -388,7 +388,7 @@ second_pass:
|
|||||||
|
|
||||||
varval = (IsProc(i)) ? current->setting[i].proc_var : &univar[i];
|
varval = (IsProc(i)) ? current->setting[i].proc_var : &univar[i];
|
||||||
|
|
||||||
sz = Strlen2(tmp,VarName[i].name);
|
sz = Strlen2(tmp,VarName[i].name); // VarName[i].name is never NULL
|
||||||
|
|
||||||
if (IsStr(i))
|
if (IsStr(i))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user