2 ===================================================================
3 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/DepTable.C,v
4 retrieving revision 1.41
5 diff -u -a -u -r1.41 DepTable.C
6 --- src/DepTable.C 13 Oct 2003 01:01:33 -0000 1.41
7 +++ src/DepTable.C 18 Apr 2005 17:37:02 -0000
11 #ifndef CXX_GLOBAL_CSTD
17 using lyx::support::ltrim;
19 ===================================================================
20 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
21 retrieving revision 1.615
22 diff -u -a -u -r1.615 buffer.C
23 --- src/buffer.C 18 Apr 2005 17:43:08 -0000 1.615
24 +++ src/buffer.C 18 Apr 2005 17:37:02 -0000
26 #include <boost/bind.hpp>
27 #include <boost/filesystem/operations.hpp>
31 +# include <windows.h>
39 ===================================================================
40 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v
41 retrieving revision 1.123
42 diff -u -a -u -r1.123 cursor.C
43 --- src/cursor.C 25 Feb 2005 11:55:31 -0000 1.123
44 +++ src/cursor.C 18 Apr 2005 17:37:02 -0000
48 #ifndef CXX_GLOBAL_CSTD
56 ===================================================================
57 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ispell.C,v
58 retrieving revision 1.25
59 diff -u -a -u -r1.25 ispell.C
60 --- src/ispell.C 20 Jan 2005 16:17:36 -0000 1.25
61 +++ src/ispell.C 18 Apr 2005 17:37:02 -0000
64 #include "support/forkedcall.h"
67 +# include "support/os_win32.h"
70 // HP-UX 11.x doesn't have this header
71 #ifdef HAVE_SYS_SELECT_H
72 #include <sys/select.h>
74 -#include <sys/time.h>
76 +# include <sys/time.h>
79 using boost::shared_ptr;
86 dup2(pipein[0], STDIN_FILENO);
87 dup2(pipeout[1], STDOUT_FILENO);
88 dup2(pipeerr[1], STDERR_FILENO);
91 lyxerr << "LyX: Failed to start ispell!" << endl;
99 lyxerr[Debug::GUI] << "Created ispell" << endl;
102 // static due to the setvbuf. Ugly.
103 static char o_buf[BUFSIZ];
113 @@ -295,18 +305,23 @@
129 bool ISpell::select(bool & err_read)
137 @@ -316,11 +331,15 @@
142 retval = ::select(SELECT_TYPE_ARG1 (max(pipeout[0], pipeerr[0]) + 1),
143 SELECT_TYPE_ARG234 (&infds),
146 SELECT_TYPE_ARG5 (&tv));
154 fgets(buf, BUFSIZ, in);
162 ===================================================================
163 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_cb.C,v
164 retrieving revision 1.247
165 diff -u -a -u -r1.247 lyx_cb.C
166 --- src/lyx_cb.C 31 Jan 2005 10:42:18 -0000 1.247
167 +++ src/lyx_cb.C 18 Apr 2005 17:37:02 -0000
169 #include "support/path.h"
170 #include "support/systemcall.h"
173 +# include "support/os_win32.h" // fork()
176 #include <boost/shared_ptr.hpp>
177 #include <boost/filesystem/operations.hpp>
179 Index: src/lyxserver.C
180 ===================================================================
181 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxserver.C,v
182 retrieving revision 1.60
183 diff -u -a -u -r1.60 lyxserver.C
184 --- src/lyxserver.C 15 Feb 2005 11:04:40 -0000 1.60
185 +++ src/lyxserver.C 18 Apr 2005 17:37:02 -0000
187 #include <sys/stat.h>
191 +# include "support/os_win32.h" // F_SETFL, O_NONBLOCK, fcntl
198 // Imported handles can be used both with OS/2 APIs and emx
199 // library functions.
200 int const fd = _imphandle(os2fd);
201 +#elif defined(_WIN32)
204 if (::access(filename.c_str(), F_OK) == 0) {
205 lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
206 @@ -235,10 +241,12 @@
211 if (::close(fd) < 0) {
212 lyxerr << "LyXComm: Could not close pipe " << filename
213 << '\n' << strerror(errno) << endl;
217 // OS/2 pipes are deleted automatically
222 // the single = is intended here.
223 - while ((status = ::read(infd, charbuf, charbuf_size - 1))) {
226 + ::read(infd, charbuf, charbuf_size - 1)
233 charbuf[status] = '\0'; // turn it into a c string
236 if (pipename.empty()) return;
242 lyxerr << "LyXComm: Pipes are closed. Could not send "
252 Index: src/lyxsocket.C
253 ===================================================================
254 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxsocket.C,v
255 retrieving revision 1.7
256 diff -u -a -u -r1.7 lyxsocket.C
257 --- src/lyxsocket.C 15 Feb 2005 13:45:40 -0000 1.7
258 +++ src/lyxsocket.C 18 Apr 2005 17:37:02 -0000
260 LyXServerSocket::~LyXServerSocket()
262 lyx_gui::unregister_socket_callback(fd_);
266 lyx::support::unlink(address_);
267 lyxerr[Debug::LYXSERVER] << "lyx: Server socket quitting" << endl;
271 string const linen(line + '\n');
272 int const size = linen.size();
274 int const written = ::write(fd_, linen.c_str(), size);
276 + int const written = -1;
278 if (written < size) { // Allways mean end of connection.
279 if ((written == -1) && (errno == EPIPE)) {
280 // The program will also receive a SIGPIPE
283 LyXDataSocket::~LyXDataSocket()
289 lyx_gui::unregister_socket_callback(fd_);
290 lyxerr[Debug::LYXSERVER] << "lyx: Data socket " << fd_ << " quitting."
294 // read and store characters in buffer
295 - while ((count = ::read(fd_, charbuf, charbuf_size - 1)) > 0) {
298 + ::read(fd_, charbuf, charbuf_size - 1)
303 buffer_.append(charbuf, charbuf + count);
308 string const linen(line + '\n');
309 int const size = linen.size();
311 int const written = ::write(fd_, linen.c_str(), size);
313 + int const written = -1;
315 if (written < size) { // Allways mean end of connection.
316 if ((written == -1) && (errno == EPIPE)) {
317 // The program will also receive a SIGPIPE
318 Index: src/client/client.C
319 ===================================================================
320 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/client/client.C,v
321 retrieving revision 1.7
322 diff -u -a -u -r1.7 client.C
323 --- src/client/client.C 20 Jan 2005 15:38:13 -0000 1.7
324 +++ src/client/client.C 18 Apr 2005 17:37:02 -0000
331 -#include <sys/select.h>
332 +# include <sys/select.h>
334 // socket(), connect()
335 -#include <sys/socket.h>
337 +# include <sys/socket.h>
338 +# include <sys/un.h>
343 Index: src/frontends/LyXView.C
344 ===================================================================
345 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/LyXView.C,v
346 retrieving revision 1.51
347 diff -u -a -u -r1.51 LyXView.C
348 --- src/frontends/LyXView.C 13 Apr 2005 09:43:57 -0000 1.51
349 +++ src/frontends/LyXView.C 18 Apr 2005 17:37:02 -0000
352 #include <boost/bind.hpp>
354 -#include <sys/time.h>
356 +# include <sys/time.h>
361 Index: src/frontends/qt2/QLyXKeySym.C
362 ===================================================================
363 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QLyXKeySym.C,v
364 retrieving revision 1.32
365 diff -u -a -u -r1.32 QLyXKeySym.C
366 --- src/frontends/qt2/QLyXKeySym.C 7 Jul 2004 09:32:19 -0000 1.32
367 +++ src/frontends/qt2/QLyXKeySym.C 18 Apr 2005 17:37:02 -0000
371 // when no document open
372 - encoding_map[""] = QTextCodec::codecForLocale();
373 + encoding_map[std::string()] = QTextCodec::codecForLocale();
375 encoding_map["iso8859-1"] = QTextCodec::codecForName("ISO 8859-1");
376 encoding_map["iso8859-2"] = QTextCodec::codecForName("ISO 8859-2");
377 Index: src/support/filetools.C
378 ===================================================================
379 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
380 retrieving revision 1.207
381 diff -u -a -u -r1.207 filetools.C
382 --- src/support/filetools.C 18 Apr 2005 17:43:11 -0000 1.207
383 +++ src/support/filetools.C 19 Apr 2005 10:11:54 -0000
384 @@ -1052,6 +1051,11 @@
386 cmd_ret const RunCommand(string const & cmd)
389 + // TODO: Implement this, or merge it into forkedcall.
390 + // Used for lyx2lyx in buffer.C, echo in math_extern and kpse in this file
391 + return make_pair(-1, string());
393 // FIXME: replace all calls to RunCommand with ForkedCall
394 // (if the output is not needed) or the code in ispell.C
395 // (if the output is needed).
396 @@ -1092,6 +1096,7 @@
397 sigprocmask(SIG_SETMASK, &oldMask, 0);
399 return make_pair(pret, ret);
404 Index: src/support/globbing.C
405 ===================================================================
406 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/globbing.C,v
407 retrieving revision 1.11
408 diff -u -a -u -r1.11 globbing.C
409 --- src/support/globbing.C 26 Nov 2004 14:37:40 -0000 1.11
410 +++ src/support/globbing.C 19 Apr 2005 08:09:32 -0000
415 +#if !defined (_WIN32)
417 #include "support/globbing.h"
418 #include "support/path.h"
422 } // namespace support
426 Index: src/support/os_win32.C
427 ===================================================================
428 RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v
429 retrieving revision 1.27
430 diff -u -r1.27 os_win32.C
431 --- src/support/os_win32.C 2005/01/21 22:08:59 1.27
432 +++ src/support/os_win32.C 2005/02/17 18:19:25
434 // Close the console when run (probably)
435 // not run from command prompt
436 char WindowTitle[1024];
438 - GetConsoleTitle(WindowTitle,1024);
439 + if (GetConsoleTitle(WindowTitle, sizeof(WindowTitle)) == 0) {
440 + // Could not get the title, so we just leave things as they are
443 if ((strcmp(WindowTitle, argv[0]) == 0) ||
444 - (strcmp(WindowTitle,"LyX") == 0)) {
445 + (strcmp(WindowTitle, "LyX") == 0)) {
446 // format a "unique" newWindowTitle
447 - wsprintf(WindowTitle,"%d/%d",
448 + wsprintf(WindowTitle, "%d/%d",
450 GetCurrentProcessId());
451 // change current window title
452 @@ -102,10 +104,11 @@
453 // ensure window title has been updated
455 // look for newWindowTitle
456 - hwndFound=FindWindow(NULL, WindowTitle);
457 + HWND hwndFound = FindWindow(NULL, WindowTitle);
459 - if ( hwndFound != NULL)
460 + if ( hwndFound != NULL) {
461 ShowWindow( hwndFound, SW_HIDE);
466 Index: src/support/socktools.C
467 ===================================================================
468 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/socktools.C,v
469 retrieving revision 1.6
470 diff -u -a -u -r1.6 socktools.C
471 --- src/support/socktools.C 20 Jan 2005 15:38:14 -0000 1.6
472 +++ src/support/socktools.C 19 Apr 2005 08:09:40 -0000
478 #include <sys/socket.h>
485 // special file 'name' will be created in the filesystem.
486 int listen(string const & name, int queue)
489 int fd; // File descriptor for the socket
490 sockaddr_un addr; // Structure that hold the socket address
492 @@ -105,14 +108,17 @@
493 lyx::support::unlink(name);
503 // Returns a file descriptor for a new connection from the socket
504 // descriptor 'sd' (or -1 in case of error)
510 // Returns the new file descriptor or -1 in case of error
520 } // namespace socktools
521 Index: src/support/tempname.C
522 ===================================================================
523 RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/tempname.C,v
524 retrieving revision 1.25
525 diff -u -a -u -r1.25 tempname.C
526 --- src/support/tempname.C 20 Jan 2005 15:38:14 -0000 1.25
527 +++ src/support/tempname.C 19 Apr 2005 08:09:40 -0000
529 # include <sys/stat.h>
536 using boost::scoped_array;
541 #if defined(HAVE_MKSTEMP)
542 return ::mkstemp(templ);
543 +#elif defined(_WIN32)
545 + return (int) ::fopen(templ, "w");
546 #elif defined(HAVE_MKTEMP)
547 // This probably just barely works...
551 string const tmpdir(dir.empty() ? package().temp_dir() : dir);
552 string tmpfl(AddName(tmpdir, mask));
554 tmpfl += convert<string>(getpid());
558 // The supposedly safe mkstemp version
560 int const tmpf = make_tempfile(tmpl.get());
562 string const t(tmpl.get());
564 + ::fclose((FILE *) tmpf);
568 lyxerr[Debug::FILES] << "Temporary file `" << t
569 << "' created." << endl;