#ifndef SHARED_PERSON_LIST_H
#define SHARED_PERSON_LIST_H
#include "../global.h"

#include "shared_util.h"
#include "shared_authenticate.h"  /* for username_cmp() */
#include "shared_lock.h"

GROUP_TYPE get_group_type(const char *group);
char *get_group_type_str(GROUP_TYPE group);
P_NODE *sort_person_list (P_NODE *pers_head);
void get_passwd_line_data(char *line, USER_DATA *data);

P_NODE *build_option_person_list (const CONFIG_STRUCT *conf);
P_NODE *option_list_remove_user(P_NODE *head, const char *username);
P_NODE *option_list_remove_first_faculty(P_NODE *head);
P_NODE *faculty_adjusted_option_list(P_NODE *head, const SESSION *user);
void free_option_person_list (P_NODE *pers_head);
void set_option_userlist (P_NODE *pers_head);

void  set_post_recipient(RECEIVE_TYPE kind, const char *username, const char *realname);
void set_post_group_reply_recipients(const char *sender, const char *sender_realname,  const char *thisuser, PERSON_NODE *recipient_head);





void print_student_option_namelist (P_NODE *pers_head);
void print_faculty_option_userlist (P_NODE *pers_head, const SESSION *user);
int count_faculty(P_NODE *head);
int count_students(P_NODE *head);
int current_student_count(CONFIG_STRUCT *conf);



void copy_data_to_user(SESSION *user, USER_DATA *data);
int get_user_info (const char *username,  SESSION *user, CONFIG_STRUCT *conf );
void get_user_data (char *name, USER_DATA * data, CONFIG_STRUCT *conf);
int get_total_users(P_NODE *head);
int are_classmates(const char *current_user, const char *target_user, CONFIG_STRUCT *conf);

#endif

