File: version.cpp

package info (click to toggle)
tinymux 2.10.1.14-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,212 kB
  • ctags: 8,535
  • sloc: cpp: 111,587; sh: 5,867; ansic: 141; makefile: 139
file content (98 lines) | stat: -rw-r--r-- 3,624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*! \file version.cpp
 * \brief Version information.
 *
 * $Id: version.cpp 4087 2009-01-05 14:56:00Z brazilofmux $
 *
 */

#include "copyright.h"
#include "autoconf.h"
#include "config.h"
#include "externs.h"

#include "_build.h"
#include "command.h"

void do_version(dbref executor, dbref caller, dbref enactor, int eval, int key)
{
    UNUSED_PARAMETER(caller);
    UNUSED_PARAMETER(enactor);
    UNUSED_PARAMETER(eval);
    UNUSED_PARAMETER(key);

    notify(executor, mudstate.version);
    UTF8 *buff = alloc_mbuf("do_version");
    mux_sprintf(buff, MBUF_SIZE, T("Build date: %s"), MUX_BUILD_DATE);
    notify(executor, buff);
    free_mbuf(buff);
}

void build_version(void)
{
#if defined(WIN64)
#if defined(ALPHA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win64 #%s [ALPHA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Alpha Win64"), MUX_VERSION);
#elif defined(BETA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win64 #%s [BETA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Beta Win64"), MUX_VERSION);
#else // RELEASED
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win64 #%s [%s]"), MUX_VERSION, MUX_BUILD_NUM,
            MUX_RELEASE_DATE);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Win64"), MUX_VERSION);
#endif // ALPHA, BETA, RELEASED
#elif defined(WIN32)
#if defined(ALPHA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win32 #%s [ALPHA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Alpha Win32"), MUX_VERSION);
#elif defined(BETA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win32 #%s [BETA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Beta Win32"), MUX_VERSION);
#else // RELEASED
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s for Win32 #%s [%s]"), MUX_VERSION, MUX_BUILD_NUM,
            MUX_RELEASE_DATE);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Win32"), MUX_VERSION);
#endif // ALPHA, BETA, RELEASED
#else // WIN32
#if defined(ALPHA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s #%s [ALPHA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Alpha"), MUX_VERSION);
#elif defined(BETA)
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s #%s [BETA]"), MUX_VERSION, MUX_BUILD_NUM);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s Beta"), MUX_VERSION);
#else // RELEASED
        mux_sprintf(mudstate.version, sizeof(mudstate.version),
            T("MUX %s #%s [%s]"), MUX_VERSION, MUX_BUILD_NUM, MUX_RELEASE_DATE);
        mux_sprintf(mudstate.short_ver, sizeof(mudstate.short_ver),
            T("MUX %s"), MUX_VERSION);
#endif // ALPHA, BETA, RELEASED
#endif // WIN32
}

void init_version(void)
{
    STARTLOG(LOG_ALWAYS, "INI", "START");
    log_text(T("Starting: "));
    log_text(mudstate.version);
    ENDLOG;
    STARTLOG(LOG_ALWAYS, "INI", "START");
    log_text(T("Build date: "));
    log_text((UTF8 *)MUX_BUILD_DATE);
    ENDLOG;
}