Add history
[minishell-2.git] / Headers / opsys.h
blob0464b39c60899abdf1516280001eb0180fef989a
1 #ifndef OPSYS_H
2 #define OPSYS_H
4 #include "input.h"
5 #include <csignal> // struct sigaction, sigaction, SIGINT, SIGHUP
6 #include <iostream> // std::cin, std::cout, printf, fprintf
7 extern bool exit_program;
9 #define WRITE_END 1
10 #define READ_END 0
12 /*!
13 * \class SignalHandler
14 * \brief Handles SIGHUP and SIGINT signals.
16 class SignalHandler
18 struct sigaction signal_action;
19 public:
20 /*!
21 * \brief Constructor for SignalHandler. Handles SIGHUP and SIGINT signals.
23 SignalHandler();
26 class OpSys
28 string get_cwd();
29 vector<vector<string>> history;
30 public:
31 string username; // Username
32 string hostname; // User's hostname
33 string cwd; // Current working directory
34 OpSys();
35 void change_dir(vector<string>);
36 void show_history();
37 short simple_command(vector<string>);
38 short piped_command (vector<string>, int);
39 friend class Prompt;
42 extern OpSys OS;
44 #endif // OPSYS_H