m_config: add custom context to includefunc callback

This commit is contained in:
wm4
2013-12-21 19:27:19 +01:00
parent 3846fc7587
commit dadf3a9a46
3 changed files with 7 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ static int parse_include(struct m_config *config, struct bstr param, bool set,
if (!set)
return 1;
char *filename = bstrdup0(NULL, param);
config->includefunc(config, filename, flags);
config->includefunc(config->includefunc_ctx, filename, flags);
talloc_free(filename);
return 1;
}

View File

@@ -61,7 +61,8 @@ typedef struct m_config {
bool use_profiles;
bool is_toplevel;
int (*includefunc)(struct m_config *conf, char *filename, int flags);
int (*includefunc)(void *ctx, char *filename, int flags);
void *includefunc_ctx;
void *optstruct; // struct mpopts or other
} m_config_t;