-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfunctions.h
74 lines (58 loc) · 1.79 KB
/
functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef BARGAIN_HUNTING_SCRAPER_H
#define BARGAIN_HUNTING_SCRAPER_H
typedef struct {
char ean[13];
char name[50];
char desc[30];
double price;
char store[15];
} product;
/*Dictonary entry*/
typedef struct DictionaryEntry {
char Key[20];
char Value[20];
} SDictEntry;
/*Our dictonary*/
typedef struct Dictionary {
int DictLength;
int DictMaxSize;
SDictEntry* entry;
} SDictionary;
typedef struct Params {
char RequestType[7];
char URL[250];
char KeyTypeAndKey[100];
char PostFields[300];
} SAPIStruct;
typedef struct string {
char* ptr;
size_t len;
} string;
typedef struct node {
product data;
struct node* next;
} node;
char* GetSallingProducts(char* Item);
void GetNonCoopProducts(char* Item, SDictionary Dictionary, node** LinkedListHead);
char* GetCoopProducts(char* Store);
void WriteCoopDataToFile(char* Item, SDictionary Dictionary, int Runs);
void StoreChoice();
void InsertToList(node** head, product data);
int StoreCheck(char CurrentInput[]);
char* APICall(SAPIStruct params);
char* DictionaryLookup(SDictionary Dictionary, char* Key);
SDictionary InitDictionary();
void InitString(struct string* s);
size_t WriteFunc(void* ptr, size_t size, size_t nmemb, struct string* s);
void CheckInputForSalling(char* string);
int IsProductInList(node* LinkedList, product data);
void Rema1000Scan(FILE* file, node** head);
void SallingScan(FILE* file, node** head);
void InsertToList(node** head, product data);
int ScanInput(char* name);
void CheckOutputChar(char* string);
void DeleteAllListItems(node** LinkedListHead);
void ReadCoopData(char* Query, node** ProductList);
void FinalPrint(struct node* head, int MaxItems);
void RelevantCoopData(FILE* QFile, char* Store, char* Query, node** LinkedList);
#endif //BARGAIN_HUNTING_SCRAPER_H