#ifndef SHARED_USER_INDEX_H
#define SHARED_USER_INDEX_H

typedef struct index_user
{
     char username[MAX_USERNAME +1];
     char id[MAX_ID +1];
     char realname[MAX_NAME +1];
     struct index_user *next;
}INDEX_USER;

typedef struct index_user_list
{
    INDEX_USER  *head;
    INDEX_USER *current;
}INDEX_USER_LIST;




void reindex_users(const char *users_path);
int add_to_user_index(const char *users_path, const char *username, const char *realname, const char *id);
void index_get_names(char *buffer, const char *id, char *username, char *realname);
void buffer_index(char **buffer);

INDEX_USER_LIST *build_index_user_list(INDEX_USER_LIST *list);
INDEX_USER_LIST *add_to_index_list(INDEX_USER_LIST *list, const char *username, const char *id, const char *realname);
void free_index_user_list(INDEX_USER_LIST *list);


#endif


