Linux-GPIO Archive mirror
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [libgpiod][RFC] helper functions for basic use cases
Date: Thu, 16 May 2024 08:19:06 +0800	[thread overview]
Message-ID: <20240516001906.GA5963@rigel> (raw)
In-Reply-To: <20240515141436.GA349711@rigel>

On Wed, May 15, 2024 at 10:14:36PM +0800, Kent Gibson wrote:
> On Wed, May 15, 2024 at 06:54:15AM -0700, Bartosz Golaszewski wrote:
> > On Wed, 15 May 2024 11:18:48 +0200, Kent Gibson <warthog618@gmail.com> said:
> > >
> >
> > Yeah, I hate it...
> >
>
> I wasn't expecting any love for it - it is ugly.
> But it does the job.
>

An alternative is to extend the struct gpiod_line_request to contain a
pointer to the config.  The ext constructors would store their config
there rather than free it.  The core constructors would leave it NULL,
though you would always have the option to keep a copy there later if
core wants to make use of it.
And gpiod_line_request_free() would free it.

The ext mutators would only accept requests with the config set.

That can all be conditional on extensions being part of the build.

So taking advantage of the pimpl interface.  Yay.

Would that work for you?

And I think I mis-interpreted one of your earlier mails - you want the
extensions to go in their own shared library, not bundled in libgpiod.so?
Though if that is the case it would be helpful to relax the use of pimpl
within the lib so the extensions can access any fields not made public
through the core API, as well as more efficiently access those that are.

Cheers,
Kent.

  reply	other threads:[~2024-05-16  0:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07  2:21 [libgpiod][RFC] helper functions for basic use cases Kent Gibson
2024-05-10 18:37 ` Bartosz Golaszewski
2024-05-11  1:11   ` Kent Gibson
2024-05-13  8:28     ` Bartosz Golaszewski
2024-05-13 10:13       ` Kent Gibson
2024-05-14 13:31         ` Bartosz Golaszewski
2024-05-14 13:38           ` Kent Gibson
2024-05-15  8:26             ` Bartosz Golaszewski
2024-05-15  9:18               ` Kent Gibson
2024-05-15 13:37                 ` Kent Gibson
2024-05-15 13:54                 ` Bartosz Golaszewski
2024-05-15 14:14                   ` Kent Gibson
2024-05-16  0:19                     ` Kent Gibson [this message]
2024-05-16 13:55                     ` Kent Gibson
2024-05-17 10:53                     ` Bartosz Golaszewski
2024-05-17 12:37                       ` Kent Gibson
2024-05-22 10:59                         ` Bartosz Golaszewski
2024-05-22 12:41                           ` Kent Gibson
2024-05-24 14:20                             ` Bartosz Golaszewski
2024-05-15  7:06       ` Martin Hundebøll
2024-05-15  9:32         ` Kent Gibson

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=20240516001906.GA5963@rigel \
    --to=warthog618@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@vger.kernel.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).