MCPcopy Create free account
hub / github.com/OpenIPC/firmware / interactive_mode

Function interactive_mode

general/package/legacy/lshell/src/lshell.c:345–371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345void interactive_mode()
346{
347 char *buffer = NULL;
348 size_t len = 0;
349 while (1)
350 {
351 printf("keychain:~/jail> ");
352 fflush(stdout);
353
354 getline(&buffer, &len, stdin);
355 if (strcmp(buffer, "exit\n") == 0)
356 {
357 break;
358 }
359
360 if (buffer[strlen(buffer) - 1] == '\n') // Replace the newline with a null char
361 {
362 buffer[strlen(buffer) - 1] = 0;
363 }
364
365 if (handle_line(buffer) == 1)
366 {
367 break;
368 }
369 }
370 free(buffer);
371}
372
373void batch_mode(FILE *fp)
374{

Callers 1

mainFunction · 0.85

Calls 1

handle_lineFunction · 0.85

Tested by

no test coverage detected