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

inputevt.c File Reference


Detailed Description

Input I/O notification.

Basically this is a duplicate of the GDK input facilities, without the features gtkg does not use.

The intent here is to break the GDK dependency but retain the same behavior, to avoid disturbing too much of the existing code.

Author:
ko (ko-@wanadoo.fr)
Date:
2002
Author:
Christian Biere
Date:
2005

#include "common.h"
#include "inputevt.h"
#include "walloc.h"
#include "override.h"

Data Structures

struct  inputevt_relay_t
 The relay structure is used as a bridge to provide GDK-compatible input condition flags. More...

struct  relay_list

Defines

#define READ_CONDITION   (G_IO_IN | G_IO_PRI)
#define WRITE_CONDITION   (G_IO_OUT)
#define EXCEPTION_CONDITION   (G_IO_ERR | G_IO_HUP | G_IO_NVAL)
#define CASE(x)   case x: return STRINGIFY(x)
#define BIT_ARRAY_BYTE(base, i)   base[i / (8 * sizeof base[0])]
#define BIT_ARRAY_BIT(base, i)   (1UL << (i % (8 * sizeof base[0])))

Typedefs

typedef relay_list relay_list_t

Functions

 RCSID ("$Id:inputevt.c, v 1.43 2005/09/30 22:07:43 cbiere Exp $")
const gchar * inputevt_cond_to_string (inputevt_cond_t cond)
gulong * bit_array_realloc (gulong *base, size_t n)
void bit_array_set (gulong *base, size_t i)
void bit_array_clear (gulong *base, size_t i)
void bit_array_flip (gulong *base, size_t i)
gboolean bit_array_get (const gulong *base, size_t i)
void bit_array_clear_range (gulong *base, size_t from, size_t to)
size_t bit_array_first_clear (const gulong *base, size_t from, size_t to)
void inputevt_relay_destroy (gpointer data)
 Frees the relay structure when its time comes.

gboolean inputevt_dispatch (GIOChannel *source, GIOCondition condition, gpointer data)
 Relays the event to the registered handler function.

guint inputevt_add_source_with_glib (inputevt_relay_t *relay)
guint inputevt_add_source (inputevt_relay_t *relay)
guint inputevt_add (gint fd, inputevt_cond_t cond, inputevt_handler_t handler, gpointer data)
 This emulates the GDK input interface.

void inputevt_init (void)
 Performs module initialization.

void inputevt_close (void)
 Performs module cleanup.


Variables

const inputevt_handler_t zero_handler


Define Documentation

#define BIT_ARRAY_BIT base,
 )     (1UL << (i % (8 * sizeof base[0])))
 

#define BIT_ARRAY_BYTE base,
 )     base[i / (8 * sizeof base[0])]
 

#define CASE  )     case x: return STRINGIFY(x)
 

#define EXCEPTION_CONDITION   (G_IO_ERR | G_IO_HUP | G_IO_NVAL)
 

#define READ_CONDITION   (G_IO_IN | G_IO_PRI)
 

#define WRITE_CONDITION   (G_IO_OUT)
 


Typedef Documentation

typedef struct relay_list relay_list_t
 


Function Documentation

void bit_array_clear gulong *  base,
size_t  i
[inline, static]
 

void bit_array_clear_range gulong *  base,
size_t  from,
size_t  to
[inline, static]
 

size_t bit_array_first_clear const gulong *  base,
size_t  from,
size_t  to
[inline, static]
 

void bit_array_flip gulong *  base,
size_t  i
[inline, static]
 

gboolean bit_array_get const gulong *  base,
size_t  i
[inline, static]
 

gulong* bit_array_realloc gulong *  base,
size_t  n
[inline, static]
 

void bit_array_set gulong *  base,
size_t  i
[inline, static]
 

guint inputevt_add gint  fd,
inputevt_cond_t  cond,
inputevt_handler_t  handler,
gpointer  data
 

This emulates the GDK input interface.

A replacement for gdk_input_add(). Behaves exactly the same, except destroy notification has been removed (since gtkg does not use it).

guint inputevt_add_source inputevt_relay_t relay  )  [static]
 

guint inputevt_add_source_with_glib inputevt_relay_t relay  )  [static]
 

void inputevt_close void   ) 
 

Performs module cleanup.

const gchar* inputevt_cond_to_string inputevt_cond_t  cond  ) 
 

gboolean inputevt_dispatch GIOChannel *  source,
GIOCondition  condition,
gpointer  data
[static]
 

Relays the event to the registered handler function.

The input condition flags are properly mapped before being passed on.

void inputevt_init void   ) 
 

Performs module initialization.

void inputevt_relay_destroy gpointer  data  )  [static]
 

Frees the relay structure when its time comes.

RCSID "$Id:inputevt.  c,
v 1.43 2005/09/30 22:07:43 cbiere Exp $" 
 


Variable Documentation

const inputevt_handler_t zero_handler [static]
 


Generated on Sun Feb 12 10:50:03 2006 for Gtk-Gnutella by doxygen 1.3.6