]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
faxcover patch - add support for CommentX functionality
authorRobert Colquhoun <rjc@trump.net.au>
Wed, 30 Jun 1999 13:20:36 +0000 (13:20 +0000)
committerRobert Colquhoun <rjc@trump.net.au>
Wed, 30 Jun 1999 13:20:36 +0000 (13:20 +0000)
Creates a BreakIntoCommentX function which separates a block of text into
separate lines with global CommentX variables.

To use include in the faxcover a line like:
    10 comments BreakIntoCommentX

this will create 10 vars(Comment1->Comment10) from the 'comments' string
which is predefined by the faxcover program.

faxcover/faxcover.c++

index b5540cf11fd5b780387e3cccc5c95ba9edc4ea1b..5c2d7d0d9140586f7a8ca5516fe4420a102362c1 100644 (file)
@@ -226,6 +226,15 @@ const char* faxCoverApp::prologue = "\
     } loop\n\
     pop pop pop pop\n\
 } def\n\
+/BreakIntoCommentX {\n\
+% <maxlines> <text> BreakIntoCommentX -\n\
+    /cbuf (Comment ) def\n\
+    0 exch\n\
+    linebreak { search { 4 -1 roll 1 add 4 2 roll }{ exch 1 add exit } ifelse } loop\n\
+    dup dup 2 add 1 roll
+    -1 1 { cbuf exch 7 exch 48 add put cbuf cvn exch def } for\n\
+    1 add exch 1 exch { cbuf exch 7 exch 48 add put cbuf cvn () def } for\n\
+} def\n\
 ";
 
 void