summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-25 09:13:24 -0400
committermidipix <writeonce@midipix.org>2016-11-11 00:22:39 -0500
commit26498daf70041bc96f4dd1817f82d8bee3a30067 (patch)
tree1f3510dceafe46539902613d48e5f59c481ccf3a
parent5694f736993d6b328e45f5cae60736b26f00fdce (diff)
downloadmdso-26498daf70041bc96f4dd1817f82d8bee3a30067.tar.bz2
mdso-26498daf70041bc96f4dd1817f82d8bee3a30067.tar.xz
driver: added struct mdso_source_version, mdso_source_version().
-rw-r--r--Makefile.in4
-rw-r--r--include/mdso/mdso.h10
-rw-r--r--src/driver/mdso_driver_ctx.c14
3 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in
index 0957e32..d8ae066 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -86,10 +86,10 @@ include $(PROJECT_DIR)/project/overrides.mk
$(APP_SRCS:%.c=%.o): version.tag
$(APP_SRCS:%.c=%.o): CFLAGS_STATIC = $(CFLAGS_APP)
-src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag
+src/%.lo: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag
$(CC) -c -o $@ $< $(CFLAGS_SHARED)
-src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag
+src/%.o: $(PROJECT_DIR)/src/%.c $(ALL_HEADERS) host.tag dirs.tag version.tag
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
lib/%$(OS_LIB_SUFFIX)$(VER_XYZ):
diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h
index 6dea3dc..52a5e21 100644
--- a/include/mdso/mdso.h
+++ b/include/mdso/mdso.h
@@ -39,6 +39,13 @@ extern "C" {
/* unit action flags */
+struct mdso_source_version {
+ int major;
+ int minor;
+ int revision;
+ const char * commit;
+};
+
struct mdso_input {
void * addr;
size_t size;
@@ -74,6 +81,9 @@ struct mdso_unit_ctx {
int nerrors;
};
+/* package info */
+mdso_api const struct mdso_source_version * mdso_source_version(void);
+
/* driver api */
mdso_api int mdso_get_driver_ctx (char ** argv, char ** envp, uint32_t flags, struct mdso_driver_ctx **);
mdso_api int mdso_create_driver_ctx (const struct mdso_common_ctx *, struct mdso_driver_ctx **);
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index d3b00cf..65d4ba2 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -16,9 +16,18 @@
#include <mdso/mdso.h>
#include <mdso/mdso_output.h>
#include <mdso/mdso_specs.h>
+#include "mdso_version.h"
#include "mdso_driver_impl.h"
#include "argv/argv.h"
+/* package info */
+static const struct mdso_source_version mdso_src_version = {
+ MDSO_TAG_VER_MAJOR,
+ MDSO_TAG_VER_MINOR,
+ MDSO_TAG_VER_PATCH,
+ MDSO_GIT_VERSION
+};
+
struct mdso_driver_ctx_alloc {
struct argv_meta * meta;
struct mdso_driver_ctx_impl ctx;
@@ -289,3 +298,8 @@ void mdso_free_driver_ctx(struct mdso_driver_ctx * ctx)
mdso_free_driver_ctx_impl(ictx);
}
}
+
+const struct mdso_source_version * mdso_source_version(void)
+{
+ return &mdso_src_version;
+}