Lines 1-5
Link Here
|
1 |
#include <iostream.h> |
1 |
#include <iostream> |
2 |
#include <string> |
2 |
#include <cstring> |
|
|
3 |
#include <cstdlib> |
3 |
|
4 |
|
4 |
// For stat() |
5 |
// For stat() |
5 |
#include <sys/types.h> |
6 |
#include <sys/types.h> |
Lines 8-15
Link Here
|
8 |
#include <unistd.h> |
9 |
#include <unistd.h> |
9 |
#endif |
10 |
#endif |
10 |
#include <errno.h> |
11 |
#include <errno.h> |
11 |
#include <stdio.h> |
|
|
12 |
#include <string.h> |
13 |
|
12 |
|
14 |
#include "cmdhandler.h" |
13 |
#include "cmdhandler.h" |
15 |
#include "getline.h" |
14 |
#include "getline.h" |
Lines 37-43
int exec_file(const char* filename) {
Link Here
|
37 |
return 3; |
36 |
return 3; |
38 |
} |
37 |
} |
39 |
|
38 |
|
40 |
cout << buf << " : " << result.c_str() << endl; |
39 |
std::cout << buf << " : " << result.c_str() << std::endl; |
41 |
} |
40 |
} |
42 |
fclose(script); |
41 |
fclose(script); |
43 |
return error ? 2 : 0; |
42 |
return error ? 2 : 0; |
Lines 96-111
int inputloop() {
Link Here
|
96 |
|
95 |
|
97 |
switch (g_cmdHandler.evalLine(cmd, &result)) { |
96 |
switch (g_cmdHandler.evalLine(cmd, &result)) { |
98 |
case 2: |
97 |
case 2: |
99 |
cout << "Hope you enjoyed the Bo2k Console Client\n"; |
98 |
std::cout << "Hope you enjoyed the Bo2k Console Client\n"; |
100 |
term = true; |
99 |
term = true; |
101 |
break; |
100 |
break; |
102 |
case -1: |
101 |
case -1: |
103 |
cerr << "Command '" << cmd << "' not known." << |
102 |
std::cerr << "Command '" << cmd << "' not known." << |
104 |
"Type 'help' for a listing of known commands.\n"; |
103 |
"Type 'help' for a listing of known commands.\n"; |
105 |
break; |
104 |
break; |
106 |
default: |
105 |
default: |
107 |
cout << result.c_str() << endl; |
106 |
std::cout << result.c_str() << std::endl; |
108 |
break; |
107 |
break; |
109 |
} |
108 |
} |
110 |
} |
109 |
} |
111 |
return 0; |
110 |
return 0; |