IO Algorithms

Name

IO Algorithms -- Interface for Algorithms.

Synopsis


struct      io_algorithm_t;
io_algorithm_t* get_IO_current_algorithm    (void);
GSList*     init_IO_algorithms              (void);
gint        register_IO_algorithm           (io_algorithm_t *algorithm);

Description

Great effort has been devoted to making the addicion of new algorithms as easy as posible, here is documented what there is to know to be able to write your own algorithms.

Details

struct io_algorithm_t

typedef struct {				/* This struct is all we know
						   about each algorithm */
	gchar * name;
	gint (*select) (void);
	gint (*unselect) (void);		/* These two functions will be
                                                   called before and after the
                                                   use of an algorithm to let
                                                   it keep a low memory usage
                                                   when not in use.*/
	GtkWidget * properties;			/* Each algorithm will maintain
                                                   it's own properties widget.
                                                   NULL means "no properties".
                                                   It should be set to NULL
                                                   when destroyed. If not
                                                   destroyed in "unselect" the
                                                   system will destroy it.*/
	gint (*event) (io_request_t *request);	/* This is called to inform the
						   algorithm of block request*/
	gint (*done_reading) (void);		/* This ia called to inform the
						   algorithm about all requested
						   reads been done */
} io_algorithm_t;


get_IO_current_algorithm ()

io_algorithm_t* get_IO_current_algorithm    (void);

Find out which is the current algorithm.

Returns : the struct which descrives the current algorithm.


init_IO_algorithms ()

GSList*     init_IO_algorithms              (void);

Initializes the IO algorithms code.

Mainly will call init functions for each algorithm.

Returns : a pointer to the algorithm structs linked list.


register_IO_algorithm ()

gint        register_IO_algorithm           (io_algorithm_t *algorithm);

Each algorithm should call this function in it's initialization function to register its algorithm struct.

algorithm : algorithm struct to register.
Returns : nothing important.

See Also

IO Simulation

How to inspect and manage requests.

Geometry

How manage geometry.

Property Widget Facility

How to hadle numerical algorithm properties with the user without learning GTK+.

Request Queues

How to hadle request queues.