-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathShop.h
33 lines (26 loc) · 874 Bytes
/
Shop.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
#ifndef __SHOP__
#define __SHOP__
#include <crtdbg.h> // TODO: remove before release
#include <stdio.h>
#include <string.h>
#include "Time.h"
#include "General.h"
typedef enum {
eRestaurant, eCoffeeShop, eBar, eNofShopTypes
}eShopType;
static const char* ShopTypeStr[eNofShopTypes] = { "Restaurant", "Coffee Shop", "Bar" };
typedef struct {
char* name;
eShopType type;
Time openHour;
Time closeHour;
int isNameDynamic; // Flag to indicate if name is dynamically allocated (for freeing)
} Shop;
int initShop(Shop* shop, char* name, eShopType type, Time openHour, Time closeHour, int isNameDynamic);
int isValidShop(char* name, eShopType type, Time openHour, Time closeHour);
void printShop(const void* shop);
int compareShopsByName(const Shop* shop1, const Shop* shop2);
void freeShop(void* shop);
void printShopTypes();
void initShopByUser(Shop* shop);
#endif