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

version.h

Go to the documentation of this file.
00001 /*
00002  * $Id: version.h,v 1.6 2005/12/21 13:43:04 rmanfredi Exp $
00003  *
00004  * Copyright (c) 2002-2003, Raphael Manfredi
00005  *
00006  *----------------------------------------------------------------------
00007  * This file is part of gtk-gnutella.
00008  *
00009  *  gtk-gnutella is free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  gtk-gnutella is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with gtk-gnutella; if not, write to the Free Software
00021  *  Foundation, Inc.:
00022  *      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *----------------------------------------------------------------------
00024  */
00025 
00036 #ifndef _core_version_h_
00037 #define _core_version_h_
00038 
00039 #include "common.h"
00040 #include "if/core/version.h"
00041 #include "lib/host_addr.h"
00042 
00047 typedef struct version {
00048     guint major;                
00049     guint minor;                
00050     guint patchlevel;           
00051     guchar tag;                 
00052     guint taglevel;             
00053     time_t timestamp;
00054 } version_t;
00055 
00056 /*
00057  * Banning periods for our versions.
00058  */
00059 
00060 #define VERSION_ANCIENT_WARN    (86400*365)     
00061 #define VERSION_ANCIENT_BAN     (86400*365)     
00063 #define VERSION_UNSTABLE_WARN   (86400*60)      
00064 #define VERSION_UNSTABLE_BAN    (86400*90)      
00066 #define VERSION_ANCIENT_REMIND  (86400*30)      
00067 #define VERSION_ANCIENT_GRACE   (86400*20)      
00069 /*
00070  * Public interface.
00071  */
00072 
00073 void version_init(void);
00074 void version_close(void);
00075 void version_ancient_warn(void);
00076 gboolean version_check(const gchar *str, const gchar *token, const host_addr_t);
00077 gboolean version_is_too_old(const gchar *vendor);
00078 gint version_cmp(const version_t *a, const version_t *b);
00079 gboolean version_fill(const gchar *version, version_t *vs);
00080 
00081 const gchar *version_str(const version_t *ver);
00082 
00083 extern gchar *version_string;
00084 extern gchar *version_short_string;
00085 
00086 guint8 version_get_code(void);
00087 
00088 #endif  /* _core_version_h_ */
00089 
00090 /* vi: set ts=4: */

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