mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-17 15:36:50 +00:00
Merge pull request #30 from joonicks/dev
calc, hostinfo, code segment layout, debug info etc
This commit is contained in:
commit
fc915b62ba
17
src/auth.c
17
src/auth.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 2001-2018 proton
|
||||
Copyright (c) 2001-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -434,6 +434,7 @@ See also: passwd, setpass
|
||||
*/
|
||||
void do_auth(COMMAND_ARGS)
|
||||
{
|
||||
Auth *au;
|
||||
#ifdef BOTNET
|
||||
char *checksum;
|
||||
#endif /* BOTNET */
|
||||
@ -443,7 +444,21 @@ void do_auth(COMMAND_ARGS)
|
||||
int hostmatch;
|
||||
|
||||
if ((pass = chop(&rest)) == NULL)
|
||||
{
|
||||
if (get_authaccess(from,MATCH_ALL) == 100)
|
||||
{
|
||||
/* empty pass + owner: List active auths */
|
||||
table_buffer("\037Active Auths\037");
|
||||
if (current->authlist == NULL)
|
||||
table_buffer("(none)");
|
||||
for(au=current->authlist;au;au=au->next)
|
||||
{
|
||||
table_buffer("%s\t%i\t%s\t%s",au->user->name,au->user->x.x.access,au->nuh,idle2str(now - au->active,TRUE));
|
||||
}
|
||||
table_send(from,3);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* chop chop
|
||||
|
||||
75
src/calc.c
75
src/calc.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 2020-2021 proton
|
||||
Copyright (c) 2020-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -92,7 +92,9 @@ const char *calculate(const char *input, CalcOp *cop, char *prepin)
|
||||
*dst = 0;
|
||||
input = prepin;
|
||||
|
||||
#ifdef TEST
|
||||
printf("%s\n",prepin);
|
||||
#endif /* TEST */
|
||||
cop_count = 0;
|
||||
maxdeci = 0;
|
||||
goto new_blank;
|
||||
@ -140,14 +142,21 @@ op_or_num:
|
||||
input++;
|
||||
goto parse_num;
|
||||
}
|
||||
if (*input >= '0' && *input <= '9')
|
||||
if (*input == '*')
|
||||
{
|
||||
op = OPER_MUL;
|
||||
input++;
|
||||
para++;
|
||||
goto parse_num;
|
||||
}
|
||||
if ((*input >= '0' && *input <= '9') || *input == '.')
|
||||
goto parse_num;
|
||||
if (*input == 0)
|
||||
goto new_op_or_num;
|
||||
goto parsing_error;
|
||||
|
||||
parse_num:
|
||||
if (*input == '-' || *input == '+')
|
||||
if (*input == '-' || *input == '+' || *input == '*')
|
||||
{
|
||||
goto new_op_or_num;
|
||||
}
|
||||
@ -176,7 +185,7 @@ parsing_error:
|
||||
calculate_result:
|
||||
x = 20;
|
||||
/* find most decimals and convert all other numbers */
|
||||
for(i=0;i<=cop_count;i++)
|
||||
/* for(i=0;i<=cop_count;i++)
|
||||
{
|
||||
if (cop[i].decimals < maxdeci)
|
||||
{
|
||||
@ -188,6 +197,7 @@ calculate_result:
|
||||
cop[i].decimals = maxdeci;
|
||||
}
|
||||
}
|
||||
*/
|
||||
r = 0;
|
||||
iterate:
|
||||
/* find highest paralevel */
|
||||
@ -195,7 +205,8 @@ iterate:
|
||||
for(i=0;i<=cop_count;i++)
|
||||
{
|
||||
if (cop[i].paralevel >= 0)
|
||||
printf("number %lli, operation %i, decimals %i, paralevel %i\n",cop[i].number,cop[i].operation,cop[i].decimals,cop[i].paralevel);
|
||||
printf("number %lu, operation %i, decimals %i, paralevel %i\n",
|
||||
cop[i].number,cop[i].operation,cop[i].decimals,cop[i].paralevel);
|
||||
if (cop[i].paralevel >= para)
|
||||
para = cop[i].paralevel;
|
||||
}
|
||||
@ -210,6 +221,18 @@ iterate:
|
||||
r += cop[i].number;
|
||||
cop[i].paralevel = -1;
|
||||
}
|
||||
if (cop[i].paralevel == para && op == 2 && cop[i].operation == OPER_MUL)
|
||||
{
|
||||
cop[i-1].number = cop[i-1].number * cop[i].number;
|
||||
/* if (cop[i-1].decimals > cop[i].decimals)*/
|
||||
{
|
||||
#ifdef TEST
|
||||
printf("decimals adjust %i > %i\n",cop[i-1].decimals,cop[i].decimals);
|
||||
#endif /* TEST */
|
||||
/* cop[i-1].number /= decival[cop[i-1].decimals - cop[i].decimals];*/
|
||||
}
|
||||
cop[i].paralevel = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (x--<0)
|
||||
@ -232,21 +255,6 @@ return_result:
|
||||
return(prepin);
|
||||
}
|
||||
|
||||
void do_calc(COMMAND_ARGS)
|
||||
{
|
||||
CalcOp cop[MAX_COP];
|
||||
int cp = 0;
|
||||
|
||||
memset(&cop,0,sizeof(cop));
|
||||
|
||||
/* start with a numeral, or '-' */
|
||||
if (*rest != '-' && (attrtab[(uchar)*rest] & NUM) == 0)
|
||||
{
|
||||
/* malformed */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void mkbin(char *dst, int num, int bits)
|
||||
{
|
||||
int lim;
|
||||
@ -317,6 +325,23 @@ int bas2int(const char *src, int base)
|
||||
|
||||
#if !defined(TEST)
|
||||
|
||||
void do_calc(COMMAND_ARGS)
|
||||
{
|
||||
char prep[MSGLEN];
|
||||
CalcOp cop[MAX_COP];
|
||||
int cp = 0;
|
||||
|
||||
memset(&cop,0,sizeof(cop));
|
||||
|
||||
/* start with a numeral, or '.', or '-' */
|
||||
if (*rest != '-' && *rest != '.' && (attrtab[(uchar)*rest] & NUM) == 0)
|
||||
{
|
||||
/* malformed */
|
||||
return;
|
||||
}
|
||||
to_user_q(from,"%s",calculate(rest,cop,prep));
|
||||
}
|
||||
|
||||
void do_convert(COMMAND_ARGS)
|
||||
{
|
||||
char output[200];
|
||||
@ -416,7 +441,7 @@ void do_convert(COMMAND_ARGS)
|
||||
if (dst != output)
|
||||
*(dst++) = ' ';
|
||||
|
||||
sprintf(dst,"oct 0%o",num,num);
|
||||
sprintf(dst,"oct 0%o",num);
|
||||
}
|
||||
|
||||
if (tohex)
|
||||
@ -461,8 +486,11 @@ void do_convert(COMMAND_ARGS)
|
||||
const char *test[] = {
|
||||
"1 - .2 + .03 - .004",
|
||||
"2.008 + 9 + .992",
|
||||
/* "999 - 555.66",
|
||||
"1+2-3+4-5+6-7+8-9",*/
|
||||
"999 - 555.66",
|
||||
"1+2-3+4-5+6-7+8-9",
|
||||
"100*200",
|
||||
"10-10*10+10",
|
||||
".001*1000",
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -470,7 +498,6 @@ int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
char prep[MSGLEN];
|
||||
CalcOp cop[MAX_COP];
|
||||
char *tmp;
|
||||
int i;
|
||||
|
||||
for(i=0;test[i];i++)
|
||||
|
||||
27
src/core.c
27
src/core.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Parts Copyright (c) 1997-2018 proton
|
||||
Parts Copyright (c) 1997-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -29,6 +29,10 @@
|
||||
#include "mcmd.h"
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef HOSTINFO
|
||||
#include <sys/utsname.h>
|
||||
#endif /* HOSTINFO */
|
||||
|
||||
#ifdef IDWRAP
|
||||
|
||||
void unlink_identfile(void)
|
||||
@ -444,6 +448,13 @@ void signoff(char *from, char *reason)
|
||||
Free(¤t->lastcmds[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* little of this n that
|
||||
*/
|
||||
Free((char**)¤t->nick);
|
||||
Free((char**)¤t->wantnick);
|
||||
Free((char**)¤t->userhost);
|
||||
|
||||
/*
|
||||
* These 2 are used by do_die() to pass reason and doer.
|
||||
*/
|
||||
@ -1251,6 +1262,10 @@ void do_version(COMMAND_ARGS)
|
||||
|
||||
void do_core(COMMAND_ARGS)
|
||||
{
|
||||
#ifdef HOSTINFO
|
||||
char *h,hostname[256];
|
||||
struct utsname un;
|
||||
#endif /* HOSTINFO */
|
||||
char tmp[MSGLEN]; /* big buffers at the top */
|
||||
Server *sp;
|
||||
Chan *chan;
|
||||
@ -1330,6 +1345,16 @@ void do_core(COMMAND_ARGS)
|
||||
table_buffer(TEXT_CURRSERVERNOT);
|
||||
table_buffer(TEXT_SERVERONTIME,idle2str(now - current->ontime,FALSE));
|
||||
table_buffer(TEXT_BOTMODES,(*current->modes) ? current->modes : TEXT_NONE);
|
||||
#ifdef HOSTINFO
|
||||
hostname[255] = 0;
|
||||
if (gethostname(hostname,250) < 0)
|
||||
h = "(hostname error)";
|
||||
else
|
||||
h = hostname;
|
||||
|
||||
if (uname(&un) == 0)
|
||||
table_buffer(TEXT_HOSTINFO,h,un.sysname,un.release,un.machine);
|
||||
#endif /* HOSTINFO */
|
||||
table_buffer(TEXT_CURRENTTIME,time2str(now));
|
||||
table_buffer(TEXT_BOTSTARTED,time2str(uptime));
|
||||
table_buffer(TEXT_BOTUPTIME,idle2str(now - uptime,FALSE));
|
||||
|
||||
139
src/debug.c
139
src/debug.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 1997-2021 proton
|
||||
Copyright (c) 1997-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -108,59 +108,68 @@ LS const struct
|
||||
#endif
|
||||
{ NULL, }};
|
||||
|
||||
#define CORE_SE ,"CORE"
|
||||
#define CFG1_SE ,"CFG1"
|
||||
#define CMD1_SE ,"CMD1"
|
||||
#define INIT_SE ,"INIT"
|
||||
#define RARE_SE ,"RARE"
|
||||
#define DBUG_SE ,"DBUG"
|
||||
|
||||
LS struct
|
||||
{
|
||||
void *func;
|
||||
char *name;
|
||||
char segment[5];
|
||||
int num;
|
||||
int size;
|
||||
int mall_size;
|
||||
|
||||
} ProcList[] =
|
||||
{
|
||||
{ SockConnect, "SockConnect" },
|
||||
{ add_bot, "add_bot" },
|
||||
{ add_server, "add_server" },
|
||||
{ SockConnect, "SockConnect" CORE_SE },
|
||||
{ add_bot, "add_bot" CFG1_SE },
|
||||
{ add_server, "add_server" CFG1_SE },
|
||||
{ add_shit, "add_shit" },
|
||||
{ add_user, "add_user" },
|
||||
{ addtouser, "addtouser" },
|
||||
{ cfg_opt, "cfg_opt" },
|
||||
{ cfg_pass, "cfg_pass" },
|
||||
{ cfg_user, "cfg_user" },
|
||||
{ addtouser, "addtouser" CORE_SE },
|
||||
{ cfg_opt, "cfg_opt" CFG1_SE },
|
||||
{ cfg_pass, "cfg_pass" CFG1_SE },
|
||||
{ cfg_user, "cfg_user" CFG1_SE },
|
||||
{ change_authnick, "change_authnick" },
|
||||
{ ctcp_dcc, "ctcp_dcc" },
|
||||
{ copy_vars, "copy_vars" },
|
||||
{ dcc_chat, "dcc_chat" },
|
||||
{ do_die, "do_die" },
|
||||
{ do_nick, "do_nick" },
|
||||
{ do_kicksay, "do_kicksay" },
|
||||
{ do_servergroup, "do_servergroup" },
|
||||
{ do_set, "do_set" },
|
||||
{ do_spy, "do_spy" },
|
||||
{ join_channel, "join_channel" },
|
||||
{ copy_vars, "copy_vars" CFG1_SE },
|
||||
{ dcc_chat, "dcc_chat" CMD1_SE },
|
||||
{ do_die, "do_die" RARE_SE },
|
||||
{ do_nick, "do_nick" CMD1_SE },
|
||||
{ do_kicksay, "do_kicksay" CMD1_SE },
|
||||
{ do_servergroup, "do_servergroup" CMD1_SE },
|
||||
{ do_set, "do_set" CMD1_SE },
|
||||
{ do_spy, "do_spy" CMD1_SE },
|
||||
{ join_channel, "join_channel" CFG1_SE },
|
||||
{ killsock, "killsock" },
|
||||
{ make_auth, "make_auth" },
|
||||
{ make_ban, "make_ban" },
|
||||
{ make_chanuser, "make_chanuser" },
|
||||
{ make_ireq, "make_ireq" },
|
||||
{ make_strp, "make_strp" },
|
||||
{ mirror_user, "mirror_user" },
|
||||
{ on_join, "on_join" },
|
||||
{ on_kick, "on_kick" },
|
||||
{ on_mode, "on_mode" },
|
||||
{ on_msg, "on_msg" },
|
||||
{ on_nick, "on_nick" },
|
||||
{ make_ireq, "make_ireq" CMD1_SE },
|
||||
{ make_strp, "make_strp" CORE_SE },
|
||||
{ mirror_user, "mirror_user" CORE_SE },
|
||||
{ on_join, "on_join" CORE_SE },
|
||||
{ on_kick, "on_kick" CORE_SE },
|
||||
{ on_mode, "on_mode" CORE_SE },
|
||||
{ on_msg, "on_msg" CORE_SE },
|
||||
{ on_nick, "on_nick" CORE_SE },
|
||||
{ parse_311, "parse_311" },
|
||||
{ randstring_getline, "randstring_getline" },
|
||||
{ randstring_getline, "randstring_getline" CMD1_SE },
|
||||
{ readcfgfile, "readcfgfile" },
|
||||
{ recover_client, "recover_client" INIT_SE },
|
||||
{ reverse_topic, "reverse_topic" },
|
||||
{ to_user, "to_user" },
|
||||
{ to_user_q, "to_user_q" },
|
||||
{ send_kick, "send_kick" },
|
||||
{ send_mode, "send_mode" },
|
||||
{ set_str_varc, "set_str_varc" },
|
||||
{ set_str_varc, "set_str_varc" CFG1_SE },
|
||||
{ setbotnick, "setbotnick" },
|
||||
{ sig_hup, "sig_hup" },
|
||||
{ sig_hup, "sig_hup" RARE_SE },
|
||||
{ table_buffer, "table_buffer" },
|
||||
#ifdef ALIAS
|
||||
{ do_alias, "do_alias" },
|
||||
@ -187,7 +196,7 @@ LS struct
|
||||
#endif /* HOSTINFO */
|
||||
#ifdef NOTE
|
||||
{ catch_note, "catch_note" },
|
||||
{ do_note, "do_note" },
|
||||
{ do_note, "do_note" CMD1_SE },
|
||||
#endif /* NOTE */
|
||||
#ifdef NOTIFY
|
||||
{ catch_whois, "catch_whois" },
|
||||
@ -201,10 +210,10 @@ LS struct
|
||||
#ifdef RAWDNS
|
||||
{ rawdns, "rawdns" },
|
||||
{ parse_query, "parse_query" },
|
||||
{ read_dnsroot, "read_dnsroot" },
|
||||
{ read_dnsroot, "read_dnsroot" CFG1_SE },
|
||||
#endif /* RAWDNS */
|
||||
#ifdef REDIRECT
|
||||
{ begin_redirect, "begin_redirect" },
|
||||
{ begin_redirect, "begin_redirect" CORE_SE },
|
||||
#endif /* REDIRECT */
|
||||
#ifdef SEEN
|
||||
{ make_seen, "make_seen" },
|
||||
@ -219,19 +228,19 @@ LS struct
|
||||
{ check_telnet, "check_telnet" },
|
||||
#endif /* TELNET */
|
||||
#ifdef TOYBOX
|
||||
{ read_bigcharset_callback, "read_bigcharset_callback" },
|
||||
{ read_bigcharset_callback, "read_bigcharset_callback" CMD1_SE },
|
||||
#endif /* TOYBOX */
|
||||
#ifdef TRIVIA
|
||||
{ trivia_check, "trivia_check" },
|
||||
{ trivia_question, "trivia_question" },
|
||||
{ trivia_score_callback, "trivia_score_callback" },
|
||||
{ trivia_check, "trivia_check" CMD1_SE },
|
||||
{ trivia_question, "trivia_question" CMD1_SE },
|
||||
{ trivia_score_callback, "trivia_score_callback" CMD1_SE },
|
||||
#endif /* TRIVIA */
|
||||
#ifdef UPTIME
|
||||
{ init_uptime, "init_uptime" },
|
||||
{ send_uptime, "send_uptime" },
|
||||
{ init_uptime, "init_uptime" CFG1_SE },
|
||||
{ send_uptime, "send_uptime" CORE_SE },
|
||||
#endif /* UPTIME */
|
||||
#ifdef URLCAPTURE
|
||||
{ urlcapture, "urlcapture" },
|
||||
{ urlcapture, "urlcapture" CORE_SE },
|
||||
#endif /* URLCAPTURE */
|
||||
{ 0, "(unknown)" },
|
||||
{ NULL, }};
|
||||
@ -445,6 +454,42 @@ const char *proc_lookup(void *addr, int size)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void proc_list(void)
|
||||
{
|
||||
int i,sel;
|
||||
void *a,*b,*l;
|
||||
|
||||
a = l = NULL;
|
||||
|
||||
do
|
||||
{
|
||||
b = NULL;
|
||||
for(i=0;ProcList[i].name;i++)
|
||||
{
|
||||
if ((ProcList[i].func > a) && ((b == NULL) || (ProcList[i].func < b)))
|
||||
{
|
||||
b = ProcList[i].func;
|
||||
sel = i;
|
||||
}
|
||||
}
|
||||
if (b)
|
||||
{
|
||||
if (l == NULL)
|
||||
l = b;
|
||||
if (strlen(ProcList[sel].name) < 14)
|
||||
a = "\t\t";
|
||||
else
|
||||
if (strlen(ProcList[sel].name) < 20)
|
||||
a = "\t";
|
||||
else
|
||||
a = " ";
|
||||
debug("; %s%s"mx_pfmt" (+%i) [%s]\n",ProcList[sel].name,a,b,b-l,ProcList[sel].segment);
|
||||
a = b;
|
||||
}
|
||||
}
|
||||
while (b);
|
||||
}
|
||||
|
||||
char *atime(time_t when)
|
||||
{
|
||||
char *pt,*zp;
|
||||
@ -573,6 +618,9 @@ void debug_memory(void)
|
||||
#ifdef ALIAS
|
||||
Alias *alias;
|
||||
#endif /* ALIAS */
|
||||
#ifdef URLCAPTURE
|
||||
Strp *sp;
|
||||
#endif /* URLCAPTURE */
|
||||
Chan *chan;
|
||||
Mech *bot;
|
||||
aMEA *mea;
|
||||
@ -588,6 +636,12 @@ void debug_memory(void)
|
||||
memtouch(alias->format);
|
||||
}
|
||||
#endif /* ALIAS */
|
||||
#ifdef URLCAPTURE
|
||||
for(sp=urlhistory;sp;sp=sp->next)
|
||||
{
|
||||
memtouch(sp);
|
||||
}
|
||||
#endif /* URLCAPTURE */
|
||||
for(bot=botlist;bot;bot=bot->next)
|
||||
{
|
||||
for(i=CHANSET_SIZE;VarName[i].name;i++)
|
||||
@ -607,6 +661,7 @@ void debug_memory(void)
|
||||
{
|
||||
memtouch(bot->lastcmds[i]);
|
||||
}
|
||||
memtouch(bot->userhost);
|
||||
}
|
||||
debug("> Memory allocations\n");
|
||||
for(mea=mrrec;(mea);mea=mea->next)
|
||||
@ -737,7 +792,10 @@ void debug_botnet(void)
|
||||
debug(" ; lsid\t\t%i\n",bn->lsid);
|
||||
debug(" ; rsid\t\t%i\n",bn->rsid);
|
||||
debug(" ; opt.pta\t\t%s\n",boolstr(bn->opt.pta));
|
||||
if (bn->controller)
|
||||
debug(" ; controller\t\t"mx_pfmt" { guid = %i }\n",(mx_ptr)bn->controller,bn->controller->guid);
|
||||
else
|
||||
debug(" ; controller\t\tnot set (NULL)\n");
|
||||
debug(" ; when\t\t%s (%lu)\n",atime(bn->when),bn->when);
|
||||
debug(" > botinfo\t\t"mx_pfmt"\n",(mx_ptr)bn->botinfo);
|
||||
debug_botinfo(bn->botinfo);
|
||||
@ -789,7 +847,7 @@ void debug_core(void)
|
||||
debug("> StructList\n");
|
||||
for(i=0;StructList[i].name;i++)
|
||||
{
|
||||
debug(" ; %s\t\t%i\n",StructList[i].name,StructList[i].size);
|
||||
debug(" ; %s\t%s%i\n",StructList[i].name,(strlen(StructList[i].name) < 12) ? "\t" : "",StructList[i].size);
|
||||
}
|
||||
debug(" ; ---\n");
|
||||
if (current)
|
||||
@ -1356,6 +1414,9 @@ void run_debug(void)
|
||||
#endif /* SCRIPTING */
|
||||
|
||||
debug_memory();
|
||||
debug("> functions\n");
|
||||
proc_list();
|
||||
debug("; ---\n");
|
||||
}
|
||||
|
||||
int wrap_debug(void)
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#ifndef TEST
|
||||
|
||||
LS char timebuf[24]; /* max format lentgh == 20+1, round up to nearest longword -> 24 */
|
||||
LS char idlestr[36]; /* max format lentgh == 24+1, round up to nearest longword -> 28 */
|
||||
LS char timebuf[32]; /* max format lentgh == 20+1, round up to 32 */
|
||||
LS char idlestr[36]; /* max format lentgh == 24+1, round up to 36 */
|
||||
LS const char monlist[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
|
||||
LS const char daylist[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 1997-2020 proton
|
||||
Copyright (c) 1997-2025 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -70,6 +70,7 @@ struct
|
||||
{ 0, "RAND", "do_rand", 0 | CBANG | SUPRES },
|
||||
#endif /* TOYBOX */
|
||||
{ 0, "CV", "do_convert", 0 | CBANG | SUPRES },
|
||||
{ 0, "CALC", "do_calc", 0 | CBANG | SUPRES },
|
||||
|
||||
/*
|
||||
* Level 10
|
||||
@ -238,7 +239,7 @@ struct
|
||||
* Level 100
|
||||
*/
|
||||
#ifdef HOSTINFO
|
||||
{ 0, "HOSTINFO", "do_hostinfo", 100 | CCPW | GAXS },
|
||||
{ 0, "SYSINFO", "do_sysinfo", 100 | CCPW | GAXS },
|
||||
{ 0, "MEMINFO", "do_meminfo", 100 | CCPW | GAXS },
|
||||
{ 0, "CPUINFO", "do_cpuinfo", 100 | CCPW | GAXS },
|
||||
{ 0, "FILEMON", "do_filemon", 100 | CCPW | GAXS | CARGS },
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 1997-2018 proton
|
||||
Copyright (c) 1997-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -42,8 +42,8 @@
|
||||
#define DEFAULTCMDCHAR '-'
|
||||
#define MECHUSERLOGIN "v3.energymech.net"
|
||||
|
||||
BEG const char VERSION[] MDEF("3.1p" GITHASH);
|
||||
BEG const char SRCDATE[] MDEF("April 14th, 2018");
|
||||
BEG const char VERSION[] MDEF("3.2p" GITHASH);
|
||||
BEG const char SRCDATE[] MDEF("May 13th, 2024");
|
||||
#ifdef __CYGWIN__
|
||||
BEG const char BOTCLASS[] MDEF("WinMech");
|
||||
#else /* ! CYGWIN */
|
||||
|
||||
595
src/h.h
595
src/h.h
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 1997-2020 proton
|
||||
Copyright (c) 1997-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -110,110 +110,111 @@
|
||||
|
||||
/* alias.c */
|
||||
|
||||
LS void afmt(char *, const char *, const char *) __page(CORE_SEG);
|
||||
LS void do_alias(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_unalias(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void afmt(char *, const char *, const char *) __page(CORE_SEG);
|
||||
LS void do_alias(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_unalias(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* auth.c */
|
||||
|
||||
LS char *cipher(char *);
|
||||
LS char *makepass(char *);
|
||||
LS int passmatch(char *, char *);
|
||||
LS void delete_auth(char *);
|
||||
LS void remove_auth(Auth *);
|
||||
LS void change_authnick(char *, char *);
|
||||
LS void aucheck(User *);
|
||||
LS User *get_authuser(const char *, const char *) __page(CORE_SEG);
|
||||
LS int get_authaccess(const char *, const char *) __page(CORE_SEG);
|
||||
LS int make_auth(const char *, const User *);
|
||||
LS void do_auth(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS char *cipher(char *) __page(CMD1_SEG);
|
||||
LS char *makepass(char *) __page(CMD1_SEG);
|
||||
LS int passmatch(char *, char *) __page(CMD1_SEG);
|
||||
LS void delete_auth(char *) __page(CMD1_SEG);
|
||||
LS void remove_auth(Auth *) __page(CMD1_SEG);
|
||||
LS void change_authnick(char *, char *) __page(CORE_SEG);
|
||||
LS void aucheck(User *) __page(CORE_SEG);
|
||||
LS User *get_authuser(const char *, const char *) __page(CORE_SEG);
|
||||
LS int get_authaccess(const char *, const char *) __page(CORE_SEG);
|
||||
LS int make_auth(const char *, const User *) __page(CMD1_SEG);
|
||||
LS void do_auth(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* bounce.c */
|
||||
|
||||
void bounce_parse(ircLink *, char *);
|
||||
void bounce_cleanup(void);
|
||||
void new_port_bounce(const struct Setting *);
|
||||
void select_bounce(void);
|
||||
void process_bounce(void);
|
||||
void select_bounce(void) __page(CORE_SEG);
|
||||
void process_bounce(void) __page(CORE_SEG);
|
||||
|
||||
/* calc.c */
|
||||
|
||||
LS void do_convert(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_convert(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_calc(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* channel.c */
|
||||
|
||||
void check_idlekick(void);
|
||||
LS Chan *find_channel(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
LS Chan *find_channel_ac(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS Chan *find_channel_ny(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
void remove_chan(Chan *);
|
||||
void join_channel(char *, char *);
|
||||
void reverse_topic(Chan *, char *, char *);
|
||||
void cycle_channel(Chan *);
|
||||
int reverse_mode(char *, Chan *, int, int);
|
||||
void chan_modestr(Chan *, char *);
|
||||
char *find_nuh(char *);
|
||||
LS Chan *find_channel(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
LS Chan *find_channel_ac(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS Chan *find_channel_ny(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
void remove_chan(Chan *) __page(CMD1_SEG);
|
||||
void join_channel(char *, char *) __page(CFG1_SEG);
|
||||
void reverse_topic(Chan *, char *, char *) __page(CORE_SEG);
|
||||
void cycle_channel(Chan *) __page(CMD1_SEG);
|
||||
int reverse_mode(char *, Chan *, int, int) __page(CORE_SEG);
|
||||
void chan_modestr(Chan *, char *) __page(CORE_SEG);
|
||||
char *find_nuh(char *) __page(CORE_SEG);
|
||||
Ban *make_ban(Ban **, char *, char *, time_t);
|
||||
void delete_ban(Chan *, char *);
|
||||
void delete_modemask(Chan *, char *, int);
|
||||
void channel_massmode(const Chan *, char *, int, char, char);
|
||||
void channel_massunban(Chan *, char *, time_t);
|
||||
LS ChanUser *find_chanuser(Chan *, const char *);
|
||||
LS ChanUser *find_chanbot(Chan *, const char *);
|
||||
LS void remove_chanuser(Chan *, const char *);
|
||||
LS void make_chanuser(char *, char *);
|
||||
LS void purge_chanusers(Chan *);
|
||||
LS char *get_nuh(const ChanUser *);
|
||||
LS void do_join(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_part(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_cycle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_forget(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_channels(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_wall(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_mode(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_names(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_cchan(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_invite(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_sayme(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_who(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_topic(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_showidle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_idle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS ChanUser *find_chanuser(Chan *, const char *) __page(CORE_SEG);
|
||||
LS ChanUser *find_chanbot(Chan *, const char *) __page(CORE_SEG);
|
||||
LS void remove_chanuser(Chan *, const char *) __page(CORE_SEG);
|
||||
LS void make_chanuser(char *, char *) __page(CORE_SEG);
|
||||
LS void purge_chanusers(Chan *) __page(CMD1_SEG);
|
||||
LS char *get_nuh(const ChanUser *) __page(CORE_SEG);
|
||||
LS void do_join(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_part(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_cycle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_forget(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_channels(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_wall(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_mode(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_names(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_cchan(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_invite(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_sayme(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_who(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_topic(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_showidle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_idle(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* core.c */
|
||||
|
||||
void unlink_identfile(void);
|
||||
int conf_callback(char *line);
|
||||
void readcfgfile(void);
|
||||
int write_session(void);
|
||||
void setbotnick(Mech *bot, char *nick);
|
||||
Mech *add_bot(int guid, char *nick);
|
||||
void signoff(char *from, char *reason);
|
||||
int conf_callback(char *line) __page(CFG1_SEG);
|
||||
void readcfgfile(void) __page(CFG1_SEG);
|
||||
int write_session(void) __page(CORE_SEG);
|
||||
void setbotnick(Mech *bot, char *nick) __page(CFG1_SEG);
|
||||
Mech *add_bot(int guid, char *nick) __page(CFG1_SEG);
|
||||
void signoff(char *from, char *reason) __page(RARE_SEG);
|
||||
void kill_all_bots(char *reason) __attr(RARE_SEG, __noreturn__);;
|
||||
Server *add_server(char *host, int port, char *pass);
|
||||
Server *add_server(char *host, int port, char *pass) __page(CFG1_SEG);
|
||||
ServerGroup *getservergroup(const char *name);
|
||||
ServerGroup *getservergroupid(int id);
|
||||
Server *find_server(int id);
|
||||
int try_server(Server *sp, char *hostname);
|
||||
void connect_to_server(void);
|
||||
void register_with_server(void);
|
||||
int sub_compile_timer(int, uint32_t *, uint32_t *, char *);
|
||||
int compile_timer(HookTimer *, char *);
|
||||
void update(SequenceTime *this);
|
||||
void process_server_input(void);
|
||||
void do_version(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_core(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_die(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void do_shutdown(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void do_servergroup(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_server(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cserv(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_away(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_do(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_nick(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_time(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_upontime(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_msg(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
Server *find_server(int id) __page(CORE_SEG);
|
||||
int try_server(Server *sp, char *hostname) __page(CORE_SEG);
|
||||
void connect_to_server(void) __page(CORE_SEG);
|
||||
void register_with_server(void) __page(CORE_SEG);
|
||||
int sub_compile_timer(int, uint32_t *, uint32_t *, char *) __page(CFG1_SEG);
|
||||
int compile_timer(HookTimer *, char *) __page(CFG1_SEG);
|
||||
void update(SequenceTime *this) __page(CORE_SEG);
|
||||
void process_server_input(void) __page(CORE_SEG);
|
||||
void do_version(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_core(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_die(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void do_shutdown(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void do_servergroup(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_server(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cserv(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_away(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_do(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_nick(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_time(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_upontime(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_msg(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* ctcp.c */
|
||||
|
||||
@ -223,14 +224,14 @@ int dcc_sendfile(char *target, char *filename);
|
||||
void dcc_pushfile(Client *client, off_t where);
|
||||
int dcc_freeslots(int uaccess);
|
||||
void parse_dcc(Client *client);
|
||||
void process_dcc(void);
|
||||
void ctcp_dcc(char *from, char *to, char *rest);
|
||||
void ctcp_finger(char *from, char *to, char *rest);
|
||||
void ctcp_ping(char *from, char *to, char *rest);
|
||||
void ctcp_version(char *from, char *to, char *rest);
|
||||
void on_ctcp(char *from, char *to, char *rest);
|
||||
void do_ping_ctcp(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_send(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void process_dcc(void) __page(CORE_SEG);
|
||||
void ctcp_dcc(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
void ctcp_finger(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
void ctcp_ping(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
void ctcp_version(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
void on_ctcp(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
void do_ping_ctcp(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_send(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* debug.c */
|
||||
|
||||
@ -252,93 +253,93 @@ char *uint32tobin(int limit, uint32_t x);
|
||||
void debug_scripthook(void);
|
||||
void run_debug(void);
|
||||
int wrap_debug(void);
|
||||
void do_debug(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_crash(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void debug(char *format, ...);
|
||||
void do_debug(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_crash(COMMAND_ARGS) __page(RARE_SEG);
|
||||
void debug(char *format, ...) __page(CORE_SEG);
|
||||
|
||||
/* dns.c */
|
||||
|
||||
void init_rawdns(void);
|
||||
void init_rawdns(void) __page(CFG1_SEG);
|
||||
struct in_addr dnsroot_lookup(const char *hostname);
|
||||
const char *get_dns_token(const char *src, const char *packet, char *dst, int sz);
|
||||
int make_query(char *packet, const char *hostname);
|
||||
struct in_addr *get_stored_ip(const char *ipdata);
|
||||
void dns_hook(char *host, char * resolved);
|
||||
void parse_query(int psz, dnsQuery *query);
|
||||
void rawdns(const char *hostname);
|
||||
void select_rawdns(void);
|
||||
void process_rawdns(void);
|
||||
char *poll_rawdns(char *hostname);
|
||||
int read_dnsroot(char *line);
|
||||
void rawdns(const char *hostname) __page(CORE_SEG);
|
||||
void select_rawdns(void) __page(CORE_SEG);
|
||||
void process_rawdns(void) __page(CORE_SEG);
|
||||
char *poll_rawdns(char *hostname) __page(CORE_SEG);
|
||||
int read_dnsroot(char *line) __page(CFG1_SEG);
|
||||
uint32_t rawdns_get_ip(const char *host);
|
||||
void do_dnsroot(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_dnsserver(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_dns(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_dnsroot(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_dnsserver(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_dns(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* dynamode.c */
|
||||
/* function.c */
|
||||
|
||||
LS void *Calloc(int) __attr(CORE_SEG, __regparm(1));
|
||||
LS void Free(char **) __attr(CORE_SEG, __regparm(1));
|
||||
LS Strp *make_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS Strp *append_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS Strp *prepend_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void purge_linklist(void **) __attr(CORE_SEG, __regparm(1));
|
||||
LS void dupe_strp(Strp *, Strp **) __attr(CORE_SEG, __regparm(2));
|
||||
LS const int StrlenX(const char *, ...) __attr(CORE_SEG, __regparm(1));
|
||||
LS const int Strlen2(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *getuh(char *) __page(CORE_SEG);
|
||||
LS char *get_token(char **, const char *) __page(CORE_SEG);
|
||||
LS char *logtime(time_t) __page(CORE_SEG);
|
||||
LS char *time2str(time_t) __page(CORE_SEG);
|
||||
LS char *time2away(time_t) __page(CORE_SEG);
|
||||
LS char *time2medium(time_t) __page(CORE_SEG);
|
||||
LS char *time2small(time_t) __page(CORE_SEG);
|
||||
LS char *idle2str(time_t, int) __page(CORE_SEG);
|
||||
LS const char *get_channel(const char *, char **) __page(CORE_SEG);
|
||||
LS const char *get_channel2(const char *, char **) __page(CORE_SEG);
|
||||
LS char *cluster(char *) __page(CORE_SEG);
|
||||
LS char *format_uh(char *, int) __page(CORE_SEG);
|
||||
LS char *nick2uh(char *, char *) __page(CORE_SEG);
|
||||
LS void deop_ban(Chan *, ChanUser *, char *) __page(CORE_SEG);
|
||||
LS void deop_siteban(Chan *, ChanUser *) __page(CORE_SEG);
|
||||
LS void screwban_format(char *) __page(CORE_SEG);
|
||||
LS void deop_screwban(Chan *, ChanUser *) __page(CORE_SEG);
|
||||
LS int is_nick(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS int asc2int(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS int get_number(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS void fix_config_line(char *) __page(CFG1_SEG);
|
||||
LS int matches(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int num_matches(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void table_buffer(const char *, ...) __page(CMD1_SEG);
|
||||
LS void table_send(const char *, const int) __page(CMD1_SEG);
|
||||
LS int is_safepath(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
LS void *Calloc(int) __attr(CORE_SEG, __regparm(1));
|
||||
LS void Free(char **) __attr(CORE_SEG, __regparm(1));
|
||||
LS Strp *make_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS Strp *append_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS Strp *prepend_strp(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void purge_linklist(void **) __attr(CORE_SEG, __regparm(1));
|
||||
LS void dupe_strp(Strp *, Strp **) __attr(CORE_SEG, __regparm(2));
|
||||
LS const int StrlenX(const char *, ...) __attr(CORE_SEG, __regparm(1));
|
||||
LS const int Strlen2(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *getuh(char *) __page(CORE_SEG);
|
||||
LS char *get_token(char **, const char *) __page(CORE_SEG);
|
||||
LS char *logtime(time_t) __page(CORE_SEG);
|
||||
LS char *time2str(time_t) __page(CORE_SEG);
|
||||
LS char *time2away(time_t) __page(CORE_SEG);
|
||||
LS char *time2medium(time_t) __page(CORE_SEG);
|
||||
LS char *time2small(time_t) __page(CORE_SEG);
|
||||
LS char *idle2str(time_t, int) __page(CORE_SEG);
|
||||
LS const char *get_channel(const char *, char **) __page(CORE_SEG);
|
||||
LS const char *get_channel2(const char *, char **) __page(CORE_SEG);
|
||||
LS char *cluster(char *) __page(CORE_SEG);
|
||||
LS char *format_uh(char *, int) __page(CORE_SEG);
|
||||
LS char *nick2uh(char *, char *) __page(CORE_SEG);
|
||||
LS void deop_ban(Chan *, ChanUser *, char *) __page(CORE_SEG);
|
||||
LS void deop_siteban(Chan *, ChanUser *) __page(CORE_SEG);
|
||||
LS void screwban_format(char *) __page(CORE_SEG);
|
||||
LS void deop_screwban(Chan *, ChanUser *) __page(CORE_SEG);
|
||||
LS int is_nick(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS int asc2int(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS int get_number(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS void fix_config_line(char *) __page(CFG1_SEG);
|
||||
LS int matches(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int num_matches(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void table_buffer(const char *, ...) __page(CMD1_SEG);
|
||||
LS void table_send(const char *, const int) __page(CMD1_SEG);
|
||||
LS int is_safepath(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
|
||||
/* greet.c */
|
||||
|
||||
void greet(void);
|
||||
void do_greet(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void greet(void) __page(CORE_SEG);
|
||||
void do_greet(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* help.c */
|
||||
|
||||
void print_help(char *from, char *line, int len);
|
||||
int do_help_callback(char *line);
|
||||
void usage_command(char *to, const char *arg);
|
||||
void usage(char *to);
|
||||
void do_help(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_usage(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void print_help(char *from, char *line, int len) __page(CMD1_SEG);
|
||||
int do_help_callback(char *line) __page(CMD1_SEG);
|
||||
void usage_command(char *to, const char *arg) __page(CMD1_SEG);
|
||||
void usage(char *to) __page(CMD1_SEG);
|
||||
void do_help(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_usage(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* hostinfo.c */
|
||||
|
||||
int monitor_fs(const char *);
|
||||
void select_monitor();
|
||||
void process_monitor();
|
||||
int parse_proc_status(char *line) __page(CMD1_SEG);
|
||||
int parse_proc_cpuinfo(char *line) __page(CMD1_SEG);
|
||||
void do_hostinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_meminfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cpuinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_filemon(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void select_monitor() __page(CORE_SEG);
|
||||
void process_monitor() __page(CORE_SEG);
|
||||
int parse_proc_status(char *line) __page(CMD1_SEG);
|
||||
int parse_proc_cpuinfo(char *line) __page(CMD1_SEG);
|
||||
void do_sysinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_meminfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cpuinfo(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_filemon(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* io.c */
|
||||
|
||||
@ -348,23 +349,23 @@ LS int SockOpts(void) __page(CORE_SEG);
|
||||
LS int SockListener(int) __page(CORE_SEG);
|
||||
LS int SockConnect(char *, int, int) __page(CORE_SEG);
|
||||
LS int SockAccept(int) __page(CORE_SEG);
|
||||
int to_file(int sock, const char *format, ...);
|
||||
void to_server(char *format, ...);
|
||||
void to_user_q(const char *, const char *, ...);
|
||||
void to_user(const char *, const char *, ...);
|
||||
char *sockread(int, char *, char *);
|
||||
void readline(int, int (*)(char *));
|
||||
int to_file(const int sock, const char *format, ...) __page(CORE_SEG);
|
||||
void to_server(char *format, ...) __page(CORE_SEG);
|
||||
void to_user_q(const char *, const char *, ...) __page(CMD1_SEG);
|
||||
void to_user(const char *, const char *, ...) __page(CORE_SEG);
|
||||
char *sockread(int, char *, char *) __page(CORE_SEG);
|
||||
void readline(int, int (*)(char *)) __page(CMD1_SEG);
|
||||
void remove_ks(KillSock *);
|
||||
int killsock(int);
|
||||
LS void do_clearqueue(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* irc.c */
|
||||
|
||||
LS void make_ireq(int, const char *, const char *) __page(CMD1_SEG);
|
||||
LS void make_ireq(int, const char *, const char *) __page(CMD1_SEG);
|
||||
void send_pa(int type, const char *nick, const char *format, ...);
|
||||
void do_irclusers(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_ircstats(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_ircwhois(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_irclusers(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_ircstats(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_ircwhois(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* kicksay.c */
|
||||
|
||||
@ -372,53 +373,53 @@ KickSay *find_kicksay(char *text, char *channel);
|
||||
void check_kicksay(Chan *chan, ChanUser *doer, char *text);
|
||||
void remove_kicksay(KickSay *kick);
|
||||
void purge_kicklist(void);
|
||||
void do_kicksay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_rkicksay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_kicksay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_rkicksay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* lib/string.c */
|
||||
|
||||
LS char *chop(char **) __attr(CORE_SEG, __regparm(1));
|
||||
LS void unchop(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int stringcasecmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int stringcmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int nickcmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *nickcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void stringcpy_n(char *, const char *, int) __attr(CORE_SEG, __regparm(3));
|
||||
LS char *stringcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *stringchr(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *stringdup(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS char *stringcat(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *tolowercat(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *chop(char **) __attr(CORE_SEG, __regparm(1));
|
||||
LS void unchop(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int stringcasecmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int stringcmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS int nickcmp(const char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *nickcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS void stringcpy_n(char *, const char *, int) __attr(CORE_SEG, __regparm(3));
|
||||
LS char *stringcpy(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *stringchr(const char *, int) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *stringdup(const char *) __attr(CORE_SEG, __regparm(1));
|
||||
LS char *stringcat(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
LS char *tolowercat(char *, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
|
||||
/* main.c */
|
||||
|
||||
void mech_exec(void);
|
||||
int randstring_count(char *line);
|
||||
int randstring_getline(char *line);
|
||||
LS char *randstring(const char *) __page(CORE_SEG);
|
||||
LS int sig_hup_callback(char *) __page(RARE_SEG); /* rare */
|
||||
LS void do_sighup(void) __page(CMD1_SEG);
|
||||
LS void sig_hup(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_child(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_alrm(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_pipe(int) __page(CORE_SEG);
|
||||
LS void do_sigusr1(void) __page(CMD1_SEG);
|
||||
LS void sig_usr1(int) __page(CMD1_SEG);
|
||||
LS void sig_usr2(int) __page(DBUG_SEG); /* DEBUG */
|
||||
LS void sig_suicide() __attr(RARE_SEG, __noreturn__); /* rare */
|
||||
LS void do_sigint(void) __page(RARE_SEG); /* rare */
|
||||
LS void sig_int(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_ill(int) __page(RARE_SEG);
|
||||
LS void sig_abrt(int) __page(RARE_SEG);
|
||||
LS void sig_bus(int) __page(CMD1_SEG);
|
||||
void mech_exec(void) __page(RARE_SEG);
|
||||
int randstring_count(char *line) __page(CMD1_SEG);
|
||||
int randstring_getline(char *line) __page(CMD1_SEG);
|
||||
LS char *randstring(const char *) __page(CORE_SEG);
|
||||
LS int sig_hup_callback(char *) __page(RARE_SEG); /* rare */
|
||||
LS void do_sighup(void) __page(CMD1_SEG);
|
||||
LS void sig_hup(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_child(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_alrm(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_pipe(int) __page(CORE_SEG);
|
||||
LS void do_sigusr1(void) __page(CMD1_SEG);
|
||||
LS void sig_usr1(int) __page(CMD1_SEG);
|
||||
LS void sig_usr2(int) __page(DBUG_SEG); /* DEBUG */
|
||||
LS void sig_suicide() __attr(RARE_SEG, __noreturn__); /* rare */
|
||||
LS void do_sigint(void) __page(RARE_SEG); /* rare */
|
||||
LS void sig_int(int) __page(RARE_SEG); /* rare */
|
||||
LS void sig_ill(int) __page(RARE_SEG);
|
||||
LS void sig_abrt(int) __page(RARE_SEG);
|
||||
LS void sig_bus(int) __page(CMD1_SEG);
|
||||
#if defined(__linux__) && defined(__x86_64__) && defined(DEBUG) && !defined(__STRICT_ANSI__)
|
||||
LS void sig_segv(int, siginfo_t *, void *) __attr(RARE_SEG, __noreturn__);
|
||||
LS void sig_segv(int, siginfo_t *, void *) __attr(RARE_SEG, __noreturn__);
|
||||
#else
|
||||
LS void sig_segv(int) __attr(RARE_SEG, __noreturn__);
|
||||
LS void sig_segv(int) __attr(RARE_SEG, __noreturn__);
|
||||
#endif
|
||||
LS void sig_term(int) __attr(RARE_SEG, __noreturn__); /* rare */
|
||||
LS void doit(void);
|
||||
LS int main(int argc, char **argv, char **envp);
|
||||
LS void sig_term(int) __attr(RARE_SEG, __noreturn__); /* rare */
|
||||
LS void doit(void) __page(CORE_SEG);
|
||||
LS int main(int argc, char **argv, char **envp) __page(INIT_SEG);
|
||||
|
||||
/* net.c */
|
||||
|
||||
@ -441,7 +442,7 @@ void basicBanner(BotNet *bn, char *rest);
|
||||
void basicLink(BotNet *bn, char *version);
|
||||
void basicQuit(BotNet *bn, char *rest);
|
||||
LS void netchanNeedop(BotNet *source, char *rest);
|
||||
LS void netchanSuppress(BotNet *, char *) __page(CORE_SEG);
|
||||
LS void netchanSuppress(BotNet *, char *) __page(CORE_SEG);
|
||||
void partyAuth(BotNet *bn, char *rest);
|
||||
int commandlocal(int dg, int sg, char *from, char *command);
|
||||
void partyCommand(BotNet *bn, char *rest);
|
||||
@ -451,16 +452,16 @@ void ushareTick(BotNet *bn, char *rest);
|
||||
void ushareDelete(BotNet *bn, char *rest);
|
||||
void parse_botnet(BotNet *bn, char *rest);
|
||||
void botnet_newsock(void);
|
||||
void select_botnet(void);
|
||||
void process_botnet(void);
|
||||
void do_link(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cmd(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void select_botnet(void) __page(CORE_SEG);
|
||||
void process_botnet(void) __page(CORE_SEG);
|
||||
void do_link(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_cmd(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* note.c */
|
||||
|
||||
int catch_note(char *from, char *to, char *rest);
|
||||
void do_note(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_read(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_note(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_read(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* notify.c */
|
||||
|
||||
@ -477,37 +478,37 @@ int read_notify(char *filename);
|
||||
void nfshow_brief(Notify *nf);
|
||||
void nfshow_full(Notify *nf);
|
||||
void sub_notifynick(char *from, char *rest);
|
||||
void do_notify(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_notify(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* ons.c */
|
||||
|
||||
LS uint32_t makecrc(const char *) __page(CORE_SEG);
|
||||
LS void send_suppress(const char *, const char *) __page(CORE_SEG);
|
||||
LS void on_kick(char *from, char *rest);
|
||||
LS void on_join(Chan *chan, char *from);
|
||||
LS void on_nick(char *from, char *newnick);
|
||||
LS void on_msg(char *from, char *to, char *rest);
|
||||
LS void on_mode(char *from, char *channel, char *rest);
|
||||
LS void common_public(Chan *chan, char *from, char *spyformat, char *rest);
|
||||
LS void on_action(char *from, char *to, char *rest);
|
||||
LS int access_needed(char *name);
|
||||
LS void do_chaccess(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_last(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS uint32_t makecrc(const char *) __page(CORE_SEG);
|
||||
LS void send_suppress(const char *, const char *) __page(CORE_SEG);
|
||||
LS void on_kick(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void on_join(Chan *chan, char *from) __page(CORE_SEG);
|
||||
LS void on_nick(char *from, char *newnick) __page(CORE_SEG);
|
||||
LS void on_msg(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
LS void on_mode(char *from, char *channel, char *rest) __page(CORE_SEG);
|
||||
LS void common_public(Chan *chan, char *from, char *spyformat, char *rest) __page(CORE_SEG);
|
||||
LS void on_action(char *from, char *to, char *rest) __page(CORE_SEG);
|
||||
LS int access_needed(char *name) __page(CORE_SEG);
|
||||
LS void do_chaccess(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_last(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* parse.c */
|
||||
|
||||
LS void parse_error(char *from, char *rest);
|
||||
LS void parse_invite(char *from, char *rest);
|
||||
LS void parse_join(char *from, char *rest);
|
||||
LS void parse_mode(char *from, char *rest);
|
||||
LS void parse_notice(char *from, char *rest);
|
||||
LS void parse_part(char *from, char *rest);
|
||||
LS void parse_ping(char *from, char *rest);
|
||||
LS void parse_pong(char *from, char *rest);
|
||||
LS void parse_privmsg(char *from, char *rest);
|
||||
LS void parse_quit(char *from, char *rest);
|
||||
LS void parse_topic(char *from, char *rest);
|
||||
LS void parse_wallops(char *from, char *rest);
|
||||
LS void parse_error(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_invite(char *from, char *rest) __page(CMD1_SEG);
|
||||
LS void parse_join(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_mode(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_notice(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_part(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_ping(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_pong(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_privmsg(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_quit(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_topic(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_wallops(char *from, char *rest) __page(CORE_SEG);
|
||||
LS void parse_213(char *from, char *rest);
|
||||
LS void parse_219(char *from, char *rest);
|
||||
LS void parse_251(char *from, char *rest);
|
||||
@ -537,8 +538,8 @@ LS void parse_346(char *from, char *rest);
|
||||
LS void parse_348(char *from, char *rest);
|
||||
LS void parse_368(char *from, char *rest);
|
||||
LS void parse_005(char *from, char *rest);
|
||||
LS uint32_t stringhash(char *s);
|
||||
LS void parse_server_input(char *rest);
|
||||
LS uint32_t stringhash(char *s) __page(CORE_SEG);
|
||||
LS void parse_server_input(char *rest) __page(CORE_SEG);
|
||||
|
||||
/* partyline.c */
|
||||
|
||||
@ -610,10 +611,10 @@ void do_pythonscript(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* reset.c */
|
||||
|
||||
char *recover_client(char *env);
|
||||
char *recover_debug(char *env);
|
||||
char *recover_server(char *env);
|
||||
void recover_reset(void);
|
||||
char *recover_client(char *env) __page(INIT_SEG);
|
||||
char *recover_debug(char *env) __page(INIT_SEG);
|
||||
char *recover_server(char *env) __page(INIT_SEG);
|
||||
void recover_reset(void) __page(INIT_SEG);
|
||||
void do_reset(COMMAND_ARGS) __page(RARE_SEG);
|
||||
|
||||
/* seen.c */
|
||||
@ -641,17 +642,17 @@ void do_clearshit(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* spy.c */
|
||||
|
||||
void send_spy(const char *src, const char *format, ...);
|
||||
void send_global(const char *src, const char *format, ...);
|
||||
void spy_typecount(Mech *bot);
|
||||
int spy_source(char *from, int *t_src, const char **src);
|
||||
char *urlhost(const char *);
|
||||
void send_spy(const char *src, const char *format, ...) __page(CORE_SEG);
|
||||
void send_global(const char *src, const char *format, ...) __page(CORE_SEG);
|
||||
void spy_typecount(Mech *bot) __page(CORE_SEG);
|
||||
int spy_source(char *from, int *t_src, const char **src) __page(CORE_SEG);
|
||||
char *urlhost(const char *) __page(CORE_SEG);
|
||||
LS void urlcapture(const char *) __page(CORE_SEG);
|
||||
int begin_redirect(char *, char *);
|
||||
void send_redirect(char *);
|
||||
void end_redirect(void);
|
||||
void stats_loghour(Chan *chan, char *filename, int hour);
|
||||
void stats_plusminususer(Chan *chan, int plusminus);
|
||||
int begin_redirect(char *, char *) __page(CORE_SEG);
|
||||
void send_redirect(char *) __page(CORE_SEG);
|
||||
void end_redirect(void) __page(CORE_SEG);
|
||||
void stats_loghour(Chan *chan, char *filename, int hour) __page(CORE_SEG);
|
||||
void stats_plusminususer(Chan *chan, int plusminus) __page(CORE_SEG);
|
||||
void do_spy(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_rspy(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_info(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
@ -687,22 +688,22 @@ LS void do_tcl(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* toybox.c */
|
||||
|
||||
LS int read_bigcharset_callback(char *);
|
||||
LS int read_bigcharset(char *);
|
||||
LS int read_ascii(char *);
|
||||
LS void trivia_week_toppers(void);
|
||||
LS void hint_one(void);
|
||||
LS void hint_two(void);
|
||||
LS void hint_three(void);
|
||||
LS void trivia_cleanup(void);
|
||||
LS void trivia_check(Chan *, char *);
|
||||
LS void trivia_no_answer(void);
|
||||
LS char *random_question(char *);
|
||||
LS void trivia_question(void);
|
||||
LS void trivia_tick(void);
|
||||
LS void write_triviascore(void);
|
||||
LS int trivia_score_callback(char *);
|
||||
LS void read_triviascore(void);
|
||||
LS int read_bigcharset_callback(char *) __page(CMD1_SEG);
|
||||
LS int read_bigcharset(char *) __page(CMD1_SEG);
|
||||
LS int read_ascii(char *) __page(CMD1_SEG);
|
||||
LS void trivia_week_toppers(void) __page(CMD1_SEG);
|
||||
LS void hint_one(void) __page(CMD1_SEG);
|
||||
LS void hint_two(void) __page(CMD1_SEG);
|
||||
LS void hint_three(void) __page(CMD1_SEG);
|
||||
LS void trivia_cleanup(void) __page(CMD1_SEG);
|
||||
LS void trivia_check(Chan *, char *) __page(CMD1_SEG);
|
||||
LS void trivia_no_answer(void) __page(CMD1_SEG);
|
||||
LS char *random_question(char *) __page(CMD1_SEG);
|
||||
LS void trivia_question(void) __page(CMD1_SEG);
|
||||
LS void trivia_tick(void) __page(CMD1_SEG);
|
||||
LS void write_triviascore(void) __page(CMD1_SEG);
|
||||
LS int trivia_score_callback(char *) __page(CMD1_SEG);
|
||||
LS void read_triviascore(void) __page(CMD1_SEG);
|
||||
LS void do_bigsay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_random_msg(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
LS void do_randtopic(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
@ -714,43 +715,43 @@ LS void do_trivia(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* uptime.c */
|
||||
|
||||
void init_uptime(void);
|
||||
void send_uptime(int type);
|
||||
void uptime_death(int type);
|
||||
void process_uptime(void);
|
||||
void init_uptime(void) __page(CFG1_SEG);
|
||||
void send_uptime(int type) __page(CORE_SEG);
|
||||
void uptime_death(int type) __page(RARE_SEG);
|
||||
void process_uptime(void) __page(CORE_SEG);
|
||||
void do_upsend(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* user.c */
|
||||
|
||||
LS void cfg_user(char *) __page(CFG1_SEG);
|
||||
LS void cfg_user(char *) __page(CFG1_SEG);
|
||||
void cfg_modcount(char *);
|
||||
LS void cfg_pass(char *) __page(CFG1_SEG);
|
||||
LS void cfg_mask(char *) __page(CFG1_SEG);
|
||||
LS void cfg_chan(char *) __page(CFG1_SEG);
|
||||
LS void cfg_opt(char *) __page(CFG1_SEG);
|
||||
LS void cfg_shit(char *) __page(CFG1_SEG);
|
||||
LS void cfg_pass(char *) __page(CFG1_SEG);
|
||||
LS void cfg_mask(char *) __page(CFG1_SEG);
|
||||
LS void cfg_chan(char *) __page(CFG1_SEG);
|
||||
LS void cfg_opt(char *) __page(CFG1_SEG);
|
||||
LS void cfg_shit(char *) __page(CFG1_SEG);
|
||||
void cfg_kicksay(char *);
|
||||
LS void cfg_greet(char *) __page(CFG1_SEG);
|
||||
LS void cfg_note(char *) __page(CFG1_SEG);
|
||||
LS void cfg_greet(char *) __page(CFG1_SEG);
|
||||
LS void cfg_note(char *) __page(CFG1_SEG);
|
||||
void user_sync(void);
|
||||
int read_userlist_callback(char *);
|
||||
int read_userlist(char *);
|
||||
int write_userlist(char *);
|
||||
void rehash_chanusers(void);
|
||||
LS void addtouser(Strp **, const char *, int) __attr(CORE_SEG, __regparm(3));
|
||||
LS int remfromuser(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
void mirror_user(User *) __page(CORE_SEG);
|
||||
void mirror_userlist(void) __page(CORE_SEG);
|
||||
LS void addtouser(Strp **, const char *, int) __attr(CORE_SEG, __regparm(3));
|
||||
LS int remfromuser(Strp **, const char *) __attr(CORE_SEG, __regparm(2));
|
||||
void mirror_user(User *) __page(CORE_SEG);
|
||||
void mirror_userlist(void) __page(CORE_SEG);
|
||||
void reset_userlink(User *, User *);
|
||||
void remove_user(User *);
|
||||
User *add_user(char *, char *, int);
|
||||
User *find_handle(const char *);
|
||||
int userhaschannel(const User *, const char *);
|
||||
User *get_user(const char *, const char *);
|
||||
int get_useraccess(const char *, const char *);
|
||||
int get_maxaccess(const char *);
|
||||
int is_bot(const char *);
|
||||
int get_protaction(Chan *, char *);
|
||||
User *get_user(const char *, const char *) __page(CORE_SEG);
|
||||
int get_useraccess(const char *, const char *) __page(CORE_SEG);
|
||||
int get_maxaccess(const char *) __page(CORE_SEG);
|
||||
int is_bot(const char *) __page(CORE_SEG);
|
||||
int get_protaction(Chan *, char *) __page(CORE_SEG);
|
||||
int usercanmodify(const char *, const User *);
|
||||
void change_pass(User *, char *) __page(CMD1_SEG);
|
||||
void do_access(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
@ -764,23 +765,23 @@ void do_load(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
/* vars.c */
|
||||
|
||||
void set_str_varc(Chan *, int, char *);
|
||||
int find_setting(const char *);
|
||||
void copy_vars(UniVar *, UniVar *);
|
||||
void set_binarydefault(UniVar *);
|
||||
void delete_vars(UniVar *, int);
|
||||
void set_str_varc(Chan *, int, char *) __page(CFG1_SEG);
|
||||
int find_setting(const char *) __page(CORE_SEG);
|
||||
void copy_vars(UniVar *, UniVar *) __page(CFG1_SEG);
|
||||
void set_binarydefault(UniVar *) __page(CFG1_SEG);
|
||||
void delete_vars(UniVar *, int) __page(CMD1_SEG);
|
||||
void var_resolve_host(const struct Setting *);
|
||||
void nobo_strcpy(const char *);
|
||||
void ec_access(char *, const char *);
|
||||
void ec_capabilities(char *, const char *);
|
||||
void ec_cc(char *, const char *);
|
||||
void ec_channels(char *, const char *);
|
||||
void ec_time(char *, const char *);
|
||||
void ec_set(char *, const char *);
|
||||
void ec_on(char *, const char *);
|
||||
void ec_server(char *, const char *);
|
||||
void ec_up(char *, const char *);
|
||||
void ec_ver(char *, const char *);
|
||||
void nobo_strcpy(const char *) __page(CMD1_SEG);
|
||||
void ec_access(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_capabilities(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_cc(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_channels(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_time(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_set(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_on(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_server(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_up(char *, const char *) __page(CMD1_SEG);
|
||||
void ec_ver(char *, const char *) __page(CMD1_SEG);
|
||||
void do_esay(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
void do_set(COMMAND_ARGS) __page(CMD1_SEG);
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 2020 proton
|
||||
Copyright (c) 2020-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -141,7 +141,7 @@ int parse_proc_status(char *line)
|
||||
|
||||
key = chop(&line);
|
||||
#ifdef DEBUG
|
||||
debug("pps key = %s (%s)\n",key,line);
|
||||
debug("(parse_proc_status) pps key = %s (%s)\n",key,line);
|
||||
#endif
|
||||
if (key == NULL)
|
||||
return(FALSE);
|
||||
@ -267,7 +267,7 @@ void process_monitor()
|
||||
FileMon *fmon;
|
||||
struct inotify_event *ivent;
|
||||
char tmp[256];
|
||||
int n;
|
||||
int n,m;
|
||||
|
||||
for(fmon=filemonlist;fmon;fmon=fmon->next)
|
||||
{
|
||||
@ -277,14 +277,14 @@ void process_monitor()
|
||||
|
||||
n = read(fmon->fd,globaldata,sizeof(struct inotify_event));
|
||||
if (ivent->len > 0)
|
||||
read(fmon->fd,ivent->name,ivent->len);
|
||||
m = read(fmon->fd,ivent->name,ivent->len);
|
||||
else
|
||||
*ivent->name = 0;
|
||||
#ifdef DEBUG
|
||||
debug("ino %i, n %i, sz %i\n",fmon->fd,n,sizeof(in2str));
|
||||
debug("wd %i, mask %lu, cookie %lu, len %lu, name %s\n",
|
||||
debug("(process_monitor) ino %i, n %i, sz %i\n",fmon->fd,n,sizeof(in2str));
|
||||
debug("(process_monitor) wd %i, mask %lu, cookie %lu, len %lu, name %s\n",
|
||||
ivent->wd,ivent->mask,ivent->cookie,ivent->len,ivent->name);
|
||||
debug("%s\n",inomask2str(ivent->mask,tmp));
|
||||
debug("(process_monitor) %s\n",inomask2str(ivent->mask,tmp));
|
||||
debug("(process_monitor) ino %i bytes read, int wd = %i, uint32_t mask = %s (%lu), "
|
||||
"uint32_t cookie = %lu, uint32_t len = %lu, char name = %s\n",
|
||||
n,ivent->wd,inomask2str(ivent->mask,tmp),ivent->mask,ivent->cookie,ivent->len,ivent->name);
|
||||
@ -302,13 +302,13 @@ void process_monitor()
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
help:HOSTINFO:(no arguments)
|
||||
help:SYSINFO:(no arguments)
|
||||
|
||||
Equivalent to ``uname -orm''
|
||||
|
||||
See also: meminfo, cpuinfo
|
||||
*/
|
||||
void do_hostinfo(COMMAND_ARGS)
|
||||
void do_sysinfo(COMMAND_ARGS)
|
||||
{
|
||||
char *h,hostname[256];
|
||||
struct utsname un;
|
||||
@ -363,7 +363,7 @@ See also: hostinfo, meminfo
|
||||
*/
|
||||
void do_cpuinfo(COMMAND_ARGS)
|
||||
{
|
||||
char bogostr[64],cpustr[64];
|
||||
char bogostr[256],cpustr[64];
|
||||
char *a1,*a2,*a3,*dst;
|
||||
int fd,n;
|
||||
double loads[3];
|
||||
@ -375,13 +375,6 @@ void do_cpuinfo(COMMAND_ARGS)
|
||||
else
|
||||
stringcpy(bogostr,"/proc/cpuinfo");
|
||||
if ((fd = open(bogostr,O_RDONLY)) < 0)
|
||||
/*
|
||||
if ((fd = open("/home/git/cpuinfo/mips3",O_RDONLY)) < 0)
|
||||
if ((fd = open("/home/git/cpuinfo/mips2",O_RDONLY)) < 0)
|
||||
if ((fd = open("/home/git/cpuinfo/mips1",O_RDONLY)) < 0)
|
||||
if ((fd = open("/home/git/cpuinfo/intel1",O_RDONLY)) < 0)
|
||||
if ((fd = open("/home/git/cpuinfo/cosmiccow",O_RDONLY)) < 0)
|
||||
*/
|
||||
#endif
|
||||
if ((fd = open("/proc/cpuinfo",O_RDONLY)) < 0)
|
||||
#ifdef DEBUG
|
||||
|
||||
5
src/io.c
5
src/io.c
@ -269,7 +269,7 @@ int SockAccept(int sock)
|
||||
/*
|
||||
* Format text and send to a socket or file descriptor
|
||||
*/
|
||||
int to_file(int sock, const char *format, ...)
|
||||
int to_file(const int sock, const char *format, ...)
|
||||
{
|
||||
va_list msg;
|
||||
#if defined(DEBUG) && !defined(GENCMD_C)
|
||||
@ -357,7 +357,8 @@ void to_user_q(const char *target, const char *format, ...)
|
||||
|
||||
if (STARTUP_ECHOTOCONSOLE)
|
||||
{
|
||||
write(1,message,strlen(message));
|
||||
int n;
|
||||
n = write(1,message,strlen(message));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -61,10 +61,10 @@ SECTIONS
|
||||
*(.text.hot .text.hot.*)
|
||||
*(.text.e) /* RARE */
|
||||
*(.text.d) /* INIT */
|
||||
*(.text.b) /* CFG1 */
|
||||
*(.text.c) /* CMD1 */
|
||||
*(.text.a) /* CORE */
|
||||
*(.text.f) /* DBUG */
|
||||
*(.text.b) /* CFG1 */
|
||||
*(.text .stub .text.* .gnu.linkonce.t.*)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
|
||||
@ -1287,6 +1287,10 @@ int main(int argc, char **argv, char **envp)
|
||||
|
||||
if (startup == STARTUP_TESTRUN)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (debug_on_exit == TRUE)
|
||||
run_debug();
|
||||
#endif /* DEBUG */
|
||||
to_file(1,"init: test run completed, exiting...\n");
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
52
src/ons.c
52
src/ons.c
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Parts Copyright (c) 1997-2009 proton
|
||||
Parts Copyright (c) 1997-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -591,31 +591,6 @@ recheck_alias:
|
||||
CurrentNick,uaccess,command,(int)acmd[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
* list of last LASTCMDSIZE commands
|
||||
*/
|
||||
if (from != CoreUser.name)
|
||||
{
|
||||
Free(¤t->lastcmds[LASTCMDSIZE-1]);
|
||||
for(j=LASTCMDSIZE-2;j>=0;j--)
|
||||
current->lastcmds[j+1] = current->lastcmds[j];
|
||||
if ((pt = STRCHR(from,'@')) == NULL)
|
||||
pt = from;
|
||||
set_mallocdoer(on_msg);
|
||||
current->lastcmds[0] = (char*)Calloc(strlen(pt) + 45);
|
||||
if (CurrentUser)
|
||||
{
|
||||
sprintf(current->lastcmds[0],"[%s] %s\r%s[%-3i]\t(*%s)",
|
||||
time2medium(now),command,CurrentUser->name,
|
||||
(CurrentUser->x.x.access),pt);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(current->lastcmds[0],"[%s] %s\r%s[---]\t(*%s)",
|
||||
time2medium(now),command,CurrentNick,pt);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* CAXS check: first argument might be a channel
|
||||
* check user access on target channel
|
||||
@ -647,6 +622,31 @@ recheck_alias:
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* list of last LASTCMDSIZE commands
|
||||
*/
|
||||
if (from != CoreUser.name)
|
||||
{
|
||||
Free(¤t->lastcmds[LASTCMDSIZE-1]);
|
||||
for(j=LASTCMDSIZE-2;j>=0;j--)
|
||||
current->lastcmds[j+1] = current->lastcmds[j];
|
||||
if ((pt = STRCHR(from,'@')) == NULL)
|
||||
pt = from;
|
||||
set_mallocdoer(on_msg);
|
||||
current->lastcmds[0] = (char*)Calloc(strlen(pt) + 45);
|
||||
if (CurrentUser)
|
||||
{
|
||||
sprintf(current->lastcmds[0],"[%s] %s\r%s[%-3i]\t(*%s)",
|
||||
time2medium(now),command,CurrentUser->name,
|
||||
(CurrentUser->x.x.access),pt);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(current->lastcmds[0],"[%s] %s\r%s[---]\t(*%s)",
|
||||
time2medium(now),command,CurrentNick,pt);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* CARGS check: at least one argument is required
|
||||
*/
|
||||
|
||||
11
src/spy.c
11
src/spy.c
@ -69,6 +69,9 @@ static int basepos(char c)
|
||||
return(63);
|
||||
return(0);
|
||||
}
|
||||
#if defined(SHACRYPT) || defined(MD5CRYPT)
|
||||
char *CRYPT_FUNC(const char *, const char *);
|
||||
#endif
|
||||
|
||||
void send_spy(const char *src, const char *format, ...)
|
||||
{
|
||||
@ -130,12 +133,12 @@ void send_spy(const char *src, const char *format, ...)
|
||||
SHA-512 | 86 characters
|
||||
*/
|
||||
#ifdef SHACRYPT
|
||||
sprintf(tempdata,"$6$%04x",(now & 0xFFFF));
|
||||
sprintf(tempdata,"$6$%04x",(uint32_t)(now & 0xFFFF));
|
||||
rnd = CRYPT_FUNC(tempsrc,tempdata);
|
||||
#endif /* SHACRYPT */
|
||||
|
||||
#if !defined(SHACRYPT) && defined(MD5CRYPT)
|
||||
sprintf(tempdata,"$1$%04x",(now & 0xFFFF));
|
||||
sprintf(tempdata,"$1$%04x",(uint32_t)(now & 0xFFFF));
|
||||
rnd = CRYPT_FUNC(tempsrc,tempdata);
|
||||
#endif /* !SHACRYPT && MD5CRYPT */
|
||||
|
||||
@ -164,7 +167,9 @@ void send_spy(const char *src, const char *format, ...)
|
||||
#endif /* DEBUG */
|
||||
if ((fd = open(spy->dest,O_WRONLY|O_CREAT|O_APPEND,NEWFILEMODE)) >= 0)
|
||||
{
|
||||
write(fd,tempdata,dst - tempdata);
|
||||
int n;
|
||||
|
||||
n = write(fd,tempdata,dst - tempdata);
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
|
||||
EnergyMech, IRC bot software
|
||||
Copyright (c) 2000-2018 proton
|
||||
Copyright (c) 2000-2024 proton
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -102,6 +102,7 @@
|
||||
#define TEXT_BOTUPTIME "Uptime\t%s"
|
||||
#define TEXT_BOTVERSION "Version\t%s (%s)"
|
||||
#define TEXT_BOTFEATURES "Features\t%s"
|
||||
#define TEXT_HOSTINFO "Host\t%s %s %s %s"
|
||||
|
||||
#define TEXT_CSERV "Current Server: %s:%i"
|
||||
#define TEXT_CSERVNOT "Current Server: " TEXT_NOTINSERVLIST
|
||||
|
||||
12
src/web.c
12
src/web.c
@ -125,7 +125,7 @@ char *webread(int s, char *rest, char *line)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#define NOBO if (dest == &mem[MSGLEN-2]) { write(s,mem,dest-mem); dest = mem; }
|
||||
#define NOBO if (dest == &mem[MSGLEN-2]) { int n; n = write(s,mem,dest-mem); dest = mem; }
|
||||
|
||||
void eml_fmt(WebSock *client, char *format)
|
||||
{
|
||||
@ -133,6 +133,7 @@ void eml_fmt(WebSock *client, char *format)
|
||||
char *src,*dest,*org;
|
||||
int out;
|
||||
int s = client->sock;
|
||||
int n;
|
||||
|
||||
org = NULL;
|
||||
out = TRUE;
|
||||
@ -230,8 +231,8 @@ restart:
|
||||
format++;
|
||||
}
|
||||
if (dest-mem > 0)
|
||||
write(s,mem,dest-mem);
|
||||
write(s,"\r\n",2);
|
||||
n = write(s,mem,dest-mem);
|
||||
n = write(s,"\r\n",2);
|
||||
}
|
||||
|
||||
void web_raw(WebSock *client, char *url)
|
||||
@ -240,8 +241,7 @@ void web_raw(WebSock *client, char *url)
|
||||
char path[MSGLEN];
|
||||
char *src,*dest;
|
||||
ino_t ino;
|
||||
int fd;
|
||||
int eml;
|
||||
int fd,eml,n;
|
||||
size_t sz;
|
||||
|
||||
eml = (matches("*.html",url)) ? TRUE : FALSE;
|
||||
@ -293,7 +293,7 @@ void web_raw(WebSock *client, char *url)
|
||||
#endif /* DEBUG */
|
||||
set_mallocdoer(web_raw);
|
||||
src = Calloc(sz+1);
|
||||
read(fd,src,sz);
|
||||
n = read(fd,src,sz);
|
||||
if (eml)
|
||||
{
|
||||
to_file(client->sock,"%s\r\n",src);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user