removal due to another working script
[trueprint.git] / src / headers.c
blob7841996a40c53c6c5ae4c57079d425c7aa66e284
1 /*
2 * Source file:
3 * headers.c
5 * Prints page headers. All functions are just front-ends to PS_startpage().
6 */
8 #include "config.h"
10 #include <stdio.h>
12 #include "trueprint.h"
13 #include "postscript.h"
14 #include "options.h"
15 #include "headers.h"
17 static char *top_left_string;
18 static char *top_centre_string;
19 static char *top_right_string;
20 static char *bottom_left_string;
21 static char *bottom_centre_string;
22 static char *bottom_right_string;
23 static char *message_string;
26 * Function:
27 * setup_headers
29 void
30 setup_headers(void)
32 top_left_string = NULL;
33 string_option("X", "left-header", "%L", &top_left_string, NULL, NULL,
34 OPT_PAGE_FURNITURE,
35 "specify string for left side of header");
37 bottom_left_string = NULL;
38 string_option("x", "left-footer", "%L", &bottom_left_string, NULL, NULL,
39 OPT_PAGE_FURNITURE,
40 "specify string for left side of footer");
42 top_centre_string = NULL;
43 string_option("Y", "center-header", "%N", &top_centre_string, NULL, NULL,
44 OPT_PAGE_FURNITURE,
45 "specify string for center of header");
47 bottom_centre_string = NULL;
48 string_option("y", "center-footer", "%n %p", &bottom_centre_string, NULL, NULL,
49 OPT_PAGE_FURNITURE,
50 "specify string for center of footer");
52 top_right_string = NULL;
53 string_option("Z", "right-header", "Page %P of %F", &top_right_string, NULL, NULL,
54 OPT_PAGE_FURNITURE,
55 "specify string for right side of header");
57 bottom_right_string = NULL;
58 string_option("z", "right-footer", "Page %P of %F", &bottom_right_string, NULL, NULL,
59 OPT_PAGE_FURNITURE,
60 "specify string for right side of footer");
62 message_string = NULL;
63 string_option("m", "message", NULL, &message_string, NULL, NULL,
64 OPT_PAGE_FURNITURE,
65 "message to be printed over page");
69 * Function:
70 * print_text_header
72 void
73 print_text_header(long page_number, long total_pages)
75 PS_startpage(top_left_string, top_centre_string, top_right_string,
76 bottom_left_string, bottom_centre_string, bottom_right_string,
77 message_string, page_number, total_pages, FALSE);
81 * Function:
82 * print_file_header
84 void
85 print_file_header(long page_no)
87 char page_no_string[10];
89 sprintf(page_no_string, "Page %ld", page_no);
91 PS_startpage("%L", "File Index", page_no_string,
92 "%L", "File Index", page_no_string,
93 message_string, page_no, 0, TRUE);
97 * Function:
98 * print_index_header
100 void
101 print_index_header(long page_no)
103 char page_no_string[10];
105 sprintf(page_no_string, "Page %ld", page_no);
107 PS_startpage("%L", "Function Index", page_no_string,
108 "%L", "Function Index", page_no_string,
109 message_string, page_no, 0, TRUE);