pianod2
multisource multiuser scriptable networked music player
Functions | Variables
fb_message.c File Reference

Football message management functions. More...

#include <config.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <assert.h>
#include "fb_public.h"
#include "fb_service.h"
Include dependency graph for fb_message.c:

Functions

void fb_free_freelists ()
 
FB_MESSAGEfb_messagealloc (void)
 
void fb_messagefree (FB_MESSAGE *freethis)
 
FB_MESSAGELISTfb_qalloc (void)
 
void fb_qfree (FB_MESSAGELIST *freethis)
 
bool fb_queue_empty (FB_IOQUEUE *q)
 
bool fb_queue_add (FB_IOQUEUE *queue, FB_MESSAGE *message)
 
void fb_queue_consume (FB_IOQUEUE *q, size_t consume)
 
void fb_queue_destroy (FB_IOQUEUE *q)
 

Variables

static FB_MESSAGEfreemessages = NULL
 
static FB_MESSAGELISTfreeq = NULL
 

Detailed Description

Football message management functions.

Function Documentation

◆ fb_free_freelists()

void fb_free_freelists ( void  )

Free the free message lists

Here is the caller graph for this function:

◆ fb_messagealloc()

FB_MESSAGE* fb_messagealloc ( void  )

Allocate a message block structure. Get it off the free list if its available, otherwise malloc a new one.

Returns
the message block, or NULL on failure.
Here is the caller graph for this function:

◆ fb_messagefree()

void fb_messagefree ( FB_MESSAGE freethis)

"Free" a message block by putting it on the free list.

Here is the caller graph for this function:

◆ fb_qalloc()

FB_MESSAGELIST* fb_qalloc ( void  )
Here is the caller graph for this function:

◆ fb_qfree()

void fb_qfree ( FB_MESSAGELIST freethis)

"Free" a single message by putting it on the free list.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_queue_add()

bool fb_queue_add ( FB_IOQUEUE queue,
FB_MESSAGE message 
)

Add a message to a queue. Does not adjust message block use counts.

Parameters
queuethe queue to add to.
messagethe message to add to the queue.
Returns
true on success, false on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_queue_consume()

void fb_queue_consume ( FB_IOQUEUE q,
size_t  consume 
)

Consume bytes at the front of the queue. Bytes consumed must not exceed the remaining bytes in the front message block.

Parameters
qthe queue
consumeThe number of bytes to consume.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_queue_destroy()

void fb_queue_destroy ( FB_IOQUEUE q)

Trash everything in a queue.

Parameters
qthe queue to free.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fb_queue_empty()

bool fb_queue_empty ( FB_IOQUEUE q)

Check if a queue empty is empty.

Returns
true if the queue is empty.
Here is the caller graph for this function:

Variable Documentation

◆ freemessages

FB_MESSAGE* freemessages = NULL
static

◆ freeq

FB_MESSAGELIST* freeq = NULL
static