Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit c147082

Browse files
committed
libvilistextum: get rid of global variable zeilen_pos
Update lists.h Update html_tag.c include headers in c-files to let compiler check function headers
1 parent 3f11a73 commit c147082

File tree

17 files changed

+182
-171
lines changed

17 files changed

+182
-171
lines changed

libVilistextum/charset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "vilistextum.h"
2222
#include "text.h"
2323
#include "multibyte.h"
24+
#include "charset.h"
2425

2526
char *default_charset = "iso-8859-1";
2627
char iconv_charset[DEF_STR_LEN];

libVilistextum/fileio.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "charset.h"
2424
#include "multibyte.h"
2525
#include "vilistextum.h"
26+
#include "fileio.h"
2627

2728
#include <iconv.h>
2829
#include <locale.h>
@@ -104,12 +105,12 @@ char* getOutput(size_t input_length, int error)
104105

105106
/* ------------------------------------------------ */
106107

107-
void finalize(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old)
108+
void finalize(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
108109
{
109110
if (!is_zeile_empty())
110111
{
111-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
112-
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old);
112+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
113+
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
113114
}
114115
}
115116

libVilistextum/fileio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#include "multibyte.h"
55

66
void init_buffer(char *input, int error);
7-
void output_string(CHAR *str, int error);
7+
void output_string(CHAR *str);
88

99
int get_current_char();
1010
int read_char(int error);
1111
void putback_char(CHAR c);
12-
void finalize(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old);
12+
void finalize(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
1313
char* getOutput();
1414

1515
struct TextBuffer

libVilistextum/html.c

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "fileio.h"
3131
#include "charset.h"
3232
#include "util.h"
33+
#include "html.h"
3334

3435
int pre=0; /* for PRE-Tag */
3536
int processed_meta=0; /* only parse meta tags once */
@@ -136,7 +137,7 @@ int get_attr(int error)
136137

137138
/* ------------------------------------------------ */
138139

139-
void html(int extractText, int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old)
140+
void html(int extractText, int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
140141
{
141142
int i;
142143
CHAR str[DEF_STR_LEN];
@@ -151,13 +152,13 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
151152
//printf("'%ls'\n", &ch);
152153
if(ch == EOF)
153154
{
154-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
155+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
155156
return;
156157
}
157158
switch (ch)
158159
{
159160
case '<':
160-
html_tag(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old);
161+
html_tag(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
161162
break;
162163

163164
/* Entities */
@@ -194,14 +195,14 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
194195
if (pre) {
195196
wort_plus_ch(0x09);
196197
} else {
197-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
198+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
198199
}
199200
break;
200201

201202
case 13: /* CR */
202203
case '\n':
203-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
204-
if (pre) { line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old); }
204+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
205+
if (pre) { line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
205206
break;
206207

207208
/* Microsoft ... */
@@ -214,7 +215,7 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
214215

215216
default:
216217
if (pre==0) {
217-
if (ch==' ') { wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old); }
218+
if (ch==' ') { wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
218219
else { wort_plus_ch(ch); }
219220
}
220221
else { wort_plus_ch(ch); }
@@ -229,7 +230,7 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
229230
ch = read_char(error);
230231
if(ch == EOF)
231232
{
232-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
233+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
233234
return;
234235
}
235236
switch (ch)
@@ -268,14 +269,14 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
268269
if (pre) {
269270
wort_plus_ch(0x09);
270271
} else {
271-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
272+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
272273
}
273274
break;
274275

275276
case 13: /* CR */
276277
case '\n':
277-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
278-
if (pre) { line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old); }
278+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
279+
if (pre) { line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
279280
break;
280281

281282
/* Microsoft ... */
@@ -288,7 +289,7 @@ void html(int extractText, int nooutput, int spaces, int paragraph, int breite,
288289

289290
default:
290291
if (pre==0) {
291-
if (ch==' ') { wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old); }
292+
if (ch==' ') { wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
292293
else { wort_plus_ch(ch); }
293294
}
294295
else { wort_plus_ch(ch); }
@@ -323,30 +324,30 @@ void check_for_center(int error)
323324

324325
/* ------------------------------------------------ */
325326

326-
void start_p(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old)
327+
void start_p(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
327328
{
328329
push_align(LEFT);
329-
neuer_paragraph(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old);
330+
neuer_paragraph(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
330331
check_for_center(error);
331332
}
332333

333334
/* ------------------------------------------------ */
334335

335-
void start_div(int a, int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old)
336+
void start_div(int a, int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
336337
{
337-
line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
338+
line_break(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
338339
if (a!=0) { push_align(a); }
339340
else { check_for_center(error); }
340341
}
341342

342343
/* ------------------------------------------------ */
343344

344-
void end_div(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old)
345+
void end_div(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
345346
{
346-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
347+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
347348

348-
if (paragraph!=0) { paragraphen_ende(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old); }
349-
else { print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old); }
349+
if (paragraph!=0) { paragraphen_ende(nooutput, spaces, paragraph, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
350+
else { print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old, zeilen_pos); }
350351
pop_align(); /* einer für start_div */
351352
}
352353

@@ -453,10 +454,10 @@ CHAR friss_kommentar(int error)
453454

454455
/* ------------------------------------------------ */
455456

456-
int start_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old)
457+
int start_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
457458
{
458-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
459-
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old);
459+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
460+
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
460461
nooutput = 1;
461462

462463
while (ch!='>' && ch!=EOF)
@@ -471,10 +472,10 @@ int start_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_l
471472
return nooutput;
472473
}
473474

474-
int end_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old)
475+
int end_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos)
475476
{
476-
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old);
477-
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old);
477+
wort_ende(nooutput, spaces, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
478+
print_zeile(nooutput, breite, error, zeilen_len, zeilen_len_old, zeilen_pos);
478479
nooutput = 0;
479480
return nooutput;
480481
}

libVilistextum/html.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ int get_new_attr(CHAR *name, CHAR *content);
1212
CHAR attr_name[DEF_STR_LEN];
1313
CHAR attr_ctnt[DEF_STR_LEN];
1414

15-
void html(int extractText, int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old);
15+
void html(int extractText, int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
1616
void check_for_center(int error);
17-
void start_p(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len);
18-
void start_div(int a, int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old);
19-
void end_div(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old);
17+
void start_p(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
18+
void start_div(int a, int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
19+
void end_div(int nooutput, int spaces, int paragraph, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
2020
CHAR friss_kommentar(int error);
2121

2222
void find_encoding(int error);
2323
void find_xml_encoding(int error);
2424

2525
void href_link_inline_output();
2626

27-
void start_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old);
28-
void end_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old);
27+
int start_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
28+
int end_nooutput(int nooutput, int spaces, int breite, int error, int zeilen_len, int zeilen_len_old, int zeilen_pos);
2929
#endif

0 commit comments

Comments
 (0)