From c2120ba28a7f3c473c05403e6015c95bec406336 Mon Sep 17 00:00:00 2001 From: oharboe Date: Fri, 31 Oct 2008 13:40:02 +0000 Subject: Added telnet_async command to enable/disable asynchronous messages. git-svn-id: svn://svn.berlios.de/openocd/trunk@1117 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/helper/command.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/helper/command.c') diff --git a/src/helper/command.c b/src/helper/command.c index 9ade320c..a8de14ee 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -795,3 +795,16 @@ void register_jim(struct command_context_s *cmd_ctx, const char *name, int (*cmd Jim_ListAppendElement(interp, cmd_entry, Jim_NewStringObj(interp, help, -1)); Jim_ListAppendElement(interp, helptext, cmd_entry); } + + +/* return global variable long value or 0 upon failure */ +long jim_global_long(const char *variable) +{ + Jim_Obj *objPtr=Jim_GetGlobalVariableStr(interp, variable, JIM_ERRMSG); + long t; + if (Jim_GetLong(interp, objPtr, &t)==JIM_OK) + { + return t; + } + return 0; +} -- cgit v1.2.3