Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

version.h File Reference


Detailed Description

Version management.

Author:
Raphael Manfredi
Date:
2002-2003

#include "common.h"
#include "if/core/version.h"
#include "lib/host_addr.h"

Go to the source code of this file.

Data Structures

struct  version
 A decompiled version descriptor. More...


Defines

#define VERSION_ANCIENT_WARN   (86400*365) /**< 1 year */
 1 year

#define VERSION_ANCIENT_BAN   (86400*365) /**< 1 year */
 1 year

#define VERSION_UNSTABLE_WARN   (86400*60) /**< 2 months - 60 days */
 2 months - 60 days

#define VERSION_UNSTABLE_BAN   (86400*90) /**< 3 months - 90 days */
 3 months - 90 days

#define VERSION_ANCIENT_REMIND   (86400*30) /**< 30 days */
 30 days

#define VERSION_ANCIENT_GRACE   (86400*20) /**< 20 days */
 20 days


Typedefs

typedef version version_t
 A decompiled version descriptor.


Functions

void version_init (void)
 Initialize version string.

void version_close (void)
 Free version string.

void version_ancient_warn (void)
 Called after GUI initialized to warn them about an ancient version.

gboolean version_check (const gchar *str, const gchar *token, const host_addr_t)
 Check version of servent, and if it's a gtk-gnutella more recent than we are, record that fact and change the status bar.

gboolean version_is_too_old (const gchar *vendor)
 Check the timestamp in the GTKG version string and returns TRUE if it is too old or could not be parsed, FALSE if OK.

gint version_cmp (const version_t *a, const version_t *b)
 Compare two gtk-gnutella versions, timestamp not withstanding.

gboolean version_fill (const gchar *version, version_t *vs)
 Parse vendor string and fill supplied version structure `vs'.

const gchar * version_str (const version_t *ver)
guint8 version_get_code (void)
 Get version code (year/month coded in one byte).


Variables

gchar * version_string
gchar * version_short_string


Define Documentation

#define VERSION_ANCIENT_BAN   (86400*365) /**< 1 year */
 

1 year

#define VERSION_ANCIENT_GRACE   (86400*20) /**< 20 days */
 

20 days

#define VERSION_ANCIENT_REMIND   (86400*30) /**< 30 days */
 

30 days

#define VERSION_ANCIENT_WARN   (86400*365) /**< 1 year */
 

1 year

#define VERSION_UNSTABLE_BAN   (86400*90) /**< 3 months - 90 days */
 

3 months - 90 days

#define VERSION_UNSTABLE_WARN   (86400*60) /**< 2 months - 60 days */
 

2 months - 60 days


Typedef Documentation

typedef struct version version_t
 

A decompiled version descriptor.

In our comments below, we are assuming a value of "0.90.3b2".


Function Documentation

void version_ancient_warn void   ) 
 

Called after GUI initialized to warn them about an ancient version.

(over a year old).

If the version being ran is not a stable one, warn after 60 days, otherwise warn after a year. If we're not "expired" yet but are approaching the deadline, start to remind them. After the deadline plus some grace period, refuse to run unless a special property is set.

gboolean version_check const gchar *  str,
const gchar *  token,
const host_addr_t  addr
 

Check version of servent, and if it's a gtk-gnutella more recent than we are, record that fact and change the status bar.

The `addr' is being passed solely for the tok_version_valid() call.

Returns:
TRUE if we properly checked the version, FALSE if we got something looking as gtk-gnutella but which failed the token-based sanity checks.

void version_close void   ) 
 

Free version string.

gint version_cmp const version_t a,
const version_t b
 

Compare two gtk-gnutella versions, timestamp not withstanding.

Returns:
-1, 0 or +1 depending on the sign of "a - b".

gboolean version_fill const gchar *  version,
version_t vs
 

Parse vendor string and fill supplied version structure `vs'.

Returns:
OK if we were able to parse correctly.

guint8 version_get_code void   ) 
 

Get version code (year/month coded in one byte).

void version_init void   ) 
 

Initialize version string.

gboolean version_is_too_old const gchar *  vendor  ) 
 

Check the timestamp in the GTKG version string and returns TRUE if it is too old or could not be parsed, FALSE if OK.

const gchar* version_str const version_t ver  ) 
 

Returns:
a user-friendly description of the version. NB: returns pointer to static data.


Variable Documentation

gchar* version_short_string
 

gchar* version_string
 


Generated on Sun Feb 12 10:50:10 2006 for Gtk-Gnutella by doxygen 1.3.6