[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch to lout3.10 for page numbering
From: |
Basile STARYNKEVITCH |
Subject: |
patch to lout3.10 for page numbering |
Date: |
Fri, 6 Dec 1996 08:59:28 +0100 |
Hello all,
Here is a small patch to lout3.10 for numbering pages. One patched
(and compiled) lout accepts -n as option to display on stderr the page
numbers. This only works for PostScript output.
--- lout.3.10/externs 1996/12/05 20:12:13 1.1
+++ lout.3.10/externs 1996/12/06 07:40:20
@@ -402,6 +402,7 @@
#define CH_FLAG_OPTION '-' /* the -- command line flag
*/
#define CH_FLAG_SAFE 'S' /* the -S command line flag
*/
#define CH_FLAG_UNSAFE 'U' /* the -U command line flag
*/
+#define CH_FLAG_PAGENO 'n' /* the -n command line flag */
#define CH_SPACE ' ' /* space character
*/
#define CH_NEWLINE '\n' /* the newline character
*/
@@ -2156,6 +2157,7 @@
extern BOOLEAN Kern;
extern BOOLEAN SafeExecution;
extern BOOLEAN AltErrorFormat;
+extern BOOLEAN VerbosePage; /* if set say page number to stderr */
extern int BackEnd;
extern FULL_CHAR *BackEndWord;
extern FULL_LENGTH PlainCharWidth;
@@ -2722,3 +2724,8 @@
#define debug_init(str) Error(1, 4, "%s - debug flags not implemented",
\
FATAL, no_fpos, str)
#endif
+/* $Id: externs,v 1.2 1996/12/05 23:09:26 basile Exp $ */
+
+/*** Local Variables: ---*/
+/*** mode: C ---*/
+/*** End: ---*/
--- lout.3.10/z01.c 1996/12/05 20:23:37 1.1
+++ lout.3.10/z01.c 1996/12/06 07:40:50
@@ -74,6 +74,7 @@
/* Kern Do kerning */
/* SafeExecution Execute safely, i.e. prohibit system() calls */
/* AltErrorFormat Use alternative error message format */
+/* VerbosePage show each page number on stderr */
/* */
/*****************************************************************************/
@@ -82,7 +83,7 @@
BOOLEAN Kern;
BOOLEAN SafeExecution;
BOOLEAN AltErrorFormat;
-
+BOOLEAN VerbosePage;
/*****************************************************************************/
/* */
@@ -162,7 +163,7 @@
lput(" --option{value} set option e.g. --'@InitialFont{Times Base 10p}'" );
lput(" -x initializing run, not for ordinary use" );
lput(" -u print this usage message on stderr and exit" );
- lput(" -V print version and configuration information" );
+ lput(" -n print each page number on stderr" );
lput(" - a file name denoting standard input" );
lput("" );
@@ -252,6 +253,7 @@
/* read command line */
stdin_seen = FALSE;
AltErrorFormat = FALSE;
+ VerbosePage = FALSE;
cross_db = CROSS_DB;
outfile = STR_STDOUT;
source_file_count = 0;
@@ -277,6 +279,11 @@
AllowCrossDb = FALSE;
break;
+
+ case CH_FLAG_PAGENO:
+ /* show each page number on stderr */
+ VerbosePage = TRUE;
+ break;
case CH_FLAG_NOKERN:
--- lout.3.10/z24.c 1996/12/05 20:10:18 1.1
+++ lout.3.10/z24.c 1996/12/06 07:44:36
@@ -381,6 +381,13 @@
for( p = label; *p != '\0'; p++ )
fputs(EightBitToPrintForm[*p], out_fp);
fprintf(out_fp, " %d\n", ++pagecount);
+ if (VerbosePage != FALSE) {
+ fprintf(stderr, " * page %d (", pagecount);
+ for( p = label; *p != '\0'; p++ )
+ fputs(EightBitToPrintForm[*p], stderr);
+ fputs(")\n", stderr);
+ fflush(stderr);
+ };
fprintf(out_fp, "%%%%BeginPageSetup\n");
FontPrintPageResources(out_fp);
FontAdvanceCurrentPage();
@@ -476,6 +483,13 @@
for( p = label; *p != '\0'; p++ )
fputs(EightBitToPrintForm[*p], out_fp);
fprintf(out_fp, " %d\n", ++pagecount);
+ if (VerbosePage != FALSE) {
+ fprintf(stderr, " * page %d (", pagecount);
+ for( p = label; *p != '\0'; p++ )
+ fputs(EightBitToPrintForm[*p], stderr);
+ fputs(")\n", stderr);
+ fflush(stderr);
+ };
fprintf(out_fp, "%%%%BeginPageSetup\n");
FontPrintPageResources(out_fp);
fprintf(out_fp, "/pgsave save def\n");
-----
N.B. Any opinions expressed here are solely mine, and not of my organization.
N.B. Les opinions exprimees ici me sont personnelles et n engagent pas le CEA.
----------------------------------------------------------------------
Basile STARYNKEVITCH ---- Commissariat à l Energie Atomique
DRN/DMT/SERMA * CEA/Saclay bat.470 * 91191 GIF/YVETTE CEDEX * France
fax: (33) 01,69.08.85.68; phone: 01,69.08.40.66; home: 01,46.65.45.53
email: Basile . Starynkevitch @ cea . fr (but remove white space)
I speak french, english, russian. Je parle français, anglais, russe.
----------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- patch to lout3.10 for page numbering,
Basile STARYNKEVITCH <=