-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmdHandler.h
138 lines (104 loc) · 2.12 KB
/
cmdHandler.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#ifndef CMDHANDLER_H_INCLUDED
#define CMDHANDLER_H_INCLUDED
/**
*Command for myStrrev function call
*/
#define STRREV 0
/**
*Command for myStrcpy function call
*/
#define STRCPY 1
/**
*Command for myStrncpy function call
*/
#define STRNCPY 2
/**
*Command for myStrcat function call
*/
#define STRCAT 3
/**
*Command for myStrchr function call
*/
#define STRCHR 4
/**
*Command for myStrstr function call
*/
#define STRSTR 5
/**
*Command for myStrtok function call
*/
#define STRTOK 6
/**
*Command for myStrupr function call
*/
#define STRUPR 7
/**
*Command for myStrlwr function call
*/
#define STRLWR 8
/**
*Command for myStrcmp function call
*/
#define STRCMP 9
/**
*Command for myStrncmp function call
*/
#define STRNCMP 10
/**
*Command for myCountStingChar function call
*/
#define COUNTSTRINGCHAR 11
/**
*Command for myStrlen function call
*/
#define STRLEN 12
/**
*Maximum string length
*/
#define STRING_LENGTH 20005
/**
* @brief Scans a number from stdin
@return Scanned number
*/
int scanNumber();
/**
* @brief Scans a command from stdin
The command is a number
@return Scanned command
*/
int scanCommand();
/**
* @brief Scans a string from stdin
@param str The string to be scanned
*/
void scanString(char *str);
/**
* @brief Scans two strings from stdin
@param first String to be scanned
@param second String to be scanned
*/
void scan2Strings(char *first, char *second);
/**
* @brief Scans two strings and one number from stdin
The scanning order is : string, string, number
@param first String to be scanned
@param second String to be scanned
@return returns the scanned number
*/
int scan2Strings1Number(char *first, char *second);
/**
* @brief Prints a string
@param str The string to be printed
*/
void printString(char *str);
/**
* @brief Prints a number
@param number The number to be printed
*/
void printNumber(int number);
/**
* @brief Reads, interprets commands, makes calls to myLibrary functions
The interpretted commands are defined at the beginning of the header file
*/
void commandInterpreter();
#endif // CMDHANDLER_H_INCLUDED