QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
evs_query.h File Reference

For doing fast lookups of ev_path -> handler. More...

#include "quickio.h"

Go to the source code of this file.

Functions

struct eventevs_query_insert (const gchar *ev_path, const evs_handler_fn handler_fn, const evs_on_fn on_fn, const evs_off_fn off_fn, const gboolean handle_children)
 Create a new event. More...
 
struct eventevs_query (const gchar *ev_path, gchar **ev_extra)
 Finds an event by its path. More...
 
void evs_query_init ()
 Intializes the ptrie for usage.
 

Detailed Description

For doing fast lookups of ev_path -> handler.

Author
Andrew Stone andre.nosp@m.w@cl.nosp@m.ovar..nosp@m.com

Function Documentation

struct event* evs_query ( const gchar *  ev_path,
gchar **  ev_extra 
)

Finds an event by its path.

Parameters
ev_pathThe event path to find
ev_extraWhere to place any extra path segments that were found. For example, if ev_path="/event/path/with/some/extras", and the registered event was "/event/path", this will contains "/with/some/extras". If there are no extra paths, this will point to a string of len==0.
struct event* evs_query_insert ( const gchar *  ev_path,
const evs_handler_fn  handler_fn,
const evs_on_fn  on_fn,
const evs_off_fn  off_fn,
const gboolean  handle_children 
)

Create a new event.

Parameters
ev_pathThe event path
handler_fnThe function to be called when an event of this type comes in
on_fnCalled when a client attempts to subscribe to the event
off_fnCalled when a client unsubscribes from the event
handle_childrenIf the event would like to handle all unhandled children events
Returns
If the event was inserted. FALSE indicates that the event already exists.