[syslog-ng] need help understanding logqueue-fifo.c code

Evan Rempel erempel at uvic.ca
Thu Mar 8 06:24:14 CET 2012

I am having difficulties understanding the code that handles the LogQueueFifo objects.

For instance

static void log_queue_fifo_push_head(LogQueue *s, LogMessage *msg, const LogPathOptions *path_options)
    LogQueueFifo *self = (LogQueueFifo *) s;
    LogMessageQueueNode *node;


I don't understand how a LogQueue*  can be passed in, and then cast to a LogQueueFifo* when the
structs are not the same. Then fields in the LogQueueFifo* are referenced but they won't have any meaning
because the LogQueue* didn't have the same data at the same location.

I am a little rusty in C, so can someone explain this to me please?


More information about the syslog-ng mailing list