1#ifdef _WIN32
2#define LIBXML_DLL_IMPORT __declspec(dllimport)
3#else
4extern "C" int xmlLoadExtDtdDefaultValue;
5#endif
6
7#include "kio_help.h"
8
9#include <docbookxslt.h>
10
11#include <QDebug>
12
13#include <QCoreApplication>
14#include <QString>
15
16#include <qplatformdefs.h>
17#include <stdlib.h>
18#include <string.h>
19
20#include <libxml/HTMLtree.h>
21#include <libxml/debugXML.h>
22#include <libxml/parserInternals.h>
23#include <libxml/xmlIO.h>
24#include <libxml/xmlmemory.h>
25#include <libxml/xmlversion.h>
26
27#include <libexslt/exslt.h>
28#include <libxslt/transform.h>
29#include <libxslt/xsltInternals.h>
30#include <libxslt/xsltconfig.h>
31#include <libxslt/xsltutils.h>
32
33// Pseudo plugin class to embed meta data
34class KIOPluginForMetaData : public QObject
35{
36 Q_OBJECT
37 Q_PLUGIN_METADATA(IID "org.kde.kio.worker.help" FILE "help.json")
38};
39
40extern "C" {
41Q_DECL_EXPORT int kdemain(int argc, char **argv)
42{
43 QCoreApplication app(argc, argv); // needed for KCrash
44 app.setApplicationName(QStringLiteral("kio_help"));
45
46 KDocTools::setupStandardDirs();
47
48 // qDebug() << "Starting " << getpid();
49
50 if (argc != 4) {
51 fprintf(stderr, format: "Usage: kio_help protocol domain-socket1 domain-socket2\n");
52 exit(status: -1);
53 }
54
55 LIBXML_TEST_VERSION
56 xmlSubstituteEntitiesDefault(val: 1);
57 xmlLoadExtDtdDefaultValue = 1;
58 exsltRegisterAll();
59
60 HelpProtocol worker(false, argv[2], argv[3]);
61 worker.dispatchLoop();
62
63 // qDebug() << "Done";
64 return 0;
65}
66}
67
68// needed for JSON file embedding
69#include "main.moc"
70

source code of kio/src/kioworkers/help/main.cpp