Nimbin2git.christianimmanuel.de / Games / dvd / upcitemdb.h

dvd files

last change 2026-09-04 (2 hours ago)

wget https://git.christianimmanuel.de/games/dvd/archive/dvd.tar.gz
upcitemdb.h 795 B · 28 lines raw
#ifndef UPCITEMDB_H
#define UPCITEMDB_H

#include <json-c/json.h>

// Define the struct to hold the parsed JSON response
typedef struct {
    char title[256];
    double lowest_recorded_price;
    double highest_recorded_price;
    char category[256];
} Websearch_st;

// Function to parse the JSON response and populate the struct
Websearch_st parse_json_response(const char *response);

// Function to print the contents of the Websearch_st struct
void print_json_response(const Websearch_st *response);

// Function to execute the curl request and return the response as a string
char* fetch_json_response(const char *url);

// Function to read barcode, fetch data, and parse into a Websearch_st struct
Websearch_st readUpcitemdb(char* barcode);

int test_upcitemdb();

#endif // UPCITEMDB_H