diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-05-30 17:41:41 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-06-01 09:43:25 +1000 |
commit | ca1d944f40971c53a76c5bdf2c45f277acfc2e0e (patch) | |
tree | c780e408eb39014fbb8b8d70216993bccea55979 /jimsh.c | |
parent | 878a8fdb576ab96d6e8c497e4dffedf82a9afbcf (diff) | |
download | jimtcl-ca1d944f40971c53a76c5bdf2c45f277acfc2e0e.zip jimtcl-ca1d944f40971c53a76c5bdf2c45f277acfc2e0e.tar.gz jimtcl-ca1d944f40971c53a76c5bdf2c45f277acfc2e0e.tar.bz2 |
Add Jim_String() macro
It is very common to get the string value
without the length. Jim_String() is a macro which does that.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jimsh.c')
-rw-r--r-- | jimsh.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -79,7 +79,7 @@ int main(int argc, char *const argv[]) /* Register static extensions */ if (Jim_InitStaticExtensions(interp) != JIM_OK) { Jim_MakeErrorMessage(interp); - fprintf(stderr, "%s\n", Jim_GetString(Jim_GetResult(interp), NULL)); + fprintf(stderr, "%s\n", Jim_String(Jim_GetResult(interp))); } Jim_SetVariableStrWithStr(interp, "jim_argv0", argv[0]); @@ -89,7 +89,7 @@ int main(int argc, char *const argv[]) if (argc == 1) { if (retcode == JIM_ERR) { Jim_MakeErrorMessage(interp); - fprintf(stderr, "%s\n", Jim_GetString(Jim_GetResult(interp), NULL)); + fprintf(stderr, "%s\n", Jim_String(Jim_GetResult(interp))); } if (retcode != JIM_EXIT) { JimSetArgv(interp, 0, NULL); @@ -101,7 +101,7 @@ int main(int argc, char *const argv[]) JimSetArgv(interp, argc - 3, argv + 3); retcode = Jim_Eval(interp, argv[2]); if (retcode != JIM_ERR) { - printf("%s\n", Jim_GetString(Jim_GetResult(interp), NULL)); + printf("%s\n", Jim_String(Jim_GetResult(interp))); } } else { @@ -111,7 +111,7 @@ int main(int argc, char *const argv[]) } if (retcode == JIM_ERR) { Jim_MakeErrorMessage(interp); - fprintf(stderr, "%s\n", Jim_GetString(Jim_GetResult(interp), NULL)); + fprintf(stderr, "%s\n", Jim_String(Jim_GetResult(interp))); } } if (retcode == JIM_EXIT) { |