-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbranch.h
More file actions
31 lines (20 loc) · 708 Bytes
/
Copy pathbranch.h
File metadata and controls
31 lines (20 loc) · 708 Bytes
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
#ifndef _BRANCH_H
#define _BRANCH_H
#include <stdint.h>
#include <semaphore.h>
typedef uint64_t BranchID;
typedef struct Branch {
BranchID branchID;
AccountAmount balance;
int numberAccounts;
Account *accounts;
sem_t branchLocker;
} Branch;
int Branch_Balance(struct Bank *bank, BranchID branchID, AccountAmount *balance);
int Branch_UpdateBalance(struct Bank *bank, BranchID branchID,
AccountAmount change);
int Branch_Init(struct Bank *bank, int numBranches, int numAccounts,
AccountAmount initialAmount);
int Branch_Validate(struct Bank *bank, BranchID branchID);
int Branch_Compare(Branch *branch1, Branch *branch2);
#endif /* _BRANCH_H */