From: "Hollerer Franz, Schrack Seconet AG, Entwicklung" <f.hollerer@schrack-seconet.com>
To: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Cc: "Hollerer Franz, Schrack Seconet AG,
Entwicklung" <f.hollerer@schrack-seconet.com>,
"Ullrich Lucas, Schrack Seconet AG,
Entwicklung" <l.ullrich@schrack-seconet.com>
Subject: [libgpiod]: feature request: API functions, const correctness
Date: Wed, 2 Aug 2023 14:06:08 +0000 [thread overview]
Message-ID: <a6ce12acff7b4ed9bae1df0115bba1f3@schrack-seconet.com> (raw)
Dear libgpiod-team,
I have a request, and it would be great if you could consider it for future versions of libgpiod. Within the current API it is not obvious which function parameters are input-only parameters, and which parameter are output parameters, i.e., will be modified.
I think it would be helpful if the API is const correct. As example, I think
> struct gpiod_line_info *gpiod_chip_get_line_info(struct gpiod_chip *chip,
> unsigned int offset);
should be changed to
> struct gpiod_line_info *gpiod_chip_get_line_info(const struct gpiod_chip *chip,
> unsigned int offset);
making it clear that the chip object is an input parameter which is not changed by the API function. Same argument applies for many other API functions...
Thanks for consideration & Best regards,
Franz Hollerer
next reply other threads:[~2023-08-02 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 14:06 Hollerer Franz, Schrack Seconet AG, Entwicklung [this message]
2023-08-12 18:42 ` [libgpiod]: feature request: API functions, const correctness Bartosz Golaszewski
2023-08-14 8:16 ` Hollerer Franz, Schrack Seconet AG, Entwicklung
2023-08-14 9:56 ` Bartosz Golaszewski
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=a6ce12acff7b4ed9bae1df0115bba1f3@schrack-seconet.com \
--to=f.hollerer@schrack-seconet.com \
--cc=l.ullrich@schrack-seconet.com \
--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