summaryrefslogtreecommitdiff
path: root/libspectre
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2016-06-23 17:40:35 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2016-06-23 17:40:35 +0200
commit316168c4dc24932a832a66a915be01a22906bacd (patch)
tree0f737c315dffa104e0e6dd4ffe2980e0e9fe802b /libspectre
parent34a52f30400aab1c21c69c31122d496751d7d99e (diff)
spectre-gs: Add a method to get the libgs version
Diffstat (limited to 'libspectre')
-rw-r--r--libspectre/spectre-gs.c11
-rw-r--r--libspectre/spectre-gs.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/libspectre/spectre-gs.c b/libspectre/spectre-gs.c
index b0821ce..b701942 100644
--- a/libspectre/spectre-gs.c
+++ b/libspectre/spectre-gs.c
@@ -327,3 +327,14 @@ spectre_gs_free (SpectreGS *gs)
CLEANUP_EXIT);
free (gs);
}
+
+long
+spectre_gs_get_version (void)
+{
+ gsapi_revision_t gsrev;
+
+ if (gsapi_revision (&gsrev, sizeof(gsrev)) != 0)
+ return 0;
+
+ return gsrev.revision;
+}
diff --git a/libspectre/spectre-gs.h b/libspectre/spectre-gs.h
index b673ce8..eb88736 100644
--- a/libspectre/spectre-gs.h
+++ b/libspectre/spectre-gs.h
@@ -58,7 +58,7 @@ int spectre_gs_send_page (SpectreGS *gs,
void spectre_gs_cleanup (SpectreGS *gs,
SpectreGSCleanupFlag flag);
void spectre_gs_free (SpectreGS *gs);
-
+long spectre_gs_get_version (void);
SPECTRE_END_DECLS
#endif /* SPECTRE_GS_H */