# HG changeset patch # User Mychaela Falconia # Date 1613719817 0 # Node ID 9c16cf1a79afb3a85f6f6a40eff0a3758de34e8d # Parent f1ea981ab2258565526ae87d4d984996d572bd55 fc-simtool sst: support output redirection diff -r f1ea981ab225 -r 9c16cf1a79af simtool/dispatch.c --- a/simtool/dispatch.c Fri Feb 19 07:26:15 2021 +0000 +++ b/simtool/dispatch.c Fri Feb 19 07:30:17 2021 +0000 @@ -167,7 +167,7 @@ {"smsp-set", 2, 6, 0, cmd_smsp_set}, {"smsp-set-tag", 3, 7, 0, cmd_smsp_set_tag}, {"spn", 0, 0, 1, cmd_spn}, - {"sst", 0, 0, 0, cmd_sst}, + {"sst", 0, 0, 1, cmd_sst}, {"telecom-sum", 0, 0, 0, cmd_telecom_sum}, {"uicc-dir", 0, 0, 1, cmd_uicc_dir}, {"unblock-chv1", 2, 2, 0, cmd_unblock_chv}, diff -r f1ea981ab225 -r 9c16cf1a79af simtool/sstlist.c --- a/simtool/sstlist.c Fri Feb 19 07:26:15 2021 +0000 +++ b/simtool/sstlist.c Fri Feb 19 07:30:17 2021 +0000 @@ -10,7 +10,9 @@ #include "curfile.h" #include "file_id.h" -cmd_sst() +cmd_sst(argc, argv, outf) + char **argv; + FILE *outf; { int rc; unsigned byte, pos, code, nserv, linelen; @@ -48,21 +50,21 @@ if (!(code & 1)) continue; if (linelen > 73) { - putchar('\n'); + putc('\n', outf); linelen = 0; } if (linelen) { - putchar(' '); + putc(' ', outf); linelen++; } - linelen += printf("%u", nserv); + linelen += fprintf(outf, "%u", nserv); if (!(code & 2)) { - putchar('^'); + putc('^', outf); linelen++; } } } if (linelen) - putchar('\n'); + putc('\n', outf); return(0); }