]> git.lyx.org Git - lyx.git/blobdiff - src/ispell.h
Enable convertDefault.sh to run even if its executable bit is not set.
[lyx.git] / src / ispell.h
index cdb193fc6cc13494194b9b90019183ac58961677..d8a3c9ca138951a08b45ef8fe2b1d53d153ae287 100644 (file)
@@ -1,20 +1,30 @@
 // -*- C++ -*-
 /**
  * \file ispell.h
- * Copyright 2002 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author unknown
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef SP_ISPELL_H
 #define SP_ISPELL_H
 
-#include <cstdio>
-
 #include "SpellBase.h"
 
+#include <boost/scoped_ptr.hpp>
+
+#include <cstdio>
+
 class BufferParams;
+namespace lyx {
+namespace support {
+class ForkedProcess;
+}
+}
 
 /// i/a spell process-based spellchecker
 class ISpell : public SpellBase {
@@ -26,15 +36,9 @@ public:
        /// return true if the spellchecker instance still exists
        virtual bool alive();
 
-       /// clean up on messy exit
-       virtual void cleanUp();
-
        /// check the given word and return the result
        virtual enum Result check(WordLangTuple const & word);
 
-       /// finish this spellchecker instance
-       virtual void close();
-
        /// insert the given word into the personal dictionary
        virtual void insert(WordLangTuple const & word);
 
@@ -48,17 +52,29 @@ public:
        virtual string const error();
 
 private:
-       ///
-       void setError();
+       /// read some data. Returns true on an error. Sets err_read
+       /// to true if the data was from stderr.
+       bool select(bool & err_read);
 
        /// instream to communicate with ispell
        FILE * in;
        /// outstream to communicate with ispell
        FILE * out;
+       /// errstream for ispell
+       FILE * inerr;
+
+       /// pipe fds
+       int pipein[2];
+       int pipeout[2];
+       int pipeerr[2];
+
+       /// buffer for reading
+       char buf[BUFSIZ];
+
        /// spell error
-       char const * error_;
-       /// the fd of the outgoing pipe
-       int isp_fd;
+       string error_;
+
+       boost::scoped_ptr<lyx::support::ForkedProcess> child_;
 
        // vileness below ... please FIXME
        /// str ???