summaryrefslogtreecommitdiff
path: root/testing/nTox.c
diff options
context:
space:
mode:
authorcharmlesscoin <charmlesscoin@gmail.com>2013-08-02 22:34:45 -0400
committercharmlesscoin <charmlesscoin@gmail.com>2013-08-02 22:34:45 -0400
commitb9e3bf1fa61aac975abe54586e1928f25767ff0a (patch)
tree02bb76b29ad08fe4102c6e3d86853e4fa1b3e206 /testing/nTox.c
parent3678b302dbf2b202afe9e53b46153da69ecbb28e (diff)
changed some formatting, fixed the removal of x and y
Diffstat (limited to 'testing/nTox.c')
-rw-r--r--testing/nTox.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/testing/nTox.c b/testing/nTox.c
index 4989f88a..a498e9a1 100644
--- a/testing/nTox.c
+++ b/testing/nTox.c
@@ -36,11 +36,12 @@
36char lines[HISTORY][STRING_LENGTH]; 36char lines[HISTORY][STRING_LENGTH];
37char line[STRING_LENGTH]; 37char line[STRING_LENGTH];
38 38
39char *help = "[i] commands: /f ID (to add friend), /m friendnumber message (to send message), /s status (to change status)\n" 39char *help = "[i] commands:\n/f ID (to add friend)\n/m friendnumber message "
40 "[i] /l list (list friends), /h for help, /i for info, /n nick (to change nickname), /q (to quit)"; 40 "(to send message)\n/s status (to change status)\n[i] /l list (l"
41 "ist friends)\n/h for help\n/i for info\n/n nick (to change nick"
42 "name)\n/q (to quit)";
41int x, y; 43int x, y;
42 44
43
44uint8_t pending_requests[256][CLIENT_ID_SIZE]; 45uint8_t pending_requests[256][CLIENT_ID_SIZE];
45uint8_t num_requests = 0; 46uint8_t num_requests = 0;
46 47
@@ -126,7 +127,7 @@ char *format_message(char *message, int friendnum)
126 return msg; 127 return msg;
127} 128}
128 129
129void line_eval(char lines[HISTORY][STRING_LENGTH], char *line) 130void line_eval(char *line)
130{ 131{
131 if (line[0] == '/') { 132 if (line[0] == '/') {
132 char inpt_command = line[1]; 133 char inpt_command = line[1];
@@ -410,13 +411,16 @@ int main(int argc, char *argv[])
410 411
411 char idstring[200]; 412 char idstring[200];
412 get_id(idstring); 413 get_id(idstring);
414
413 initscr(); 415 initscr();
414 noecho(); 416 noecho();
415 raw(); 417 raw();
416 getmaxyx(stdscr, y, x); 418 getmaxyx(stdscr, y, x);
419
420 new_lines("/h for list of commands");
417 new_lines(idstring); 421 new_lines(idstring);
418 new_lines(help);
419 strcpy(line, ""); 422 strcpy(line, "");
423
420 IP_Port bootstrap_ip_port; 424 IP_Port bootstrap_ip_port;
421 bootstrap_ip_port.port = htons(atoi(argv[2])); 425 bootstrap_ip_port.port = htons(atoi(argv[2]));
422 int resolved_address = resolve_addr(argv[1]); 426 int resolved_address = resolve_addr(argv[1]);
@@ -443,7 +447,7 @@ int main(int argc, char *argv[])
443 447
444 getmaxyx(stdscr, y, x); 448 getmaxyx(stdscr, y, x);
445 if (c == '\n') { 449 if (c == '\n') {
446 line_eval(lines, line); 450 line_eval(line);
447 strcpy(line, ""); 451 strcpy(line, "");
448 } else if (c == 127) { 452 } else if (c == 127) {
449 line[strlen(line)-1] = '\0'; 453 line[strlen(line)-1] = '\0';