make eventing cooler, yeah I know it's only 1 day old but... *shrug*

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@156 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2005-12-15 19:10:43 +00:00
parent ced29c144d
commit 48e62491e1
5 changed files with 88 additions and 53 deletions
+14 -8
View File
@@ -38,28 +38,34 @@ extern "C" {
#include <switch.h>
struct switch_event_subclass {
char *owner;
char *name;
};
struct switch_event {
switch_event_t event;
int subclass;
switch_event_subclass *subclass;
char *data;
void *user_data;
struct switch_event *next;
};
struct switch_event_node {
char *id;
switch_event_t event;
int subclass;
switch_event_subclass *subclass;
switch_event_callback_t callback;
void *user_data;
struct switch_event_node *next;
};
SWITCH_DECLARE(switch_status) switch_event_shutdown(void);
SWITCH_DECLARE(switch_status) switch_event_init(switch_memory_pool *pool);
SWITCH_DECLARE(switch_status) switch_event_fire_subclass(switch_event_t event, int subclass, char *data);
SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, int subclass, switch_event_callback_t callback);
SWITCH_DECLARE(switch_status) switch_event_fire_subclass(switch_event_t event, char *subclass_name, char *data);
SWITCH_DECLARE(switch_status) switch_event_bind(char *id, switch_event_t event, char *subclass_name, switch_event_callback_t callback, void *user_data);
SWITCH_DECLARE(char *) switch_event_name(switch_event_t event);
SWITCH_DECLARE(char *) switch_event_subclass_name(int subclass);
SWITCH_DECLARE(switch_status) switch_event_reserve_subclass(int subclass, char *name);
#define switch_event_fire(event, data) switch_event_fire_subclass(event, 0, data);
SWITCH_DECLARE(switch_status) switch_event_reserve_subclass_detailed(char *owner, char *subclass_name);
#define switch_event_fire(event, data) switch_event_fire_subclass(event, NULL, data);
#define switch_event_reserve_subclass(subclass_name) switch_event_reserve_subclass_detailed(__FILE__, subclass_name)
#endif
+1
View File
@@ -139,6 +139,7 @@ typedef enum {
} switch_event_t;
typedef struct switch_event switch_event;
typedef struct switch_event_subclass switch_event_subclass;
typedef struct switch_event_node switch_event_node;
typedef void (*switch_event_callback_t)(switch_event *);
typedef apr_threadattr_t switch_threadattr_t;