src/frontend.c

Thu, 11 Jul 2024 20:14:34 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 11 Jul 2024 20:14:34 +0200
changeset 83
75ae588389d4
parent 82
ce67b1b2e979
permissions
-rw-r--r--

clean up tag v3.1

55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 /*
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 * Copyright 2016 Mike Becker. All rights reserved.
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are met:
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 * 2. Redistributions in binary form must reproduce the above copyright
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 * notice, this list of conditions and the following disclaimer in the
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 * documentation and/or other materials provided with the distribution.
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 * POSSIBILITY OF SUCH DAMAGE.
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 *
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 #include <stdio.h>
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 #include <stdlib.h>
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32 #include <unistd.h>
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33 #include <string.h>
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
34
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35 #include "c2html.h"
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
36 #include <cx/utils.h>
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 typedef struct {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 char* outfilename;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 char* headerfile;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 char* footerfile;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 char* infilename;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 int showlinenumbers;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 } Settings;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
46 static int appendfile(const char *filename, FILE *fout, const char *errmsg) {
82
ce67b1b2e979 hotfix: do not try to append file when none is specified
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
47 if (filename == NULL) return 0; // nothing to append
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
48 FILE *fin = fopen(filename, "r");
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
49 if (!fin) {
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 perror(errmsg);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 if (fout != stdout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 fclose(fout);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 return 1;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55 }
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
56 cx_stream_copy(fin, fout, (cx_read_func) fread, (cx_write_func) fwrite);
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
57 fclose(fin);
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 return 0;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 static void printhelp() {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 printf("Formats source code using HTML.\n\nUsage:\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 " c2html [Options] FILE\n\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 " Options:\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65 " -h Prints this help message\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 " -j Highlight Java instead of C source code\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 " -o <output> Output file (stdout, if not specified)\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68 " -H <header> Prepend header file\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 " -F <footer> Append footer file\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 " -p Disable highlighting (plain text)\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 " -l Disable line numbers\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 " -V, -v Prints version and exits\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 "\n");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76 int main(int argc, char** argv) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 /* Default settings */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 Settings settings;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 memset(&settings, 0, sizeof(settings));
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 settings.showlinenumbers = 1;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 c2html_highlighter_func hltr = c2html_c_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84 /* Parse command line */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
85 int optc;
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 while ((optc = getopt(argc, argv, "hljo:pH:F:vV")) != -1) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 switch (optc) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 case 'o':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 if (!(optarg[0] == '-' && optarg[1] == 0)) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 settings.outfilename = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 case 'F':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 settings.footerfile = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 case 'H':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 settings.headerfile = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 case 'j':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 hltr = c2html_java_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 case 'p':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 hltr = c2html_plain_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 case 'l':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 settings.showlinenumbers = 0;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 case 'h':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 printhelp();
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 case 'v':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 case 'V':
78
719e3c6d4c9b release version 3.1
Mike Becker <universe@uap-core.de>
parents: 70
diff changeset
113 #if VERSION_DEVELOP > 0
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 printf("%d.%d (unstable)\n", VERSION_MAJOR, VERSION_MINOR);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 #else
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 #endif
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 default:
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
121 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 if (optind != argc-1) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 printhelp();
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 /* Open output file */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 settings.infilename = argv[optind];
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 FILE *fout;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 if (settings.outfilename) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 fout = fopen(settings.outfilename, "w");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133 if (!fout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 perror("Error opening output file");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 fout = stdout;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 /* Prepend header file */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
142 if (appendfile(settings.headerfile, fout,
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 "Error opening header file")) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
145 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 /* Process input file */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 FILE *inputfile = fopen(settings.infilename, "r");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 if (inputfile) {
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
150 CxBuffer fbuf;
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
151 cxBufferInit(&fbuf, NULL, 4096, NULL, CX_BUFFER_AUTO_EXTEND);
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
152 cx_stream_copy(inputfile, &fbuf, (cx_read_func) fread,
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
153 (cx_write_func) cxBufferWrite);
70
60cecca5e484 fix illegal memory access when input file does not end with line break
Mike Becker <universe@uap-core.de>
parents: 67
diff changeset
154 cxBufferPut(&fbuf, 0);
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
155 fclose(inputfile);
70
60cecca5e484 fix illegal memory access when input file does not end with line break
Mike Becker <universe@uap-core.de>
parents: 67
diff changeset
156 c2html_textformat(
60cecca5e484 fix illegal memory access when input file does not end with line break
Mike Becker <universe@uap-core.de>
parents: 67
diff changeset
157 fbuf.space, fout, (cx_write_func ) fwrite, hltr,
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
158 settings.showlinenumbers
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
159 );
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
160 cxBufferDestroy(&fbuf);
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 perror("Error opening input file");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 if (fout != stdout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164 fclose(fout);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 /* Append footer file */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
170 if (appendfile(settings.footerfile, fout,
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 "Error opening footer file")) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
176 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178

mercurial