projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Gettext 1.11.5 compatibility.
[tinc]
/
lib
/
list.c
diff --git
a/lib/list.c
b/lib/list.c
index
d317622
..
b4c5871
100644
(file)
--- a/
lib/list.c
+++ b/
lib/list.c
@@
-1,7
+1,7
@@
/*
list.c -- functions to deal with double linked lists
/*
list.c -- functions to deal with double linked lists
- Copyright (C) 2000
Ivo Timmermans <itimmermans@bigfoot.com
>
- 2000
Guus Sliepen <guus@sliepen.warande.net
>
+ Copyright (C) 2000
,2001 Ivo Timmermans <ivo@o2w.nl
>
+ 2000
,2001 Guus Sliepen <guus@sliepen.eu.org
>
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
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
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: list.c,v 1.1.2.
7 2001/01/07 15:24:52
guus Exp $
+ $Id: list.c,v 1.1.2.
11 2002/06/21 10:11:11
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-60,7
+60,7
@@
void list_free_node(list_t *list, list_node_t *node)
if(node->data && list->delete)
list->delete(node->data);
if(node->data && list->delete)
list->delete(node->data);
- free(node
->data
);
+ free(node);
}
/* Insertion and deletion */
}
/* Insertion and deletion */
@@
-81,6
+81,8
@@
list_node_t *list_insert_head(list_t *list, void *data)
else
list->tail = node;
else
list->tail = node;
+ list->count++;
+
return node;
}
return node;
}
@@
-100,6
+102,8
@@
list_node_t *list_insert_tail(list_t *list, void *data)
else
list->head = node;
else
list->head = node;
+ list->count++;
+
return node;
}
return node;
}
@@
-114,6
+118,8
@@
void list_unlink_node(list_t *list, list_node_t *node)
node->next->prev = node->prev;
else
list->tail = node->prev;
node->next->prev = node->prev;
else
list->tail = node->prev;
+
+ list->count--;
}
void list_delete_node(list_t *list, list_node_t *node)
}
void list_delete_node(list_t *list, list_node_t *node)