diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2013-04-24 04:13:09 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2013-04-24 04:13:09 +0000 |
commit | 5f8eb67e3760459c0834c08f36d9e502d3388e3a (patch) | |
tree | b0094c17ab958c91c23c0e89d3bb437c5adf6982 /print/psutils/files/patch-psresize.c | |
parent | - Add patch to prevent deletion of /dev/null (diff) |
Merge print/psutils-a4 and print/psutils-letter into a single port
print/psutils. The default paper size in the programs can be set via
libpaper ($PAPERSIZE or etc/papersize configuration file).
Notes
Notes:
svn path=/head/; revision=316401
Diffstat (limited to 'print/psutils/files/patch-psresize.c')
-rw-r--r-- | print/psutils/files/patch-psresize.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/print/psutils/files/patch-psresize.c b/print/psutils/files/patch-psresize.c new file mode 100644 index 000000000000..7c7eeb37f248 --- /dev/null +++ b/print/psutils/files/patch-psresize.c @@ -0,0 +1,56 @@ +--- psresize.c.orig 1997-03-12 07:53:03.000000000 +0900 ++++ psresize.c 2012-03-03 03:02:24.000000000 +0900 +@@ -20,6 +20,10 @@ + #include "pserror.h" + #include "patchlev.h" + ++#if defined(LIBPAPER) ++#include <paper.h> ++#endif ++ + char *program ; + int pages ; + int verbose ; +@@ -46,7 +50,7 @@ + #define MIN(x,y) ((x) > (y) ? (y) : (x)) + #define MAX(x,y) ((x) > (y) ? (x) : (y)) + +-void main(int argc, char *argv[]) ++int main(int argc, char *argv[]) + { + double scale, rscale; /* page scale */ + double waste, rwaste; /* amount wasted */ +@@ -56,13 +60,21 @@ + double inheight = -1; + Paper *paper; + PageSpec *specs; ++ char *name = NULL; + ++#if defined(LIBPAPER) ++ name = (char *)systempapername(); ++ if (name == NULL) ++ name = (char *)defaultpapername(); ++#else + #ifdef PAPER +- if ( (paper = findpaper(PAPER)) != (Paper *)0 ) { +- inwidth = width = (double)PaperWidth(paper); +- inheight = height = (double)PaperHeight(paper); +- } ++ name = PAPER; ++#endif + #endif ++ if ((paper = findpaper(name)) != NULL) { ++ inwidth = width = (double)PaperWidth(paper); ++ inheight = height = (double)PaperHeight(paper); ++ } + + vshift = hshift = 0; + rotate = 0; +@@ -175,6 +187,6 @@ + + pstops(1, 1, 0, specs, 0.0); /* do page rearrangement */ + +- exit(0); ++ return (0); + } + |