aboutsummaryrefslogtreecommitdiff
path: root/jim-clock.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-11-06 23:21:48 +1000
committerSteve Bennett <steveb@workware.net.au>2011-11-07 15:31:29 +1000
commit5fe0bb5f3beedb262512a8e548bf7cc6ed9bff96 (patch)
tree3b010fb2fc159e74b3f5eb14dc273179a159e36d /jim-clock.c
parent5e7859e24d9534bf1e7e745bf1e2906afcf83633 (diff)
downloadjimtcl-5fe0bb5f3beedb262512a8e548bf7cc6ed9bff96.zip
jimtcl-5fe0bb5f3beedb262512a8e548bf7cc6ed9bff96.tar.gz
jimtcl-5fe0bb5f3beedb262512a8e548bf7cc6ed9bff96.tar.bz2
Remove use of designated initialisers
For better compatibility c89 compatibility. Also simplify jim-subcmd. Remove -usage and command descriptions. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-clock.c')
-rw-r--r--jim-clock.c70
1 files changed, 37 insertions, 33 deletions
diff --git a/jim-clock.c b/jim-clock.c
index 51ffb51..3d95aa3 100644
--- a/jim-clock.c
+++ b/jim-clock.c
@@ -106,47 +106,51 @@ static int clock_cmd_millis(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}
static const jim_subcmd_type clock_command_table[] = {
- { .cmd = "seconds",
- .function = clock_cmd_seconds,
- .minargs = 0,
- .maxargs = 0,
- .description = "Returns the current time as seconds since the epoch"
+ { "seconds",
+ NULL,
+ clock_cmd_seconds,
+ 0,
+ 0,
+ /* Description: Returns the current time as seconds since the epoch */
},
- { .cmd = "clicks",
- .function = clock_cmd_micros,
- .minargs = 0,
- .maxargs = 0,
- .description = "Returns the current time in 'clicks'"
+ { "clicks",
+ NULL,
+ clock_cmd_micros,
+ 0,
+ 0,
+ /* Description: Returns the current time in 'clicks' */
},
- { .cmd = "microseconds",
- .function = clock_cmd_micros,
- .minargs = 0,
- .maxargs = 0,
- .description = "Returns the current time in microseconds"
+ { "microseconds",
+ NULL,
+ clock_cmd_micros,
+ 0,
+ 0,
+ /* Description: Returns the current time in microseconds */
},
- { .cmd = "milliseconds",
- .function = clock_cmd_millis,
- .minargs = 0,
- .maxargs = 0,
- .description = "Returns the current time in milliseconds"
+ { "milliseconds",
+ NULL,
+ clock_cmd_millis,
+ 0,
+ 0,
+ /* Description: Returns the current time in milliseconds */
},
- { .cmd = "format",
- .args = "seconds ?-format format?",
- .function = clock_cmd_format,
- .minargs = 1,
- .maxargs = 3,
- .description = "Format the given time"
+ { "format",
+ "seconds ?-format format?",
+ clock_cmd_format,
+ 1,
+ 3,
+ /* Description: Format the given time */
},
#ifdef HAVE_STRPTIME
- { .cmd = "scan",
- .args = "str -format format",
- .function = clock_cmd_scan,
- .minargs = 3,
- .maxargs = 3,
- .description = "Determine the time according to the given format"
+ { "scan",
+ "str -format format",
+ clock_cmd_scan,
+ 3,
+ 3,
+ /* Description: Determine the time according to the given format */
},
#endif
- { 0 }
+ { NULL }
};
int Jim_clockInit(Jim_Interp *interp)