MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / rotctl_parse

Function rotctl_parse

tests/rotctl_parse.c:534–1521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532
533
534int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, const char *argv[],
535 int argc,
536 int interactive, int prompt, char send_cmd_term)
537{
538 int retcode; /* generic return code from functions */
539 unsigned char cmd;
540 struct test_table *cmd_entry = NULL;
541 int ext_resp = 0;
542 char resp_sep = '\n';
543
544 char command[MAXARGSZ + 1];
545 char arg1[MAXARGSZ + 1], *p1 = NULL;
546 char arg2[MAXARGSZ + 1], *p2 = NULL;
547 char arg3[MAXARGSZ + 1], *p3 = NULL;
548 char arg4[MAXARGSZ + 1], *p4 = NULL;
549#ifdef __USEP5P6__
550 char *p5 = NULL;
551 char *p6 = NULL;
552#endif
553 char arg_format[8];
554
555 SNPRINTF(arg_format, sizeof(arg_format), "%%%ds", MAXARGSZ);
556
557 /* cmd, internal, rotctld */
558#ifdef HAVE_LIBREADLINE
559
560 if (!(interactive && prompt && have_rl))
561#endif
562 {
563 if (interactive)
564 {
565 static int last_was_ret = 1;
566
567 if (prompt)
568 {
569 fprintf_flush(fout, "\nRotator command: ");
570 }
571
572 do
573 {
574 if (scanfc(fin, "%c", &cmd) < 1)
575 {
576 return -1;
577 }
578
579 /* Extended response protocol requested with leading '+' on command
580 * string--rotctld only!
581 */
582 if (cmd == '+' && !prompt)
583 {
584 ext_resp = 1;
585
586 if (scanfc(fin, "%c", &cmd) < 1)
587 {
588 return -1;
589 }
590 }
591 else if (cmd == '+' && prompt)

Callers 2

mainFunction · 0.85
handle_socketFunction · 0.85

Calls 10

usage_rotFunction · 0.85
rig_debugFunction · 0.85
pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
rigerrorFunction · 0.85
scanfcFunction · 0.70
parse_argFunction · 0.70
next_wordFunction · 0.70
find_cmd_entryFunction · 0.70
rp_getlineFunction · 0.70

Tested by

no test coverage detected