~ubuntu-branches/ubuntu/karmic/gtk-gnutella/karmic

« back to all changes in this revision

Viewing changes to src/version.h

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Kleineidam
  • Date: 2004-05-22 15:26:55 UTC
  • Revision ID: james.westby@ubuntu.com-20040522152655-lyi6iaswmy4hq4wy
Tags: upstream-0.93.3.0
ImportĀ upstreamĀ versionĀ 0.93.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Id: version.h,v 1.18 2004/01/02 14:00:25 rmanfredi Exp $
 
3
 *
 
4
 * Copyright (c) 2002-2003, Raphael Manfredi
 
5
 *
 
6
 * Version management.
 
7
 *
 
8
 *----------------------------------------------------------------------
 
9
 * This file is part of gtk-gnutella.
 
10
 *
 
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.
 
15
 *
 
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.
 
20
 *
 
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
 
23
 *  Foundation, Inc.:
 
24
 *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
25
 *----------------------------------------------------------------------
 
26
 */
 
27
 
 
28
#ifndef _version_h_
 
29
#define _version_h_
 
30
 
 
31
#include <glib.h>
 
32
 
 
33
/*
 
34
 * A decompiled version descriptor.
 
35
 * In our comments below, we are assuming a value of "0.90.3b2".
 
36
 */
 
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) */
 
43
        time_t timestamp;
 
44
} version_t;
 
45
 
 
46
/*
 
47
 * Banning periods for our versions.
 
48
 */
 
49
 
 
50
#define VERSION_ANCIENT_WARN    (86400*365)             /* 1 year */
 
51
#define VERSION_ANCIENT_BAN             (86400*365)             /* 1 year */
 
52
 
 
53
#define VERSION_UNSTABLE_WARN   (86400*60)              /* 2 months - 60 days */
 
54
#define VERSION_UNSTABLE_BAN    (86400*90)              /* 3 months - 90 days */
 
55
 
 
56
#define VERSION_ANCIENT_REMIND  (86400*30)              /* 30 days */
 
57
#define VERSION_ANCIENT_GRACE   (86400*20)              /* 20 days */
 
58
 
 
59
#define xstr(x) STRINGIFY(x)  
 
60
 
 
61
#if defined(GTA_PATCHLEVEL) && (GTA_PATCHLEVEL != 0)
 
62
#define GTA_VERSION_NUMBER \
 
63
        xstr(GTA_VERSION) "." xstr(GTA_SUBVERSION) "." xstr(GTA_PATCHLEVEL) \
 
64
                GTA_REVCHAR
 
65
#else
 
66
#define GTA_VERSION_NUMBER \
 
67
        xstr(GTA_VERSION) "." xstr(GTA_SUBVERSION) GTA_REVCHAR
 
68
#endif
 
69
 
 
70
/*
 
71
 * Public interface.
 
72
 */
 
73
 
 
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);
 
82
 
 
83
const gchar *version_str(const version_t *ver);
 
84
 
 
85
extern gchar *version_string;
 
86
extern gchar *version_short_string;
 
87
 
 
88
#endif  /* _version_h_ */
 
89
 
 
90
/* vi: set ts=4: */
 
91