[libgpiod]: feature request: API functions, const correctness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux