From: Stephan Bosch Date: Tue, 8 Oct 2019 16:56:54 +0000 (+0200) Subject: plugins: fts-solr: Move definition of struct solr_lookup_xml_context from solr-connec... X-Git-Tag: 2.3.10~162 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4aa0e2ced27e1e15b92f06210c5495f45ccb31ed;p=thirdparty%2Fdovecot%2Fcore.git plugins: fts-solr: Move definition of struct solr_lookup_xml_context from solr-connection.c to solr-response.c. --- diff --git a/src/plugins/fts-solr/Makefile.am b/src/plugins/fts-solr/Makefile.am index 522202e884..e44452017f 100644 --- a/src/plugins/fts-solr/Makefile.am +++ b/src/plugins/fts-solr/Makefile.am @@ -28,6 +28,9 @@ lib21_fts_solr_plugin_la_SOURCES = \ fts-solr-plugin.c \ solr-connection.c +EXTRA_DIST = \ + solr-response.c + noinst_HEADERS = \ fts-solr-plugin.h \ solr-response.h \ diff --git a/src/plugins/fts-solr/solr-connection.c b/src/plugins/fts-solr/solr-connection.c index 35093b2887..cf5b82e45e 100644 --- a/src/plugins/fts-solr/solr-connection.c +++ b/src/plugins/fts-solr/solr-connection.c @@ -14,39 +14,6 @@ #include -enum solr_xml_response_state { - SOLR_XML_RESPONSE_STATE_ROOT, - SOLR_XML_RESPONSE_STATE_RESPONSE, - SOLR_XML_RESPONSE_STATE_RESULT, - SOLR_XML_RESPONSE_STATE_DOC, - SOLR_XML_RESPONSE_STATE_CONTENT -}; - -enum solr_xml_content_state { - SOLR_XML_CONTENT_STATE_NONE = 0, - SOLR_XML_CONTENT_STATE_UID, - SOLR_XML_CONTENT_STATE_SCORE, - SOLR_XML_CONTENT_STATE_MAILBOX, - SOLR_XML_CONTENT_STATE_NAMESPACE, - SOLR_XML_CONTENT_STATE_UIDVALIDITY, - SOLR_XML_CONTENT_STATE_ERROR -}; - -struct solr_lookup_xml_context { - enum solr_xml_response_state state; - enum solr_xml_content_state content_state; - int depth; - - uint32_t uid, uidvalidity; - float score; - char *mailbox, *ns; - - pool_t result_pool; - /* box_id -> solr_result */ - HASH_TABLE(char *, struct solr_result *) mailboxes; - ARRAY(struct solr_result *) results; -}; - struct solr_connection_post { struct solr_connection *conn; @@ -76,6 +43,8 @@ struct solr_connection { bool http_ssl:1; }; +#include "solr-response.c" + static int solr_xml_parse(struct solr_connection *conn, const void *data, size_t size, bool done) diff --git a/src/plugins/fts-solr/solr-response.c b/src/plugins/fts-solr/solr-response.c new file mode 100644 index 0000000000..05abedce70 --- /dev/null +++ b/src/plugins/fts-solr/solr-response.c @@ -0,0 +1,39 @@ +/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */ + +#include "lib.h" +#include "solr-response.h" + +#include + +enum solr_xml_response_state { + SOLR_XML_RESPONSE_STATE_ROOT, + SOLR_XML_RESPONSE_STATE_RESPONSE, + SOLR_XML_RESPONSE_STATE_RESULT, + SOLR_XML_RESPONSE_STATE_DOC, + SOLR_XML_RESPONSE_STATE_CONTENT +}; + +enum solr_xml_content_state { + SOLR_XML_CONTENT_STATE_NONE = 0, + SOLR_XML_CONTENT_STATE_UID, + SOLR_XML_CONTENT_STATE_SCORE, + SOLR_XML_CONTENT_STATE_MAILBOX, + SOLR_XML_CONTENT_STATE_NAMESPACE, + SOLR_XML_CONTENT_STATE_UIDVALIDITY, + SOLR_XML_CONTENT_STATE_ERROR +}; + +struct solr_lookup_xml_context { + enum solr_xml_response_state state; + enum solr_xml_content_state content_state; + int depth; + + uint32_t uid, uidvalidity; + float score; + char *mailbox, *ns; + + pool_t result_pool; + /* box_id -> solr_result */ + HASH_TABLE(char *, struct solr_result *) mailboxes; + ARRAY(struct solr_result *) results; +};