aggiunta logica di gestione dati. Assistito con ai

This commit is contained in:
admin committed 2026-10-09 17:18:38 +02:00
1 parent 1a15d93f76
commit 5db402c7cf
10 files changed
+769 -71

No files matched your search

+1
View File
@@ -6,5 +6,6 @@
#include <string.h>
extern char productPricesFileLocation[64]; // Dichiarazione extern
extern char countFileLocation[64];
#endif
+22 -5
View File
@@ -1,19 +1,36 @@
#ifndef LOGIC_H
#define LOGIC_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ncurses.h>
#include <json-c/json.h>
struct product {
float cost;
int numberSold;
char name;
float cost;
int numberSold;
char name;
};
int getCount();
/* File */
int existsFile(const char *fname);
void createFile(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
+5
View File
@@ -8,6 +8,11 @@
int runMainMenu();
void runOptionsMenu();
void runSellWindow();
void runAboutWindow();
void runViewSalesWindow();
void runViewProductsWindow();
void runAddProductWindow();
void example_window();
#endif