21 lines
634 B
C
21 lines
634 B
C
|
// user.h
|
||
|
#ifndef USER_H
|
||
|
#define USER_H
|
||
|
|
||
|
#define MAX_FRIENDS 10
|
||
|
|
||
|
typedef struct {
|
||
|
char username[32];
|
||
|
char password[32];
|
||
|
char friends[MAX_FRIENDS][32];
|
||
|
int friend_count;
|
||
|
} User;
|
||
|
|
||
|
int load_users(User users[], int max_users);
|
||
|
int save_users(User users[], int user_count);
|
||
|
int find_user(User users[], int user_count, const char *username);
|
||
|
int check_password(User users[], int user_count, const char *username, const char *password);
|
||
|
int add_user(User users[], int *user_count, const char *username, const char *password);
|
||
|
int add_friend(User users[], int user_count, const char *username, const char *friendname);
|
||
|
|
||
|
#endif
|