diff options
Diffstat (limited to 'src/wydawca.h')
-rw-r--r-- | src/wydawca.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/wydawca.h b/src/wydawca.h index 9e4b2be..8e2f155 100644 --- a/src/wydawca.h +++ b/src/wydawca.h @@ -291,6 +291,9 @@ struct notification { enum notification_target tgt; const char *sign_keys; const char *msg; + char *modname; + void *modcfg; + grecs_node_t *modnode; }; void register_message_template(const char *name, const char *text); @@ -316,6 +319,27 @@ void meta_free(struct metadef *def); const char *expand_email_admin(struct metadef *def, void *data); const char *expand_email_owner(struct metadef *def, void *data); +/* Modules */ +typedef char *(*format_fn)(void *, const char *); + +struct module { + char *name; + char *path; + grecs_locus_t locus; + void *handle; + void *(*config) (grecs_node_t *); + int (*notify) (void *, int, format_fn, void *); +}; + +int cb_module(enum grecs_callback_command cmd, grecs_node_t *node, + void *varptr, void *cb_data); +void modules_load(void); + +extern struct grecs_list *module_load_path, *module_prepend_load_path; +void module_notify(const char *name, void *modcfg, + enum notification_event ev, struct file_triplet *tpl); + + /* Global variables */ extern char *program_name; extern uid_t wydawca_uid; @@ -483,6 +507,8 @@ void config_finish(struct grecs_node *); void config_help(void); int assert_string_arg(grecs_locus_t *, enum grecs_callback_command, const grecs_value_t *); +grecs_value_t *get_arg(grecs_value_t *value, unsigned n, int type); + /* vtab.c */ int url_to_vtab(mu_url_t url, struct virt_tab *vtab); |