#ifndef SHARED_CS_UTIL_H
#define SHARED_CS_UTIL_H

#include "../global.h"
#include "ClearSilver.h"

extern CGI *global_cgi;
extern int global_theme;

#define REMOTE_HOST getenv("REMOTE_HOST")


#define cs_set_value(name, value)  hdf_set_value(global_cgi->hdf, name, value)
#define cs_set_int_value(name, value)  hdf_set_int_value(global_cgi->hdf, name, value)
#define cs_cgi_redirect(location)  cgi_redirect(global_cgi, "%s", location)

void cs_cgi_destroy();
void cs_cgi_init();
void cs_critical_error(const char *error_code, const char *detail);



void cs_set_current_time();
void cs_set_course_info(CONFIG_STRUCT *conf);
void  cs_dump_hdf();
void cs_set_back_url(const char *course, const char *key, const char *program);

void cs_get_required_parameter (char *name, char *value, int maxlen);
void cs_get_optional_parameter (char *name, char *value, int maxlen);

NEOERR *cs_load_lang(const char *cs_file);
void cs_cgi_display(const char *cs_file, int load_lang);

void cs_set_image_path();
void cs_set_loadpath();
void cs_set_server_name();
void cs_set_bin_alias();
char *cs_survey_get_stringvalue(const char *name);
char *cs_survey_get_optvalue(const char *name);
void cs_set_theme_path();
void cs_html_escape_string(char *source_string, char **new_string);

int cs_set_event_msg();
void get_lang_string(HDF **hdf);

void cs_timeout_error(char *error_code, char *detail);

