[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libextractor] 01/05: avoid use of deprecated libtidy heade
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libextractor] 01/05: avoid use of deprecated libtidy header |
Date: |
Wed, 11 Oct 2017 20:54:43 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
commit c3e153fecd70a28e701771537ab4b4f0d5bc1267
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Oct 11 20:12:40 2017 +0200
avoid use of deprecated libtidy header
---
src/plugins/html_extractor.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/plugins/html_extractor.c b/src/plugins/html_extractor.c
index 6ac08096..8cd4abad 100644
--- a/src/plugins/html_extractor.c
+++ b/src/plugins/html_extractor.c
@@ -27,7 +27,7 @@
#include "extractor.h"
#include <magic.h>
#include <tidy/tidy.h>
-#include <tidy/buffio.h>
+#include <tidy/tidybuffio.h>
/**
* Mapping of HTML META names to LE types.
@@ -59,7 +59,7 @@ static struct
{ "rights", EXTRACTOR_METATYPE_RIGHTS },
{ "dc.rights", EXTRACTOR_METATYPE_RIGHTS },
{ "copyright", EXTRACTOR_METATYPE_COPYRIGHT },
- { "language", EXTRACTOR_METATYPE_LANGUAGE },
+ { "language", EXTRACTOR_METATYPE_LANGUAGE },
{ "keywords", EXTRACTOR_METATYPE_KEYWORDS },
{ "abstract", EXTRACTOR_METATYPE_ABSTRACT },
{ "formatter", EXTRACTOR_METATYPE_CREATED_BY_SOFTWARE },
@@ -82,7 +82,7 @@ static magic_t magic;
* @param tag tag to map
* @return EXTRACTOR_METATYPE_RESERVED if the type was not found
*/
-static enum EXTRACTOR_MetaType
+static enum EXTRACTOR_MetaType
tag_to_type (const char *tag)
{
unsigned int i;
@@ -146,7 +146,7 @@ static void TIDY_CALL
unget_byte_cb (void *sourceData, byte bt)
{
struct EXTRACTOR_ExtractContext *ec = sourceData;
-
+
(void) ec->seek (ec->cls, -1, SEEK_CUR);
}
@@ -167,11 +167,11 @@ eof_cb (void *sourceData)
/**
- * Main entry method for the 'text/html' extraction plugin.
+ * Main entry method for the 'text/html' extraction plugin.
*
* @param ec extraction context provided to the plugin
*/
-void
+void
EXTRACTOR_html_extract_method (struct EXTRACTOR_ExtractContext *ec)
{
TidyDoc doc;
@@ -250,9 +250,9 @@ EXTRACTOR_html_extract_method (struct
EXTRACTOR_ExtractContext *ec)
case TidyNode_Php:
break;
case TidyNode_XmlDecl:
- break;
+ break;
case TidyNode_Start:
- case TidyNode_StartEnd:
+ case TidyNode_StartEnd:
name = tidyNodeGetName (child);
if ( (0 == strcasecmp (name, "title")) &&
(NULL != (title = tidyGetChild (child))) )
@@ -278,13 +278,13 @@ EXTRACTOR_html_extract_method (struct
EXTRACTOR_ExtractContext *ec)
}
if (0 == strcasecmp (name, "meta"))
{
- if (NULL == (attr = tidyAttrGetById (child,
+ if (NULL == (attr = tidyAttrGetById (child,
TidyAttr_NAME)))
break;
- if (EXTRACTOR_METATYPE_RESERVED ==
+ if (EXTRACTOR_METATYPE_RESERVED ==
(type = tag_to_type (tidyAttrValue (attr))))
break;
- if (NULL == (attr = tidyAttrGetById (child,
+ if (NULL == (attr = tidyAttrGetById (child,
TidyAttr_CONTENT)))
break;
name = tidyAttrValue (attr);
@@ -297,14 +297,14 @@ EXTRACTOR_html_extract_method (struct
EXTRACTOR_ExtractContext *ec)
name,
strlen (name) + 1))
goto CLEANUP;
- break;
+ break;
}
break;
case TidyNode_End:
- break;
+ break;
default:
break;
- }
+ }
}
CLEANUP:
tidyRelease (doc);
@@ -463,7 +463,7 @@ findInTags (struct TagInfo * t,
/* mimetype = text/html */
-int
+int
EXTRACTOR_html_extract (const char *data,
size_t size,
EXTRACTOR_MetaDataProcessor proc,
@@ -562,7 +562,7 @@ EXTRACTOR_html_extract (const char *data,
if text/html is present, we take that as the mime-type; if charset=
is present, we try to use that for character set conversion. */
if (0 == strncasecmp (tmp, "text/html", strlen ("text/html")))
- ret = proc (proc_cls,
+ ret = proc (proc_cls,
"html",
EXTRACTOR_METATYPE_MIMETYPE,
EXTRACTOR_METAFORMAT_UTF8,
@@ -613,7 +613,7 @@ EXTRACTOR_html_extract (const char *data,
free (tmp);
i++;
}
- while (tags != NULL)
+ while (tags != NULL)
{
t = tags;
if ( (tagMatch ("title", t->tagStart, t->tagEnd)) &&
@@ -667,7 +667,7 @@ EXTRACTOR_html_extract (const char *data,
/**
* Initialize glib and load magic file.
*/
-void __attribute__ ((constructor))
+void __attribute__ ((constructor))
html_gobject_init ()
{
magic = magic_open (MAGIC_MIME_TYPE);
@@ -681,8 +681,8 @@ html_gobject_init ()
/**
* Destructor for the library, cleans up.
*/
-void __attribute__ ((destructor))
-html_ltdl_fini ()
+void __attribute__ ((destructor))
+html_ltdl_fini ()
{
if (NULL != magic)
{
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [libextractor] branch master updated (6095d713 -> 25da5822), gnunet, 2017/10/11
- [GNUnet-SVN] [libextractor] 04/05: version bumping, gnunet, 2017/10/11
- [GNUnet-SVN] [libextractor] 03/05: recover lost ChangeLog entry, gnunet, 2017/10/11
- [GNUnet-SVN] [libextractor] 01/05: avoid use of deprecated libtidy header,
gnunet <=
- [GNUnet-SVN] [libextractor] 02/05: make code compile against libexiv 0.26, gnunet, 2017/10/11
- [GNUnet-SVN] [libextractor] 05/05: disting, updates po files, gnunet, 2017/10/11