-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
53 lines (44 loc) · 794 Bytes
/
main.c
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
#include <stdio.h>
#include <stdlib.h>
#include "ushell.h"
#include <curses.h>
#include <string.h>
void args_cmd( char* argv[], int argc )
{
unsigned i;
printf("arguments count: %d\r\n", argc);
for(i = 0; i< argc; ++i) {
printf("argument %d: %s\r\n", i, argv[i]);
}
}
static ushell_cmd_def_t user_cmds[] = {
{"args", args_cmd},
{NULL, NULL}
};
void ushell_putc(char c)
{
//putchar(c);
addch(c);
}
char ushell_getc()
{
return (char)getch();
//return (char)getchar();
}
int ushell_printf(const char * format, ...)
{
va_list ap;
va_start(ap, format);
vprintf(format, ap);
va_end(ap);
}
int main(void)
{
initscr();
noecho();
refresh();
ushell_init(user_cmds);
ushell_loop();
endwin();
return 0;
}