[PATCH v6 5/8] edit: pass the l_edit instance to the display and debug handlers.
Grant Erickson <[email protected]> Sun, 6 Apr 2025 15:12:12 -0700
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <53394b18e388c2a6048705a7fa7a0a25ec49c868.1743977403.git.gerickson@nuovations.com> |
l_edit integrations are made easier when they have access to the instance pointer in their callbacks. --- ell/edit.c | 4 ++-- ell/edit.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ell/edit.c b/ell/edit.c index 899fea4da830..54cfc566c4ad 100644 --- a/ell/edit.c +++ b/ell/edit.c @@ -229,7 +229,7 @@ static void update_debug(struct l_edit *edit) tmp = l_string_unwrap(str); - edit->debug_handler(tmp, edit->debug_data); + edit->debug_handler(edit, tmp, edit->debug_data); l_free(tmp); } @@ -270,7 +270,7 @@ static void update_display(struct l_edit *edit) len--; } - edit->display_handler(buf, len, pos, edit->display_data); + edit->display_handler(edit, buf, len, pos, edit->display_data); update_debug(edit); } diff --git a/ell/edit.h b/ell/edit.h index 45ad2e657156..decf261c7b9e 100644 --- a/ell/edit.h +++ b/ell/edit.h @@ -20,12 +20,12 @@ struct l_edit; struct l_edit *l_edit_new(void); void l_edit_free(struct l_edit *edit); -typedef void (*l_edit_debug_func_t) (const char *str, void *user_data); +typedef void (*l_edit_debug_func_t) (struct l_edit *edit, const char *str, void *user_data); bool l_edit_set_debug_handler(struct l_edit *edit, l_edit_debug_func_t handler, void *user_data); -typedef void (*l_edit_display_func_t) (const wchar_t *wstr, size_t wlen, +typedef void (*l_edit_display_func_t) (struct l_edit *edit, const wchar_t *wstr, size_t wlen, size_t pos, void *user_data); bool l_edit_set_display_handler(struct l_edit *edit, -- 2.45.0