comparison simtool/readef.c @ 172:e7e0d8c06654

fc-simtool: support output redirection in select command
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 02 Mar 2021 03:18:21 +0000
parents 4d747b86da00
children e70964adcbba
comparison
equal deleted inserted replaced
171:4d747b86da00 172:e7e0d8c06654
36 if (curfile_structure != 0x00) { 36 if (curfile_structure != 0x00) {
37 fprintf(stderr, 37 fprintf(stderr,
38 "error: readef command is only for transparent EFs\n"); 38 "error: readef command is only for transparent EFs\n");
39 return(-1); 39 return(-1);
40 } 40 }
41 if (outf == stdout) { 41 fprintf(outf, "Transparent EF of %u byte(s)\n", curfile_total_size);
42 printf("Transparent EF of %u byte(s)\n", curfile_total_size); 42 fprintf(outf, "File status: %02X\n", sim_resp_data[11]);
43 printf("File status: %02X\n", sim_resp_data[11]); 43 show_access_conditions(outf, "UPDATE", sim_resp_data[8] & 0xF);
44 show_access_conditions("UPDATE", sim_resp_data[8] & 0xF); 44 show_access_conditions(outf, "READ & SEEK", sim_resp_data[8] >> 4);
45 show_access_conditions("READ & SEEK", sim_resp_data[8] >> 4); 45 show_access_conditions(outf, "INCREASE", sim_resp_data[9] >> 4);
46 show_access_conditions("INCREASE", sim_resp_data[9] >> 4); 46 show_access_conditions(outf, "INVALIDATE", sim_resp_data[10] & 0xF);
47 show_access_conditions("INVALIDATE", sim_resp_data[10] & 0xF); 47 show_access_conditions(outf, "REHABILITATE", sim_resp_data[10] >> 4);
48 show_access_conditions("REHABILITATE", sim_resp_data[10] >> 4);
49 }
50 if (!curfile_total_size) 48 if (!curfile_total_size)
51 return(0); 49 return(0);
52 readlen = curfile_total_size; 50 readlen = curfile_total_size;
53 if (readlen > 256) 51 if (readlen > 256)
54 readlen = 256; 52 readlen = 256;