From 78613bbdf83b3ac7b58f5021294b75c8e3698b19 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Mon, 30 Mar 2020 18:39:01 -0400 Subject: added setwidth --- badroff.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/badroff.c b/badroff.c index 522b305..084fa53 100644 --- a/badroff.c +++ b/badroff.c @@ -50,9 +50,13 @@ char* center(char* text){ memcpy(str+min, text, len); return str; } +char* setwidth(char* txt){ + sscanf(txt, "%d", &width); + return NULL; +} -char* cmds[] = {"CT "}; -char* (*call[])(char* txt) = {center}; +char* cmds[] = {"CT ", "W "}; +char* (*call[])(char* txt) = {center, setwidth}; char* cmd(void){ char* dat = popstrbuf(inbuf, chrfill('\n')); -- cgit