src/frontend.c

Sun, 24 Sep 2023 18:48:42 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 24 Sep 2023 18:48:42 +0200
changeset 73
072fa3e165f0
parent 70
60cecca5e484
child 78
719e3c6d4c9b
permissions
-rw-r--r--

use make vars instead of config vars for rmdir/mkdir

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) {
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
47 FILE *fin = fopen(filename, "r");
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
48 if (!fin) {
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 perror(errmsg);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 if (fout != stdout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 fclose(fout);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 return 1;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 }
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
55 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
56 fclose(fin);
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 return 0;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 }
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 static void printhelp() {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
61 printf("Formats source code using HTML.\n\nUsage:\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62 " c2html [Options] FILE\n\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 " Options:\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 " -h Prints this help message\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65 " -j Highlight Java instead of C source code\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 " -o <output> Output file (stdout, if not specified)\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 " -H <header> Prepend header file\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68 " -F <footer> Append footer file\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 " -p Disable highlighting (plain text)\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 " -l Disable line numbers\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 " -V, -v Prints version and exits\n"
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 "\n");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 }
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 int main(int argc, char** argv) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 /* Default settings */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 Settings settings;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 memset(&settings, 0, sizeof(settings));
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 settings.showlinenumbers = 1;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 c2html_highlighter_func hltr = c2html_c_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 /* Parse command line */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
84 int optc;
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 while ((optc = getopt(argc, argv, "hljo:pH:F:vV")) != -1) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 switch (optc) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 case 'o':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 if (!(optarg[0] == '-' && optarg[1] == 0)) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 settings.outfilename = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 case 'F':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 settings.footerfile = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 case 'H':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 settings.headerfile = optarg;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 case 'j':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 hltr = c2html_java_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 case 'p':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 hltr = c2html_plain_highlighter;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 case 'l':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 settings.showlinenumbers = 0;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 break;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 case 'h':
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 printhelp();
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 case 'v':
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 #ifdef VERSION_DEVELOP
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 printf("%d.%d (unstable)\n", VERSION_MAJOR, VERSION_MINOR);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 #else
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 #endif
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 default:
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 }
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 if (optind != argc-1) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 printhelp();
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 /* Open output file */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 settings.infilename = argv[optind];
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 FILE *fout;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 if (settings.outfilename) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 fout = fopen(settings.outfilename, "w");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 if (!fout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133 perror("Error opening output file");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 fout = stdout;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 }
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 /* Prepend header file */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
141 if (appendfile(settings.headerfile, fout,
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 "Error opening header file")) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 }
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 /* Process input file */
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 FILE *inputfile = fopen(settings.infilename, "r");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 if (inputfile) {
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
149 CxBuffer fbuf;
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
150 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
151 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
152 (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
153 cxBufferPut(&fbuf, 0);
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
154 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
155 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
156 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
157 settings.showlinenumbers
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 );
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
159 cxBufferDestroy(&fbuf);
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160 } else {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 perror("Error opening input file");
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 if (fout != stdout) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 fclose(fout);
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164 }
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 }
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 /* Append footer file */
66
1b12cf799fee upgrade to ucx 3.0
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
169 if (appendfile(settings.footerfile, fout,
55
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 "Error opening footer file")) {
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 return EXIT_FAILURE;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 }
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 return EXIT_SUCCESS;
bf54085ce341 adds appropriate public API
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 }
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

mercurial