aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-03-30 18:39:01 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-03-30 18:39:01 -0400
commit78613bbdf83b3ac7b58f5021294b75c8e3698b19 (patch)
treef65e6d5429bab78aaa33d917f06c1e2b9d6c9155
parent969e678287771bab0a34ca44396a721ade715720 (diff)
added setwidth
-rw-r--r--badroff.c8
1 files 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'));