diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-11-11 12:11:07 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-11-18 07:57:03 +1000 |
commit | 0ddf0885b9560de1b242bc58d27033e069555707 (patch) | |
tree | 34e1969ddabb51aefa18adbc9afe7bc01c4ca108 /jim-package.c | |
parent | 8ca0b5227f362c9ab3e4e507c0a41be609c449d5 (diff) | |
download | jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.zip jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.tar.gz jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.tar.bz2 |
Cleanup hash table interfaces
Remove const-ness of hash table keys
Also consolidate string hashtable ops
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-package.c')
-rw-r--r-- | jim-package.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/jim-package.c b/jim-package.c index 51c5c69..8a2fc49 100644 --- a/jim-package.c +++ b/jim-package.c @@ -10,6 +10,9 @@ #define R_OK 4 #endif +/* All packages have a fixed, dummy version */ +static const char *package_version_1 = "1.0"; + /* ----------------------------------------------------------------------------- * Packages handling * ---------------------------------------------------------------------------*/ @@ -166,24 +169,18 @@ int Jim_PackageRequire(Jim_Interp *interp, const char *name, int flags) * * package provide name ?version? * - * This procedure is invoked to declare that a particular version - * of a particular package is now present in an interpreter. There - * must not be any other version of this package already - * provided in the interpreter. + * This procedure is invoked to declare that + * a particular package is now present in an interpreter. + * The package must not already be provided in the interpreter. * * Results: - * Returns JIM_OK and sets the package version (or 1.0 if not specified). + * Returns JIM_OK and sets results as "1.0" (the given version is ignored) * *---------------------------------------------------------------------- */ static int package_cmd_provide(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { - const char *version = "1.0"; - - if (argc == 2) { - version = Jim_String(argv[1]); - } - return Jim_PackageProvide(interp, Jim_String(argv[0]), version, JIM_ERRMSG); + return Jim_PackageProvide(interp, Jim_String(argv[0]), package_version_1, JIM_ERRMSG); } /* |