Skip to content

Commit

Permalink
Allow the parser client to pass data to plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed Oct 4, 2012
1 parent 4f2bf3b commit 4c31d12
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gst_playd.c
Expand Up @@ -54,7 +54,7 @@ struct timer_closure {
};

static struct parser_plugin_entry parser_operations[] = {
{ "Ping", op_ping_new, op_ping_register, op_ping_free },
{ "Ping", NULL, op_ping_new, op_ping_register, op_ping_free },
{ NULL },
};

Expand Down
2 changes: 1 addition & 1 deletion src/operations.c
Expand Up @@ -29,7 +29,7 @@ struct message_dispatch_entry ping_messages[] = {
{ NULL },
};

void* op_ping_new(void)
void* op_ping_new(void* dontcare)
{
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/operations.h
Expand Up @@ -21,7 +21,7 @@
#ifndef _OPERATIONS_H
#define _OPERATIONS_H

void* op_ping_new(void);
void* op_ping_new(void*);
char* op_ping_parse(const char* param, void*);
gboolean op_ping_register(void* ctx, struct message_dispatch_entry** entries);
void op_ping_free(void* ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/parser.c
Expand Up @@ -62,7 +62,7 @@ void parse_free(struct parse_ctx* parser)

gboolean parse_register_plugin(struct parse_ctx* parser, struct parser_plugin_entry* plugin)
{
void* plugin_ctx = (*plugin->plugin_new)();
void* plugin_ctx = (*plugin->plugin_new)(plugin->context);

struct message_dispatch_entry* regd_messages = NULL;
struct plugin_entry_with_ctx* p_entry;
Expand Down
3 changes: 2 additions & 1 deletion src/parser.h
Expand Up @@ -32,8 +32,9 @@ struct message_dispatch_entry {

struct parser_plugin_entry {
const char* friendly_name;
void* context;

void* (*plugin_new)(void);
void* (*plugin_new)(void* registrar_ctx);
gboolean (*plugin_register)(void* ctx, struct message_dispatch_entry** entries);
void (*plugin_free)(void* ctx);
};
Expand Down

0 comments on commit 4c31d12

Please sign in to comment.