aboutsummaryrefslogtreecommitdiff
path: root/network/irssi-python/abi18.diff
blob: 6248382771174f2846aeb8e0c2f8b7c850e793cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff --git a/configure.ac b/configure.ac
index e2b630d..c962091 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 #AC_PREREQ(2.59)
-AC_INIT([irssi-python], [test3], [loafier@gmail.com])
+AC_INIT([irssi-python], [test5], [loafier@gmail.com])
 AC_CONFIG_SRCDIR([src/pycore.c])
 AC_CONFIG_HEADER([pyirssi-config.h])
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/src/objects/rawlog-object.c b/src/objects/rawlog-object.c
index c872850..c5fa869 100644
--- a/src/objects/rawlog-object.c
+++ b/src/objects/rawlog-object.c
@@ -24,6 +24,10 @@
 #include "rawlog-object.h"
 #include "pycore.h"
 
+#if defined(IRSSI_ABI_VERSION) && IRSSI_ABI_VERSION >= 18
+#define RAWLOG18
+#endif
+
 /* monitor "????" signal */
 static void rawlog_cleanup(RAWLOG_REC *ban)
 {
@@ -64,7 +68,13 @@ PyDoc_STRVAR(PyRawlog_nlines_doc,
 static PyObject *PyRawlog_nlines_get(PyRawlog *self, void *closure)
 {
     RET_NULL_IF_INVALID(self->data);
-    return PyInt_FromLong(self->data->nlines);
+    return PyInt_FromLong(
+#ifdef RAWLOG18
+	self->data->lines->length
+#else
+	self->data->nlines
+#endif
+    );
 }
 
 /* specialized getters/setters */
@@ -93,7 +103,14 @@ static PyObject *PyRawlog_get_lines(PyRawlog *self, PyObject *args)
     if (!lines)
         return NULL;
 
-    for (node = self->data->lines; node; node = node->next)
+    for (node =
+#ifdef RAWLOG18
+	     self->data->lines->head
+#else
+	     self->data->lines
+#endif
+	     ;
+	 node; node = node->next)
     {
         int ret;
         PyObject *line = PyString_FromString(node->data);