]> jfr.im git - irc/irssi/irssi.git/commitdiff
reverse queue
authorailin-nemui <redacted>
Fri, 9 Nov 2018 10:32:00 +0000 (11:32 +0100)
committerailin-nemui <redacted>
Fri, 9 Nov 2018 10:32:00 +0000 (11:32 +0100)
src/core/rawlog.c
src/perl/common/Rawlog.xs

index dafad057cff41603095afff2420bc58018c8df56..e0c4dd3d69cf1557dde99add49b51ea53b611864 100644 (file)
@@ -63,7 +63,7 @@ void rawlog_destroy(RAWLOG_REC *rawlog)
 static void rawlog_add(RAWLOG_REC *rawlog, char *str)
 {
        if (rawlog->lines->length >= rawlog_lines && rawlog_lines > 0) {
-               void *tmp = g_queue_pop_tail(rawlog->lines);
+               void *tmp = g_queue_pop_head(rawlog->lines);
                g_free(tmp);
        }
 
@@ -72,7 +72,7 @@ static void rawlog_add(RAWLOG_REC *rawlog, char *str)
                write_buffer(rawlog->handle, "\n", 1);
        }
 
-       g_queue_push_head(rawlog->lines, str);
+       g_queue_push_tail(rawlog->lines, str);
        signal_emit_id(signal_rawlog, 2, rawlog, str);
 }
 
@@ -105,7 +105,7 @@ static void rawlog_dump(RAWLOG_REC *rawlog, int f)
        GList *tmp;
        ssize_t ret = 0;
 
-       for (tmp = rawlog->lines->tail; ret != -1 && tmp != NULL; tmp = tmp->prev) {
+       for (tmp = rawlog->lines->head; ret != -1 && tmp != NULL; tmp = tmp->next) {
                ret = write(f, tmp->data, strlen((char *) tmp->data));
                 if (ret != -1)
                         ret = write(f, "\n", 1);
index 73845287e1d135a178b5e2e1d3138274cd0bb018..3c946c7e10a9b4e13decb465f15fdbb9abe551be 100644 (file)
@@ -21,7 +21,7 @@ rawlog_get_lines(rawlog)
 PREINIT:
        GList *tmp;
 PPCODE:
-       for (tmp = rawlog->lines->tail; tmp != NULL; tmp = tmp->prev) {
+       for (tmp = rawlog->lines->head; tmp != NULL; tmp = tmp->next) {
                XPUSHs(sv_2mortal(new_pv(tmp->data)));
        }