kolibrios/contrib/kolibri-libc/samples/shell_io.c
turbocat c1e6562f35 kolibri-libc:
- Added shell_ping
- Added shell_get_pid
- Fixed malloc in stdlib.h
- Added check during SHELL init (uses shell_ping)
- getc is used like fgetc

git-svn-id: svn://kolibrios.org@8635 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-03-04 09:01:18 +00:00

25 lines
671 B
C

#include <shell_api.h>
#include <ksys.h>
#include <stdio.h>
int main(int argc, char**argv)
{
debug_printf("%u\n", shell_get_pid());
char string[256];
shell_cls();
shell_printf("Number of arguments %d\n",argc);
for(int i=0; i<argc; i++){
shell_printf("argv[%d]=%s\n", i, argv[i]);
}
shell_puts("This is a test console application for Shell\n\r");
shell_puts("Type a string (255 symbols max): ");
shell_gets(string);
shell_puts("You typed:\n\r");
shell_puts(string);
shell_puts("Press any key: ");
string[0] = shell_getc();
shell_puts("\n\rYou pressed: ");
shell_putc(string[0]);
shell_exit();
}