Main Page | Directories | File List | Globals

fifo.c File Reference

#include <agnix/agnix.h>
#include <agnix/queues.h>
#include <agnix/list.h>
#include <agnix/console.h>

Include dependency graph for fifo.c:

Go to the source code of this file.

Defines

#define MOD_NAME   "QUEUES: \t"

Functions

int queue_type_fifo_init (struct queue_type_s *queue_type)
int queue_type_fifo_remove (struct queue_type_s *queue_type)
int queue_fifo_init (struct queue_s *queue)
int queue_fifo_remove (struct queue_s *queue)
int queue_fifo_enqueue (struct queue_s *queue, struct queue_entry_s *queue_entry)
queue_entry_s * queue_fifo_dequeue (struct queue_s *queue)
int queue_fifo_control (struct queue_s *queue, int op, void *arg)
int queues_fifo_init (void)

Variables

queue_ops_s queue_fifo_ops
queue_type_ops_s queue_type_fifo_ops
queue_type_s queue_type_fifo


Define Documentation

#define MOD_NAME   "QUEUES: \t"
 

Definition at line 19 of file fifo.c.


Function Documentation

int queue_fifo_control struct queue_s *  queue,
int  op,
void *  arg
 

Definition at line 62 of file fifo.c.

00063 {
00064     return 0;
00065 }

struct queue_entry_s* queue_fifo_dequeue struct queue_s *  queue  ) 
 

Definition at line 48 of file fifo.c.

00049 {
00050     struct queue_entry_s *queue_entry;
00051 
00052     if (list_empty(&queue->queue_list))
00053         return NULL;
00054 
00055     queue_entry = list_entry(queue->queue_list.next, struct queue_entry_s, queue_entry_list);
00056 
00057     list_del(queue->queue_list.next);    
00058 
00059     return queue_entry;
00060 }

int queue_fifo_enqueue struct queue_s *  queue,
struct queue_entry_s *  queue_entry
 

Definition at line 41 of file fifo.c.

00042 {
00043     list_add_tail(&queue_entry->queue_entry_list, &queue->queue_list);    
00044 
00045     return 0;
00046 }

int queue_fifo_init struct queue_s *  queue  ) 
 

Definition at line 31 of file fifo.c.

00032 {
00033     return 0;
00034 }

int queue_fifo_remove struct queue_s *  queue  ) 
 

Definition at line 36 of file fifo.c.

00037 {
00038     return 0;
00039 }

int queue_type_fifo_init struct queue_type_s *  queue_type  ) 
 

Definition at line 21 of file fifo.c.

00022 {
00023     return 0;
00024 }

int queue_type_fifo_remove struct queue_type_s *  queue_type  ) 
 

Definition at line 26 of file fifo.c.

00027 {
00028     return 0;
00029 }

int queues_fifo_init void   ) 
 

Definition at line 88 of file fifo.c.

References queue_type_fifo, and register_queue_type().

Referenced by queues_init().

00089 {
00090     return register_queue_type(&queue_type_fifo);
00091 }

Here is the call graph for this function:


Variable Documentation

struct queue_ops_s queue_fifo_ops
 

Initial value:

 {
    .init               = queue_fifo_init,
    .remove             = queue_fifo_remove,
    .enqueue            = queue_fifo_enqueue,
    .dequeue            = queue_fifo_dequeue,
    .control            = queue_fifo_control,
    .peek               = NULL
}

Definition at line 67 of file fifo.c.

struct queue_type_s queue_type_fifo
 

Initial value:

 {
    .queue_type         = QUEUE_TYPE_FIFO,
    .queue_type_name    = "FIFO",
    .queue_type_ops     = &queue_type_fifo_ops,
}

Definition at line 82 of file fifo.c.

Referenced by queues_fifo_init().

struct queue_type_ops_s queue_type_fifo_ops
 

Initial value:

 {
    .init               = queue_type_fifo_init,
    .remove             = queue_type_fifo_remove,
    .queue_ops          = &queue_fifo_ops
}

Definition at line 76 of file fifo.c.

Dokumentacje wygenerowano programem Doxygen 1.4.2 dla projektu Agnix