Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

mq.h File Reference


Detailed Description

Message queues.

Author:
Raphael Manfredi
Date:
2002-2003

#include "common.h"
#include "gnutella.h"
#include "pmsg.h"
#include "tx.h"
#include "lib/cq.h"
#include "lib/slist.h"

Go to the source code of this file.

Data Structures

struct  mq_ops
 Operations defined on all mq types. More...
struct  mq_cops
struct  mqueue
 A message queue. More...

Defines

#define MQ_DEBUG
#define mq_check(x, y)   mq_check_track((x), (y), _WHERE_, __LINE__)

Typedefs

typedef mqueue mqueue_t

Enumerations

enum  mq_magic { MQ_MAGIC = 0x33990ee }
enum  { MQ_FLOWC = (1 << 0), MQ_DISCARD = (1 << 1), MQ_SWIFT = (1 << 2), MQ_WARNZONE = (1 << 3) }

Functions

gboolean mq_is_flow_controlled (const struct mqueue *q)
gboolean mq_is_swift_controlled (const struct mqueue *q)
gint mq_maxsize (const struct mqueue *q)
gint mq_size (const struct mqueue *q)
gint mq_lowat (const struct mqueue *q)
gint mq_hiwat (const struct mqueue *q)
gint mq_count (const struct mqueue *q)
gint mq_pending (const struct mqueue *q)
bio_sourcemq_bio (const struct mqueue *q)
gnutella_nodemq_node (const struct mqueue *q)
void mq_putq (mqueue_t *q, pmsg_t *mb)
 Enqueue message, which becomes owned by the queue.
void mq_free (mqueue_t *q)
 Free queue and all enqueued messages.
void mq_clear (mqueue_t *q)
 Remove all unsent messages from the queue.
void mq_discard (mqueue_t *q)
 Forbid further writes to the queue.
void mq_shutdown (mqueue_t *q)
 Disable all further writes from the queue.
void mq_fill_ops (struct mq_ops *ops)
const struct mq_copsmq_get_cops (void)
 Get common operations.
const gchar * mq_info (const mqueue_t *q)
 Compute readable queue information.
void mq_check_track (mqueue_t *q, gint offset, const gchar *where, gint line)
 Check queue's sanity.


Define Documentation

#define mq_check x,
 )     mq_check_track((x), (y), _WHERE_, __LINE__)
 

#define MQ_DEBUG
 


Typedef Documentation

typedef struct mqueue mqueue_t
 


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
MQ_FLOWC  In flow control.
MQ_DISCARD  No writing, discard message.
MQ_SWIFT  Swift mode, dropping more traffic.
MQ_WARNZONE  Between hiwat and lowat.

enum mq_magic
 

Enumeration values:
MQ_MAGIC 


Function Documentation

struct bio_source* mq_bio const struct mqueue q  ) 
 

void mq_check_track mqueue_t q,
gint  offset,
const gchar *  where,
gint  line
 

Check queue's sanity.

void mq_clear mqueue_t q  ) 
 

Remove all unsent messages from the queue.

gint mq_count const struct mqueue q  ) 
 

void mq_discard mqueue_t q  ) 
 

Forbid further writes to the queue.

void mq_fill_ops struct mq_ops ops  ) 
 

void mq_free mqueue_t q  ) 
 

Free queue and all enqueued messages.

Since the message queue is the top of the network TX stack, calling mq_free() recursively requests freeing to lower layers.

const struct mq_cops* mq_get_cops void   ) 
 

Get common operations.

gint mq_hiwat const struct mqueue q  ) 
 

const gchar* mq_info const mqueue_t q  ) 
 

Compute readable queue information.

gboolean mq_is_flow_controlled const struct mqueue q  ) 
 

gboolean mq_is_swift_controlled const struct mqueue q  ) 
 

gint mq_lowat const struct mqueue q  ) 
 

gint mq_maxsize const struct mqueue q  ) 
 

struct gnutella_node* mq_node const struct mqueue q  ) 
 

gint mq_pending const struct mqueue q  ) 
 

void mq_putq mqueue_t q,
pmsg_t mb
 

Enqueue message, which becomes owned by the queue.

void mq_shutdown mqueue_t q  ) 
 

Disable all further writes from the queue.

gint mq_size const struct mqueue q  ) 
 


Generated on Sat Jun 30 17:53:28 2007 for gtk-gnutella by  doxygen 1.3.9.1