Channel Mode BugFixes. Various Updates. Damn, the new
Autoconf stuff doesn't work to well...
This commit is contained in:
parent
92270b6461
commit
058b502f7f
7 changed files with 33 additions and 25 deletions
|
@ -3,9 +3,12 @@ NeoStats ChangeLog - Anything we add/remove/fix/change is in here (even our rant
|
|||
- Updated the ./configure/Makefile setup. Full autoconf support now
|
||||
- NeoStats now installs into ~/NeoStats
|
||||
- Beta skeleton for add on modules to get NeoStats configuration from ~/NeoStats/include/*.h (include files)
|
||||
- Bug fix with Channel Modes saving.
|
||||
- Bug Fix with Channeldump (actually, it was when creating new channels. We didn't set the member count to 0, so it was a random number :)
|
||||
|
||||
* NeoStats * Fish * Version 2.5.0-Alpha4.8
|
||||
- More bug fixes with Channel support. It looks pretty stable now :)
|
||||
|
||||
* NeoStats * Fish * Version 2.5.0-Alpha4.7 (hu, what happened to 4.6?)
|
||||
- Bug fixes (maybe) with channel support
|
||||
- New option to userdump to specify a user to dump out particulars
|
||||
|
|
18
chans.c
18
chans.c
|
@ -5,7 +5,7 @@
|
|||
** Based from GeoStats 1.1.0 by Johnathan George net@lite.net
|
||||
*
|
||||
** NetStats CVS Identification
|
||||
** $Id: chans.c,v 1.12 2002/03/13 11:35:09 fishwaldo Exp $
|
||||
** $Id: chans.c,v 1.13 2002/03/13 16:30:11 fishwaldo Exp $
|
||||
*/
|
||||
|
||||
#include <fnmatch.h>
|
||||
|
@ -32,7 +32,6 @@ extern void Change_Topic(char *owner, Chans *c, time_t time, char *topic) {
|
|||
}
|
||||
|
||||
int comparemode(ModesParm *m, long mode) {
|
||||
log("Modes %d -> %d", m->mode, mode);
|
||||
if (m->mode == mode) {
|
||||
return 0;
|
||||
} else {
|
||||
|
@ -68,7 +67,7 @@ void ChanMode(char *origin, char **av, int ac) {
|
|||
j++;
|
||||
} else {
|
||||
if (cFlagTab[i].parameters) {
|
||||
m = malloc(sizeof(ModesParm));
|
||||
m = smalloc(sizeof(ModesParm));
|
||||
m->mode = cFlagTab[i].mode;
|
||||
strcpy(m->param, av[j]);
|
||||
mn = lnode_create(m);
|
||||
|
@ -141,7 +140,7 @@ Chans *new_chan(char *chan) {
|
|||
hnode_t *cn;
|
||||
|
||||
strcpy(segv_location, "new_chan");
|
||||
c = malloc(sizeof(Chans));
|
||||
c = smalloc(sizeof(Chans));
|
||||
strcpy(c->name, chan);
|
||||
cn = hnode_create(c);
|
||||
if (hash_isfull(ch)) {
|
||||
|
@ -153,6 +152,8 @@ Chans *new_chan(char *chan) {
|
|||
}
|
||||
void del_chan(Chans *c) {
|
||||
hnode_t *cn;
|
||||
lnode_t *cm;
|
||||
|
||||
strcpy(segv_location, "del_chan");
|
||||
cn = hash_lookup(ch, c->name);
|
||||
if (!cn) {
|
||||
|
@ -160,6 +161,13 @@ void del_chan(Chans *c) {
|
|||
return;
|
||||
} else {
|
||||
log("Deleting Channel %s", c->name);
|
||||
cm = list_first(c->modeparms);
|
||||
while (cm) {
|
||||
free(lnode_get(cm));
|
||||
cm = list_next(c->modeparms, cm);
|
||||
}
|
||||
list_destroy_nodes(c->modeparms);
|
||||
list_destroy(c->modeparms);
|
||||
hash_delete(ch, cn);
|
||||
hnode_destroy(cn);
|
||||
free(c);
|
||||
|
@ -266,7 +274,7 @@ void join_chan(User *u, char *chan) {
|
|||
c->topictime = 0;
|
||||
}
|
||||
/* add this users details to the channel members hash */
|
||||
cm = malloc(sizeof(Chanmem));
|
||||
cm = smalloc(sizeof(Chanmem));
|
||||
strcpy(cm->nick, u->nick);
|
||||
cm->joint = time(NULL);
|
||||
cm->flags = 0;
|
||||
|
|
2
dl.c
2
dl.c
|
@ -445,7 +445,7 @@ int load_module(char *path1, User *u) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
mod_ptr = (Module *)malloc(sizeof(Module));
|
||||
mod_ptr = (Module *)smalloc(sizeof(Module));
|
||||
|
||||
mn = hnode_create(mod_ptr);
|
||||
if (hash_isfull(mh)) {
|
||||
|
|
14
hash.c
14
hash.c
|
@ -14,7 +14,7 @@
|
|||
* into proprietary software; there is no requirement for such software to
|
||||
* contain a copyright notice related to this source.
|
||||
*
|
||||
* $Id: hash.c,v 1.3 2002/03/08 11:46:07 fishwaldo Exp $
|
||||
* $Id: hash.c,v 1.4 2002/03/13 16:30:11 fishwaldo Exp $
|
||||
* $Name: $
|
||||
*/
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
|||
#include "hash.h"
|
||||
|
||||
#ifdef KAZLIB_RCSID
|
||||
static const char rcsid[] = "$Id: hash.c,v 1.3 2002/03/08 11:46:07 fishwaldo Exp $";
|
||||
static const char rcsid[] = "$Id: hash.c,v 1.4 2002/03/13 16:30:11 fishwaldo Exp $";
|
||||
#endif
|
||||
|
||||
#define INIT_BITS 6
|
||||
|
@ -297,10 +297,10 @@ hash_t *hash_create(hashcount_t maxcount, hash_comp_t compfun,
|
|||
if (hash_val_t_bit == 0) /* 1 */
|
||||
compute_bits();
|
||||
|
||||
hash = malloc(sizeof *hash); /* 2 */
|
||||
hash = smalloc(sizeof *hash); /* 2 */
|
||||
|
||||
if (hash) { /* 3 */
|
||||
hash->table = malloc(sizeof *hash->table * INIT_SIZE); /* 4 */
|
||||
hash->table = smalloc(sizeof *hash->table * INIT_SIZE); /* 4 */
|
||||
if (hash->table) { /* 5 */
|
||||
hash->nchains = INIT_SIZE; /* 6 */
|
||||
hash->highmark = INIT_SIZE * 2;
|
||||
|
@ -742,7 +742,7 @@ int hash_isempty(hash_t *hash)
|
|||
|
||||
static hnode_t *hnode_alloc(void *context)
|
||||
{
|
||||
return malloc(sizeof *hnode_alloc(NULL));
|
||||
return smalloc(sizeof *hnode_alloc(NULL));
|
||||
}
|
||||
|
||||
static void hnode_free(hnode_t *node, void *context)
|
||||
|
@ -757,7 +757,7 @@ static void hnode_free(hnode_t *node, void *context)
|
|||
|
||||
hnode_t *hnode_create(void *data)
|
||||
{
|
||||
hnode_t *node = malloc(sizeof *node);
|
||||
hnode_t *node = smalloc(sizeof *node);
|
||||
if (node) {
|
||||
node->data = data;
|
||||
node->next = NULL;
|
||||
|
@ -881,7 +881,7 @@ static int tokenize(char *string, ...)
|
|||
static char *dupstring(char *str)
|
||||
{
|
||||
int sz = strlen(str) + 1;
|
||||
char *new = malloc(sz);
|
||||
char *new = smalloc(sz);
|
||||
if (new)
|
||||
memcpy(new, str, sz);
|
||||
return new;
|
||||
|
|
14
list.c
14
list.c
|
@ -14,7 +14,7 @@
|
|||
* into proprietary software; there is no requirement for such software to
|
||||
* contain a copyright notice related to this source.
|
||||
*
|
||||
* $Id: list.c,v 1.2 2002/03/11 06:55:04 fishwaldo Exp $
|
||||
* $Id: list.c,v 1.3 2002/03/13 16:30:12 fishwaldo Exp $
|
||||
* $Name: $
|
||||
*/
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
|||
#define lnode_prev(N) ((N)->prev)
|
||||
|
||||
#ifdef KAZLIB_RCSID
|
||||
static const char rcsid[] = "$Id: list.c,v 1.2 2002/03/11 06:55:04 fishwaldo Exp $";
|
||||
static const char rcsid[] = "$Id: list.c,v 1.3 2002/03/13 16:30:12 fishwaldo Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -73,7 +73,7 @@ list_t *list_init(list_t *list, listcount_t maxcount)
|
|||
|
||||
list_t *list_create(listcount_t maxcount)
|
||||
{
|
||||
list_t *new = malloc(sizeof *new);
|
||||
list_t *new = smalloc(sizeof *new);
|
||||
if (new) {
|
||||
assert (maxcount != 0);
|
||||
new->nilnode.next = &new->nilnode;
|
||||
|
@ -229,7 +229,7 @@ void list_process(list_t *list, void *context,
|
|||
|
||||
lnode_t *lnode_create(void *data)
|
||||
{
|
||||
lnode_t *new = malloc(sizeof *new);
|
||||
lnode_t *new = smalloc(sizeof *new);
|
||||
if (new) {
|
||||
new->data = data;
|
||||
new->next = NULL;
|
||||
|
@ -294,10 +294,10 @@ lnodepool_t *lnode_pool_create(listcount_t n)
|
|||
|
||||
assert (n != 0);
|
||||
|
||||
pool = malloc(sizeof *pool);
|
||||
pool = smalloc(sizeof *pool);
|
||||
if (!pool)
|
||||
return NULL;
|
||||
nodes = malloc(n * sizeof *nodes);
|
||||
nodes = smalloc(n * sizeof *nodes);
|
||||
if (!nodes) {
|
||||
free(pool);
|
||||
return NULL;
|
||||
|
@ -819,7 +819,7 @@ static int tokenize(char *string, ...)
|
|||
static char *dupstring(char *str)
|
||||
{
|
||||
int sz = strlen(str) + 1;
|
||||
char *new = malloc(sz);
|
||||
char *new = smalloc(sz);
|
||||
if (new)
|
||||
memcpy(new, str, sz);
|
||||
return new;
|
||||
|
|
2
stats.h
2
stats.h
|
@ -181,7 +181,7 @@ struct chanmem_ {
|
|||
|
||||
struct modeparms_ {
|
||||
long mode;
|
||||
char param[64];
|
||||
char param[512];
|
||||
} modeparms_;
|
||||
|
||||
|
||||
|
|
5
users.c
5
users.c
|
@ -5,7 +5,7 @@
|
|||
** Based from GeoStats 1.1.0 by Johnathan George net@lite.net
|
||||
*
|
||||
** NetStats CVS Identification
|
||||
** $Id: users.c,v 1.24 2002/03/12 07:56:02 fishwaldo Exp $
|
||||
** $Id: users.c,v 1.25 2002/03/13 16:30:12 fishwaldo Exp $
|
||||
*/
|
||||
|
||||
#include <fnmatch.h>
|
||||
|
@ -82,9 +82,6 @@ void AddUser(const char *nick, const char *user, const char *host, const char *s
|
|||
}
|
||||
|
||||
void part_u_chan(list_t *list, lnode_t *node, User *u) {
|
||||
#ifdef DEBUG
|
||||
log("Parting %s", lnode_get(node));
|
||||
#endif
|
||||
part_chan(u, lnode_get(node));
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue