-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinked_list_implementation.h
57 lines (51 loc) · 1.53 KB
/
linked_list_implementation.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
#ifndef L_L_IMP /* Guard */
#define L_L_IMP
#define MAX_NAME_LEN 11
/*******************************************************************************
* List structs
*******************************************************************************/
struct account
{
int id;
int pin;
double balance;
char fname[MAX_NAME_LEN] ;
char lname[MAX_NAME_LEN] ;
};
typedef struct account account_t;
struct jointAccount
{
int userID1;
int userPin1;
int userID2;
int userPin2;
double balance;
char fname1[MAX_NAME_LEN] ;
char lname1[MAX_NAME_LEN] ;
char fname2[MAX_NAME_LEN] ;
char lname2[MAX_NAME_LEN] ;
};
typedef struct jointAccount jointAccount_t;
struct nodeAcc
{
account_t account;
struct nodeAcc* nextNode;
};
typedef struct nodeAcc nodeAcc_t;
struct nodeJAcc
{
jointAccount_t account;
struct nodeJAcc* nextNode;
};
typedef struct nodeJAcc nodeJAcc_t;
/*******************************************************************************
* Function prototypes. As the project is being developed, more function
declarations may be added.
*******************************************************************************/
void appendSingleAccNode(account_t accountS, nodeAcc_t* head);
void appendJointAccNode(jointAccount_t, nodeJAcc_t* head);
void removeSingleAccNode(account_t accountS, nodeAcc_t* head);
void removeJointAccNode(jointAccount_t accountJ, nodeJAcc_t* head);
nodeAcc_t* findSingleNode(int userID, nodeAcc_t* head);
nodeJAcc_t* findJointNode(int userID, nodeJAcc_t* head);
#endif