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

version.c File Reference


Detailed Description

Version management.

Author:
Raphael Manfredi
Date:
2002-2003

#include "common.h"
#include "version.h"
#include "token.h"
#include "settings.h"
#include "if/gnet_property.h"
#include "if/gnet_property_priv.h"
#include "lib/atoms.h"
#include "lib/getdate.h"
#include "lib/misc.h"
#include "lib/glib-missing.h"
#include "lib/tm.h"
#include "lib/utf8.h"
#include "lib/override.h"

Defines

#define SECS_PER_DAY   86400

Functions

 RCSID ("$Id:version.c, v 1.19 2005/12/21 13:43:04 rmanfredi Exp $")
const gchar * version_get_string (void)
 Get version string.

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

void version_dump (const gchar *str, const version_t *ver, const gchar *cmptag)
 Dump original version string and decompiled form to stdout.

const gchar * version_str (const version_t *ver)
void version_stamp (const gchar *str, version_t *ver)
 Parse gtk-gnutella's version number in User-Agent/Server string `str' and extract timestamp into `ver'.

gboolean version_parse (const gchar *str, version_t *ver)
 Parse gtk-gnutella's version number in User-Agent/Server string `str' and extract relevant information into `ver'.

gint version_tagcmp (guchar a, guchar b)
 Compare two tag chars, assuming version numbers are equal.

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'.

void version_new_found (const gchar *text, gboolean stable)
 Invoked when a newer version is found.

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.

void version_init (void)
 Initialize version string.

void version_maybe_refuse (gint overtime)
 Called when the version has expired since the indicated amount.

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

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.

void version_close (void)
 Free version string.


Variables

gchar * version_string = NULL
gchar * version_short_string = NULL
version_t our_version
version_t last_rel_version
version_t last_dev_version
guint8 version_code


Define Documentation

#define SECS_PER_DAY   86400
 


Function Documentation

RCSID "$Id:version.  c,
v 1.19 2005/12/21 13:43:04 rmanfredi Exp $" 
 

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".

void version_dump const gchar *  str,
const version_t ver,
const gchar *  cmptag
[static]
 

Dump original version string and decompiled form to stdout.

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).

const gchar* version_get_string void   ) 
 

Get version string.

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.

void version_maybe_refuse gint  overtime  )  [static]
 

Called when the version has expired since the indicated amount.

If that amount is greater than our grace period, refuse to run unless they set the "ancient_version_force" property explicitly.

void version_new_found const gchar *  text,
gboolean  stable
[static]
 

Invoked when a newer version is found.

gboolean version_parse const gchar *  str,
version_t ver
[static]
 

Parse gtk-gnutella's version number in User-Agent/Server string `str' and extract relevant information into `ver'.

Returns:
TRUE if we parsed a gtk-gnutella version correctly, FALSE if we were not facing a gtk-gnutella version, or if we did not recognize it.

void version_stamp const gchar *  str,
version_t ver
[static]
 

Parse gtk-gnutella's version number in User-Agent/Server string `str' and extract timestamp into `ver'.

const gchar* version_str const version_t ver  ) 
 

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

gint version_tagcmp guchar  a,
guchar  b
[static]
 

Compare two tag chars, assuming version numbers are equal.

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


Variable Documentation

version_t last_dev_version [static]
 

version_t last_rel_version [static]
 

version_t our_version [static]
 

guint8 version_code [static]
 

gchar* version_short_string = NULL
 

gchar* version_string = NULL
 


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