Set c.screen in ewmh.tag and before tags in rules.execute
[awesome.git] / common / version.c
blobbbca1e41255d47b2b8a21d4ddc1a6c7603398b66
1 /*
2 * version.c - version message utility functions
4 * Copyright © 2008 Julien Danjou <julien@danjou.info>
5 * Copyright © 2008 Hans Ulrich Niedermann <hun@n-dimensional.de>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #include <stdlib.h>
23 #include <stdio.h>
25 #include <lualib.h>
26 #include <lauxlib.h>
28 #include "config.h"
29 #include "common/version.h"
30 #include "awesome-version-internal.h"
32 /** \brief Print version message and quit program.
33 * \param executable program name
35 void
36 eprint_version(void)
38 printf("awesome " AWESOME_VERSION
39 " (" AWESOME_RELEASE ")\n"
40 " • Build:");
41 #if defined(__DATE__) && defined(__TIME__)
42 printf(" " __DATE__ " " __TIME__);
43 #endif
44 printf(" for %s", AWESOME_COMPILE_MACHINE);
45 #if defined(__GNUC__) \
46 && defined(__GNUC_MINOR__) \
47 && defined(__GNUC_PATCHLEVEL__)
48 printf(" by gcc version %d.%d.%d",
49 __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
50 #endif
51 printf(" (%s@%s)\n", AWESOME_COMPILE_BY, AWESOME_COMPILE_HOSTNAME);
53 lua_State *L = luaL_newstate();
54 luaopen_base(L);
55 lua_getglobal(L, "_VERSION");
56 printf(" • Compiled against " LUA_RELEASE
57 " (running with %s)\n", lua_tostring(L, -1));
58 lua_close(L);
60 printf(" • D-Bus support: ");
61 #ifdef WITH_DBUS
62 printf("✔\n");
63 #else
64 printf("✘\n");
65 #endif
66 exit(EXIT_SUCCESS);
69 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80