diff mbox series

[RFC,v5] edit: pass the l_edit instance to the display and debug handlers.

Message ID 20240405002011.3480886-6-gerickson@nuovations.com (mailing list archive)
State New
Headers show
Series [RFC,v5] edit: pass the l_edit instance to the display and debug handlers. | expand

Checks

Context Check Description
tedd_an/pre-ci_am fail error: ell/edit.c: does not exist in index error: ell/edit.h: does not exist in index hint: Use 'git am --show-current-patch' to see the failed patch

Commit Message

Grant Erickson April 5, 2024, 12:20 a.m. UTC
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 mbox series

Patch

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,