($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: ell@lists.linux.dev
Cc: Marcel Holtmann <marcel@holtmann.org>
Subject: [RFC PATCH v5] edit: pass the l_edit instance to the display and debug handlers.
Date: Thu,  4 Apr 2024 17:20:08 -0700	[thread overview]
Message-ID: <20240405002011.3480886-6-gerickson@nuovations.com> (raw)
In-Reply-To: <20240405002011.3480886-1-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.42.0


  parent reply	other threads:[~2024-04-05  0:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  0:20 [RFC PATCH v5] Line Editor Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] edit: Initial revision Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] ell: Add include directive for 'ell/edit.h' Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] ell/Makefile: Added 'edit.[ch]' to HEADERS and SOURCES Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] edit: Added 'l_edit_*' symbols Grant Erickson
2024-04-05  0:20 ` Grant Erickson [this message]
2024-04-05  0:20 ` [RFC PATCH v5] edit: change return signatures from 'bool' to 'int' Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] edit: change the 'l_edit_enter' return signature from 'char *' " Grant Erickson
2024-04-05  0:20 ` [RFC PATCH v5] edit: improve error handling of 'mbstowcs' and 'wcstombs' functions Grant Erickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240405002011.3480886-6-gerickson@nuovations.com \
    --to=gerickson@nuovations.com \
    --cc=ell@lists.linux.dev \
    --cc=marcel@holtmann.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).