Committer : isomer
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2006-01-07 00:57:27 UTC
Modified files:
ChangeLog include/channel.h ircd/channel.c ircd/convert-conf.c
ircd/ircd_parser.y ircd/m_invite.c ircd/parse.c ircd/s_stats.c
ircd/umkpasswd.c
Log message:
Author: isomer <[EMAIL PROTECTED]>
Log message:
More statification.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.767 ircu2.10/ChangeLog:1.768
--- ircu2.10/ChangeLog:1.767 Fri Jan 6 16:40:14 2006
+++ ircu2.10/ChangeLog Fri Jan 6 16:57:16 2006
@@ -1,3 +1,9 @@
+2006-01-08 Perry Lorier <[EMAIL PROTECTED]>
+
+ * ircd/channel.c ircd/channel.c ircd/convert-conf.c ircd/ircd_parser.y
+ ircd/m_invite.c ircd/parse.c ircd/s_stats.c ircd/mkpasswd.c: more
+ statsification
+
2006-01-06 Michael Poole <[EMAIL PROTECTED]>
* include/ircd_log.h (log_vwrite): Re-export this symbol, which is
@@ -20,10 +26,10 @@
which is always needed in s_stats.c.
2006-01-07 Perry Lorier <[EMAIL PROTECTED]>
+
* ircd/crule.c ircd/ircd.c ircd/ircd_alloc.c ircd/motd.c ircd/s_conf.c
ircd/uping.c: Convert DEBUG's to log_write's
-
2006-01-07 Perry Lorier <[EMAIL PROTECTED]>
* ircd/*.c include/*.h: Add static to functions where possible,
Index: ircu2.10/include/channel.h
diff -u ircu2.10/include/channel.h:1.57 ircu2.10/include/channel.h:1.58
--- ircu2.10/include/channel.h:1.57 Fri Jan 6 03:22:29 2006
+++ ircu2.10/include/channel.h Fri Jan 6 16:57:16 2006
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance.
- * @version $Id: channel.h,v 1.57 2006/01/06 11:22:29 isomer Exp $
+ * @version $Id: channel.h,v 1.58 2006/01/07 00:57:16 isomer Exp $
*/
#ifndef INCLUDED_channel_h
#define INCLUDED_channel_h
@@ -377,7 +377,6 @@
struct Client* cptr, struct Client* sptr,
struct Channel* chptr);
extern struct Client* find_chasing(struct Client* sptr, const char* user, int*
chasing);
-void add_invite(struct Client *cptr, struct Channel *chptr);
int number_of_zombies(struct Channel *chptr);
extern const char* find_no_nickchange_channel(struct Client* cptr);
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.167 ircu2.10/ircd/channel.c:1.168
--- ircu2.10/ircd/channel.c:1.167 Fri Jan 6 03:22:29 2006
+++ ircu2.10/ircd/channel.c Fri Jan 6 16:57:16 2006
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.167 2006/01/06 11:22:29 isomer Exp $
+ * @version $Id: channel.c,v 1.168 2006/01/07 00:57:16 isomer Exp $
*/
#include "config.h"
@@ -71,21 +71,6 @@
/** Number of ban structures in use. */
static size_t bans_inuse;
-#if !defined(NDEBUG)
-/** return the length (>=0) of a chain of links.
- * @param lp pointer to the start of the linked list
- * @return the number of items in the list
- */
-static unsigned int list_length(struct SLink *lp)
-{
- unsigned int count = 0;
-
- for (; lp; lp = lp->next)
- ++count;
- return count;
-}
-#endif
-
/** Set the mask for a ban, checking for IP masks.
* @param[in,out] ban Ban structure to modify.
* @param[in] banstr Mask to ban.
@@ -1263,43 +1248,6 @@
return chptr;
}
-/** invite a user to a channel.
- *
- * Adds an invite for a user to a channel. Limits the number of invites
- * to FEAT_MAXCHANNELSPERUSER. Does not sent notification to the user.
- *
- * @param cptr The client to be invited.
- * @param chptr The channel to be invited to.
- */
-void add_invite(struct Client *cptr, struct Channel *chptr)
-{
- struct SLink *inv, **tmp;
-
- del_invite(cptr, chptr);
- /*
- * Delete last link in chain if the list is max length
- */
- assert(list_length((cli_user(cptr))->invited) == (cli_user(cptr))->invites);
- if ((int)(cli_user(cptr))->invites >= feature_int(FEAT_MAXCHANNELSPERUSER))
- del_invite(cptr, (cli_user(cptr))->invited->value.chptr);
- /*
- * Add client to channel invite list
- */
- inv = make_link();
- inv->value.cptr = cptr;
- inv->next = chptr->invites;
- chptr->invites = inv;
- /*
- * Add channel to the end of the client invite list
- */
- for (tmp = &((cli_user(cptr))->invited); *tmp; tmp = &((*tmp)->next));
- inv = make_link();
- inv->value.chptr = chptr;
- inv->next = NULL;
- (*tmp) = inv;
- (cli_user(cptr))->invites++;
-}
-
/** Delete an invite
* Delete Invite block from channel invite list and client invite list
*
Index: ircu2.10/ircd/convert-conf.c
diff -u ircu2.10/ircd/convert-conf.c:1.7 ircu2.10/ircd/convert-conf.c:1.8
--- ircu2.10/ircd/convert-conf.c:1.7 Fri Dec 30 17:47:12 2005
+++ ircu2.10/ircd/convert-conf.c Fri Jan 6 16:57:16 2006
@@ -24,17 +24,16 @@
#define MAX_FIELDS 5
-const char *admin_names[] = { "location", "contact", "contact", 0 },
- *connect_names[] = { "host", "password", "name", "#port", "class", 0 },
+static const char *admin_names[] = { "location", "contact", "contact", 0 },
*crule_names[] = { "server", "", "rule", 0 },
*general_names[] = { "name", "vhost", "description", "", "#numeric", 0 },
*motd_names[] = { "host", "file", 0 },
*class_names[] = { "name", "#pingfreq", "#connectfreq", "#maxlinks",
"#sendq", 0 },
*removed_features[] = { "VIRTUAL_HOST", "TIMESEC",
"OPERS_SEE_IN_SECRET_CHANNELS", "LOCOP_SEE_IN_SECRET_CHANNELS", "HIS_STATS_h",
"HIS_DESYNCS", "AUTOHIDE", 0 };
-char orig_line[512], line[512], dbuf[512];
-char *fields[MAX_FIELDS + 1];
-unsigned int nfields;
-unsigned int lineno;
+static char orig_line[512], line[512], dbuf[512];
+static char *fields[MAX_FIELDS + 1];
+static unsigned int nfields;
+static unsigned int lineno;
/*** GENERIC SUPPORT CODE ***/
@@ -138,7 +137,7 @@
/*** SERVER CONNECTION RELATED CODE ***/
-struct connect {
+static struct connect {
char *host;
char *password;
char *port;
@@ -244,14 +243,14 @@
/*** FEATURE MANAGEMENT CODE ***/
-struct feature {
+static struct feature {
struct string_list *values;
struct string_list *origins;
struct feature *next;
char name[1];
} *features;
-struct remapped_feature {
+static struct remapped_feature {
const char *name;
const char *privilege;
int flags; /* 2 = global, 1 = local */
@@ -365,7 +364,7 @@
/*** OPERATOR BLOCKS ***/
-struct operator {
+static struct operator {
char *name;
char *host;
char *password;
@@ -501,7 +500,7 @@
fprintf(stdout, "};\n");
}
-struct string_list *quarantines;
+static struct string_list *quarantines;
static void do_quarantine(void)
{
Index: ircu2.10/ircd/ircd_parser.y
diff -u ircu2.10/ircd/ircd_parser.y:1.59 ircu2.10/ircd/ircd_parser.y:1.60
--- ircu2.10/ircd/ircd_parser.y:1.59 Wed Dec 28 20:55:16 2005
+++ ircu2.10/ircd/ircd_parser.y Fri Jan 6 16:57:16 2006
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
- * $Id: ircd_parser.y,v 1.59 2005/12/29 04:55:16 entrope Exp $
+ * $Id: ircd_parser.y,v 1.60 2006/01/07 00:57:16 isomer Exp $
*/
%{
@@ -67,15 +67,15 @@
int yylex(void);
/* Now all the globals we need :/... */
- int tping, tconn, maxlinks, sendq, port, invert, stringno, flags;
- char *name, *pass, *host, *ip, *username, *origin, *hub_limit;
- char *stringlist[MAX_STRINGS];
- struct ConnectionClass *c_class;
- struct DenyConf *dconf;
- struct ServerConf *sconf;
- struct s_map *smap;
- struct Privs privs;
- struct Privs privs_dirty;
+ static int tping, tconn, maxlinks, sendq, port, invert, stringno, flags;
+ static char *name, *pass, *host, *ip, *username, *origin, *hub_limit;
+ static char *stringlist[MAX_STRINGS];
+ static struct ConnectionClass *c_class;
+ static struct DenyConf *dconf;
+ static struct ServerConf *sconf;
+ static struct s_map *smap;
+ static struct Privs privs;
+ static struct Privs privs_dirty;
static void parse_error(char *pattern,...) {
static char error_buffer[1024];
Index: ircu2.10/ircd/m_invite.c
diff -u ircu2.10/ircd/m_invite.c:1.25 ircu2.10/ircd/m_invite.c:1.26
--- ircu2.10/ircd/m_invite.c:1.25 Tue Sep 13 08:17:46 2005
+++ ircu2.10/ircd/m_invite.c Fri Jan 6 16:57:16 2006
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_invite.c,v 1.25 2005/09/13 15:17:46 entrope Exp $
+ * $Id: m_invite.c,v 1.26 2006/01/07 00:57:16 isomer Exp $
*/
/*
@@ -99,6 +99,59 @@
/* #include <assert.h> -- Now using assert in ircd_log.h */
+#if !defined(NDEBUG)
+/** return the length (>=0) of a chain of links.
+ * @param lp pointer to the start of the linked list
+ * @return the number of items in the list
+ */
+static unsigned int list_length(struct SLink *lp)
+{
+ unsigned int count = 0;
+
+ for (; lp; lp = lp->next)
+ ++count;
+ return count;
+}
+#endif
+
+/** invite a user to a channel.
+ *
+ * Adds an invite for a user to a channel. Limits the number of invites
+ * to FEAT_MAXCHANNELSPERUSER. Does not sent notification to the user.
+ *
+ * @param cptr The client to be invited.
+ * @param chptr The channel to be invited to.
+ */
+static void add_invite(struct Client *cptr, struct Channel *chptr)
+{
+ struct SLink *inv, **tmp;
+
+ del_invite(cptr, chptr);
+ /*
+ * Delete last link in chain if the list is max length
+ */
+ assert(list_length((cli_user(cptr))->invited) == (cli_user(cptr))->invites);
+ if ((int)(cli_user(cptr))->invites >= feature_int(FEAT_MAXCHANNELSPERUSER))
+ del_invite(cptr, (cli_user(cptr))->invited->value.chptr);
+ /*
+ * Add client to channel invite list
+ */
+ inv = make_link();
+ inv->value.cptr = cptr;
+ inv->next = chptr->invites;
+ chptr->invites = inv;
+ /*
+ * Add channel to the end of the client invite list
+ */
+ for (tmp = &((cli_user(cptr))->invited); *tmp; tmp = &((*tmp)->next));
+ inv = make_link();
+ inv->value.chptr = chptr;
+ inv->next = NULL;
+ (*tmp) = inv;
+ (cli_user(cptr))->invites++;
+}
+
+
/*
* m_invite - generic message handler
*
Index: ircu2.10/ircd/parse.c
diff -u ircu2.10/ircd/parse.c:1.56 ircu2.10/ircd/parse.c:1.57
--- ircu2.10/ircd/parse.c:1.56 Wed Dec 28 20:55:16 2005
+++ ircu2.10/ircd/parse.c Fri Jan 6 16:57:16 2006
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Parse input from IRC clients and other servers.
- * @version $Id: parse.c,v 1.56 2005/12/29 04:55:16 entrope Exp $
+ * @version $Id: parse.c,v 1.57 2006/01/07 00:57:16 isomer Exp $
*/
#include "config.h"
@@ -637,7 +637,7 @@
/* UNREG, CLIENT, SERVER, OPER, SERVICE */
{ m_quit, m_ignore, m_ignore, m_ignore, m_ignore }
},
- { 0 }
+ { 0, 0, 0, 0, 0, 0, 0, { 0, 0, 0, 0, 0 } }
};
/** Array of command parameters. */
@@ -649,7 +649,7 @@
* @param[in] msg_p Message to insert.
* @param[in] cmd Text of command to insert.
*/
-void
+static void
add_msg_element(struct MessageTree *mtree_p, struct Message *msg_p, char *cmd)
{
struct MessageTree *ntree_p;
Index: ircu2.10/ircd/s_stats.c
diff -u ircu2.10/ircd/s_stats.c:1.47 ircu2.10/ircd/s_stats.c:1.48
--- ircu2.10/ircd/s_stats.c:1.47 Fri Jan 6 03:22:31 2006
+++ ircu2.10/ircd/s_stats.c Fri Jan 6 16:57:16 2006
@@ -62,7 +62,7 @@
/** @file
* @brief Report configuration lines and other statistics from this
* server.
- * @version $Id: s_stats.c,v 1.47 2006/01/06 11:22:31 isomer Exp $
+ * @version $Id: s_stats.c,v 1.48 2006/01/07 00:57:16 isomer Exp $
*
* Note: The info is reported in the order the server uses
* it--not reversed as in ircd.conf!
@@ -101,7 +101,7 @@
/** Contains information about all statistics. */
-struct StatDesc statsinfo[] = {
+static struct StatDesc statsinfo[] = {
{ 'a', "nameservers", STAT_FLAG_OPERFEAT|STAT_FLAG_LOCONLY, FEAT_HIS_STATS_a,
report_dns_servers, 0,
"DNS servers." },
Index: ircu2.10/ircd/umkpasswd.c
diff -u ircu2.10/ircd/umkpasswd.c:1.10 ircu2.10/ircd/umkpasswd.c:1.11
--- ircu2.10/ircd/umkpasswd.c:1.10 Fri Jan 6 16:40:14 2006
+++ ircu2.10/ircd/umkpasswd.c Fri Jan 6 16:57:16 2006
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: umkpasswd.c,v 1.10 2006/01/07 00:40:14 entrope Exp $
+ * $Id: umkpasswd.c,v 1.11 2006/01/07 00:57:16 isomer Exp $
*/
#include "config.h"
#include <unistd.h>
@@ -54,13 +54,13 @@
/* only needed with memdebug, which also calls Debug() */
}
-void copyright(void)
+static void copyright(void)
{
fprintf(stderr, "umkpasswd - Copyright (c) 2002 hikari\n");
-return;
+ return;
}
-void show_help(void)
+static void show_help(void)
{
#ifdef DEBUGMODE
char *debughelp = "[-d <level>] ";
@@ -115,7 +115,7 @@
}
/* quick and dirty salt generator */
-char *make_salt(const char *salts)
+static char *make_salt(const char *salts)
{
char *tmp = NULL;
long int n = 0;
@@ -181,7 +181,7 @@
return 0;
}
-char *basename_into(char *tmp, char *target)
+static char *basename_into(char *tmp, char *target)
{
unsigned int len, ii;
@@ -233,7 +233,7 @@
}
/* dump the loaded mechs list */
-void show_mechs(void)
+static void show_mechs(void)
{
crypt_mechs_t* mechs;
@@ -257,7 +257,7 @@
}
/* load in the mech "modules" */
-void load_mechs(void)
+static void load_mechs(void)
{
/* we need these loaded by hand for now */
@@ -268,7 +268,7 @@
return;
}
-crypt_mechs_t* hunt_mech(const char* mechname)
+static crypt_mechs_t* hunt_mech(const char* mechname)
{
crypt_mechs_t* mech;
@@ -291,7 +291,7 @@
}
}
-char* crypt_pass(const char* pw, const char* mech)
+static char* crypt_pass(const char* pw, const char* mech)
{
crypt_mechs_t* crypt_mech;
char* salt, *untagged, *tagged;
@@ -319,7 +319,7 @@
return tagged;
}
-char* parse_arguments(int argc, char **argv)
+static char* parse_arguments(int argc, char **argv)
{
int len = 0, c = 0;
const char* options = "a:d:lm:u:y:5:";
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches