ekg/msgqueue.c File Reference

#include "ekg2-config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "debug.h"
#include "dynstuff.h"
#include "commands.h"
#include "msgqueue.h"
#include "protocol.h"
#include "sessions.h"
#include "stuff.h"
#include "xmalloc.h"
#include "dynstuff_inline.h"

Functions

static LIST_FREE_ITEM (list_msg_queue_free, msg_queue_t *)
 DYNSTUFF_LIST_DECLARE (msgs_queue, msg_queue_t, list_msg_queue_free, __DYNSTUFF_LIST_ADD, __DYNSTUFF_LIST_REMOVE_ITER, __DYNSTUFF_LIST_DESTROY)
int msg_queue_remove_uid (const char *uid)
int msg_queue_remove_seq (const char *seq)
int msg_queue_flush (const char *session)
int msg_queue_count_session (const char *uid)
int msg_queue_write ()
int msg_queue_read ()

Variables

msg_queue_tmsgs_queue = NULL

Function Documentation

DYNSTUFF_LIST_DECLARE ( msgs_queue  ,
msg_queue_t  ,
list_msg_queue_free  ,
__DYNSTUFF_LIST_ADD  ,
__DYNSTUFF_LIST_REMOVE_ITER  ,
__DYNSTUFF_LIST_DESTROY   
)

static LIST_FREE_ITEM ( list_msg_queue_free  ,
msg_queue_t  
) [static]

int msg_queue_count_session ( const char *  uid  ) 

int msg_queue_flush ( const char *  session  ) 

int msg_queue_read (  ) 

msg_queue_read()

Read msgqueue of not sended messages.
msgqueue is subdir ("queue") in ekg2 config directory.

Todo:
return count of readed messages?
Todo:
code which handle errors is awful and it need rewriting.
Returns:
-1 if fail to open msgqueue directory
0 on success.

int msg_queue_remove_seq ( const char *  seq  ) 

int msg_queue_remove_uid ( const char *  uid  ) 

int msg_queue_write (  ) 


Variable Documentation

msg_queue_t* msgs_queue = NULL


Generated on Sat Nov 22 22:30:43 2008 for ekg2 by  doxygen 1.5.1