-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.h
72 lines (50 loc) · 1.27 KB
/
user.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
//
// Created by Jiayi on 2022/3/6.
//
#ifndef CW1_LIBRARY_USER_H
#define CW1_LIBRARY_USER_H
#include "page.h"
#include "librarian.h"
#include "book_management.h"
void page_user();
void registration();
//user链表
void create_user_info(char*,char*);
void user_initial(users*);
void login();
void user_menu(users*);
//定义用户结构体
struct borrowed{//原名字为node
int borrow_num,max_borrowed;
Book borrow_books[10];
};
typedef struct user{//原名字为user
char name[20];
char username[20];
char password[20];
int librarian;
struct borrowed user_borrowed_books;
struct user* next;
}User;//原名字为User
//user链表头节点
User* user_head_node; //user head pointer. //users* u_head_node
User* admin; //administrator account
User* librarian;
int user_num;//user_amout
v//用户初始化:
void user_borrow(User*);
int user_num; //the number of user
//用户注册:
void user_register();
//用户登录:
void user_login();
//找用户名:
User* serch_username(char*);
//用户操作:
void borrow_book(User*);
void return_book(User*);
//用户管理加载:
void store_users();//结构体写入文件
void users_file_to_list();//读取文件到链表
void creat_user_list(char*,char*, char*);
#endif //CW1_LIBRARY_USER_H