shithub: neatpost

Download patch

ref: 0557bd6c8fa6cf90da90dfb48c60c84889514888
parent: f231cb477ed4d7fc87702c5f4ee6d8a633a961be
author: Ali Gholami Rudi <ali@rudi.ir>
date: Wed May 2 16:50:50 EDT 2018

post: change "ps_" function prefix to "doc"

--- a/pdf.c
+++ b/pdf.c
@@ -876,7 +876,7 @@
 	sbuf_printf(pg, "%s l\n", pdfpos(o_h, o_v));
 }
 
-void ps_header(char *title, int pagewidth, int pageheight, int linewidth)
+void docheader(char *title, int pagewidth, int pageheight, int linewidth)
 {
 	pdf_title = title;
 	obj_map();
@@ -888,7 +888,7 @@
 	pdf_height = (pageheight * 72 + 127) / 254;
 }
 
-void ps_trailer(int pages)
+void doctrailer(int pages)
 {
 	int i;
 	int xref_off;
@@ -944,13 +944,13 @@
 	free(obj_off);
 }
 
-void ps_pagebeg(int n)
+void docpagebeg(int n)
 {
 	pg = sbuf_make();
 	sbuf_printf(pg, "BT\n");
 }
 
-void ps_pageend(int n)
+void docpageend(int n)
 {
 	int cont_id;
 	int i;
--- a/post.c
+++ b/post.c
@@ -291,7 +291,7 @@
 			fprintf(stderr, "neatpost: cannot open device %s\n", postdev);
 			exit(1);
 		}
-		ps_header(ps_title, ps_pagewidth, ps_pageheight, ps_linewidth);
+		docheader(ps_title, ps_pagewidth, ps_pageheight, ps_linewidth);
 		break;
 	case 'T':
 		nextword(postdev);
@@ -350,9 +350,9 @@
 		break;
 	case 'p':
 		if (o_pages)
-			ps_pageend(o_pages);
+			docpageend(o_pages);
 		o_pages = nextnum();
-		ps_pagebeg(o_pages);
+		docpagebeg(o_pages);
 		outpage();
 		break;
 	case 'w':
@@ -383,7 +383,7 @@
 		if (!isspace(c))
 			postcmd(c);
 	if (o_pages)
-		ps_pageend(o_pages);
+		docpageend(o_pages);
 }
 
 static struct paper {
@@ -473,7 +473,7 @@
 		}
 	}
 	post();
-	ps_trailer(o_pages);
+	doctrailer(o_pages);
 	dev_close();
 	return 0;
 }
--- a/post.h
+++ b/post.h
@@ -74,11 +74,10 @@
 void drawa(int h1, int v1, int h2, int v2);
 void draws(int h1, int v1, int h2, int v2);
 
-/* postscript functions */
-void ps_header(char *title, int pagewidth, int pageheight, int linewidth);
-void ps_trailer(int pages);
-void ps_pagebeg(int n);
-void ps_pageend(int n);
+void docheader(char *title, int pagewidth, int pageheight, int linewidth);
+void doctrailer(int pages);
+void docpagebeg(int n);
+void docpageend(int n);
 
 /* colors */
 #define CLR_R(c)		(((c) >> 16) & 0xff)
--- a/ps.c
+++ b/ps.c
@@ -357,7 +357,7 @@
 	}
 }
 
-void ps_pagebeg(int n)
+void docpagebeg(int n)
 {
 	out("%%%%Page: %d %d\n", n, n);
 	out("/saveobj save def\n");
@@ -365,7 +365,7 @@
 	out("%d pagesetup\n", n);
 }
 
-void ps_pageend(int n)
+void docpageend(int n)
 {
 	out("cleartomark\n");
 	out("showpage\n");
@@ -372,7 +372,7 @@
 	out("saveobj restore\n");
 }
 
-void ps_trailer(int pages)
+void doctrailer(int pages)
 {
 	out("%%%%Trailer\n");
 	out("done\n");
@@ -482,7 +482,7 @@
 	"} bind def\n";
 
 /* pagewidth and pageheight are in tenths of a millimetre */
-void ps_header(char *title, int pagewidth, int pageheight, int linewidth)
+void docheader(char *title, int pagewidth, int pageheight, int linewidth)
 {
 	out("%%!PS-Adobe-2.0\n");
 	out("%%%%Version: 1.0\n");