shithub: neatpost

Download patch

ref: 255cdc8b04e092cf8ed11a7781f5b968d12b86df
parent: 403abc5b0c3c322d2f49196d5e3b2687e40ebd47
author: Ali Gholami Rudi <ali@rudi.ir>
date: Fri Aug 21 13:30:31 EDT 2020

post: add X set command for setting device dependent variables

--- a/pdf.c
+++ b/pdf.c
@@ -830,6 +830,10 @@
 		snprintf(pdf_title, sizeof(pdf_title), "%s", val);
 }
 
+void outset(char *var, char *val)
+{
+}
+
 void outpage(void)
 {
 	o_v = 0;
--- a/post.c
+++ b/post.c
@@ -360,6 +360,12 @@
 			spec++;
 		outinfo(kwd, spec);
 	}
+	if (!strcmp("set", cmd)) {
+		char var[ILNLEN];
+		char val[ILNLEN];
+		if (sscanf(arg, "%s %s", var, val) == 2)
+			outset(var, val);
+	}
 	if (!strcmp("BeginObject", cmd))
 		drawmbeg(arg);
 	if (!strcmp("EndObject", cmd))
--- a/post.h
+++ b/post.h
@@ -63,6 +63,7 @@
 void outmark(int n, char (*desc)[256], int *page, int *off, int *level);
 void outname(int n, char (*desc)[64], int *page, int *off);
 void outinfo(char *kwd, char *val);
+void outset(char *var, char *val);
 void outpage(void);
 void outmnt(int f);
 void outgname(int g);
--- a/ps.c
+++ b/ps.c
@@ -366,6 +366,10 @@
 		snprintf(ps_title, sizeof(ps_title), "%s", val);
 }
 
+void outset(char *var, char *val)
+{
+}
+
 void docpagebeg(int n)
 {
 	out("%%%%Page: %d %d\n", n, n);