Skip to content

Commit fff94f7

Browse files
committed
*: licence changes #39, whitespace/comment changes
A confusing situation where conflicting licences were used in several files. For this decision, we're referring to a conversation with GMRS Software/original authors where they agree to relicence the code to GPL. This conversion is included in the HISTORY file. As such, all files are stripped form previous licences and now licenced under the GPL-2 licence. While at it, remove a lot of whitespace and comments that are redundant, or kept in Git's logs. Closes: https://github.com/grobian/html2text/issues/39 Signed-off-by: Fabian Groffen <[email protected]>
1 parent bbe309a commit fff94f7

27 files changed

+139
-747
lines changed

Area.cpp

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
2-
/***************************************************************************/
3-
41
/*
52
* Portions Copyright (c) 1999 GMRS Software GmbH
63
* Carl-von-Linde-Str. 38, D-85716 Unterschleissheim, http://www.gmrs.de
74
* All rights reserved.
85
*
96
* Author: Arno Unkrig <[email protected]>
10-
*/
11-
12-
/* This program is free software; you can redistribute it and/or modify
7+
*
8+
* This program is free software; you can redistribute it and/or modify
139
* it under the terms of the GNU General Public License as published by
1410
* the Free Software Foundation; either version 2 of the License, or
1511
* (at your option) any later version.
@@ -20,17 +16,6 @@
2016
* GNU General Public License in the file COPYING for more details.
2117
*/
2218

23-
/***************************************************************************/
24-
25-
/*
26-
* Changes to version 1.2.2 were made by Martin Bayer <[email protected]>
27-
* Dates and reasons of modifications:
28-
* Wed Jul 2 21:56:45 CEST 2003: ported to g++ 3.3
29-
*/
30-
31-
/***************************************************************************/
32-
33-
3419
#include <stdio.h>
3520
#include <stdlib.h>
3621
#include <string.h>
@@ -40,8 +25,6 @@
4025
#include "string.h"
4126
#include "iconvstream.h"
4227

43-
/* ------------------------------------------------------------------------- */
44-
4528
static void *malloc_error(size_t size) {
4629
void *ret = malloc(size);
4730
if (ret == NULL) {
@@ -120,8 +103,6 @@ Line::~Line()
120103
free(cells_);
121104
}
122105

123-
/* ------------------------------------------------------------------------- */
124-
125106
void
126107
Line::resize(size_type l)
127108
{
@@ -199,12 +180,8 @@ Line::add_attribute(char addition)
199180
p++->attribute |= addition;
200181
}
201182

202-
/* ------------------------------------------------------------------------- */
203-
204183
bool Area::use_backspaces = true;
205184

206-
/* ------------------------------------------------------------------------- */
207-
208185
Area::Area() :
209186
width_(0),
210187
height_(0),
@@ -289,8 +266,6 @@ Area::~Area()
289266
free(cells_);
290267
}
291268

292-
/* ------------------------------------------------------------------------- */
293-
294269
const Area &
295270
Area::operator>>=(size_type rs)
296271
{
@@ -525,8 +500,6 @@ Area::add_attribute(
525500
}
526501
}
527502

528-
/* ------------------------------------------------------------------------- */
529-
530503
static char backspace = '\b';
531504

532505
iconvstream &
@@ -594,6 +567,3 @@ operator<<(iconvstream& os, const Area &a)
594567

595568
return os;
596569
}
597-
598-
/* ------------------------------------------------------------------------- */
599-

Area.h

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
2-
/***************************************************************************/
3-
41
/*
52
* Portions Copyright (c) 1999 GMRS Software GmbH
63
* Carl-von-Linde-Str. 38, D-85716 Unterschleissheim, http://www.gmrs.de
74
* All rights reserved.
85
*
96
* Author: Arno Unkrig <[email protected]>
10-
*/
11-
12-
/* This program is free software; you can redistribute it and/or modify
7+
*
8+
* This program is free software; you can redistribute it and/or modify
139
* it under the terms of the GNU General Public License as published by
1410
* the Free Software Foundation; either version 2 of the License, or
1511
* (at your option) any later version.
@@ -20,24 +16,9 @@
2016
* GNU General Public License in the file COPYING for more details.
2117
*/
2218

