iBuy data structures
Functions to read and write iBuy data from files
 All Data Structures Files Functions
structures.h
1 
6 #ifndef _DEFSTRUCTS_H_
7 #define _DEFSTRUCTS_H_
8 
9  #define MAX_USERS 30
10  #define MAX_ITEMS 100
11 
12  #define L_USER_LOGIN 11
13  #define L_USER_PASSWORD 9
14  #define L_USER_NAME 26
15  #define L_USER_SURNAME 21
16  #define L_ITEM_NAME 65
17  #define L_ITEM_DESCRIPTION 257
18 
19  struct User {
20  int userID;
21  char login[L_USER_LOGIN];
22  char password[L_USER_PASSWORD];
23  char name[L_USER_NAME];
24  char surname[L_USER_SURNAME];
25  int nFavoriteSellers;
26  int favoriteSellers[MAX_USERS-1]; // A user cannot be friend of him/herself
27  };
28 
29  struct Item {
30  int itemID;
31  char name[L_ITEM_NAME];
32  char description[L_ITEM_DESCRIPTION];
33  float price;
34  int sellerID;
35  int nLikeRatings;
36  int likeRatings[MAX_USERS];
37  int nDealRatings;
38  int dealRatings[MAX_USERS];
39  int nSoldRatings;
40  int soldRatings[MAX_USERS];
41  };
42 
43 #endif