From 39cecd4b8efee84745894b544aa7d2d57c6454f9 Mon Sep 17 00:00:00 2001 From: dockes Date: Tue, 19 Jun 2007 12:27:52 +0000 Subject: [PATCH] get test driver to compile --- src/internfile/internfile.cpp | 18 ++++++++++++------ src/internfile/internfile.h | 3 ++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/internfile/internfile.cpp b/src/internfile/internfile.cpp index c4f02c8e..22646fc6 100644 --- a/src/internfile/internfile.cpp +++ b/src/internfile/internfile.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: internfile.cpp,v 1.31 2007-06-19 08:36:24 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: internfile.cpp,v 1.32 2007-06-19 12:27:52 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -589,6 +589,8 @@ bool FileInterner::idocTempFile(TempFile& otemp, RclConfig *cnf, #include #include #include +#include + using namespace std; #include "debuglog.h" @@ -651,8 +653,12 @@ int main(int argc, char **argv) fprintf(stderr, "%s\n", str.c_str()); exit(1); } - - FileInterner interner(fn, config, "/tmp"); + struct stat st; + if (stat(fn.c_str(), &st)) { + perror("stat"); + exit(1); + } + FileInterner interner(fn, &st, config, "/tmp"); Rcl::Doc doc; FileInterner::Status status = interner.internfile(doc, ipath); switch (status) { @@ -677,11 +683,11 @@ int main(int argc, char **argv) "]]]]\n-----------------------------------------------------\n" << "doc.origcharset [[[[" << doc.origcharset << "]]]]\n-----------------------------------------------------\n" << - "doc.title [[[[" << doc.title << + "doc.meta[title] [[[[" << doc.meta["title"] << "]]]]\n-----------------------------------------------------\n" << - "doc.keywords [[[[" << doc.keywords << + "doc.meta[keywords] [[[[" << doc.meta["keywords"] << "]]]]\n-----------------------------------------------------\n" << - "doc.meta["abstract"] [[[[" << doc.meta["abstract"] << + "doc.meta[abstract] [[[[" << doc.meta["abstract"] << "]]]]\n-----------------------------------------------------\n" << "doc.text [[[[" << doc.text << "]]]]\n"; } diff --git a/src/internfile/internfile.h b/src/internfile/internfile.h index d72cd8df..ae73a189 100644 --- a/src/internfile/internfile.h +++ b/src/internfile/internfile.h @@ -16,7 +16,7 @@ */ #ifndef _INTERNFILE_H_INCLUDED_ #define _INTERNFILE_H_INCLUDED_ -/* @(#$Id: internfile.h,v 1.14 2007-02-08 17:05:12 dockes Exp $ (C) 2004 J.F.Dockes */ +/* @(#$Id: internfile.h,v 1.15 2007-06-19 12:27:52 dockes Exp $ (C) 2004 J.F.Dockes */ #include #include @@ -47,6 +47,7 @@ class FileInterner { * different for previewing and indexing. * * @param fn file name + * @param stp pointer to updated stat struct. * @param cnf Recoll configuration * @param td temporary directory to use as working space if * decompression needed. Must be private and will be wiped clean.