summaryrefslogtreecommitdiff
path: root/libsoup/soup-version.h.in
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2012-09-20 17:02:40 -0700
committerDan Winship <danw@gnome.org>2012-10-22 18:48:02 +0200
commit33cf3c6f2530732e85a93d42c153db53844feebb (patch)
treeb2879f7b77babac881cf19a37ae87654e8ccf18a /libsoup/soup-version.h.in
parentcbbde758b8ea533916fe25dc25d64bac564ea09a (diff)
downloadlibsoup-33cf3c6f2530732e85a93d42c153db53844feebb.tar.gz
Add API to get version information
Expose API to get information about the soup version. This is useful because it allows applications to use API without actually depending on it completely. https://bugzilla.gnome.org/show_bug.cgi?id=684514
Diffstat (limited to 'libsoup/soup-version.h.in')
-rw-r--r--libsoup/soup-version.h.in41
1 files changed, 41 insertions, 0 deletions
diff --git a/libsoup/soup-version.h.in b/libsoup/soup-version.h.in
new file mode 100644
index 00000000..6332d581
--- /dev/null
+++ b/libsoup/soup-version.h.in
@@ -0,0 +1,41 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * soup-version.h: Version information
+ *
+ * Copyright (C) 2012 Igalia S.L.
+ */
+
+#ifndef SOUP_VERSION_H
+#define SOUP_VERSION_H
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define SOUP_MAJOR_VERSION (@SOUP_MAJOR_VERSION@)
+#define SOUP_MINOR_VERSION (@SOUP_MINOR_VERSION@)
+#define SOUP_MICRO_VERSION (@SOUP_MICRO_VERSION@)
+
+#define SOUP_CHECK_VERSION(major, minor, micro) \
+ (SOUP_MAJOR_VERSION > (major) || \
+ (SOUP_MAJOR_VERSION == (major) && SOUP_MINOR_VERSION > (minor)) || \
+ (SOUP_MAJOR_VERSION == (major) && SOUP_MINOR_VERSION == (minor) && \
+ SOUP_MICRO_VERSION >= (micro)))
+
+guint
+soup_get_major_version (void);
+
+guint
+soup_get_minor_version (void);
+
+guint
+soup_get_micro_version (void);
+
+gboolean
+soup_check_version (guint major,
+ guint minor,
+ guint micro);
+
+G_END_DECLS
+
+#endif /* SOUP_VERSION_H */