Main.c 412 B

12345678910111213141516171819202122
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include "Console.h"
  4. int main() {
  5. if(initConsole()) {
  6. puts(getConsoleError());
  7. return 0;
  8. }
  9. while(true) {
  10. puts("Work 1");
  11. usleep(50000);
  12. puts("Work 2");
  13. const ConsoleLine* s = readConsoleLine("> ");
  14. if(s != NULL && s->length > 0 && s->data[0] == 'q') {
  15. break;
  16. }
  17. }
  18. return 0;
  19. }