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

event_gen_register.c File Reference


Detailed Description

For internal use only.

This file contains the implementation of the event_gen_register() function and its various helper functions.

Definition in file event_gen_register.c.

#include "event_int.h"
#include <stdlib.h>
#include <string.h>

Include dependency graph for event_gen_register.c:

Go to the source code of this file.

Data Structures

struct  generator
 Generator description structure. More...

Defines

#define gd_init(gd, desc)
 Initialize an ev_gendesc_t.
#define gens_link(ctx, gens)
 Event generators linker.

Functions

static ev_err_t gens_construct (ev_ctx_t *ctx, ev_gens_t *prev, ev_gens_t *next, struct generator *desc)
 Construct a generator descriptor.
static ev_err_t gens_extend (ev_ctx_t *ctx, ev_gens_t *gens, struct generator *desc)
 Extend an existing generator descriptor list element.
static ev_err_t gens_merge (ev_ctx_t *ctx, ev_gens_t *gens, struct generator *desc)
 Merge two sets of generator descriptors.
ev_err_t event_gen_register (ev_ctx_t *ctx, unsigned int gentype, ev_magic_t genmagic, size_t gensize, ev_freegen_t genrel)
 Register a generator.


Define Documentation

#define gd_init gd,
desc   ) 
 

For internal use only.

This helper macro initializes a generator descriptor with the specified description.

Parameters:
[in] gd A pointer to the ev_gendesc_t to be initialized.
[in] desc A pointer to a struct generator containing the description of the generator.

Definition at line 60 of file event_gen_register.c.

Referenced by gens_construct(), gens_extend(), and gens_merge().

#define gens_link ctx,
gens   ) 
 

For internal use only.

This macro is used to link a set of generator descriptors, as specified in the gens argument, into the linked list of generator descriptors. The gens structure must already have its next and prev pointers set.

Parameters:
[in] ctx A pointer to the containing ev_ctx_t.
[in] gens A pointer to an ev_gens_t to be linked into the list of generators.

Definition at line 88 of file event_gen_register.c.

Referenced by gens_construct(), gens_extend(), and gens_merge().


Function Documentation

static ev_err_t gens_construct ev_ctx_t ctx,
ev_gens_t prev,
ev_gens_t next,
struct generator desc
[static]
 

For internal use only.

This function is a helper function to create a new ev_gens_t containing a description of one generator, as specified by the desc parameter.

Parameters:
[in] ctx A pointer to the containing ev_ctx_t.
[in] prev A pointer to the previous ev_gens_t in the generator list.
[in] next A pointer to the next ev_gens_t in the generator list.
[in] desc A pointer to a struct generator containing the description of the generator.
Return values:
ENOMEM Out of memory.

Definition at line 119 of file event_gen_register.c.

References _ev_ctx_s::ec_maxgen, ev_return, ev_trace, gd_init, gens_link, generator::gentype, _ev_gens_s::gs_count, _ev_gens_s::gs_first, _ev_gens_s::gs_gens, _ev_gens_s::gs_next, and _ev_gens_s::gs_prev.

Referenced by event_gen_register().

static ev_err_t gens_extend ev_ctx_t ctx,
ev_gens_t gens,
struct generator desc
[static]
 

For internal use only.

This function is a helper function to extend an existing ev_gens_t to include a description of a new generator, as specified by the desc parameter.

Parameters:
[in] ctx A pointer to the containing ev_ctx_t.
[in] gens A pointer to the ev_gens_t to be extended.
[in] desc A pointer to a struct generator containing the description of the generator.
Return values:
ENOMEM Out of memory.

Definition at line 167 of file event_gen_register.c.

References _ev_ctx_s::ec_maxgen, ev_assert, ev_return, ev_trace, gd_init, gens_link, generator::gentype, _ev_gens_s::gs_count, _ev_gens_s::gs_first, and _ev_gens_s::gs_gens.

Referenced by event_gen_register().

static ev_err_t gens_merge ev_ctx_t ctx,
ev_gens_t gens,
struct generator desc
[static]
 

For internal use only.

This function is a helper function to merge two ev_gens_t structures into a single ev_gens_t containing all the generators of the two being merged and the one specified by the desc parameter. It is only called when the new generator has a type one greater than the last generator in gens and one less than the first generator in the ev_gens_t following gens in the linked list.

Parameters:
[in] ctx A pointer to the containing ev_ctx_t.
[in] gens A pointer to the first of two ev_gens_t to be merged.
[in] desc A pointer to a struct generator containing the description of the generator.
Return values:
ENOMEM Out of memory.

Definition at line 224 of file event_gen_register.c.

References _ev_ctx_s::ec_maxgen, ev_assert, ev_return, ev_trace, gd_init, gens_link, generator::gentype, _ev_gens_s::gs_count, _ev_gens_s::gs_first, _ev_gens_s::gs_gens, _ev_gens_s::gs_next, and _ev_gens_s::gs_prev.

Referenced by event_gen_register().


Generated on Wed Dec 28 23:37:16 2005 for event by  doxygen 1.4.4