Commit 456fa635 authored by Pierre's avatar Pierre
Browse files

dynamicoverlay: We need a commanddesc_static_t for non strdup()-ed initializer.

parent 46ef499f
...@@ -71,18 +71,29 @@ typedef struct commandparams_t ...@@ -71,18 +71,29 @@ typedef struct commandparams_t
bool b_visible; /*< visibility flag of overlay */ bool b_visible; /*< visibility flag of overlay */
} commandparams_t; } commandparams_t;
typedef int (*parser_func_t)(char *psz_command, char *psz_end, commandparams_t *p_params );
typedef int (*execute_func_t)( filter_t *p_filter, const commandparams_t *p_params, commandparams_t *p_results );
typedef int (*unparse_func_t)( const commandparams_t *p_results, buffer_t *p_output );
typedef struct commanddesc_t typedef struct commanddesc_t
{ {
char *psz_command; char *psz_command;
bool b_atomic; bool b_atomic;
int ( *pf_parser ) ( char *psz_command, char *psz_end, parser_func_t pf_parser;
commandparams_t *p_params ); execute_func_t pf_execute;
int ( *pf_execute ) ( filter_t *p_filter, const commandparams_t *p_params, unparse_func_t pf_unparse;
commandparams_t *p_results );
int ( *pf_unparse ) ( const commandparams_t *p_results,
buffer_t *p_output );
} commanddesc_t; } commanddesc_t;
typedef struct commanddesc_static_t
{
const char *psz_command;
bool b_atomic;
parser_func_t pf_parser;
execute_func_t pf_execute;
unparse_func_t pf_unparse;
} commanddesc_static_t;
typedef struct command_t typedef struct command_t
{ {
struct commanddesc_t *p_command; struct commanddesc_t *p_command;
......
...@@ -792,7 +792,7 @@ static int exec_StartAtomic( filter_t *p_filter, ...@@ -792,7 +792,7 @@ static int exec_StartAtomic( filter_t *p_filter,
/***************************************************************************** /*****************************************************************************
* Command functions * Command functions
*****************************************************************************/ *****************************************************************************/
static const commanddesc_t p_commands[] = static const commanddesc_static_t p_commands[] =
{ {
{ .psz_command = "DataSharedMem", { .psz_command = "DataSharedMem",
.b_atomic = true, .b_atomic = true,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment