diff options
author | Alfred E. Heggestad <aeh@db.org> | 2014-10-19 01:23:57 +0200 |
---|---|---|
committer | Alfred E. Heggestad <aeh@db.org> | 2014-10-19 01:23:57 +0200 |
commit | 76db3b6d9fabb4c9460c917bfc4405a50897658e (patch) | |
tree | 77a97667796553fc40a6e89654772d60eb496d85 /include | |
parent | ad3905c989d13b5a216643437d2152f8c0629bde (diff) |
ui: update UI-module API
- change from multiple-instances to single-instance
(multiple-instances was never used)
- remove ui/input config parameters from the "core" config,
moved to each specific module (cons and evdev)
- modules updated: stdio, cons, evdev, wincons
- this patch solves the reported crash, that module-functions
are called after the module was unloaded.
Diffstat (limited to 'include')
-rw-r--r-- | include/baresip.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/include/baresip.h b/include/baresip.h index 5325bc2..406c5fc 100644 --- a/include/baresip.h +++ b/include/baresip.h @@ -130,11 +130,6 @@ enum audio_mode { /** Core configuration */ struct config { - /** Input */ - struct config_input { - char device[64]; /**< Input device name */ - uint32_t port; /**< Input port number */ - } input; /** SIP User-Agent */ struct config_sip { @@ -534,27 +529,24 @@ struct sipevent_sock *uag_sipevent_sock(void); * User Interface */ -struct ui; -struct ui_st; +typedef int (ui_output_h)(const char *str); -/** User Interface parameters */ -struct ui_prm { - char *device; /**< Device name */ - uint16_t port; /**< Port number */ +/** Defines a User-Interface module */ +struct ui { + struct le le; /**< Linked-list element */ + const char *name; /**< Name of the UI-module */ + ui_output_h *outputh; /**< Handler for output strings (optional) */ }; -typedef void (ui_input_h)(char key, struct re_printf *pf, void *arg); -typedef int (ui_alloc_h)(struct ui_st **stp, struct ui_prm *prm, - ui_input_h *ih, void *arg); -typedef int (ui_output_h)(struct ui_st *st, const char *str); +void ui_register(struct ui *ui); +void ui_unregister(struct ui *ui); -void ui_init(const struct config_input *cfg); +void ui_reset(void); void ui_input(char key); +void ui_input_key(char key, struct re_printf *pf); void ui_input_str(const char *str); int ui_input_pl(struct re_printf *pf, const struct pl *pl); void ui_output(const char *str); -int ui_register(struct ui **uip, const char *name, - ui_alloc_h *alloch, ui_output_h *outh); /* |