-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlibrary-management.h
41 lines (35 loc) · 1.19 KB
/
library-management.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
// library-management.h
#ifndef LIBRARY_MANAGEMENT_H
#define LIBRARY_MANAGEMENT_H
// Book structure definition
typedef struct {
int book_no;
char book_name[100];
char author[100];
int no_of_books;
int no_of_books_available;
} Book;
// User structure definition
typedef struct {
char name[100];
int id;
struct {
int len;
int books_no[2];
char return_date[2][11]; // Format: dd-mm-yyyy
} books_issued;
} User;
// Function prototypes
void read_books_from_csv(Book books[], int *book_count);
void write_books_to_csv(Book books[], int book_count);
void read_users_from_csv(User users[], int *user_count);
void write_users_to_csv(User users[], int user_count);
void add_book(Book books[], int *book_count);
void display_books(Book books[], int book_count);
void add_user(User users[], int *user_count);
void display_users(User users[], int user_count);
void display_single_user(User user);
int check_availability_by_no(Book books[], int book_count, int book_no);
int check_availability_by_name(Book books[], int book_count, const char *book_name);
void users_returning_on_date(User users[], int user_count, const char *date);
#endif // LIBRARY_MANAGEMENT_H