#include <unistd.h>
#include <fcntl.h>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <csignal>
#include "BufferView.h"
#include "gettext.h"
#include "lyx_gui_misc.h"
+#include "debug.h"
+#include "support/lstrings.h"
extern LyXRC *lyxrc;
extern BufferView *current_view;
isp_pid = -1;
if(pipe(pipein)==-1 || pipe(pipeout)==-1) {
- fprintf(stderr,"LyX: Can't create pipe for spellchecker!");
+ lyxerr << "LyX: Can't create pipe for spellchecker!" << endl;
return;
}
if ((out = fdopen(pipein[1], "w"))==0) {
- fprintf(stderr,"LyX: Can't create stream for pipe for spellchecker!");
+ lyxerr << "LyX: Can't create stream for pipe for spellchecker!"
+ << endl;
return;
}
if ((in = fdopen(pipeout[0], "r"))==0) {
- fprintf(stderr,"LyX: Can't create stream for pipe for spellchecker!");
+ lyxerr <<"LyX: Can't create stream for pipe for spellchecker!"
+ << endl;
return;
}
isp_pid = fork();
if(isp_pid==-1) {
- fprintf(stderr,"LyX: Can't create child process for spellchecker!");
+ lyxerr << "LyX: Can't create child process for spellchecker!"
+ << endl;
return;
}
for (int i=0; i < argc -1; i++)
delete[] argv[i];
- fprintf(stderr, "LyX: Failed to start ispell!\n");
+ lyxerr << "LyX: Failed to start ispell!" << endl;
_exit(0);
}
// Actually I used it to tell if it's truly Ispell or if it's
// aspell -- (kevinatk@home.com)
char buf[2048];
-#ifdef WITH_WARNINGS
-#warning verify that this works.
-#endif
fd_set infds;
struct timeval tv;
int retval = 0;
} else if (retval == 0) {
// timeout. Give nice message to user.
- fprintf(stderr, "Ispell read timed out, what now?\n");
-#ifdef WITH_WARNINGS
-#warning Is this the correct thing to do?
-#endif
+ lyxerr << "Ispell read timed out, what now?" << endl;
+ // This probably works but could need some thought
isp_pid = -1;
close(pipeout[0]); close(pipeout[1]);
close(pipein[0]); close(pipein[1]);
isp_fd = -1;
} else {
// Select returned error
- fprintf(stderr, "Select on ispell returned error, what now?\n");
+ lyxerr << "Select on ispell returned error, what now?" << endl;
}
}
if(isp_pid!=-1) {
ispell_terminate();
string word_msg;
- word_msg += int(word_count);
+ word_msg += tostr(word_count);
if (word_count != 1) {
word_msg += _(" words checked.");
} else {