summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-03-06 14:26:36 -0500
committermidipix <writeonce@midipix.org>2016-03-08 14:21:08 -0500
commit6376f0dd27115ae9951267c8f1313b498d439ba1 (patch)
tree2f051d7c6bfa1b1631b065cc2e81925b002b3353
parentd03fbc17f423db1720a3509eba0affa753412ce5 (diff)
downloadslibtool-6376f0dd27115ae9951267c8f1313b498d439ba1.tar.bz2
slibtool-6376f0dd27115ae9951267c8f1313b498d439ba1.tar.xz
driver: added context initialization for --warnings.
-rw-r--r--include/slibtool/slibtool.h8
-rw-r--r--src/driver/slbt_driver_ctx.c11
2 files changed, 19 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index 7f48fdd..edc24e5 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -57,6 +57,13 @@ enum slbt_tag {
SLBT_TAG_CXX,
};
+enum slbt_warning_level {
+ SLBT_WARNING_LEVEL_UNKNOWN,
+ SLBT_WARNING_LEVEL_ALL,
+ SLBT_WARNING_LEVEL_ERROR,
+ SLBT_WARNING_LEVEL_NONE,
+};
+
/* unit action flags */
struct slbt_input {
@@ -70,6 +77,7 @@ struct slbt_common_ctx {
uint64_t fmtflags;
enum slbt_mode mode;
enum slbt_tag tag;
+ enum slbt_warning_level warnings;
};
struct slbt_driver_ctx {
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 53cbcf8..319678b 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -174,6 +174,17 @@ int slbt_get_driver_ctx(
case TAG_FEATURES:
cctx.drvflags |= SLBT_DRIVER_FEATURES;
break;
+
+ case TAG_WARNINGS:
+ if (!strcmp("all",entry->arg))
+ cctx.tag = SLBT_WARNING_LEVEL_ALL;
+
+ else if (!strcmp("error",entry->arg))
+ cctx.tag = SLBT_WARNING_LEVEL_ERROR;
+
+ else if (!strcmp("none",entry->arg))
+ cctx.tag = SLBT_WARNING_LEVEL_NONE;
+ break;
}
} else
nunits++;