23-
/***************************************************************************/
24-
25-
/*
26-
* Changes to version 1.2.2 were made by Martin Bayer <[email protected]>
27-
* Dates and reasons of modifications:
28-
* Thu Oct 4 21:21:10 CEST 2001: ported to g++ 3.0
29-
* Wed Jul 2 21:59:41 CEST 2003: ported to g++ 3.3
30-
*/
31-
32-
/***************************************************************************/
33-
34-
3519
#ifndef __Area_h_INCLUDED__ /* { */
3620
#define __Area_h_INCLUDED__
3721

38-
/* ------------------------------------------------------------------------- */
39-
40-
4122
#include <sys/types.h>
4223
#include <string>
4324
#include "iconvstream.h"
@@ -50,8 +31,6 @@ BOOL_DEFINITION
5031

5132
using std::string;
5233

53-
/* ------------------------------------------------------------------------- */
54-
5534
struct Cell {
5635
int character;
5736
char attribute;
@@ -67,8 +46,6 @@ struct Cell {
6746
}
6847
};
6948

70-
/* ------------------------------------------------------------------------- */
71-
7249
class Line {
7350
public:
7451
typedef size_t size_type;
@@ -144,8 +121,6 @@ class Line {
144121
friend class Area;
145122
};
146123

147-
/* ------------------------------------------------------------------------- */
148-
149124
class Area {
150125
public:
151126
typedef size_t size_type;
@@ -240,9 +215,4 @@ class Area {
240215
friend iconvstream &operator<<(iconvstream&, const Area &);
241216
};
242217

243-
/* ------------------------------------------------------------------------- */
244-
245218
#endif /* } */
246-
247-
/* ------------------------------------------------------------------------- */
248-

HTMLControl.cpp

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
2-
/***************************************************************************/
3-
41
/*
52
* Portions Copyright (c) 1999 GMRS Software GmbH
63
* Carl-von-Linde-Str. 38, D-85716 Unterschleissheim, http://www.gmrs.de
74
* All rights reserved.
85
*
96
* Author: Arno Unkrig <[email protected]>
10-
*/
11-
12-
/* This program is free software; you can redistribute it and/or modify
7+
*
8+
* This program is free software; you can redistribute it and/or modify
139
* it under the terms of the GNU General Public License as published by
1410
* the Free Software Foundation; either version 2 of the License, or
1511
* (at your option) any later version.
@@ -20,20 +16,6 @@
2016
* GNU General Public License in the file COPYING for more details.
2117
*/
2218

23-
/***************************************************************************/
24-
25-
/*
26-
* Changes to version 1.2.2 were made by Martin Bayer <[email protected]>
27-
* Dates and reasons of modifications:
28-
* Fre Jun 8 17:20:38 CEST 2001: fixed coredump
29-
* Sun Apr 7 11:31:10 CEST 2002: fixed parser errors
30-
* Wed Jul 2 22:00:21 CEST 2003: ported to g++ 3.3
31-
* Sun Nov 16 22:13:50 CET 2003: better rendering of XHTML
32-
*/
33-
34-
/***************************************************************************/
35-
36-
3719
#include <iostream>
3820
#include <stdlib.h>
3921
#include <string.h>
@@ -58,8 +40,6 @@ enum {
5840
NON_CONTAINER_TAG
5941
};
6042

61-
/* ------------------------------------------------------------------------- */
62-
6343
void
6444
HTMLControl::htmlparser_yyerror(const char *p)
6545
{
@@ -199,8 +179,6 @@ int HTMLControl::htmlparser_yylex(
199179
}
200180
}
201181

202-
/* ------------------------------------------------------------------------- */
203-
204182
/*
205183
* Keep this array sorted alphabetically!
206184
*/
@@ -288,8 +266,6 @@ tag_names[] = {
288266
#undef pack
289267
};
290268

291-
/* ------------------------------------------------------------------------- */
292-
293269
int
294270
HTMLControl::yylex2(html2text::HTMLParser::semantic_type *value_return,
295271
int *tag_type_return)
@@ -615,8 +591,6 @@ HTMLControl::yylex2(html2text::HTMLParser::semantic_type *value_return,
615591
}
616592
}
617593

618-
/* ------------------------------------------------------------------------- */
619-
620594
bool
621595
HTMLControl::read_cdata(const char *terminal, string *value_return)
622596
{
@@ -631,8 +605,9 @@ HTMLControl::read_cdata(const char *terminal, string *value_return)
631605
if (toupper(c) == terminal[state]) {
632606
state++;
633607
if (terminal[state] == '\0') {
634-
// s.erase(s.length() - state);
635-
// caused core dump on empty STYLE and SCRIPT elements - Johannes Geiger
608+
// s.erase(s.length() - state);
609+
// caused core dump on empty STYLE and
610+
// SCRIPT elements - Johannes Geiger
636611
s.erase(s.length() - state + 1);
637612
return true;
638613
}
@@ -643,8 +618,6 @@ HTMLControl::read_cdata(const char *terminal, string *value_return)
643618
}
644619
}
645620

646-
/* ------------------------------------------------------------------------- */
647-
648621
int
649622
HTMLControl::get_char()
650623
{
@@ -701,6 +674,3 @@ HTMLControl::unget_char(int c)
701674
}
702675
ungotten_chars[number_of_ungotten_chars++] = c;
703676
}
704-
705-
/* ------------------------------------------------------------------------- */
706-

