#include #include #include #include #include #include #include #include #ifndef ESH_TYPES_H #define ESH_TYPES_H typedef enum { BACKGROUND, FOREGROUND } ESH_JOB_TYPE; typedef enum { INNER_CMD, EXEC_CMD } ESH_COMMAND_TYPE; typedef struct { char* command; ESH_COMMAND_TYPE command_type; ESH_JOB_TYPE job_type; pid_t job_pid; int stdout_pipe[2]; // 0 is for writing in child process and for reading in parent process. int stderr_pipe[2]; // 1 is for writing in parent process and for reading in child process. } EShJob; typedef struct { char* build_ref; struct passwd* user_data; char* current_working_dir; char* config_file_path; // path to file, containing configurations (changeable via settings/cmd line args) char* history_file_path; // path to file, where entered commands history is stored (changeable via settings/cmd line args) int history_limit; // max lines of commands, which can be stored (changeable via settings/cmd line args) int max_jobs_number; // max active jobs (foreground & background) limit (changeable via settings/cmd line args) int max_invite_message_len; char* invite_message; int jobs_number; EShJob* jobs_list; int exited; // used to stop threads on exiting } EShInfo; extern EShInfo* esh_info_global; #endif // ESH_TYPES_H