-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcl.h
More file actions
33 lines (30 loc) · 803 Bytes
/
cl.h
File metadata and controls
33 lines (30 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ----------------------------------------------------------------------------------------------------- */
/* ------------------------------------------ CommandLineBuff ----------------------------------------- */
#ifndef _COMMANDLINE_H_
#define _COMMANDLINE_H_
#define COMMNAD_QUEUE_LENGTH 5
class CommandLineBuff
{
public:
CommandLineBuff(char *command_buffer, string prompt);
void Up();
void Down();
int Last();
void Store();
private:
string command_queue[COMMNAD_QUEUE_LENGTH];
int command_b_read;
int command_b_write;
int command_b_length;
int command_b_last;
char *command_buffer;
string prompt;
};
// terminal
int termios_init();
int termios_restore();
int kbhit(void);
// command line parser
size_t cParser(char* inputline, char argv[8][32]);
#endif
// END OF FILE