HTMLControl.h

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
2-
/***************************************************************************/
3-
41
/*
52
* Portions Copyright (c) 1999 GMRS Software GmbH
63
* Carl-von-Linde-Str. 38, D-85716 Unterschleissheim, http://www.gmrs.de
74
* All rights reserved.
85
*
96
* Author: Arno Unkrig <[email protected]>
10-
*/
11-
12-
/* This program is free software; you can redistribute it and/or modify
7+
*
8+
* This program is free software; you can redistribute it and/or modify
139
* it under the terms of the GNU General Public License as published by
1410
* the Free Software Foundation; either version 2 of the License, or
1511
* (at your option) any later version.
@@ -20,32 +16,16 @@
2016
* GNU General Public License in the file COPYING for more details.
2117
*/
2218

23-
/***************************************************************************/
24-
25-
/*
26-
* Changes to version 1.2.2 were made by Martin Bayer <[email protected]>
27-
* Dates and reasons of modifications:
28-
* Thu Oct 4 21:25:07 CEST 2001: ported to g++ 3.0
29-
* Wed Jul 2 22:01:12 CEST 2003: ported to g++ 3.3
30-
*/
31-
32-
/***************************************************************************/
33-
34-
3519
#ifndef __HTMLControl_h_INCLUDED__ /* { */
3620
#define __HTMLControl_h_INCLUDED__
3721

38-
/* ------------------------------------------------------------------------- */
39-
4022
#include "iconvstream.h"
4123
#include <istream>
4224

4325
#include "HTMLParser.tab.hh"
4426

4527
using std::istream;
4628

47-
/* ------------------------------------------------------------------------- */
48-
4929
class HTMLControl {
5030
public:
5131
HTMLControl(iconvstream& is_,
@@ -78,7 +58,8 @@ class HTMLControl {
7858
/*
7959
* Helpers.
8060
*/
81-
int yylex2(html2text::HTMLParser::semantic_type *value_return, int *tag_type_return);
61+
int yylex2(html2text::HTMLParser::semantic_type *value_return,
62+
int *tag_type_return);
8263
bool literal_mode;
8364
int next_token;
8465
html2text::HTMLParser::semantic_type next_token_value;
@@ -94,9 +75,4 @@ class HTMLControl {
9475
int number_of_ungotten_chars;
9576
};
9677

97-
/* ------------------------------------------------------------------------- */
98-
9978
#endif /* } */
100-
101-
/* ------------------------------------------------------------------------- */
102-

HTMLDriver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2020 Fabian Groffen <[email protected]>
1+
/* Copyright 2020-2022 Fabian Groffen <[email protected]>
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by

HTMLDriver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2020 Fabian Groffen <[email protected]>
1+
/* Copyright 2020-2022 Fabian Groffen <[email protected]>
22
*
33
* This program is free software; you can redistribute it and/or modify
44
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)