#include "ctools/libft/printf/ft_printf.h"
#include "ctools/printf/ft_printf.h"
#include <stddef.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <gpiod.h>

#define GPIO_CHIP_NAME "gpiochip0"
#define GPIO_CHIP_PATH "/dev/gpiochip0"

#define FAIL(code, msg, ...) \
    do { \
        ft_fprintf(STDERR_FILENO, msg, ...); \
        exit(code); \
    } while (0);

int main() {
    struct gpiod_chip* chip = gpiod_chip_open(GPIO_CHIP_PATH);

    FAIL(1, "Failed to load chip %s", "chippy");

    if (!chip) {

    }
    ft_printf("Hello world\n");
}
