[ekg2-commit] ekg2: events.c (HEAD) emoticons.c (HEAD) [darkjames]
CVS commit
cvs w toxygen.net
Czw, 22 Lis 2007, 17:38:40 CET
Module name: ekg2
Changes by: darkjames 2007-11-22 17:38:37
Modified files:
events.c emoticons.c
Log message:
.asda
Index: events.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/events.c,v
diff -d -u -r1.54 -r1.55
--- events.c 22 Nov 2007 16:29:44 -0000 1.54
+++ events.c 22 Nov 2007 16:38:37 -0000 1.55
@@ -182,7 +182,7 @@
return 0;
}
-LIST_FREE_ITEM(list_event_free, struct event *) {
+static LIST_FREE_ITEM(list_event_free, struct event *) {
xfree(data->name);
xfree(data->action);
xfree(data->target);
@@ -213,7 +213,7 @@
return -1;
}
- LIST_REMOVE(&events, list_event_free);
+ LIST_REMOVE(&events, ev, list_event_free);
printq("events_del", itoa(id));
@@ -230,8 +230,6 @@
*/
void event_free()
{
- list_t l;
-
xfree(events_all);
events_all = NULL;
Index: emoticons.c
===================================================================
RCS file: /home/cvs/ekg2/ekg/emoticons.c,v
diff -d -u -r1.11 -r1.12
--- emoticons.c 28 Feb 2007 20:15:09 -0000 1.11
+++ emoticons.c 22 Nov 2007 16:38:37 -0000 1.12
@@ -72,35 +72,6 @@
}
/*
- * emoticon_remove()
- *
- * usuwa emoticon o danej nazwie.
- *
- * - name.
- *
- * 0/-1
- */
-#if 0 /* never used, never exported, uncomment when needed */
-static int emoticon_remove(const char *name)
-{
- list_t l;
-
- for (l = emoticons; l; l = l->next) {
- emoticon_t *f = l->data;
-
- if (!xstrcasecmp(f->name, name)) {
- xfree(f->value);
- xfree(f->name);
- list_remove(&emoticons, f, 1);
- return 0;
- }
- }
-
- return -1;
-}
-#endif
-
-/*
* emoticon_read()
*
* ładuje do listy wszystkie makra z pliku ~/.gg/emoticons
@@ -207,26 +178,50 @@
return ms;
}
+static LIST_FREE_ITEM(list_emoticon_free, emoticon_t *) {
+ xfree(data->name);
+ xfree(data->value);
+ xfree(data);
+}
+
/*
- * emoticon_free()
+ * emoticon_remove()
*
- * usuwa pamięć zajętą przez emoticony.
+ * usuwa emoticon o danej nazwie.
+ *
+ * - name.
+ *
+ * 0/-1
*/
-void emoticon_free()
+#if 0 /* never used, never exported, uncomment when needed */
+static int emoticon_remove(const char *name)
{
list_t l;
- if (!emoticons)
- return;
-
for (l = emoticons; l; l = l->next) {
- emoticon_t *e = l->data;
+ emoticon_t *f = l->data;
- xfree(e->name);
- xfree(e->value);
+ if (!xstrcasecmp(f->name, name)) {
+ LIST_REMOVE(&emoticons, f, list_emoticon_free);
+ return 0;
+ }
}
+
+ return -1;
+}
+#endif
- list_destroy(emoticons, 1);
+
+/*
+ * emoticon_free()
+ *
+ * usuwa pamięć zajętą przez emoticony.
+ */
+void emoticon_free() {
+ if (!emoticons)
+ return;
+
+ LIST_DESTROY(emoticons, list_emoticon_free);
emoticons = NULL;
}
Więcej informacji o liście dyskusyjnej ekg2-commit