summaryrefslogtreecommitdiff
path: root/gfx/fig.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-24 18:08:15 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-24 18:08:15 -0300
commit71d2312487fed19d2500357cb644c3801179f600 (patch)
tree70510dcfbc9abb3376306492b89845333fc2865b /gfx/fig.c
parent279ddbdb4fb11dbffb487db05b74787b5275b4d9 (diff)
downloadeeshow-71d2312487fed19d2500357cb644c3801179f600.tar.gz
eeshow-71d2312487fed19d2500357cb644c3801179f600.tar.bz2
eeshow-71d2312487fed19d2500357cb644c3801179f600.zip
separate argument list from gfx_init; related API changes
Diffstat (limited to 'gfx/fig.c')
-rw-r--r--gfx/fig.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gfx/fig.c b/gfx/fig.c
index 41d4933..d469a28 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -237,7 +237,14 @@ static bool apply_vars(char *buf, int n_vars, const char **vars)
-static void *fig_init(int argc, char *const *argv)
+static void *fig_init(void)
+{
+ /* @@@ this is asking for trouble ... */
+ return NULL;
+}
+
+
+static bool fig_args(void *ctx, int argc, char *const *argv)
{
static char *buf = NULL;
static size_t n = 0;
@@ -269,7 +276,7 @@ static void *fig_init(int argc, char *const *argv)
if (!template) {
fig_header();
fig_colors();
- return NULL;
+ return 1;
}
file = fopen(template, "r");
@@ -289,7 +296,7 @@ static void *fig_init(int argc, char *const *argv)
}
fclose(file);
- return NULL;
+ return 1;
}
@@ -307,4 +314,5 @@ const struct gfx_ops fig_ops = {
.tag = fig_tag,
.text_width = fig_text_width,
.init = fig_init,
+ .args = fig_args,
};