diff --git a/common/version.c b/common/version.c index 844f18e8..2786a4d9 100644 --- a/common/version.c +++ b/common/version.c @@ -66,4 +66,22 @@ eprint_version(void) exit(EXIT_SUCCESS); } +/** Get version string. + * \return A string describing the current version. + */ +const char * +awesome_version_string(void) +{ + return AWESOME_VERSION; +} + +/** Get release string. + * \return A string describing the code name of the relase. + */ +const char * +awesome_release_string(void) +{ + return AWESOME_RELEASE; +} + // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/common/version.h b/common/version.h index bee63163..ee368bc3 100644 --- a/common/version.h +++ b/common/version.h @@ -23,5 +23,7 @@ #define AWESOME_COMMON_VERSION_H void eprint_version(void) __attribute__ ((noreturn)); +const char *awesome_version_string(void); +const char *awesome_release_string(void); #endif diff --git a/luaa.c b/luaa.c index 074f2b89..04b0a262 100644 --- a/luaa.c +++ b/luaa.c @@ -23,9 +23,9 @@ #include "luaa.h" #include "globalconf.h" -#include "awesome-version-internal.h" #include "awesome.h" #include "common/backtrace.h" +#include "common/version.h" #include "config.h" #include "event.h" #include "objects/client.h" @@ -222,13 +222,13 @@ luaA_awesome_index(lua_State *L) if(A_STREQ(buf, "version")) { - lua_pushliteral(L, AWESOME_VERSION); + lua_pushstring(L, awesome_version_string()); return 1; } if(A_STREQ(buf, "release")) { - lua_pushliteral(L, AWESOME_RELEASE); + lua_pushstring(L, awesome_release_string()); return 1; }