[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1524 - Extractor/src/plugins/pdf
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1524 - Extractor/src/plugins/pdf |
Date: |
Thu, 14 Jul 2005 10:04:06 -0700 (PDT) |
Author: grothoff
Date: 2005-07-14 10:04:04 -0700 (Thu, 14 Jul 2005)
New Revision: 1524
Modified:
Extractor/src/plugins/pdf/pdfextractor.cc
Log:
improvements
Modified: Extractor/src/plugins/pdf/pdfextractor.cc
===================================================================
--- Extractor/src/plugins/pdf/pdfextractor.cc 2005-07-14 16:53:13 UTC (rev
1523)
+++ Extractor/src/plugins/pdf/pdfextractor.cc 2005-07-14 17:04:04 UTC (rev
1524)
@@ -195,13 +195,14 @@
return result;
}
- struct EXTRACTOR_Keywords * libextractor_pdf_extract(char * filename,
- unsigned char * data,
+ struct EXTRACTOR_Keywords * libextractor_pdf_extract(const char * filename,
+ char * data,
size_t size,
struct
EXTRACTOR_Keywords * prev) {
PDFDoc * doc;
- GString * fileName;
Object info;
+ Object obj;
+ BaseStream * stream;
struct EXTRACTOR_Keywords * result;
const char * mime;
@@ -220,13 +221,12 @@
}
}
- fileName = new GString(filename);
/* errorInit(); -- keep commented out, otherwise errors are printed to
stderr for non-pdf files! */
- initParams(".xpdfrc", ".xpdfrc");
- doc = new PDFDoc(fileName, NULL, NULL);
+ obj.initNull();
+ stream = new MemStream(data, 0, size, &obj);
+ doc = new PDFDoc(stream, NULL, NULL);
if (! doc->isOk()) {
delete doc;
- freeParams();
return prev;
}
@@ -285,8 +285,17 @@
info.free();
delete doc;
- freeParams();
return result;
}
}
+
+
+
+void __attribute__ ((constructor)) xpdf_init(void) {
+ initParams(".xpdfrc", ".xpdfrc");
+}
+
+void __attribute__ ((destructor)) xpdf_done(void) {
+ freeParams();
+}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1524 - Extractor/src/plugins/pdf,
grothoff <=