summaryrefslogtreecommitdiff
path: root/gfx/gfx.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 15:11:50 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-03 19:52:24 -0300
commitcd197d8d8b34e3770ec49dfdc808427b2e1f0963 (patch)
tree6d113a0a97979d52309e463554c2209fc8151ae0 /gfx/gfx.c
parent487c2ed78ba10bdd089009fe88f21fbc276ee3b2 (diff)
downloadeeshow-cd197d8d8b34e3770ec49dfdc808427b2e1f0963.tar.gz
eeshow-cd197d8d8b34e3770ec49dfdc808427b2e1f0963.tar.bz2
eeshow-cd197d8d8b34e3770ec49dfdc808427b2e1f0963.zip
gfx/gfx.c: we now pass a combined option string to drivers
Further changes implied by this: - drivers can no longer receive arguments, only options - drivers have to ignore options they don't recognize
Diffstat (limited to 'gfx/gfx.c')
-rw-r--r--gfx/gfx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gfx/gfx.c b/gfx/gfx.c
index 2599131..e49160c 100644
--- a/gfx/gfx.c
+++ b/gfx/gfx.c
@@ -121,10 +121,18 @@ struct gfx *gfx_init(const struct gfx_ops *ops)
}
-bool gfx_args(struct gfx *gfx, int argc, char *const *argv)
+bool gfx_args(struct gfx *gfx, int argc, char *const *argv, const char *opts)
{
+ char *combined = (char *) opts;
+ bool res;
+
+ if (gfx->ops->opts)
+ alloc_printf(&combined, "%s%s", opts, gfx->ops->opts);
optind = 0;
- return gfx->ops->args && gfx->ops->args(gfx->user, argc, argv);
+ res = gfx->ops->args && gfx->ops->args(gfx->user, argc, argv, combined);
+ if (gfx->ops->opts)
+ free(combined);
+ return res;
}