#define ERR_NONE "ERR_NONE"
#define ERR_PARAM_MISSING "ERR_PARAM_MISSING"
#define ERR_PARAM_LONG "ERR_PARAM_LONG"
#define ERR_FOPEN_WRITE_FAILED "ERR_FOPEN_WRITE_FAILED"
#define ERR_FWRITE_FAILED "ERR_FWRITE_FAILED"
#define ERR_LOGGED_OUT "ERR_LOGGED_OUT"
#define ERR_NO_FILE "ERR_NO_FILE"
#define ERR_FREAD_FAILED "ERR_FREAD_FAILED"
#define ERR_UPLOAD_FILE "ERR_UPLOAD_FILE"
#define ERR_NO_MODULES_SELECTED "ERR_NO_MODULES_SELECTED"
#define ERR_MALLOC_FAILED "ERR_MALLOC_FAILED"
#define ERR_FSEEK_FAILED "ERR_FSEEK_FAILED"
#define ERR_OPENDIR_FAILED "ERR_OPENDIR_FAILED"
#define ERR_PARAM_FORMAT "ERR_PARAM_FORMAT"
#define ERR_FOPEN_READ_FAILED "ERR_FOPEN_READ_FAILED"
#define ERR_MKDIR_FAILED "ERR_MKDIR_FAILED"
#define ERR_GETCWD_FAILED "ERR_GETCWD_FAILED"
#define ERR_ERROR_CHDIR_TO_BIN "ERR_ERROR_CHDIR_TO_BIN"
#define ERR_UNIQUE_FNAME_NOT_FOUND "ERR_UNIQUE_FNAME_NOT_FOUND"
#define ERR_REQUEST_DENIED "ERR_REQUEST_DENIED"
#define ERR_FILE_FORMAT_ERROR "ERR_FILE_FORMAT_ERROR"
#define ERR_GRADES_UPLOAD_FORMAT "ERR_GRADES_UPLOAD_FORMAT"
#define ERR_ERROR_READING_CONFIG "ERR_ERROR_READING_CONFIG"
#define ERR_FTELL_FAILED "ERR_FTELL_FAILED"
#define ERR_RED_READ "ERR_RED_READ"
#define ERR_NO_THEME_PATH "ERR_NO_THEME_PATH"
#define ERR_FOPEN_APPEND_FAILED "ERR_FOPEN_APPEND_FAILED"
#define GRADES_HAS_BEEN_RELEASED "GRADES_HAS_BEEN_RELEASED"
#define ERR_NO_GRADE_FOR_AUDIT_ST "ERR_NO_GRADE_FOR_AUDIT_ST"
#define ERR_NO_RELEASED_GRADES "ERR_NO_RELEASED_GRADES"
#define ERR_MISS_CHECKBOXES "ERR_MISS_CHECKBOXES"
#define ERR_GRADES_DB "ERR_GRADES_DB"
#define ERR_GRADES_NO_THIS_USER "ERR_GRADES_NO_THIS_USER"
#define ERR_GRADES_NO_ITEM "ERR_GRADES_NO_ITEM"
#define ERR_GRADES_NO_GRADES_FOR_THIS_QUIZ "ERR_GRADES_NO_GRADES_FOR_THIS_QUIZ"
#define ERR_GRADES_INVALID_ITEM "ERR_GRADES_INVALID_ITEM"
#define ERR_GRADES_SCALE_FORM "ERR_GRADES_SCALE_FORM"
#define ERR_GRADES_CAL_FORM "ERR_GRADES_CAL_FORM"
#define ERR_GRADES_GROUP_FORM "ERR_GRADES_GROUP_FORM"
#define ERR_NOCHANGE_DB "ERR_NOCHANGE_DB"
#define ERR_SEARCH_STRING_TOO_SHORT "ERR_SEARCH_STRING_TOO_SHORT"
#define ERR_ADDING_TO_PASSWORD "ERR_ADDING_TO_PASSWORD"
#define ERR_ADDING_COURSE_TO_USERS_LIST "ERR_ADDING_COURSE_TO_USERS_LIST"
#define ERR_FIRST_NAME_HAS_INVALID_CHARS "ERR_FIRST_NAME_HAS_INVALID_CHARS"
#define ERR_LAST_NAME_HAS_INVALID_CHARS "ERR_LAST_NAME_HAS_INVALID_CHARS"
#define ERR_ID_HAS_INVALID_CHARS "ERR_ID_HAS_INVALID_CHARS"
#define ERR_UPDATING_CENTRAL_USER "ERR_UPDATING_CENTRAL_USER"
#define ERR_NO_CHANGES "ERR_NO_CHANGES"
#define ERR_UNEXPECTED_END_OF_LINE "ERR_UNEXPECTED_END_OF_LINE"
#define ERR_NO_EVENTS_RECORDED_FOR_X "ERR_NO_EVENTS_RECORDED_FOR_X"
#define ERR_PASSWD_PARSE_ERROR "ERR_PASSWD_PARSE_ERROR"
#define ERR_ID_TOO_SHORT "ERR_ID_TOO_SHORT"
#define ERR_PASSWD_WRONG_LENGTH "ERR_PASSWD_WRONG_LENGTH"
#define ERR_PASSWD_ENTERED_DIFFERENTLY "ERR_PASSWD_ENTERED_DIFFERENTLY"
#define ERR_NEW_PASSWD_SAME_AS_OLD "ERR_NEW_PASSWD_SAME_AS_OLD"
#define ERR_CANT_USE_DEFAULT_PASSWORD "ERR_CANT_USE_DEFAULT_PASSWORD"
#define ERR_PASSWD_AND_ID_SAME "ERR_PASSWD_AND_ID_SAME"
#define ERR_PASSWD_HAS_INVALID_CHARS_X "ERR_PASSWD_HAS_INVALID_CHARS_X"
#define ERR_PASSWD_CONTAINS_YOUR_NAME "ERR_PASSWD_CONTAINS_YOUR_NAME"
#define ERR_PASSWD_TOO_SIMPLE "ERR_PASSWD_TOO_SIMPLE"
#define ERR_PASSWD_INTERNAL_ERROR "ERR_PASSWD_INTERNAL_ERROR"
#define ERR_NOT_JPG_FILE "ERR_NOT_JPG_FILE"
#define ERR_CANT_GET_CWD "ERR_CANT_GET_CWD"
#define ERR_CHDIR_FAILED "ERR_CHDIR_FAILED"
#define ERR_UNSUPPORTED_GROUP "ERR_UNSUPPORTED_GROUP"
#define ERR_RED_WRITE "ERR_RED_WRITE"
#define ERR_UNKNOWN_CASE_IN_SWITCH "ERR_UNKNOWN_CASE_IN_SWITCH"
#define ERR_READING_TRANSCRIPT_FILE "ERR_READING_TRANSCRIPT_FILE"
#define ERR_EMPTY_FILE "ERR_EMPTY_FILE"
#define ERR_FIRST_ATTACHMENT_FIELD_BLANK "ERR_FIRST_ATTACHMENT_FIELD_BLANK"
#define ERR_FIRST_HOTPOT_ATTACHMENT_BLANK "ERR_FIRST_HOTPOT_ATTACHMENT_BLANK"
#define ERR_ZIPFILE_MUST_BE_ONLY_FILE "ERR_ZIPFILE_MUST_BE_ONLY_FILE"
#define ERR_FIRST_FIELD_NOT_ZIP_OR_HOTPOT "ERR_FIRST_FIELD_NOT_ZIP_OR_HOTPOT"
#define ERR_FIRST_FIELD_NOT_ZIP_OR_HTML "ERR_FIRST_FIELD_NOT_ZIP_OR_HTML"
#define ERR_CHMOD_FAILED "ERR_CHMOD_FAILED"
#define ERR_INTERNAL_ERROR "ERR_INTERNAL_ERROR"
#define ERR_CANT_ATTACH_NEW_WEB_SITE "ERR_CANT_ATTACH_NEW_WEB_SITE"
#define ERR_CANT_MAKE_ADDITIONAL_ATTACHMENTS "ERR_CANT_MAKE_ADDITIONAL_ATTACHMENTS"
#define ERR_TEAM_PARAM_NOT_FROM_A_Z "ERR_TEAM_PARAM_NOT_FROM_A_Z"
#define ERR_CANT_START_UNZIP "ERR_CANT_START_UNZIP"
#define ERR_UNZIP_CODE_1 "ERR_UNZIP_CODE_1"
#define ERR_UNZIP_CODE_2 "ERR_UNZIP_CODE_2"
#define ERR_UNZIP_CODE_3 "ERR_UNZIP_CODE_3"
#define ERR_UNZIP_CODE_51 "ERR_UNZIP_CODE_51"
#define ERR_UNZIP_MEMORY_ERROR "ERR_UNZIP_MEMORY_ERROR"
#define ERR_UNZIP_CODE_9 "ERR_UNZIP_CODE_9"
#define ERR_UNZIP_CODE_10 "ERR_UNZIP_CODE_10"
#define ERR_UNZIP_CODE_11 "ERR_UNZIP_CODE_11"
#define ERR_UNZIP_CODE_50 "ERR_UNZIP_CODE_50"
#define ERR_UNZIP_UNDOCUMENTED_ERROR "ERR_UNZIP_UNDOCUMENTED_ERROR"
#define ERR_CANT_FIND_ZIPFILE "ERR_CANT_FIND_ZIPFILE"
#define ERR_DIR_NAMED_X_FOUND_X_IS_RESERVED "ERR_DIR_NAMED_X_FOUND_X_IS_RESERVED"
#define ERR_NO_HTML_FILES_FOUND "ERR_NO_HTML_FILES_FOUND"
#define ERR_NO_HOTPOTATO_FILES_FOUND "ERR_NO_HOTPOTATO_FILES_FOUND"
#define ERR_MORE_THAN_ONE_HOTPOT_FILE_FOUND "ERR_MORE_THAN_ONE_HOTPOT_FILE_FOUND"
#define ERR_RENAME_FAILED "ERR_RENAME_FAILED"
#define ERR_CANT_RENAME_TEMP_DIR "ERR_CANT_RENAME_TEMP_DIR"
#define ERR_ERROR_READING_FILTER "ERR_ERROR_READING_FILTER"
#define ERR_ERROR_CREATING_FILTER "ERR_ERROR_CREATING_FILTER"
#define ERR_ERROR_WRITING_FILTER "ERR_ERROR_WRITING_FILTER"
#define ERR_REMOVAL_FROM_LIST_FAILED "ERR_REMOVAL_FROM_LIST_FAILED"
#define ERR_SYMLINK_FAILED "ERR_SYMLINK_FAILED"
#define ERR_UNABLE_TO_DETERMINE_FILENAME "ERR_UNABLE_TO_DETERMINE_FILENAME"
#define ERR_READING_INFO "ERR_READING_INFO"
#define ERR_ERROR_READING_ATTACHMENT "ERR_ERROR_READING_ATTACHMENT"
#define ERR_CANT_FIND_THIS_OFFSET "ERR_CANT_FIND_THIS_OFFSET"
#define ERR_OPENING_INFO "ERR_OPENING_INFO"
#define ERR_ATTACH_ZIP_ONLY_ONE_FILE "ERR_ATTACH_ZIP_ONLY_ONE_FILE"
#define ERR_MSG_IS_READ_ONLY "ERR_MSG_IS_READ_ONLY"
#define ERR_ERROR_PARSING_HOTPOT_FILE "ERR_ERROR_PARSING_HOTPOT_FILE"
#define ERR_UNKNOWN_QUESTION_TYPE "ERR_UNKNOWN_QUESTION_TYPE"
#define ERR_ERROR_PARSING_SCORE "ERR_ERROR_PARSING_SCORE"
#define ERR_END_BEFORE_START "ERR_END_BEFORE_START"
#define ERR_CANT_START_ZIP "ERR_CANT_START_ZIP"
#define ERR_ZIP_ERROR_CODE_2 "ERR_ZIP_ERROR_CODE_2"
#define ERR_ZIP_ERROR_CODE_3 "ERR_ZIP_ERROR_CODE_3"
#define ERR_ZIP_ERROR_CODE_4 "ERR_ZIP_ERROR_CODE_4"
#define ERR_ZIP_ERROR_CODE_5 "ERR_ZIP_ERROR_CODE_5"
#define ERR_ZIP_ERROR_CODE_6 "ERR_ZIP_ERROR_CODE_6"
#define ERR_ZIP_ERROR_CODE_7 "ERR_ZIP_ERROR_CODE_7"
#define ERR_ZIP_ERROR_CODE_8 "ERR_ZIP_ERROR_CODE_8"
#define ERR_ZIP_ERROR_CODE_9 "ERR_ZIP_ERROR_CODE_9"
#define ERR_ZIP_ERROR_CODE_10 "ERR_ZIP_ERROR_CODE_10"
#define ERR_ZIP_ERROR_CODE_11 "ERR_ZIP_ERROR_CODE_11"
#define ERR_ZIP_ERROR_CODE_12 "ERR_ZIP_ERROR_CODE_12"
#define ERR_ZIP_ERROR_CODE_13 "ERR_ZIP_ERROR_CODE_13"
#define ERR_ZIP_ERROR_CODE_14 "ERR_ZIP_ERROR_CODE_14"
#define ERR_ZIP_ERROR_CODE_15 "ERR_ZIP_ERROR_CODE_15"
#define ERR_ZIP_ERROR_CODE_16 "ERR_ZIP_ERROR_CODE_16"
#define ERR_ZIP_ERROR_CODE_18 "ERR_ZIP_ERROR_CODE_18"
#define ERR_ZIP_ERROR_UNDOCUMENTED "ERR_ZIP_ERROR_UNDOCUMENTED"
#define ERR_TEAM_NOT_FOUND "ERR_TEAM_NOT_FOUND"
#define ERR_MSG_NOT_FOUND "ERR_MSG_NOT_FOUND"
#define ERR_GATHER_PARSE_ERROR "ERR_GATHER_PARSE_ERROR"
#define ERR_LAST_FILE_IO_ERROR "ERR_LAST_FILE_IO_ERROR"
#define ERR_CLIPBOARD_IS_EMPTY "ERR_CLIPBOARD_IS_EMPTY"
#define ERR_ADMINS_CANT_VIEW_CLIPBOARD "ERR_ADMINS_CANT_VIEW_CLIPBOARD"
#define ERR_UNKNOWN_GATHER_TYPE "ERR_UNKNOWN_GATHER_TYPE"
#define ERR_SURVEY_NO_DATA "ERR_SURVEY_NO_DATA"
#define ERR_SURVEY_NO_INFORMATION "ERR_SURVEY_NO_INFORMATION"
#define ERR_NO_SURVEYS "ERR_NO_SURVEYS"
#define ERR_COPY_ERROR "ERR_COPY_ERROR"
#define ERR_INVALID_USER "ERR_INVALID_USER"
#define ERR_SURVEY_RESULT_NOT_AVAILABLE "ERR_SURVEY_RESULT_NOT_AVAILABLE"
#define ERR_RESUBMIT_ERROR "ERR_RESUBMIT_ERROR"
#define ERR_SURVEY_TIME_FORMAT "ERR_SURVEY_TIME_FORMAT"
#define ERR_NOT_VALID_DATE "ERR_NOT_VALID_DATE"
#define ERR_SURVEY_UNRELEASE_TIME_WRONG "ERR_SURVEY_UNRELEASE_TIME_WRONG"
#define ERR_SURVEY_RESULT_TIME "ERR_SURVEY_RESULT_TIME"
#define ERR_CANT_SURVEY_STANDALONE_COURSES "ERR_CANT_SURVEY_STANDALONE_COURSES"
#define ERR_NO_CENTRAL_COURSES "ERR_NO_CENTRAL_COURSES"
#define ERR_ERROR_CREATING_SURVEY_DIRECTORY "ERR_ERROR_CREATING_SURVEY_DIRECTORY"
#define ERR_NO_COURSE_MSG "ERR_NO_COURSE_MSG"
#define ERR_USERNAME_PASSWD_INCORRECT "ERR_USERNAME_PASSWD_INCORRECT"
#define ERR_COURSE_GROUP_NOT_FOUND "ERR_COURSE_GROUP_NOT_FOUND"
#define ERR_SUPPLIED_DONT_MATCH_ACTUAL "ERR_SUPPLIED_DONT_MATCH_ACTUAL"
#define ERR_YOU_DIDNT_CHANGE_REALNAME "ERR_YOU_DIDNT_CHANGE_REALNAME"
#define ERR_REALNAME_MUST_HAVE_SPACE "ERR_REALNAME_MUST_HAVE_SPACE"
#define ERR_NAME_HAS_BANNED_CHARS "ERR_NAME_HAS_BANNED_CHARS"
#define ERR_PASS_PARAMETERS_ERROR_MSG "ERR_PASS_PARAMETERS_ERROR_MSG"
#define ERR_UNABLE_TO_OPEN_KEYS "ERR_UNABLE_TO_OPEN_KEYS"
#define ERR_UNABLE_TO_OPEN_COURSES "ERR_UNABLE_TO_OPEN_COURSES"
#define ERR_NO_PID_FILE "ERR_NO_PID_FILE"
#define ERR_KILLING_MELANGE_AT_X_FAILED "ERR_KILLING_MELANGE_AT_X_FAILED"
#define ERR_CANT_START_NEW_PROCESS "ERR_CANT_START_NEW_PROCESS"
#define ERR_INVALID_USERNAME "ERR_INVALID_USERNAME"
#define ERR_INVALID_PASSWORD "ERR_INVALID_PASSWORD"
#define ERR_PASSWORD_WRONG_LEN "ERR_PASSWORD_WRONG_LEN"
#define ERR_FIRST_NAME_INVALID "ERR_FIRST_NAME_INVALID"
#define ERR_LAST_NAME_INVALID "ERR_LAST_NAME_INVALID"
#define ERR_EXISTING_USER_MSG "ERR_EXISTING_USER_MSG"
#define ERR_PASSWORDS_DONT_MATCH "ERR_PASSWORDS_DONT_MATCH"
#define ERR_PAGE_TITLE_BLANK "ERR_PAGE_TITLE_BLANK"
#define ERR_NO_OTHER_ADMINS_FOUND "ERR_NO_OTHER_ADMINS_FOUND"
#define ERR_SUPER_USER_EXISTING "ERR_SUPER_USER_EXISTING"
#define ERR_PASSWD_AND_USERNAME_SAME "ERR_PASSWD_AND_USERNAME_SAME"
#define ERR_INCORRECT_PASSWD_ENTERED "ERR_INCORRECT_PASSWD_ENTERED"
#define ERR_NOT_CAPTURE_MODE "ERR_NOT_CAPTURE_MODE"
#define ERR_COOKIES_MUST_BE_ENABLED "ERR_COOKIES_MUST_BE_ENABLED"
#define ERR_INVALID_COURSE_TYPE "ERR_INVALID_COURSE_TYPE"
#define ERR_ROSTER_FILE_NOT_ASCII "ERR_ROSTER_FILE_NOT_ASCII"
#define ERR_ERROR_READING_COURSE_CODE "ERR_ERROR_READING_COURSE_CODE"
#define ERR_ERROR_READING_COURSE_TITLE "ERR_ERROR_READING_COURSE_TITLE"
#define ERR_ERROR_READING_SEMESTER "ERR_ERROR_READING_SEMESTER"
#define ERR_ERROR_READING_TEACHER_NAME "ERR_ERROR_READING_TEACHER_NAME"
#define ERR_COURSE_CODE_EMPTY "ERR_COURSE_CODE_EMPTY"
#define ERR_COURSE_TITLE_EMPTY "ERR_COURSE_TITLE_EMPTY"
#define ERR_SEMESTER_EMPTY "ERR_SEMESTER_EMPTY"
#define ERR_TEACHER_NAME_EMPTY "ERR_TEACHER_NAME_EMPTY"
#define ERR_COURSE_CODE_TOO_LONG "ERR_COURSE_CODE_TOO_LONG"
#define ERR_COURSE_TITLE_TOO_LONG "ERR_COURSE_TITLE_TOO_LONG"
#define ERR_SEMESTER_TOO_LONG "ERR_SEMESTER_TOO_LONG"
#define ERR_TEACHER_NAME_TOO_LONG "ERR_TEACHER_NAME_TOO_LONG"
#define ERR_GENERAL_ERROR "ERR_GENERAL_ERROR"
#define ERR_MAX_ID_LEN_IS_X "ERR_MAX_ID_LEN_IS_X"
#define ERR_ID_MUST_HAVE_DIGIT "ERR_ID_MUST_HAVE_DIGIT"
#define ERR_ID_HAS_BANNED_CHARS_X "ERR_ID_HAS_BANNED_CHARS_X"
#define ERR_MAX_NAME_LEN_IS_X "ERR_MAX_NAME_LEN_IS_X"
#define ERR_NAME_HAS_BANNED_CHARS_X "ERR_NAME_HAS_BANNED_CHARS_X"
#define ERR_PERSON_LINE_HAS_BAD_FORMAT "ERR_PERSON_LINE_HAS_BAD_FORMAT"
#define ERR_COURSE_X_HAS_INVALID_CHARS "ERR_COURSE_X_HAS_INVALID_CHARS"
#define ERR_COURSE_CANT_START_WITH_T "ERR_COURSE_CANT_START_WITH_T"
#define ERR_TEACHER_ID_LINE_MISSING "ERR_TEACHER_ID_LINE_MISSING"
#define ERR_MKSTEMP_FAILED "ERR_MKSTEMP_FAILED"
#define ERR_COURSE_X_Y_HAS_NO_TEACHER "ERR_COURSE_X_Y_HAS_NO_TEACHER"
#define ERR_FILE_X_NOT_FOUND "ERR_FILE_X_NOT_FOUND"
#define ERR_COURSE_NAMES_EMPTY "ERR_COURSE_NAMES_EMPTY"
#define ERR_DATA_FOR_X_NOT_FOUND "ERR_DATA_FOR_X_NOT_FOUND"
#define ERR_NO_DATA_FOUND "ERR_NO_DATA_FOUND"
#define ERR_TAR_PATH_ERROR "ERR_TAR_PATH_ERROR"
#define ERR_STAT_FAILED "ERR_STAT_FAILED"
#define ERR_CANT_CREATE_WORK_SPACE "ERR_CANT_CREATE_WORK_SPACE"
#define ERR_CANT_FIND_WORK_SPACE "ERR_CANT_FIND_WORK_SPACE"
#define ERR_CANT_FIND_CONF "ERR_CANT_FIND_CONF"
#define ERR_PASSWD_OPEN_FAILED "ERR_PASSWD_OPEN_FAILED"
#define ERR_COURSE_EXIST_ERROR_MSG "ERR_COURSE_EXIST_ERROR_MSG"
#define ERR_NO_VALID_TEACHER "ERR_NO_VALID_TEACHER"
#define ERR_USERNAME_LEN "ERR_USERNAME_LEN"
#define ERR_NO_UNUSED_USERNAMES_FOUND "ERR_NO_UNUSED_USERNAMES_FOUND"
#define ERR_REALNAME_TOO_LONG "ERR_REALNAME_TOO_LONG"
#define ERR_INVALID_CHARACTER_IN_NAME "ERR_INVALID_CHARACTER_IN_NAME"
#define ERR_ALREADY_ENROLLED "ERR_ALREADY_ENROLLED"
#define ERR_ID_MUST_HAVE_DIGITS "ERR_ID_MUST_HAVE_DIGITS"
#define ERR_ID_ALREADY_USED "ERR_ID_ALREADY_USED"
#define ERR_FGETS_FAILED "ERR_FGETS_FAILED"
#define ERR_RED_OPEN "ERR_RED_OPEN"
#define ERR_RED_READ_OPEN "ERR_RED_READ_OPEN"
#define ERR_EXPECTED_ATTACHED_WEBSITE "ERR_EXPECTED_ATTACHED_WEBSITE"
#define ERR_FLOCK_SHARED_FAILED "ERR_FLOCK_SHARED_FAILED"
#define ERR_FLOCK_EXCLUSIVE_FAILED "ERR_FLOCK_EXCLUSIVE_FAILED"
#define ERR_FLOCK_UNLOCK_FAILED "ERR_FLOCK_UNLOCK_FAILED"
#define ERR_CANT_GET_NEW_COURSE_LOCK "ERR_CANT_GET_NEW_COURSE_LOCK"
#define ERR_BLANK_RECIPIENT "ERR_BLANK_RECIPIENT"
#define ERR_NOT_IN_PASSWD "ERR_NOT_IN_PASSWD"
#define ERR_UNABLE_TO_OPEN_NEW_FILE "ERR_UNABLE_TO_OPEN_NEW_FILE"
#define ERR_ERROR_READING_NEW_FILE "ERR_ERROR_READING_NEW_FILE"
#define ERR_UNABLE_TO_OPEN_INBOX "ERR_UNABLE_TO_OPEN_INBOX"
#define ERR_ERROR_WRITING_TO_INBOX "ERR_ERROR_WRITING_TO_INBOX"
#define ERR_CANT_OPEN_NEWS_DIR "ERR_CANT_OPEN_NEWS_DIR"
#define ERR_ERROR_OPENING_INFO "ERR_ERROR_OPENING_INFO"
#define ERR_ERROR_READING_INFO "ERR_ERROR_READING_INFO"
#define ERR_ERROR_OPENING_OUTBOX "ERR_ERROR_OPENING_OUTBOX"
#define ERR_CANT_FIND_TERMINATING_NULL "ERR_CANT_FIND_TERMINATING_NULL"
#define ERR_XML_PARSER "ERR_XML_PARSER"
#define ERR_SERVER_LOCK_MESSAGE "ERR_SERVER_LOCK_MESSAGE"
#define ERR_SORRY_YOUVE_BEEN_LOGGED_OUT "ERR_SORRY_YOUVE_BEEN_LOGGED_OUT"
#define ERR_ERROR_READING_KEY_FILE "ERR_ERROR_READING_KEY_FILE"
#define ERR_ERROR_WRITING_KEY "ERR_ERROR_WRITING_KEY"
#define ERR_CANT_OPEN_RELEASE_DATAFILE "ERR_CANT_OPEN_RELEASE_DATAFILE"
#define ERR_ERROR_READING_RELEASE_DATAFILE "ERR_ERROR_READING_RELEASE_DATAFILE"
#define ERR_NO_STUDENT_FOUND "ERR_NO_STUDENT_FOUND"
#define ERR_ERROR_CHECKING_INDEX_LOCKFILE "ERR_ERROR_CHECKING_INDEX_LOCKFILE"
#define ERR_CANT_LOCK_USER_INDEX "ERR_CANT_LOCK_USER_INDEX"
#define ERR_ERROR_READING_ID_FILE_X "ERR_ERROR_READING_ID_FILE_X"
#define ERR_CANT_OPEN_USERS_DIR_X "ERR_CANT_OPEN_USERS_DIR_X"
#define ERR_INDEX_FILE_FORMAT_ERROR "ERR_INDEX_FILE_FORMAT_ERROR"
#define ERR_ERROR_OPENING_CONFIG_FILE "ERR_ERROR_OPENING_CONFIG_FILE"
#define ERR_ERROR_READING_CONFIG_FILE "ERR_ERROR_READING_CONFIG_FILE"
#define ERR_THIS_IS_A_SECURE_SERVER "ERR_THIS_IS_A_SECURE_SERVER"
#define ERR_YOUR_SESSION_HAS_TIMED_OUT "ERR_YOUR_SESSION_HAS_TIMED_OUT"
#define ERR_CANT_CREATE_NEW_KEY "ERR_CANT_CREATE_NEW_KEY"
#define ERR_NO_SLASH_IN_COURSE_PATH "ERR_NO_SLASH_IN_COURSE_PATH"
#define ERR_COURSE_LIST_OPEN_FAILED "ERR_COURSE_LIST_OPEN_FAILED"
#define ERR_BAD_MONTH "ERR_BAD_MONTH"
#define ERR_BAD_DATE "ERR_BAD_DATE"
#define ERR_SURVEY_ERROR_1 "ERR_SURVEY_ERROR_1"
#define ERR_SURVEY_ERROR_2 "ERR_SURVEY_ERROR_2"
#define ERR_DATA_IS_NOT_AVAILABLE "ERR_DATA_IS_NOT_AVAILABLE"
#define ERR_NUMBER_ERROR "ERR_NUMBER_ERROR"
#define ERR_MYMANHATTAN_COURSE_NAME "ERR_MYMANHATTAN_COURSE_NAME"
#define ERR_USERNAME_PASSWORD "ERR_USERNAME_PASSWORD"
#define ERR_CANT_GET_EVENT_STRING "ERR_CANT_GET_EVENT_STRING"
#define ERR_DELETE_GROUP_WEIGHT "ERR_DELETE_GROUP_WEIGHT"
#define ERR_SURVEY_LIKERT_LEFT_TAG "ERR_SURVEY_LIKERT_LEFT_TAG" 
#define ERR_SURVEY_LIKERT_RIGHT_TAG "ERR_SURVEY_LIKERT_RIGHT_TAG" 
#define ERR_HAS_BAD_CHAR "ERR_HAS_BAD_CHAR" 
#define ERR_CALENDAR_SET_EVENT "ERR_CALENDAR_SET_EVENT" 
#define ERR_CALENDAR_DELETE_EVENT "ERR_CALENDAR_DELET_EVENT" 
#define ERR_CALENDAR_DB_OPEN "ERR_CALENDAR_DB_OPEN" 
#define ERR_CALENDAR_UPDATE_EVENT "ERR_CALENDAR_UPDATE_EVENT" 
#define ERR_CALENDAR_EVENT_DETAIL "ERR_CALENDAR_EVENT_DETAIL" 
#define ERR_INVALID_CAL_METHOD "ERR_INVALID_CAL_METHOD" 

