diff --git a/c/env.c b/c/env.c index 444e86a..dea0221 100644 --- a/c/env.c +++ b/c/env.c @@ -12,6 +12,30 @@ #include "scheme.h" +value_t envst_language(void) +{ + struct accum acc = ACCUM_EMPTY; + + accum_elt(&acc, symbol("language")); + accum_name_value(&acc, "implementation-name", + string_from_cstr("Up Scheme")); + accum_name_value(&acc, "implementation-version", + string_from_cstr("0.1.0")); + return acc.list; +} + +value_t envst_language_c(void) +{ + struct accum acc = ACCUM_EMPTY; + + accum_elt(&acc, symbol("language")); + accum_name_value(&acc, "implementation-name", + string_from_cstr(SCHEME_C_COMPILER_NAME)); + accum_name_value(&acc, "implementation-version", + string_from_cstr(SCHEME_C_COMPILER_VERSION)); + return acc.list; +} + static value_t get_features_list(void) { static struct accum acc; diff --git a/c/env_unix.c b/c/env_unix.c index 24dd1ad..f8c1688 100644 --- a/c/env_unix.c +++ b/c/env_unix.c @@ -32,30 +32,6 @@ static const struct utsname *get_global_uname(void) const char *env_get_os_name(void) { return get_global_uname()->sysname; } -static value_t envst_language(void) -{ - struct accum acc = ACCUM_EMPTY; - - accum_elt(&acc, symbol("language")); - accum_name_value(&acc, "implementation-name", - string_from_cstr("Up Scheme")); - accum_name_value(&acc, "implementation-version", - string_from_cstr("0.1.0")); - return acc.list; -} - -static value_t envst_language_c(void) -{ - struct accum acc = ACCUM_EMPTY; - - accum_elt(&acc, symbol("language")); - accum_name_value(&acc, "implementation-name", - string_from_cstr(SCHEME_C_COMPILER_NAME)); - accum_name_value(&acc, "implementation-version", - string_from_cstr(SCHEME_C_COMPILER_VERSION)); - return acc.list; -} - static value_t envst_os(void) { struct accum acc = ACCUM_EMPTY; diff --git a/c/scheme.h b/c/scheme.h index 8a0a924..a27e08b 100644 --- a/c/scheme.h +++ b/c/scheme.h @@ -1005,6 +1005,8 @@ const char *env_get_os_name(void); // env.c +value_t envst_language(void); +value_t envst_language_c(void); value_t get_version_alist(void); value_t builtin_features(value_t *args, uint32_t nargs); value_t builtin_version_alist(value_t *args, uint32_t nargs);