#ifndef SHARED_SUPER_UTIL_H
#define SHARED_SUPER_UTIL_H

#include "shared_super_key.h"
#include "shared_survey_string.h"



typedef struct admin_user
{
    char username[MAX_USERNAME +1];
    char realname[MAX_NAME +1];
    int is_super_user;
    struct admin_user *next;
}ADMIN_USER;





typedef struct delete_course_node
     {
           char *del_id;
           char *del_info;
           struct delete_course_node *next;
    }DEL_COURSE_NODE;



void read_param( char *key);



void  super_conf_info_table(ADMIN_CONFIG_STRUCT *conf,  char *username,  char *realname); 



void write_to_index(const char *username, const char *realname);

int has_other_admins(ADMIN_USER *head);
ADMIN_USER *build_admin_user_list();
void free_admin_user_list(ADMIN_USER *list);
char *new_str(const char *str);
void check_str(char *str,  const char* msg);

void delete_super_key(const char *key_dir, const char *username);
void free_del_list(DEL_COURSE_NODE *head);
//int get_num_parameters( char *name);


int has_course_progs(ADMIN_CONFIG_STRUCT *conf);
int has_people_progs(ADMIN_CONFIG_STRUCT *conf);
int has_server_progs(ADMIN_CONFIG_STRUCT *conf);

void get_cgi_admin_config_values(ADMIN_CONFIG_STRUCT *conf);
DEL_COURSE_NODE *build_selected_course_list();






int write_super_configuration_file (const char *username, ADMIN_CONFIG_STRUCT * config);
int read_super_configuration_file (const char *username, ADMIN_CONFIG_STRUCT * config);


void list_course_commands(ADMIN_CONFIG_STRUCT *conf);
void list_people_commands(ADMIN_CONFIG_STRUCT *conf);
void  list_server_commands(ADMIN_CONFIG_STRUCT *conf);

void
set_admin_data( ADMIN_USER *list);


#endif