#define SURVEY_DELETE_CODE "SURVEY_DELETE_CODE"
#define SURVEY_COPY_CODE  "SURVEY_COPY_CODE" 
#define SURVEY_PUBLIC_CODE "SURVEY_PUBLIC_CODE" 
#define SURVEY_SHARED_CODE "SURVEY_SHARED_CODE" 
#define SURVEY_SUBMIT_CODE "SURVEY_SUBMIT_CODE" 
#define SURVEY_SUBMIT_WWW_CODE "SURVEY_SUBMIT_WWW_CODE" 
#define SURVEY_SUBMIT_CLASS_CODE "SURVEY_SUBMIT_CLASS_CODE" 


#define ERR_DB_OPEN "ERR_DB_OPEN" 
#define ERR_DB_CREATE_ERROR "ERR_DB_CREATE_ERROR" 
#define ERR_DB_INSERT "ERR_DB_INSERT" 
#define ERR_YOU_DONT_HAVE_COURSE "ERR_YOU_DONT_HAVE_COURSE" 
#define ERR_NO_TEACHER "ERR_NO_TEACHER" 
#define ERR_NO_COURSE_ON_MANHATTAN "ERR_NO_COURSE_ON_MANHATTAN" 
#define ERR_PODCASTING_FILE_FORMAT "ERR_PODCASTING_FILE_FORMAT" 
#define ERR_PODCASTING_NEED_ONE_FILE "ERR_PODCASTING_NEED_ONE_FILE" 
#define ERR_GRADE_BOOK_NEW_ITEM "ERR_GRADE_BOOK_NEW_ITEM" 
#define ERR_GRADE_BOOK_ITEM_NO_CHANGE "ERR_GRADE_BOOK_ITEM_NO_CHANGE" 
#define ERR_GRADE_BOOK_UNDEFINED_OPERATION "ERR_GRADE_BOOK_UNDEFINED_OPERATION" 
#define ERR_GRADE_BOOK_UPDATE_LETTER_GRADES "ERR_GRADE_BOOK_UPDATE_LETTER_GRADES" 
#define ERR_GRADE_BOOK_NO_CHANGE_LETTER_GRADES "ERR_GRADE_BOOK_NO_CHANGE_LETTER_GRADES" 
#define ERR_GRADE_BOOK_NOT_FOUND "ERR_GRADE_BOOK_NOT_FOUND"
#define ERR_GRADE_BOOK_NO_DATA_ITEM "ERR_GRADE_BOOK_NO_DATA_ITEM"

#define ERR_SURVEY_PARSE_DATA_FAILED "ERR_SURVEY_PARSE_DATA_FAILED"


#endif
