#ifndef LOGIC_H #define LOGIC_H #include #include #include #include #include struct product { float cost; int numberSold; char name; }; /* File */ int existsFile(const char *fname); int createFile(const char *fname); int renameDataFile(const char *oldName, const char *newName); /* Prodotti */ json_object *getProducts(const char *fname); void listProducts(const char *fname); int addProduct(const char *fname, const char *name, double price); double getPrice(const char *fname, const char *name); /* Copie vendute */ int getCount(const char *fname, const char *name); void listSold(const char *fname); int addSold(const char *fname, const char *name, int qty); /* Entrate */ double getTotalRevenue(const char *productsFile, const char *soldFile); #endif