FreeCalypso > hg > fc-pcsc-tools
comparison simtool/pbdump.c @ 81:e89004a245ce
EF_LND code refactoring in prep for adding more lnd-* commands
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Feb 2021 05:53:22 +0000 |
parents | 0b29c0d19db4 |
children | fe660c7ea97f |
comparison
equal
deleted
inserted
replaced
80:54cebab70c19 | 81:e89004a245ce |
---|---|
5 #include <sys/types.h> | 5 #include <sys/types.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include "simresp.h" | 8 #include "simresp.h" |
9 #include "curfile.h" | 9 #include "curfile.h" |
10 #include "file_id.h" | |
11 | 10 |
12 static | 11 static |
13 check_blank_area(dp, endp) | 12 check_blank_area(dp, endp) |
14 u_char *dp, *endp; | 13 u_char *dp, *endp; |
15 { | 14 { |
136 cmd_lnd_dump() | 135 cmd_lnd_dump() |
137 { | 136 { |
138 int rc; | 137 int rc; |
139 unsigned recno; | 138 unsigned recno; |
140 | 139 |
141 rc = select_op(DF_TELECOM); | 140 rc = select_ef_lnd(); |
142 if (rc < 0) | 141 if (rc < 0) |
143 return(rc); | 142 return(rc); |
144 rc = select_op(EF_LND); | |
145 if (rc < 0) | |
146 return(rc); | |
147 rc = parse_ef_select_response(); | |
148 if (rc < 0) | |
149 return(rc); | |
150 if (curfile_structure != 0x03) { | |
151 fprintf(stderr, "error: EF_LND is not cyclic\n"); | |
152 return(-1); | |
153 } | |
154 if (curfile_record_len < 14) { | |
155 fprintf(stderr, | |
156 "error: EF_LND has record length of %u bytes, less than minimum 14\n", | |
157 curfile_record_len); | |
158 return(-1); | |
159 } | |
160 for (recno = 1; recno <= curfile_record_count; recno++) { | 143 for (recno = 1; recno <= curfile_record_count; recno++) { |
161 rc = readrec_op(recno, 0x04, curfile_record_len); | 144 rc = readrec_op(recno, 0x04, curfile_record_len); |
162 if (rc < 0) | 145 if (rc < 0) |
163 return(rc); | 146 return(rc); |
164 if (check_simresp_all_blank()) | 147 if (check_simresp_all_blank()) |