FreeCalypso > hg > fc-pcsc-tools
annotate simtool/dispatch.c @ 96:3bce899bcf78
doc/Low-level-commands: a38 command documented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 17 Feb 2021 20:55:34 +0000 |
parents | ae831b21ef77 |
children | d2e800abd257 |
rev | line source |
---|---|
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module implements the command dispatch for fc-simtool |
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 <ctype.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 <string.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <strings.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <stdlib.h> |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 extern int cmd_a38(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 extern int cmd_change_chv(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 extern int cmd_disable_chv(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 extern int cmd_enable_chv(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 extern int cmd_exec(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 extern int cmd_fix_sysmo_msisdn(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 extern int cmd_grcard1_set_adm(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 extern int cmd_grcard1_set_ki(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 extern int cmd_grcard1_set_pin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 extern int cmd_grcard2_set_adm(); |
74
8562d8508cf2
grcard2-set-{adm,super}-hex commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
68
diff
changeset
|
21 extern int cmd_grcard2_set_adm_hex(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 extern int cmd_grcard2_set_pin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 extern int cmd_grcard2_set_puk(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 extern int cmd_grcard2_set_super(); |
74
8562d8508cf2
grcard2-set-{adm,super}-hex commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
68
diff
changeset
|
25 extern int cmd_grcard2_set_super_hex(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 extern int cmd_iccid(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 extern int cmd_imsi(); |
76
0b29c0d19db4
fc-simtool: dump-lnd command renamed to lnd-dump
Mychaela Falconia <falcon@freecalypso.org>
parents:
74
diff
changeset
|
28 extern int cmd_lnd_dump(); |
84
51f26fd967e2
lnd-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
83
diff
changeset
|
29 extern int cmd_lnd_erase(); |
88
ae831b21ef77
lnd-restore command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
87
diff
changeset
|
30 extern int cmd_lnd_restore(); |
83
07e395fddfe1
lnd-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
31 extern int cmd_lnd_write(); |
54
2d1679c7975b
fc-simtool opl-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
32 extern int cmd_opl_dump(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 extern int cmd_pb_dump(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 extern int cmd_pb_dump_rec(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 extern int cmd_pb_erase(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 extern int cmd_pb_erase_one(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 extern int cmd_pb_erase_range(); |
87
bc862d41f96b
pb-restore command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
84
diff
changeset
|
38 extern int cmd_pb_restore(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 extern int cmd_pb_update(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 extern int cmd_pb_update_imm(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 extern int cmd_pb_update_imm_hex(); |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
50
diff
changeset
|
42 extern int cmd_plmnsel_dump(); |
50
dc8a2e6fa03e
fc-simtool pnn-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
43 extern int cmd_pnn_dump(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 extern int cmd_readbin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 extern int cmd_readef(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 extern int cmd_readrec(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 extern int cmd_restore_file(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 extern int cmd_savebin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 extern int cmd_save_sms_bin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 extern int cmd_select(); |
42
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
51 extern int cmd_sms_erase_all(); |
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
52 extern int cmd_sms_erase_one(); |
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
53 extern int cmd_sms_erase_range(); |
38
f5a26c1d0b93
fc-simtool smsp-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
29
diff
changeset
|
54 extern int cmd_smsp_dump(); |
40
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
55 extern int cmd_smsp_erase_all(); |
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
56 extern int cmd_smsp_erase_one(); |
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
57 extern int cmd_smsp_erase_range(); |
39
2467b7acad1f
fc-simtool smsp-restore implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
38
diff
changeset
|
58 extern int cmd_smsp_restore(); |
44
f4eb1e83b4b3
fc-simtool smsp-set command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
42
diff
changeset
|
59 extern int cmd_smsp_set(); |
45
5bca197e7495
fc-simtool smsp-set-tag command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
44
diff
changeset
|
60 extern int cmd_smsp_set_tag(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 extern int cmd_spn(); |
59
c56e63a8725d
fc-simtool sst-dump command shortened to just sst
Mychaela Falconia <falcon@freecalypso.org>
parents:
58
diff
changeset
|
62 extern int cmd_sst(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 extern int cmd_telecom_sum(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 extern int cmd_uicc_dir(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 extern int cmd_unblock_chv(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 extern int cmd_update_bin(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 extern int cmd_update_bin_imm(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 extern int cmd_update_rec(); |
78
702c2c40e51a
fc-simtool update-rec-prev command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
69 extern int cmd_update_rec_prev(); |
61
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
59
diff
changeset
|
70 extern int cmd_user_sum(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 extern int cmd_verify_chv(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 extern int cmd_verify_ext(); |
47
ae3342497fea
fc-simtool verify-hex command added
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
73 extern int cmd_verify_hex(); |
68
105aa3d1a494
fc-simtool write-iccid command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
67
diff
changeset
|
74 extern int cmd_write_iccid(); |
67
9ff7ee99346f
forgot to hook in newly added write-imsi command
Mychaela Falconia <falcon@freecalypso.org>
parents:
63
diff
changeset
|
75 extern int cmd_write_imsi(); |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 extern int display_sim_resp_in_hex(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 extern int good_exit(); |
29
d368051576d0
fc-simtool & fc-uicc-tool: add explicit atr command
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
79 extern int retrieve_atr(); |
1
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 static struct cmdtab { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 char *cmd; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 int minargs; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 int maxargs; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 int (*func)(); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 } cmdtab[] = { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 {"a38", 1, 1, cmd_a38}, |
29
d368051576d0
fc-simtool & fc-uicc-tool: add explicit atr command
Mychaela Falconia <falcon@freecalypso.org>
parents:
1
diff
changeset
|
88 {"atr", 0, 0, retrieve_atr}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 {"change-chv1", 2, 2, cmd_change_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 {"change-chv2", 2, 2, cmd_change_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 {"change-pin1", 2, 2, cmd_change_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 {"change-pin2", 2, 2, cmd_change_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 {"disable-chv", 1, 1, cmd_disable_chv}, |
62
4bb28235f08a
add {dis,en}able-{chv,pin}1 command aliases for consistency
Mychaela Falconia <falcon@freecalypso.org>
parents:
61
diff
changeset
|
94 {"disable-chv1", 1, 1, cmd_disable_chv}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 {"disable-pin", 1, 1, cmd_disable_chv}, |
62
4bb28235f08a
add {dis,en}able-{chv,pin}1 command aliases for consistency
Mychaela Falconia <falcon@freecalypso.org>
parents:
61
diff
changeset
|
96 {"disable-pin1", 1, 1, cmd_disable_chv}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 {"enable-chv", 1, 1, cmd_enable_chv}, |
62
4bb28235f08a
add {dis,en}able-{chv,pin}1 command aliases for consistency
Mychaela Falconia <falcon@freecalypso.org>
parents:
61
diff
changeset
|
98 {"enable-chv1", 1, 1, cmd_enable_chv}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 {"enable-pin", 1, 1, cmd_enable_chv}, |
63
5f8c06445a40
bug in last commit
Mychaela Falconia <falcon@freecalypso.org>
parents:
62
diff
changeset
|
100 {"enable-pin1", 1, 1, cmd_enable_chv}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 {"exec", 1, 1, cmd_exec}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 {"exit", 0, 0, good_exit}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 {"fix-sysmo-msisdn", 0, 0, cmd_fix_sysmo_msisdn}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 {"grcard1-set-adm1", 2, 2, cmd_grcard1_set_adm}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 {"grcard1-set-adm2", 2, 2, cmd_grcard1_set_adm}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 {"grcard1-set-ki", 1, 1, cmd_grcard1_set_ki}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 {"grcard1-set-pin1", 2, 2, cmd_grcard1_set_pin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 {"grcard1-set-pin2", 2, 2, cmd_grcard1_set_pin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 {"grcard2-set-adm", 1, 1, cmd_grcard2_set_adm}, |
74
8562d8508cf2
grcard2-set-{adm,super}-hex commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
68
diff
changeset
|
110 {"grcard2-set-adm-hex", 1, 1, cmd_grcard2_set_adm_hex}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 {"grcard2-set-pin1", 1, 1, cmd_grcard2_set_pin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 {"grcard2-set-pin2", 1, 1, cmd_grcard2_set_pin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 {"grcard2-set-puk1", 1, 1, cmd_grcard2_set_puk}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 {"grcard2-set-puk2", 1, 1, cmd_grcard2_set_puk}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 {"grcard2-set-super", 1, 1, cmd_grcard2_set_super}, |
74
8562d8508cf2
grcard2-set-{adm,super}-hex commands implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
68
diff
changeset
|
116 {"grcard2-set-super-hex", 1, 1, cmd_grcard2_set_super_hex}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 {"iccid", 0, 0, cmd_iccid}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 {"imsi", 0, 0, cmd_imsi}, |
82
fe660c7ea97f
lnd-dump command can save to file like pb-dump and smsp-dump
Mychaela Falconia <falcon@freecalypso.org>
parents:
78
diff
changeset
|
119 {"lnd-dump", 0, 1, cmd_lnd_dump}, |
84
51f26fd967e2
lnd-erase command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
83
diff
changeset
|
120 {"lnd-erase", 0, 0, cmd_lnd_erase}, |
88
ae831b21ef77
lnd-restore command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
87
diff
changeset
|
121 {"lnd-restore", 1, 1, cmd_lnd_restore}, |
83
07e395fddfe1
lnd-write command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
82
diff
changeset
|
122 {"lnd-write", 1, 2, cmd_lnd_write}, |
54
2d1679c7975b
fc-simtool opl-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
53
diff
changeset
|
123 {"opl-dump", 0, 0, cmd_opl_dump}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 {"pb-dump", 1, 2, cmd_pb_dump}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 {"pb-dump-rec", 2, 3, cmd_pb_dump_rec}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 {"pb-erase", 1, 1, cmd_pb_erase}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 {"pb-erase-one", 2, 2, cmd_pb_erase_one}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 {"pb-erase-range", 3, 3, cmd_pb_erase_range}, |
87
bc862d41f96b
pb-restore command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
84
diff
changeset
|
129 {"pb-restore", 2, 2, cmd_pb_restore}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 {"pb-update", 2, 2, cmd_pb_update}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 {"pb-update-imm", 3, 4, cmd_pb_update_imm}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 {"pb-update-imm-hex", 4, 4, cmd_pb_update_imm_hex}, |
53
4eb447be01c0
fc-simtool plmnsel-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
50
diff
changeset
|
133 {"plmnsel-dump", 0, 0, cmd_plmnsel_dump}, |
50
dc8a2e6fa03e
fc-simtool pnn-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
48
diff
changeset
|
134 {"pnn-dump", 0, 0, cmd_pnn_dump}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 {"quit", 0, 0, good_exit}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 {"readbin", 2, 2, cmd_readbin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 {"readef", 1, 1, cmd_readef}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 {"readrec", 1, 2, cmd_readrec}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 {"restore-file", 2, 2, cmd_restore_file}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 {"savebin", 2, 2, cmd_savebin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 {"save-sms-bin", 1, 1, cmd_save_sms_bin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 {"select", 1, 1, cmd_select}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 {"sim-resp", 0, 0, display_sim_resp_in_hex}, |
42
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
144 {"sms-erase-all", 0, 0, cmd_sms_erase_all}, |
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
145 {"sms-erase-one", 1, 1, cmd_sms_erase_one}, |
2714d379edc2
fc-simtool sms-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
40
diff
changeset
|
146 {"sms-erase-range", 2, 2, cmd_sms_erase_range}, |
38
f5a26c1d0b93
fc-simtool smsp-dump implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
29
diff
changeset
|
147 {"smsp-dump", 0, 1, cmd_smsp_dump}, |
40
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
148 {"smsp-erase-all", 0, 0, cmd_smsp_erase_all}, |
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
149 {"smsp-erase-one", 1, 1, cmd_smsp_erase_one}, |
4c240a37e7c4
fc-simtool smsp-erase-* command family implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
39
diff
changeset
|
150 {"smsp-erase-range", 2, 2, cmd_smsp_erase_range}, |
39
2467b7acad1f
fc-simtool smsp-restore implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
38
diff
changeset
|
151 {"smsp-restore", 1, 1, cmd_smsp_restore}, |
44
f4eb1e83b4b3
fc-simtool smsp-set command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
42
diff
changeset
|
152 {"smsp-set", 2, 6, cmd_smsp_set}, |
45
5bca197e7495
fc-simtool smsp-set-tag command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
44
diff
changeset
|
153 {"smsp-set-tag", 3, 7, cmd_smsp_set_tag}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 {"spn", 0, 0, cmd_spn}, |
59
c56e63a8725d
fc-simtool sst-dump command shortened to just sst
Mychaela Falconia <falcon@freecalypso.org>
parents:
58
diff
changeset
|
155 {"sst", 0, 0, cmd_sst}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 {"telecom-sum", 0, 0, cmd_telecom_sum}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 {"uicc-dir", 0, 0, cmd_uicc_dir}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 {"unblock-chv1", 2, 2, cmd_unblock_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 {"unblock-chv2", 2, 2, cmd_unblock_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 {"unblock-pin1", 2, 2, cmd_unblock_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 {"unblock-pin2", 2, 2, cmd_unblock_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 {"update-bin", 2, 2, cmd_update_bin}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 {"update-bin-imm", 2, 2, cmd_update_bin_imm}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 {"update-rec", 2, 2, cmd_update_rec}, |
78
702c2c40e51a
fc-simtool update-rec-prev command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
76
diff
changeset
|
165 {"update-rec-prev", 1, 1, cmd_update_rec_prev}, |
61
633033af6fb8
fc-simtool user-sum command implemented,
Mychaela Falconia <falcon@freecalypso.org>
parents:
59
diff
changeset
|
166 {"user-sum", 0, 0, cmd_user_sum}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 {"verify-chv1", 1, 1, cmd_verify_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 {"verify-chv2", 1, 1, cmd_verify_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 {"verify-ext", 2, 2, cmd_verify_ext}, |
47
ae3342497fea
fc-simtool verify-hex command added
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
170 {"verify-hex", 2, 2, cmd_verify_hex}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
171 {"verify-pin1", 1, 1, cmd_verify_chv}, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
172 {"verify-pin2", 1, 1, cmd_verify_chv}, |
68
105aa3d1a494
fc-simtool write-iccid command implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
67
diff
changeset
|
173 {"write-iccid", 1, 1, cmd_write_iccid}, |
67
9ff7ee99346f
forgot to hook in newly added write-imsi command
Mychaela Falconia <falcon@freecalypso.org>
parents:
63
diff
changeset
|
174 {"write-imsi", 1, 1, cmd_write_imsi}, |
1
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 {0, 0, 0, 0} |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 }; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 simtool_dispatch_cmd(cmd, is_script) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 char *cmd; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 char *argv[10]; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 char *cp, **ap; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 struct cmdtab *tp; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 for (cp = cmd; isspace(*cp); cp++) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 ; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 if (!*cp || *cp == '#') |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 return(0); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 if (is_script) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 printf("Script command: %s\n", cp); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 argv[0] = cp; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 while (*cp && !isspace(*cp)) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 cp++; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 if (*cp) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 *cp++ = '\0'; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 for (tp = cmdtab; tp->cmd; tp++) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 if (!strcmp(tp->cmd, argv[0])) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 break; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 if (!tp->func) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 fprintf(stderr, "error: no such command\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 for (ap = argv + 1; ; ) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 while (isspace(*cp)) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 cp++; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 if (!*cp || *cp == '#') |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 break; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 if (ap - argv - 1 >= tp->maxargs) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 fprintf(stderr, "error: too many arguments\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 if (*cp == '"') { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 *ap++ = ++cp; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 for (;;) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
215 if (!*cp) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
216 unterm_qstring: fprintf(stderr, |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 "error: unterminated quoted string\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
220 if (*cp == '"') |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
221 break; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 if (*cp++ == '\\') { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 if (!*cp) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 goto unterm_qstring; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 cp++; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 *cp++ = '\0'; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 } else { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
230 *ap++ = cp; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
231 while (*cp && !isspace(*cp)) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 cp++; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 if (*cp) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
234 *cp++ = '\0'; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
235 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
236 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
237 if (ap - argv - 1 < tp->minargs) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 fprintf(stderr, "error: too few arguments\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 *ap = 0; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 return tp->func(ap - argv, argv); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 dispatch_ready_argv(argc, argv) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 char **argv; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 struct cmdtab *tp; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 for (tp = cmdtab; tp->cmd; tp++) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 if (!strcmp(tp->cmd, argv[0])) |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 break; |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 if (!tp->func) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 fprintf(stderr, "error: no such command\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
255 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
256 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 if (argc - 1 > tp->maxargs) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 fprintf(stderr, "error: too many arguments\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
259 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
260 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
261 if (argc - 1 < tp->minargs) { |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
262 fprintf(stderr, "error: too few arguments\n"); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 return(-1); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 } |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 return tp->func(argc, argv); |
2071b28cd0c7
simtool: first refactored version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 } |