Porting C based GPIO Programming from Raspian/Raspberry PI OS

Fundamentally we have already answered your question regarding GPIO in our initial reponse.

  1. Search for C GPIO and you will get this: C/C++ GPIO library

  2. Our original reply post pointed you to libretech-wiring-tool. You can use lgpio bcm PIGPIO# to get the GPIO chip/line based on the Raspberry Pi GPIO numbering or lgpio info HEADER PIN# to get it based on the header relative pin number.

In so far as we are concerned, we have provided all the tools and necessary information to port any application to the upstream gpiod interface.