12345678910111213141516171819202122 |
- #include <stdio.h>
- #include <unistd.h>
- #include "Console.h"
- int main() {
- if(initConsole()) {
- puts(getConsoleError());
- return 0;
- }
- while(true) {
- puts("Work 1");
- usleep(50000);
- puts("Work 2");
- const ConsoleLine* s = readConsoleLine("> ");
- if(s != NULL && s->length > 0 && s->data[0] == 'q') {
- break;
- }
- }
- return 0;
- }
|