2
* $Id: version.h,v 1.18 2004/01/02 14:00:25 rmanfredi Exp $
4
* Copyright (c) 2002-2003, Raphael Manfredi
8
*----------------------------------------------------------------------
9
* This file is part of gtk-gnutella.
11
* gtk-gnutella is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* gtk-gnutella is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with gtk-gnutella; if not, write to the Free Software
24
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
*----------------------------------------------------------------------
34
* A decompiled version descriptor.
35
* In our comments below, we are assuming a value of "0.90.3b2".
37
typedef struct version {
38
guint major; /* Major version number (0) */
39
guint minor; /* Minor version number (90) */
40
guint patchlevel; /* Patch level (3) */
41
guchar tag; /* Code letter after version number (b) */
42
guint taglevel; /* Value after code letter (2) */
47
* Banning periods for our versions.
50
#define VERSION_ANCIENT_WARN (86400*365) /* 1 year */
51
#define VERSION_ANCIENT_BAN (86400*365) /* 1 year */
53
#define VERSION_UNSTABLE_WARN (86400*60) /* 2 months - 60 days */
54
#define VERSION_UNSTABLE_BAN (86400*90) /* 3 months - 90 days */
56
#define VERSION_ANCIENT_REMIND (86400*30) /* 30 days */
57
#define VERSION_ANCIENT_GRACE (86400*20) /* 20 days */
59
#define xstr(x) STRINGIFY(x)
61
#if defined(GTA_PATCHLEVEL) && (GTA_PATCHLEVEL != 0)
62
#define GTA_VERSION_NUMBER \
63
xstr(GTA_VERSION) "." xstr(GTA_SUBVERSION) "." xstr(GTA_PATCHLEVEL) \
66
#define GTA_VERSION_NUMBER \
67
xstr(GTA_VERSION) "." xstr(GTA_SUBVERSION) GTA_REVCHAR
74
void version_init(void);
75
void version_close(void);
76
void version_ancient_warn(void);
77
gboolean version_check(const gchar *str, const gchar *token, guint32 ip);
78
gboolean version_is_too_old(const gchar *vendor);
79
gint version_cmp(const version_t *a, const version_t *b);
80
gboolean version_fill(const gchar *version, version_t *vs);
81
gboolean version_newer(const gchar *str, time_t stamp);
83
const gchar *version_str(const version_t *ver);
85
extern gchar *version_string;
86
extern gchar *version_short_string;
88
#endif /* _version_h_ */