FreeCalypso > hg > fc-pcsc-tools
comparison uicc/dumpdir.c @ 22:1b1468869ccf
new trimmed fc-uicc-tool is here
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 12 Feb 2021 04:34:53 +0000 |
| parents | |
| children | dcfec53643c5 |
comparison
equal
deleted
inserted
replaced
| 21:d4dc86195382 | 22:1b1468869ccf |
|---|---|
| 1 /* | |
| 2 * This module implements the dump of EF_DIR. | |
| 3 */ | |
| 4 | |
| 5 #include <sys/types.h> | |
| 6 #include <stdio.h> | |
| 7 #include "file_id.h" | |
| 8 | |
| 9 cmd_dir() | |
| 10 { | |
| 11 int rc; | |
| 12 unsigned record_len, record_count; | |
| 13 unsigned recno; | |
| 14 | |
| 15 rc = select_op(FILEID_MF); | |
| 16 if (rc < 0) | |
| 17 return(rc); | |
| 18 rc = select_op(EF_DIR); | |
| 19 if (rc < 0) | |
| 20 return(rc); | |
| 21 rc = select_resp_get_linear_fixed(&record_len, &record_count); | |
| 22 if (rc < 0) | |
| 23 return(rc); | |
| 24 if (record_len < 5) { | |
| 25 fprintf(stderr, "error: EF_DIR record length is too short\n"); | |
| 26 return(-1); | |
| 27 } | |
| 28 for (recno = 1; recno <= record_count; recno++) { | |
| 29 rc = readrec_op(recno, 0x04, record_len); | |
| 30 if (rc < 0) | |
| 31 return(rc); | |
| 32 if (check_simresp_all_blank()) | |
| 33 continue; | |
| 34 printf("Record #%u:\n", recno); | |
| 35 dump_efdir_record(); | |
| 36 } | |
| 37 return(0); | |
| 38 } |
