recollindex builds. Still need to implement quite a lot of ifndefed stuff (pathut, rclconfig)

--HG--
branch : WINDOWSPORT
This commit is contained in:
Jean-Francois Dockes
2015-08-30 15:30:50 +02:00
parent d4cd1dd91c
commit 75517f7497
24 changed files with 344 additions and 59 deletions
+2 -1
View File
@@ -46,7 +46,7 @@ void reapXAttrs(const RclConfig* cfg, const string& path,
map<string, string>& xfields)
{
LOGDEB2(("reapXAttrs: [%s]\n", path.c_str()));
#ifndef _WIN32
// Retrieve xattrs names from files and mapping table from config
vector<string> xnames;
if (!pxattr::list(path, &xnames)) {
@@ -79,6 +79,7 @@ void reapXAttrs(const RclConfig* cfg, const string& path,
xfields[key] = value;
LOGDEB2(("reapXAttrs: [%s] -> [%s]\n", key.c_str(), value.c_str()));
}
#endif
}
void docFieldsFromXattrs(RclConfig *cfg, const map<string, string>& xfields,
+2
View File
@@ -14,6 +14,7 @@
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "autoconfig.h"
#include <stdio.h>
#include <fcntl.h>
@@ -21,6 +22,7 @@
#include "safeunistd.h"
#include <time.h>
#include <cstdlib>
#include "safesysstat.h"
#include <map>
#include <sstream>
+8 -1
View File
@@ -18,10 +18,13 @@
#include <stdio.h>
#include <errno.h>
#include "safefcntl.h"
#include <sys/types.h>
#include "safesysstat.h"
#include "safeunistd.h"
#include <iostream>
#include <string>
using namespace std;
#include "cstr.h"
#include "mh_text.h"
@@ -32,6 +35,8 @@ using namespace std;
#include "pxattr.h"
#include "pathut.h"
using namespace std;
const int MB = 1024*1024;
const int KB = 1024;
@@ -51,9 +56,11 @@ bool MimeHandlerText::set_document_file(const string& mt, const string &fn)
return false;
}
#ifndef _WIN32
// Check for charset defined in extended attribute as per:
// http://freedesktop.org/wiki/CommonExtendedAttributes
pxattr::get(m_fn, "charset", &m_charsetfromxattr);
#endif
// Max file size parameter: texts over this size are not indexed
int maxmbs = 20;
+4
View File
@@ -195,6 +195,9 @@ static const string cstr_mh_charset("charset");
MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
bool multiple, const string& id)
{
#ifdef _WIN32
return 0;
#else
ConfSimple attrs;
string cmdstr;
@@ -238,6 +241,7 @@ MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
#endif
return h;
#endif
}
/* Get handler/filter object for given mime type: */
+4
View File
@@ -23,6 +23,10 @@
* -----END-LICENCE-----
*/
#include <time.h>
#ifdef _WIN32
// Local implementation in windows directory
#include "strptime.h"
#endif
#include <stdio.h>
#include <algorithm>
#include <cstring>