FreeCalypso > hg > fc-pcsc-tools
annotate simtool/pbdump.c @ 173:e70964adcbba
fc-simtool readef extended to fully dump all files
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 02 Mar 2021 03:33:41 +0000 |
parents | 869488ef86b6 |
children |
rev | line source |
---|---|
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
9
dc565e91069d
pb-dump meaty function factored out into libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
8
diff
changeset
|
2 * This module implements pb-dump and pb-dump-rec commands. |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <stdio.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdlib.h> |
19
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
8 #include "simresp.h" |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include "curfile.h" |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
19
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
11 static |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
12 check_blank_area(dp, endp) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
13 u_char *dp, *endp; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
14 { |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
15 while (dp < endp) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
16 if (*dp++ != 0xFF) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
17 return(-1); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
18 return(0); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
19 } |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
20 |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
21 static void |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
22 dump_record(recno, outf) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
23 unsigned recno; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
24 FILE *outf; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
25 { |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
26 int rc; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
27 unsigned textlen; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
28 u_char *fixp; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
29 char digits[21]; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
30 |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
31 fprintf(outf, "#%u: ", recno); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
32 if (sim_resp_data_len > 14) { |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
33 rc = validate_alpha_field(sim_resp_data, |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
34 sim_resp_data_len - 14, |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
35 &textlen); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
36 if (rc < 0) { |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
37 malformed: fprintf(outf, "malformed record\n"); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
38 return; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
39 } |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
40 } else |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
41 textlen = 0; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
42 fixp = sim_resp_data + sim_resp_data_len - 14; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
43 if (fixp[0] < 2 || fixp[0] > 11) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
44 goto malformed; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
45 rc = decode_phone_number(fixp + 2, fixp[0] - 1, digits); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
46 if (rc < 0) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
47 goto malformed; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
48 rc = check_blank_area(fixp + 1 + fixp[0], fixp + 12); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
49 if (rc < 0) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
50 goto malformed; |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
51 /* all checks passed */ |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
52 fprintf(outf, "%s,0x%02X ", digits, fixp[1]); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
53 if (fixp[12] != 0xFF) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
54 fprintf(outf, "CCP=%u ", fixp[12]); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
55 if (fixp[13] != 0xFF) |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
56 fprintf(outf, "EXT=%u ", fixp[13]); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
57 print_alpha_field(sim_resp_data, textlen, outf); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
58 putc('\n', outf); |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
59 } |
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
60 |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
61 cmd_pb_dump(argc, argv, outf) |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 char **argv; |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
63 FILE *outf; |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 int rc; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 unsigned recno; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 rc = phonebook_op_common(argv[1]); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 if (rc < 0) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 return(rc); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 for (recno = 1; recno <= curfile_record_count; recno++) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 rc = readrec_op(recno, 0x04, curfile_record_len); |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
73 if (rc < 0) |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 return(rc); |
5
ce189c97b7b1
check_simresp_all_blank() factored out into libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
75 if (check_simresp_all_blank()) |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 continue; |
19
72a24b8538eb
meaty function of pb-dump moved back into simtool, out of libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
9
diff
changeset
|
77 dump_record(recno, outf); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 return(0); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
82 cmd_pb_dump_rec(argc, argv, outf) |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 char **argv; |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
84 FILE *outf; |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 int rc; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 unsigned recno, startrec, endrec; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 rc = phonebook_op_common(argv[1]); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 if (rc < 0) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 return(rc); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 startrec = strtoul(argv[2], 0, 0); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 if (startrec < 1 || startrec > curfile_record_count) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 fprintf(stderr, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 "error: specified starting record number is invalid\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 if (argv[3]) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 endrec = strtoul(argv[3], 0, 0); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 if (endrec < 1 || endrec > curfile_record_count) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 fprintf(stderr, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 "error: specified final record number is invalid\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 if (startrec > endrec) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 fprintf(stderr, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 "error: reverse record range specified\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 } else |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 endrec = startrec; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 for (recno = startrec; recno <= endrec; recno++) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 rc = readrec_op(recno, 0x04, curfile_record_len); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 if (rc < 0) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 return(rc); |
5
ce189c97b7b1
check_simresp_all_blank() factored out into libcommon
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
116 if (check_simresp_all_blank()) |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 continue; |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
118 dump_record(recno, outf); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 return(0); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 } |
58
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
122 |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
123 cmd_lnd_dump(argc, argv, outf) |
82
fe660c7ea97f
lnd-dump command can save to file like pb-dump and smsp-dump
Mychaela Falconia <falcon@freecalypso.org>
parents:
81
diff
changeset
|
124 char **argv; |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
125 FILE *outf; |
58
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
126 { |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
127 int rc; |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
128 unsigned recno; |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
129 |
81
e89004a245ce
EF_LND code refactoring in prep for adding more lnd-* commands
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
130 rc = select_ef_lnd(); |
58
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
131 if (rc < 0) |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
132 return(rc); |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
133 for (recno = 1; recno <= curfile_record_count; recno++) { |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
134 rc = readrec_op(recno, 0x04, curfile_record_len); |
111
869488ef86b6
pb-dump command family reworked for new output redirection
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
135 if (rc < 0) |
58
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
136 return(rc); |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
137 if (check_simresp_all_blank()) |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
138 continue; |
82
fe660c7ea97f
lnd-dump command can save to file like pb-dump and smsp-dump
Mychaela Falconia <falcon@freecalypso.org>
parents:
81
diff
changeset
|
139 dump_record(recno, outf); |
58
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
140 } |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
141 return(0); |
1861d9fb7751
fc-simtool dump-lnd command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
19
diff
changeset
|
142 } |