+2003-07-18 [christoph] 0.9.3claws25
+
+ * configure.ac
+ * src/common/sylpheed.[ch]
+ * src/common/version.h.in
+ add version in numeric form to allow easy comparison
+
+ * src/plugins/demo/demo.c
+ add version check
+ - sylpheed version > plugin version => never allowed, sylpheed
+ could contain unknown API changes
+ - sylpheed version < minimum version required => don't load,
+ API required not available (if linking does not fail)
+
2003-07-18 [alfons] 0.9.3claws24
* src/common/plugin.[ch]
MICRO_VERSION=3
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws24
-VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
+EXTRA_VERSION=25
+VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws${EXTRA_VERSION}
dnl set $target
AC_CANONICAL_SYSTEM
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
+AC_SUBST(MAJOR_VERSION)
+AC_SUBST(MINOR_VERSION)
+AC_SUBST(MICRO_VERSION)
+AC_SUBST(EXTRA_VERSION)
dnl GNOME installed?
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
parse_parameter(argc, argv);
+ debug_print("Starting sylpheed version %08x\n", VERSION_NUMERIC);
+
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
{
return startup_dir;
}
+
+guint sylpheed_get_version(void)
+{
+ return VERSION_NUMERIC;
+}
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#ifndef SYLPHEED_H
+#define SYLPHEED_H
+
+#include <glib.h>
+
gboolean sylpheed_init (int *argc, char ***argv);
void sylpheed_done (void);
const gchar *sylpheed_get_startup_dir (void);
+guint sylpheed_get_version (void);
+
+#endif /* SYLPHEED_H */
#ifndef __VERSION_H__
#define __VERSION_H__
+#define MAKE_NUMERIC_VERSION(a, b, c, d) ((a << 24) | (b << 16) | (c << 8) | d)
+
#define PACKAGE "@PACKAGE@"
#define VERSION "@VERSION@"
#define PROG_VERSION "Sylpheed version "VERSION
+#define VERSION_NUMERIC MAKE_NUMERIC_VERSION(@MAJOR_VERSION@, @MINOR_VERSION@, \
+ @MICRO_VERSION@, @EXTRA_VERSION@)
#endif /* __VERSION_H__ */
*/
#include "intl.h"
+#include "version.h"
+#include "sylpheed.h"
#include "plugin.h"
#include "utils.h"
#include "hooks.h"
gint plugin_init(gchar **error)
{
+ if ((sylpheed_get_version() > VERSION_NUMERIC)) {
+ *error = g_strdup("Your sylpheed version is never then the version the plugin was build with");
+ return -1;
+ }
+
+ if ((sylpheed_get_version() < MAKE_NUMERIC_VERSION(0, 8, 11, 39))) {
+ *error = g_strdup("Your sylpheed version is too old");
+ return -1;
+ }
+
hook_id = hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST, my_log_hook, NULL);
if (hook_id == -1) {
*error = g_strdup("Failed to register log text hook");