Remove remaining OS/2 bits:

* src/lyx_cb.C
	(newFile): Remove OS/2 code

	* src/lyxserver.C
	(LyXComm::startPipe): ditto
	(LyXComm::endPipe): ditto
	(LyXComm::send): ditto

	* src/support/rename.C
	(lyx::support::rename): ditto

	* src/support/filetools.C
	(fileOpenSearch): ditto
	(createTmpDir): ditto
	(createLyXTmpDir): ditto
	(makeAbsPath): ditto

	* src/support/getcwd.C
	(l_getcwd): ditto

	* src/support/forkedcall.C
	(Forkedcall::generateChild): ditto

	* src/support/chdir.C
	(lyx::support::chdir): ditto

	* src/support/os.C: ditto
	* configure.ac: ditto
	* development/scons/scons_utils.py: ditto
	* development/Win32/config.h: ditto

	* lyx.man: Remove OS/2 related stuff
	* lib/doc/Customization.lyx: ditto
	* lib/doc/fr_Customization.lyx: ditto
	* lib/doc/it_Customization.lyx: ditto

	* src/support/os2_defines.h: Remove
	* src/support/os2_errortable.h: ditto
	* src/support/os_os2.C: ditto
	* INSTALL.OS2: ditto
	* README.OS2: ditto
	* development/OS2/quick_fix.patch: ditto
	* development/OS2/gnugettext.diff: ditto
	* development/OS2: ditto

	* src/support/Makefile.am: Remove deleted files
	* development/Makefile.am: Remove deleted OS2 directory


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13848 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-05-14 17:00:53 +00:00
parent 029fe9fcd0
commit 479abc6efd
24 changed files with 10 additions and 1803 deletions

View File

@ -1,520 +0,0 @@
INSTALL.OS2 file for OS/2 version of LyX 1.1.3
by Shigeru Miyata <miyata@kusm.kyoto-u.ac.jp>
modified by Arnd Hanses <Arnd.H.Hanses@rz.ruhr-uni-bochum.de>
##############################################################
- This INSTALL.OS2 file is a more detailed step by step guide on
installing (or compiling) LyX and related useful (or even
necessary) optional programs on OS/2.
- For general information on LyX please refer to the generic
README and README.OS2. For generic compilation instructions
refer to INSTALL. NEWS also contains important information.
Thanks to all contributors to this piece of documentation,
namely Mika Kristian Laitio <lamikr@cc.jyu.fi>.
I hope this will make live a bit easier for OS/2 LyXers.
Happy LyXing!
CONTENTS:
========
A. Installation Details
I. Requirements/Optional Software
1) XFree/2
2) xpm.dll library (depends on distribution)
3) 'GNU file utilities' and 'sed'
4) LaTeX and 'dvips' (Options)
5) 'Xdvi', 'gs', 'ghostview' or 'gv' (Options)
6) 'perl' (Option)
7) 'man' and 'gnugroff' (Options)
II. Installing a Binary Distribution
B. Compiling/Installing the Source Distribution
A. Installation Details:
------------------------
* Introduction:
------------
LyX and related programs have been ported from UNIX, following
the UNIX design philosophy to do complex tasks combining small
external standard utilities.
UNIX is designed as a multi user system, where a professional
system administrator maintains applications. On a single user
workstation the user has to do this complicated job. Often
programs assume you are familiar with the details of the UNIX
standard. Even if documentation therefore seems complicated,
you should try to read all the documents, UNIX manual (man)
pages and FAQ a program supplies.
I. Requirements/Optional Software:
------------------------------
1) XFree86 for OS/2
----------------
Use only a current version. Check
http://www-set.gmd.de/~veit/os2/xf86os2.html
An OS/2 specific FAQ answering most of the questions about
using XFree86/2 is found always up to date at:
http://www-set.gmd.de/~veit/os2/xf86os2.html
2) 'xpm.dll' library (if indicated in README.bin)
-----------------
Check hobbes for 'xpm', or:
http://set.gmd.de/~veit/os2/xf86plib.html
3) 'sed' and 'GNU utilities' (Option)
-------------------------
- Required: 'sed.exe'
- Optional: 'groff.exe' for ASCII text export, 'GNU text
utilities', 'man' to read man/man1/lyx.1.
You can search for OS/2 ports of those standard UNIX utilities on:
Hobbes or ftp.leo.org
in unix or gnu directories. Put the executables into a directory
in PATH, e. g.:
d:\bin
(Hint: Often ports assume a UNIX-like 'sh.exe' in '\bin'!)
and put the dll's into a directory in LIBPATH.
4) 'LaTeX' and 'dvips' (Option)
-------------------
You will need them for printable output. With emTeX make sure that
you have latex2e.cmd in \emtex\bin-directory. If it is missing (i.
e. if you installed emtex from emtex-bin-os2.zip) create it using
the following commands from \emtex\doc\english:
cd \emtex\btexfmts
makefmt 386 latex2e US 8bit -b \emtex\bin\latex2e
Now you can print US-english text. If LyX cannot find the files
'latex.cmd' or 'latex2e.cmd' (available if your LaTeX is installed
correctly) it will work with standard options. Then you can use it
as an editor to write files in native (*.lyx) and LaTeX (*.tex)
format. You can later print LaTeX files on every system with a
proper LaTeX2e installation (or send them to your editor).
* A preconfigured version of emTeX may be found searching:
http://tsikora.tiac.net/os2/os2-body.html
for 'emTeX'. Install first 'emTeX' and then unzip 'dvips583' into
your emtex root directory.
* Additional TeX macros for special purposes (e. g. Babel) are
available on your local CTAN mirror. There you will find also the
documentation how to install it. Please read Help->LaTeXconfig for
availability of the LaTeX packages after installing LyX.
Babel is - unlike with almost all other recent TeX distributions -
not standard with emTeX. For non-US languages you can install Babel
and recreate the LaTeX format files with the correct languages
after selected, reading the respective original documentation. All
further problems should be discussed with the author (Eberhard
Mattes) and on emTeX list.
* In Germany I recommend:
ftp://ftp.dante.de/tex-archive/help/Catalogue/catalogue.html
as the starting point for browsing CTAN. Dvips is also available
on:
http://www.leo.org/pub/comp/os/os2/leo/emTeX/contrib/index.html.
5) 'Xdvi', 'gs', 'ghostview' or 'gv' with 'xaw3d' (Options)
----------------------------------------------
* For fast preview you need XDVI.
[Excerpt from Peter Ganten's README.OS2 (missing in the package):
....
-- Xdvi now understands drive letters and semicolons as path
separators
-- Xdvi is now compiled with the SEARCH-SUBDIRECTORIES flag
-- Xdvi will now call ghostscript to display postscript-pictures (see
note below)
-- MakeTeXPk.cmd will now look into your psfonts.map file and call
gsftopk to display postscript fonts
-- Xdvi will now use virtual fonts ... ]
* For perfect preview of the printed
output of LyX you need ghostview or gv (the latter needs xaw3d.dll
being renamed to xaw.dll) and a special version of Ghostscript for
X11. (The standard 'gsos2' lacks '-sDEVICE=x11' and will *not*
work!).
* OS/2 ports (and necessary info) can be found using the links in:
http://www-set.gmd.de/~veit/os2/xf86ported.html,
and Ghostscript in Michael Holzapfel's page:
http://www.ime.rwth-aachen.de/~michael/os2/ghostscript/index.html.
* Configuration of EmTeX and XDVI to work poperly is a bit tricky,
as they use different directory structures and syntax:
- You can export documents in tex format and preview later with
emTeX's tools.
- Else you must unzip 'xdvi.zip' and 'xaw3d.zip' in %x11root%. Then
correct the line
mapfile='d:\emtex\data\dvips\psfonts.map'
in 'MakeTeXpk.cmd' so that it points to the psfonts.map file
which came with dvips*.zip'. You will find this 'MakeTeXpk.cmd'
in
%x11root%\xfree86\bin
SET XDVIFONTS to your upper TeX fonts directory 'foo':
SET XDVIFONTS=x:/foo/*/%ddpi/%f.%p
The asterisk means: search subdirectories and will be expanded,
e.g. to
x:/foo/pixel.lj/300dpi/fontname.pk
For preview of Postscript fonts (Type 1) you need the
corresponding virtual fonts und must use SET XDVIVFS like above:
SET XDVIVFS=D:/foo/vf;D:/foo/vf/adobe
There is no possibility to search subdirectories here, so you have
to list all directories with virtual fonts.
* Gv needs to find gs.exe: You should rename gsos2.exe to gs.exe,
and move the executables and the dll to %PATH%. [According to the
original documentation moving the dll to %LIBPATH% should work as
well. But on my system it doesn't.] Also you should add to
config.sys:
SET GS_LIB=x:/path_to_your_gs2dll.dll;*.ps_helper_files;type_1fonts
SET GS_FONTPATH=path_to_aditional_fonts_not_included_in_fontmap
For details please refer to the (often complicated) docs of the
respective packages.
Here an example:
...
SET GS_LIB=D:/HYOTY/GSTOOLS/gs5.50;E:/PSFONTS;
SET GS_FONTPATH=D:/APPS/GSTOOLS/gs5.50/FONTS;E:/PSFONTS;
rem This is where EmTeX tree begins
SET EMTEXDIR=D:\EMTEX
rem This is where Xdvi/dvips look for fonts (bitmap, virtual, type1
fonts, resp.)
SET XDVIFONTS=D:/texfonts/*/%ddpi/%f.%p
SET XDVIVFS=D:/texfonts/vf/%f.vf
SET T1FONTS=D:\PSFONTS;D:\XFREE86\LIB\X11\FONTS\TYPE1;
SET TEXCONFIG=D:/EMTEX/data/dvips
rem TeX/LaTeX has to find its font metrics (*.tfm)
SET TEXTFM=D:\EMTEX\tfm!!
rem TeX/LaTeX has to find its macros, etc. (*.sty; *.cls; *.tcp; etc.)
SET TEXINPUT=D:\EMTEX\TEXINPUT\LATEX2E!!;D:\EMTEX\TEXINPUT!!
rem This is where dvipm/Xdvi looks for input data to preview
SET DVIDRVinput=D:\EMTEX\doc;D:\EMTEX\doc\latex;D:\EMTEX\doc\english;
SET DVIDRVGRAPH=D:\EMTEX\DOC
SET XDVIFIGS=D:/EMTEX/data/dvips;D:/HYOTY/GSTOOLS/gs5.50;E:/PSFONTS;
SET indexstyle=D:\emtex\idxstyle
rem Call mf386.exe to render missing bitmap fonts
SET MFJOBOPT=/3
SET indexstyle=D:\XFREE86\USR\emtex\idxstyle
SET EMTEXED=emacsclient +%1 %2
rem Where chktex stores its user configuration
SET chktexrc=%home%
.......
Do not copy it! You need to adapt it to your directory structure.
6) 'man' and 'gnugroff':
--------------------
For reading unformatted manual pages in UNIX 'roff' format like the
ones coming with LyX you need 'manxxx.zip' and 'gnugroff.zip', both
available from www.leo.org.
Hint:
----
gnugroff.zip (README.OS2 date: Feb 24th 1994) from Leo has a little
bug concerning doc macros:
Please change file prefix and suffix in groff/tmac/mdoc directory to
the following:
doc-common
doc-ditroff
doc-nroff
doc-syms
or adapt the content of
groff\tmac\doc
accordingly, so that it will find the distribution macros with
non-standard names.
My proposed settings for man and groff are:
rem path to font directory
SET GROFF_FONT_PATH=D:/USR/local/lib/GROFF/FONT
rem path to tmac directory
SET GROFF_TMAC_PATH=D:/USR/local/lib/GROFF/TMAC
SET REFER=D:/XFREE86/USR/local/lib/GROFF/DICT/PAPERS/IND
rem system primary codepage
SET GROFF_TYPESETTER=cp850
rem where man finds it manual pages
SET MANPATH=D:/XFREE86/MAN;D:/XFREE86/usr/emx/doc/MAN
rem necessary for correct formatting of BSD man pages
set NROFF=GROFF -Tascii -mandoc
II. Installing a Binary Distribution:
--------------------------------
0) Only for update: If you are upgrading from LyX v. 0.12.0,
old documentation files in %HOME%/.lyx/doc/ and
%X11ROOT%/XFree86/lib/X11/lyx/doc should be removed before
unpacking (since they are read only). You might wish to make
a backup, if you want to keep old docs.
1) Unpack the distribution in the directory %X11ROOT%
2) In config.sys SET LANG and LANGUAGE according to
your preferences and restart.
Beware: All programs supporting local
languages will be affected, e.g.:
SET LANG=de_DE rem german helpfiles will be used
SET LANGUAGE=de_DE rem german menus and messages
Note1: For keyboard problems read the XFree documentation. Lyx
helpfiles also contain several hints.
Note2: German users should always use Layout; Document; Language:German
and Encoding:latin1 to avoid problems with special characters.
This might apply to other languages, too.
Note3: As distributed, LyX expects to find
its internationalization files in the directory
%X11ROOT%/XFree86/lib/X11/locale
its system configuration files in the directory
%X11ROOT%/XFree86/lib/X11/lyx
If you unpacked the distribution in directory c:\foo, add
the environment variables LYX_LOCALEDIR and LYX_DIR_11x
to config.sys to point to c:/foo/XFree86/lib/X11/locale and
c:/foo/XFree86/lib/X11/lyx as follows:
SET LYX_LOCALEDIR=c:/foo/XFree86/lib/X11/locale
SET LYX_DIR_11x=c:/foo/XFree86/lib/X11/lyx
Note that, if you do not have any interest in having LyX display
its messages in other languages than english, you can safely
skip this step for LYX_LOCALEDIR.
3) At the root of the drive where your %HOME% resides, create a
directory named tmp, if you haven't got one. LyX will need it, so
remember not to delete it later.
4) If updating make a backup of %HOME%\.lyx\lyxrc.defaults as it will
be changed.
Read README and NEWS about updating and run
Options;Reconfigure as indicated.
5) Configure LyX for your system by executing
lyx
and choose Options->Reconfigure in the menu bar.
Watch the messages there.
6) If you don't have %HOME%\.lyx\lyxrc now then move
%X11ROOT%\XFree86\lyxrc.example to %HOME%\.lyx\lyxrc.
Verify if LYX is able to find the programs mentioned
there and in %HOME%\.lyx\lyxrc.defaults. If not,
change name and path as required. Read LyX doc in
Help->Customization
about customizing LyX for your needs. Read
Help->LatexConfiguration
to verify that all installed LaTeX packages which LyX can use
have been detected.
Remember to repeat the check after any 'Reconfigure'!
7) Printer setup is difficult. The most simple solution is to print to a
postscript file and the use gvpm for printing. If you have installed
'printlp.exe' of 'gnugroff.zip' from 'ww.leo.org', you could try to
directly print to the local OS/2 spooler:
Excerpt from 'gnugroff.zip' README.OS2:
- New printlp and printdvi programs: Printlp captures all stdin input
and spools it to "lpt1" (default) or the output device set in the
environment variable LP_DEVICE. Printdvi captures all stdin input
into a temporary file and calls the command "v" with the name as
argument (v is the viewer in emTeX) or the command in the
environment variable DVI_PRINT_COMMAND. If the command contains a
%s, this will be replaced by the temporary file name.
I recommend to add to config.sys
SET DVI_PRINT_COMMAND=VP
and to add to your lyxrc
\print_spool_command "printdvi"
or printlp for postscript printer or if you already configured a
postscript filter according to the LyX documentation. A different solution
to try is this one from Marcus von Cube (for xephem): Create an
/* xprint.cmd */
parse arg file
file = translate( file, "\", "/" )
'@print /d:lpt2 /b' file
(you may want to change "print /d:lpt2 /b" to "printdvi") or create a
LPR-Installation:
If your %ETC%\INETD.LST contains the following line:
printer tcp lpd
and inetd is running, you should be able to use lpr:
lpr -s localhost -p lpt2 -b <filename>
It accepts "/" as path seperator.
This would mean adding
\print_spool_command "lpr"
\print_spool_printerprefix "-s localhost -p lpt2 -b"
=======================================================================
B. Compiling/Installing the source distribution with emx:
-----------------------------------------------------
++++to be written++++++
Some hints:
Run configure.cmd from top level lyx-xxx directory of the source distribution.
To create a smaller stripped version optimized for pentium on emx 0.9c type:
configure.cmd --pentium-optimize
1,368,068 bytes (1.0.1 on emx 0.9c)
To create a smaller english-only version type:
configure.cmd --disable-nls --pentium-optimize
and then type
cd src
x11make
I recommend to run
lib\configure.cmd --without-latex-config.
The LaTeX configuration should better made when running LyX the first
time and can always be repeated with Menu: Options->Reconfigure. So I
added --without-latex-config to the call at the end of top configure.cmd.
Run the following if you have tee.exe:
configure.cmd 2>&1|tee errors.log
or
configure.cmd --pentium-optimize 2>&1|tee errors.log
Read the logfile for any problems:
cd.. & e errors.log
I recommend the following compilation settings:
set CC=gcc
set CONFIG_SHELL=d:/bin/sh.exe
set MAKE_SHELL=d:/bin/sh.exe
set EMX_FIX_CMD="emxbind -a \$@ ..."
SET C_INCLUDE_PATH=D:/XFREE86/INCLUDE/X11;d:/XFREE86/usr/emx/include
set CPLUS_INCLUDE_PATH=D:/XFREE86/INCLUDE/X11;d:/XFREE86/usr/emx/include/cpp;d:/XFREE86/usr/emx/include
set OBJC_INCLUDE_PATH=D:/XFREE86/INCLUDE/X11;d:/XFREE86/usr/emx/include
SET LIBRARY_PATH=D:/XFREE86/LIB/X11;d:/XFREE86/usr/emx/lib
set PROTODIR=d:/XFREE86/usr/emx/include/cpp/gen
set GCCLOAD=5
set GCCOPT=-pipe
set emxopt=-c
set MAKE=x11make.exe
set shell=/bin/sh
Now you can run
x11make
directly from toplevel source directory.
Note by Shigeru Miyata <miyata@kusm.kyoto-u.ac.jp>:
----------------------
Run configure.cmd rather than configure! Notice it is not the
one in binary package, which is actually lib/configure.cmd, but
the one in the top directory of the source distribution.
It won't check the xpm version and other things BTW since I think
I can assume rather uniform installations on OS/2 (actually the
outdated error of the sh-script comes from an old header file,
not from the library, though. Remove the incompatible header or
you will experience very weird, hard to track crashes).
Makefiles are not perfect, however:
- You have to type make in src/ directory;
- If you do not specify --disable-nls, you have to make libintl
first;
- make install/bindist won't work, the makefile in po/ directory
not generated;
- In order to link xforms statically, "-lforms" in LYX_LIBS flag
must be modified manually to "-lforms_s -lulib -lsocket";
- And probably more ;-(
Here is a statistic (exact size depends on libraries used,
codepage, etc.):
unstripped stripped
emx09c 10,735,882 1,634,308
emx09d 15,938,707 2,899,972
emx09d (-fno-exceptions) 13,246,507 1,519,620
In LyX 1.2, g++-2.8 (emx09d) or later will be the definite
requirement. (You cannot link 1.1 with emx09c, since the
executable size far exceeds 70M unstripped due to template codes,
for example.)


View File

@ -1,267 +0,0 @@
These are temporary instructions from Shigeru Miyata <miyata@kusm.kyoto-u.ac.jp>
===========================================================================
(The top level) configure.cmd is obsoleted by. Please follow the
step like this:
1. Install GNU m4, gnu?utils, aclocal/2, autoheader/2, automake/2,
autoconf/2, perl, GNU patch and a UNIX type shell like pdksh.
2. Apply the patch development/OS2/quick_fix.patch
// os2_defines.h needs a modification because bmtable.c is C.
// Now it hits me, why don't we patch "test -x" (gnufutils)?
// However, we can't modify the behavior of "test -f", so
// it is still necessary to modify script files for LyX.
3. Install xforms 0.88 and rename
forms.a -> forms_d.a
forms_s.a -> forms.a
// Ever since 1.1.5pre1, you cannot link xforms 0.88 dynamically.
// If you don't like this, please ask Holger Veit to export
// fl_get_scrollbar_bounds, fl_get_scrollbar_increment and
// fl_get_scrollbar_value from the DLL. They're already there!
// I will try to release xforms 0.89 ASAP.
4. Install Hung-Chi Chu's port of GNU gettext. Other ports will
not work.
5. Set environment variables
MAKE_SHELL=sh
LIBS=-lulib -lsocket -lbsd -lshm -lstdcpp
CXXFLAGS=-g -O2 -m486 -Zmt -DOS2 -fno-rtti -fno-exceptions
// ulib must be linked if we use static xforms library 0.88.
// If xforms 0.89 is used -lulib must be removed from above.
// Unless you are using pgcc, we use gcc rather than g++.
// Hence stdc++ must be linked explicitely. Also please
// note that ld for pgcc often fails to link big executables
// like unstripped lyx.exe
// Due to a bug (actually a limitation) of autoconf/2,
// you have to set CXXFLAGS explicitely in order to compile
// CVS version newer than 11 Oct. 2000.
6. From sh prompt, type
autogen.sh; rm -f config.cache
and then
configure --prefix=/XFree86 --datadir=/XFree86/lib/X11 --with-included-string
x11make
// Please do not use make.cmd make.exe should be OK.
// x11make.exe is the safest choice
// While you are running configure, make sure that it is not
// a background process to other CPU intensive processes.
// While OS/2 kernel is much more efficient, faster and
// more responsive than other systems like LINUX (you can
// easily *FEEL* this if you stop PM/WPS and run XFree86
// only), its TTY interface is lousy, to say the least.
// If the synchronization to the children breaks, configure
// often detects wrongfully.
7. If you are going to make a binary distribution, you have
to prepare lib/configure.cmd noweb2lyx.cmd and reLyX.cmd,
since end users may not have a UNIX type shell installed.
In order to create noweb2lyx.cmd and reLyX.cmd, first rename
noweb2lyx and reLyX and open them in a text editor. You
have to remove hardcoded path in the first line:
#!perl
Also in reLyX.cmd, $lyxdir should be changed to include the
drive letter (the line 21):
$lyxdir = "$ENV{X11ROOT}/XFree86/lib/X11/lyx";
Finally, prepend a line
extproc perl.exe -S
so that cmd.exe pass the execution control to perl.
// I know configure.cmd had done this automatically.
// So you can compare the result with the scripts in 1.0.4
// distribution.
===========================================================================
README file for OS/2 version of LyX 1.0.1
by Shigeru Miyata <miyata@kusm.kyoto-u.ac.jp>
modified by Arnd Hanses <Arnd.H.Hanses@rz.ruhr-uni-bochum.de>
##############################################################
- This README.OS2 addresses experienced users of XFree86 and
LyX on OS/2 and covers in very short form the steps for
updating (installing) LyX.
- For general information on LyX please refer to the generic
README. For generic compiling instructions refer to INSTALL.
- For a more detailed step by step guide on installing (or compiling)
LyX and other related useful (or even necessary) optional programs
on OS/2 please refer to INSTALL.OS2. If you are not already an
experienced user of LyX an OS/2 you are advised to read it.
- For a description of the binary distribution and any necessary
support libraries please refer to README.bin, which comes with the
binary distribution.
LyX has been ported to OS/2 with XFree86 by Shigeru Miyata and
has been installed and used successfully by many people.
Unfortunately there is yet no easy to install and complete distribu-
tion of XFree86-related software for OS/2. Despite increasing popula-
rity of X on OS/2, extensive printed documentation about XFree/2 and
related programs like LyX is still not available. So you will
have to study the available documentation (man pages, READMEs, faq,
etc.) thoroughly to avoid unnecessary grief for you and for other
people, trying to help you on the net. Nevertheless, there are
existing tutorials and manuals covering X on UNIX family operating
systems, which do contain some valuable information even for X on
OS/2.
[A hint as a starting point for users speaking German:
http://www.rrzn-uni-hannover.de/Umdrucke/WSC.5/WSC5_1.html].
This release is considered to be stable for general use, but - like
any other piece of software - certainly is not bug free.
So take the usual precautions like adopting a regular backup policy.
Standard disclaimers of non liability apply.
As this is a voluntary project with a large number of contributions
by many people, hints and bug fixes to the program and/or the
documentation are always appreciated and thoroughly considered. If
you have the necessary skills (or want to take the chance to acquire
them) for programming in LaTeX or C++ you can become a LyX developer.
You can support further development by making a donation, if you feel
that LyX made your live a bit easier or you want to support open source
software.
Please refer to the links at www.lyx.org for details.
==============================================================
A. Quick Update:
------------
0) Only for update: If you are upgrading from LyX v. 0.12.0,
any old documentation files in %HOME%/.lyx/doc/ and
%X11ROOT%/XFree86/lib/X11/lyx/doc should be removed before
unpacking (since they are read only). You might wish to make
a backup, if you want to keep old docs.
1) Unpack the archive at %X11ROOT%.
2) Run lyx and let the program copy configuration files to
%HOME%\.lyx\.
3) If you don't have %HOME%\.lyx\lyxrc then move
%X11ROOT%\XFree86\lyxrc.example to %HOME%\.lyx\lyxrc.
If updating, make a backup of old version, if you want.
Read README and WHATSNEW about updating and run
Options->Reconfigure as indicated.
4) Verify if LYX is able to find the programs mentioned
in %HOME%\.lyx\lyxrc and in %HOME%\.lyx\lyxrc.defaults; if not,
change name and path as required.
Note: Remember to repeat the check after any 'Reconfigure'!
5) In config.sys SET LANG and LANGUAGE according to
your preferences. Beware: All programs supporting local
languages will be affected, e.g.:
SET LANG=de_DE rem german helpfiles will be used
SET LANGUAGE=de_DE rem german menus and messages
6) Restart OS/2 and run LyX. Have fun!
B. Help/Problems:
-------------
* Please refer to the manpage (type 'man lyx' on the command line or
use 'xman')
* If you encounter apparently OS/2 specific bugs, (i.e. bugs not
already mentioned in the documentation or the buglist) you can report
them to the XFree86/OS2 mailing list as well as to the LyX developer
mailing list.
* For any questions on using LyX please subscribe to the the LyX user
mailing list.
- To subscribe to the XFree86 mailing list send mail to
majordomo@borneo.gmd.de
with "subscribe" as the subject.
To contribute to the mailing list, mail to
xfreeos2@borneo.gmd.de
- For subscription to lyx-user list (general help on LyX) go to
http://www.lyx.org
and search for subscription info.
* Hints:
-----
1. To prevent 'file not found' with EmTeX and some non-US versions
of Warp, I recommend:
1) In filenames use only A-Z, a-z, 1-9.
2) Use a recent LaTeX package inputenc.sty. Select
Layout->Document->Encoding:latin1, so that LyX adds
the LaTeX command '\usepackage[latin1]{inputenc}'.
2. LaTeX import occasionally produces buggy *.lyx files. LyX tries
to save data in case of problems (and does a good job here),
but I recommend:
To import LaTeX close down and restart LyX (or close all
documents, you are working on) and try the import, so that
in case of any problems none of your existing documents will
be affected.
3. Inline preview of inline images sometimes does not show the
image: If you want to preview the image, just click on it and
select fullscreen preview.
4. Some XFree/2 programs (as ported from UNIX) expect a sh.exe
in \bin directory: I recommend to install sh.exe of pdksh.zip
in x:\bin (x: drive of %X11ROOT%). To work around problems you
can try the commands
set EMXSHELL=x:\bin\sh.exe
before starting the programs. As far as I know, LyX runs without
problems in this way.
Some suggestions in case of problems:
------------------------------------
1) Please check, if your x:\xfree86\lib does appear correctly in
libpath.
2) Please check against the file list, if you did install all files of
the distribution.
3) Remove all installed files and
%.home%/.lyx/
and perform a
chkdsk /f
and a consistency check of your lyx binary package (unzip -tv
foo.zip).
4) Reinstall the complete package and check out if everything appears,
no truncated files, no crc errors, etc.
5) Run
lyx -dbg 1026 >lyxerrors.log 2>&1
or, if you have tee.exe,
lyx -dbg 1026 2>&1|tee lyxerrors.log
and watch out for any error messages. Report any remaining problems.
As this is a completely voluntary project, everybody involved will be
grateful for user efforts like detailed bug reports, suggestions,
fixes, additions to the documentation, etc.
6) Have fun! (I'm sure).
C. Tips for Advanced Users:
-----------------------
* You can start LyX automatically by adding
'start/min/n xconsole.exe'
'set EMXSHELL=x:\bin\sh.exe'
'start/min/n lyx >/dev/console$ 2>&1'
to xinitrc.cmd before the line that invokes the
window manager, so that LyX' messages appear in the
console window and LyX appears in the pm-task list.
* You can start LyX automatically by adding
'detach xconsole.exe'
'detach lyx >/dev/console$ 2>&1'
to xinitrc.cmd before the line that invokes the
window manager, so that LyX' messages appear in the
console window and LyX does not appear in the PM task list.

View File

@ -379,10 +379,6 @@ int mkstemp(char*);
#endif #endif
#endif #endif
#ifdef __EMX__
# include "support/os2_defines.h"
#endif
#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM) #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
# define USE_BOOST_FORMAT 1 # define USE_BOOST_FORMAT 1
#else #else

View File

@ -2,5 +2,5 @@ include $(top_srcdir)/config/common.am
EXTRA_DIST = boostworkaround.txt ChangeLog Code_rules FORMAT \ EXTRA_DIST = boostworkaround.txt ChangeLog Code_rules FORMAT \
gettext.patch lazy_lyxtext.txt lyx3 lyx.rpm.README \ gettext.patch lazy_lyxtext.txt lyx3 lyx.rpm.README \
lyxserver lyx.spec.in lyx.spec MacOSX OS2 Seminar.txt \ lyxserver lyx.spec.in lyx.spec MacOSX Seminar.txt \
TodoPlan-1.3 tools Win32 TodoPlan-1.3 tools Win32

View File

@ -1,172 +0,0 @@
diff -ub intl.orig/bindtextdom.c intl/bindtextdom.c
--- intl.orig/bindtextdom.c Thu Aug 28 09:18:18 1997
+++ intl/bindtextdom.c Fri Apr 10 10:40:36 1998
@@ -94,15 +94,15 @@
if (dirname == NULL)
/* The current binding has be to returned. */
- return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+ return binding == NULL ? (char *) strdup(__XOS2RedirRoot(_nl_default_dirname)) : binding->dirname;
if (binding != NULL)
{
/* The domain is already bound. Replace the old binding. */
char *new_dirname;
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_dirname = (char *) _nl_default_dirname;
+ if (strcmp (dirname, __XOS2RedirRoot(_nl_default_dirname)) == 0)
+ new_dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
else
{
size_t len = strlen (dirname) + 1;
@@ -113,7 +113,7 @@
memcpy (new_dirname, dirname, len);
}
- if (strcmp (binding->dirname, _nl_default_dirname) != 0)
+ if (strcmp (binding->dirname, __XOS2RedirRoot(_nl_default_dirname)) != 0)
free (binding->dirname);
binding->dirname = new_dirname;
@@ -134,8 +134,8 @@
return NULL;
memcpy (new_binding->domainname, domainname, len);
- if (strcmp (dirname, _nl_default_dirname) == 0)
- new_binding->dirname = (char *) _nl_default_dirname;
+ if (strcmp (dirname, __XOS2RedirRoot(_nl_default_dirname)) == 0)
+ new_binding->dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
else
{
len = strlen (dirname) + 1;
diff -ub intl.orig/dcgettext.c intl/dcgettext.c
--- intl.orig/dcgettext.c Thu Aug 28 09:18:20 1997
+++ intl/dcgettext.c Fri Apr 10 10:40:34 1998
@@ -154,6 +154,7 @@
const char *_nl_current_default_domain = _nl_default_default_domain;
/* Contains the default location of the message catalogs. */
+
const char _nl_default_dirname[] = GNULOCALEDIR;
/* List with bindings of specific domains created by bindtextdomain()
@@ -260,8 +261,12 @@
}
if (binding == NULL)
- dirname = (char *) _nl_default_dirname;
+ dirname = (char *) strdup(__XOS2RedirRoot(_nl_default_dirname));
+#ifdef __EMX__
+ else if (binding->dirname[0] == '/' || (isalpha(binding->dirname[0]) && binding->dirname[1] == ':'))
+#else
else if (binding->dirname[0] == '/')
+#endif
dirname = binding->dirname;
else
{
@@ -326,7 +331,7 @@
while (1)
{
/* Make CATEGORYVALUE point to the next element of the list. */
- while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+ while (categoryvalue[0] != '\0' && categoryvalue[0] == PATH_SEPARATOR)
++categoryvalue;
if (categoryvalue[0] == '\0')
{
@@ -340,7 +345,7 @@
else
{
char *cp = single_locale;
- while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+ while (categoryvalue[0] != '\0' && categoryvalue[0] != PATH_SEPARATOR)
*cp++ = *categoryvalue++;
*cp = '\0';
}
diff -ub intl.orig/gettext.h intl/gettext.h
--- intl.orig/gettext.h Thu Aug 28 09:18:20 1997
+++ intl/gettext.h Wed Apr 8 15:47:08 1998
@@ -25,6 +25,12 @@
# include <limits.h>
#endif
+#ifdef __EMX__
+#define PATH_SEPARATOR ';'
+#else
+#define PATH_SEPARATOR ':'
+#endif
+
/* @@ end of prolog @@ */
/* The magic number of the GNU message catalog format. */
diff -ub intl.orig/l10nflist.c intl/l10nflist.c
--- intl.orig/l10nflist.c Thu Aug 28 09:18:22 1997
+++ intl/l10nflist.c Thu Apr 9 00:03:58 1998
@@ -222,7 +222,11 @@
/* Construct file name. */
memcpy (abs_filename, dirlist, dirlist_len);
+#ifndef __EMX__
__argz_stringify (abs_filename, dirlist_len, ':');
+#else
+ __argz_stringify (abs_filename, dirlist_len, ';');
+#endif
cp = abs_filename + (dirlist_len - 1);
*cp++ = '/';
cp = stpcpy (cp, language);
diff -ub intl.orig/libgettext.h intl/libgettext.h
--- intl.orig/libgettext.h Wed Sep 17 14:28:58 1997
+++ intl/libgettext.h Wed Apr 8 15:47:08 1998
@@ -36,6 +36,13 @@
# include <locale.h>
#endif
+#ifdef __EMX__
+#undef GNULOCALEDIR
+#define GNULOCALEDIR "/XFree86/lib/X11/locale"
+#include <X11/Xlocale.h>
+#else
+#define __XOS2RedirRoot(path) path
+#endif
#ifdef __cplusplus
extern "C" {
diff -ub intl.orig/localealias.c intl/localealias.c
--- intl.orig/localealias.c Thu Aug 28 09:18:22 1997
+++ intl/localealias.c Wed Apr 8 15:47:08 1998
@@ -72,6 +72,11 @@
#include "gettext.h"
#include "gettextP.h"
+#ifdef __EMX__
+#undef LOCALE_ALIAS_PATH
+#define LOCALE_ALIAS_PATH "/XFree86/lib/X11/locale"
+#endif
+
/* @@ end of prolog @@ */
#ifdef _LIBC
@@ -170,11 +175,11 @@
{
const char *start;
- while (locale_alias_path[0] == ':')
+ while (locale_alias_path[0] == PATH_SEPARATOR)
++locale_alias_path;
start = locale_alias_path;
- while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
+ while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR)
++locale_alias_path;
if (start < locale_alias_path)
@@ -350,6 +355,9 @@
const struct alias_map *map1;
const struct alias_map *map2;
{
+#ifdef __EMX__
+#define strcasecmp stricmp
+#endif
#if defined _LIBC || defined HAVE_STRCASECMP
return strcasecmp (map1->alias, map2->alias);
#else

View File

@ -1,257 +0,0 @@
Index: lyx-devel/config/progtest.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/progtest.m4,v
retrieving revision 1.2
diff -u -r1.2 progtest.m4
--- lyx-devel/config/progtest.m4 2000/01/08 21:02:55 1.2
+++ lyx-devel/config/progtest.m4 2001/01/01 01:09:00
@@ -11,6 +11,19 @@
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[case "`uname -s 2> /dev/null`" in
+OS/2)
+ PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+ PATH_IFS=';'
+ EXE_EXT='.exe'
+ CMD_EXT='.cmd'
+ ;;
+*)
+ PATH_IFS=':'
+ EXE_EXT=''
+ CMD_EXT=''
+ ;;
+esac]
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
@@ -20,10 +33,12 @@
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
+ if test -f $ac_dir/$ac_word \
+ -o -f $ac_dir/$ac_word$EXE_EXT \
+ -o -f $ac_dir/$ac_word$CMD_EXT; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
Index: lyx-devel/lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.17
diff -u -r1.17 configure.m4
--- lyx-devel/lib/configure.m4 2000/11/21 15:45:42 1.17
+++ lyx-devel/lib/configure.m4 2001/01/01 01:09:05
@@ -28,6 +28,19 @@
dnl
define(SEARCH_PROG,[dnl
changequote([,])dnl
+case "`uname -s 2> /dev/null`" in
+OS/2)
+ PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+ PATH_IFS=';'
+ EXE_EXT='.exe'
+ CMD_EXT='.cmd'
+ ;;
+*)
+ PATH_IFS=':'
+ EXE_EXT=''
+ CMD_EXT=''
+ ;;
+esac
MSG_CHECKING($1)
MSG_RESULT(($3))
$2=
@@ -37,10 +50,12 @@
set dummy $ac_prog ; ac_word=$[2]
if test -n "$ac_word"; then
MSG_CHECKING([for \"$ac_word\"],[+])
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$PATH_IFS"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -x [$ac_dir/$ac_word]; then
+ if test -x [$ac_dir/$ac_word] \
+ -o -x [$ac_dir/$ac_word$EXE_EXT] \
+ -o -x [$ac_dir/$ac_word$CMD_EXT]; then
$2="$ac_prog"
break
fi
@@ -180,8 +195,17 @@
fi
# Search for an installed reLyX or a ready-to-install one
+case "`uname -s 2> /dev/null`" in
+OS/2)
+save_PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+PATH_IFS=';'
+;;
+*)
save_PATH=${PATH}
-PATH=${PATH}:./reLyX/
+PATH_IFS=':'
+;;
+esac
+PATH=${PATH}${PATH_IFS}./reLyX/
SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,reLyX)
PATH=${save_PATH}
test $tex_to_lyx_command = "reLyX" && tex_to_lyx_command="reLyX -f \$\$i"
Index: lyx-devel/lib/reLyX/acinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/acinclude.m4,v
retrieving revision 1.2
diff -u -r1.2 acinclude.m4
--- lyx-devel/lib/reLyX/acinclude.m4 2000/11/07 12:07:13 1.2
+++ lyx-devel/lib/reLyX/acinclude.m4 2001/01/01 01:09:06
@@ -10,15 +10,24 @@
dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
dnl
define(RELYX_SEARCH_PROG,[dnl
+case "`uname -s 2> /dev/null`" in
+OS/2)
+ PATH=`echo -E "$PATH" | sed 's+\\\\+/+g'`
+ PATH_IFS=';'
+ ;;
+*)
+ PATH_IFS=':'
+ ;;
+esac
for ac_prog in $2 ; do
# Extract the first word of "$ac_prog", so it can be a program name with
# args.
set dummy $ac_prog ; ac_word=$[2]
if test ! -n "[$]$1"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}$PATH_IFS"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
- if test -f [$ac_dir/$ac_word]; then
+ if test -f [$ac_dir/$ac_word] -o -f [$ac_dir/$ac_word$ac_exeext]; then
$1="$ac_prog"
break
fi
Index: lyx-devel/lib/reLyX/configure.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/configure.in,v
retrieving revision 1.8
diff -u -r1.8 configure.in
--- lyx-devel/lib/reLyX/configure.in 2000/06/26 15:33:12 1.8
+++ lyx-devel/lib/reLyX/configure.in 2001/01/01 01:09:06
@@ -2,6 +2,7 @@
AC_INIT(reLyX.in)
AC_PREREQ(2.13) dnl We want to use autoconf 2.13
AC_CONFIG_AUX_DIR(../../config)
+AC_EXEEXT
dnl PACKAGE=reLyX
dnl Do this to install in $datadir/lyx/reLyX instead of $datadir/reLyX/reLyX
Index: lyx-devel/src/os2_defines.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/os2_defines.h,v
retrieving revision 1.5
diff -u -r1.5 os2_defines.h
--- lyx-devel/src/os2_defines.h 2000/11/08 09:39:44 1.5
+++ lyx-devel/src/os2_defines.h 2001/01/01 01:09:07
@@ -13,16 +13,22 @@
#ifndef OS2_DEFINES_H
#define OS2_DEFINES_H
+#if defined (__cplusplus)
#include <cctype>
-#include <process.h>
#include <cstdlib>
+extern "C" inline int readlink(const char *, char *, size_t) {return -1;}
+#else
+#include <ctype.h>
+#include <stdlib.h>
+#define readlink(s, t, l) (-1)
+#endif
+#include <process.h>
#include <unistd.h>
#include <X11/Xlocale.h>
/* #include <malloc.h> */
#define lstat stat
#define S_ISLNK(x) false
#define S_ISBLK(x) false
-#define readlink(s, t, l) (strcpy(t, s), strlen(t))
/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
#define chdir _chdir2
#define strcasecmp stricmp
Index: lyx-devel/src/support/rename.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/rename.C,v
retrieving revision 1.5
diff -u -r1.5 rename.C
--- lyx-devel/src/support/rename.C 2000/11/13 10:35:02 1.5
+++ lyx-devel/src/support/rename.C 2001/01/01 01:09:10
@@ -6,6 +6,9 @@
bool lyx::rename(string const & from, string const & to)
{
+#ifdef __EMX__
+ ::unlink(to.c_str());
+#endif
if (::rename(from.c_str(), to.c_str()) == -1)
if (lyx::copy(from, to)) {
lyx::unlink(from);
Index: lyx-devel/src/support/syscall.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/syscall.C,v
retrieving revision 1.18
diff -u -r1.18 syscall.C
--- lyx-devel/src/support/syscall.C 2000/10/11 21:06:43 1.18
+++ lyx-devel/src/support/syscall.C 2001/01/01 01:09:10
@@ -15,6 +15,7 @@
#include "syscontr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
+#include "support/filetools.h"
using std::endl;
Index: lyx-devel/src/support/tempname.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/tempname.C,v
retrieving revision 1.4
diff -u -r1.4 tempname.C
--- lyx-devel/src/support/tempname.C 2000/11/15 03:22:08 1.4
+++ lyx-devel/src/support/tempname.C 2001/01/01 01:09:10
@@ -12,6 +12,17 @@
extern string system_tempdir;
+#ifdef __EMX__
+ // EMX mkstemp() behaviour may be problematic, however,
+ // as noted by Lgb in the comment to CreateTmpDir(),
+ // there is no point for using mkstemp() here.
+#undef HAVE_MKSTEMP
+#include <sys/types.h>
+#include <sys/stat.h>
+#define INCL_DOSFILEMGR
+#include <os2.h>
+#endif
+
static inline
int make_tempfile(char * templ)
{
@@ -19,9 +30,14 @@
return ::mkstemp(templ);
#else
#ifdef HAVE_MKTEMP
+#ifdef __EMX__
+ ULONG cur = 0;
+ LONG req = 1;
+ DosSetRelMaxFH(&req, &cur); // No need to check error code.
+#endif
// This probably just barely works...
::mktemp(templ);
- return ::open(templ, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ return ::open(templ, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
#else
#warning FIX FIX FIX
#endif

View File

@ -621,10 +621,6 @@ int mkstemp(char*);
#endif #endif
#endif #endif
#ifdef __EMX__
#include "support/os2_defines.h"
#endif
#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM) #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
#define USE_BOOST_FORMAT 1 #define USE_BOOST_FORMAT 1
#else #else

View File

@ -140,10 +140,6 @@ int mkstemp(char*);
#endif #endif
#endif #endif
#ifdef __EMX__
# include "support/os2_defines.h"
#endif
#if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM) #if defined(HAVE_OSTREAM) && defined(HAVE_LOCALE) && defined(HAVE_SSTREAM)
# define USE_BOOST_FORMAT 1 # define USE_BOOST_FORMAT 1
#else #else

View File

@ -10026,28 +10026,6 @@ Warning: if LyX crashes, it may not manage to remove the pipes; in this
If LyX starts and the pipes exist already, it will not start any server. If LyX starts and the pipes exist already, it will not start any server.
\end_layout \end_layout
\begin_layout Standard
Other than this, there are a few points to consider:
\end_layout
\begin_layout Itemize
Both server and clients must run on UNIX or OS/2 machines.
Communications between LyX on UNIX and clients on OS/2 or vice versa is
not possible right now.
\end_layout
\begin_layout Itemize
On OS/2, only one client can connect to LyXServer at a time.
\end_layout
\begin_layout Itemize
On OS/2, clients must open inpipe with
\family typewriter
O_WRONLY
\family default
mode.
\end_layout
\begin_layout Standard \begin_layout Standard
You can find a complete example client written in C in the source distribution You can find a complete example client written in C in the source distribution
as as

View File

@ -8433,33 +8433,6 @@ Attention : si LyX se plante, il peut ne pas avoir enlev
Si LyX démarre et que les tubes existent déjà, il ne démarrera pas de serveur. Si LyX démarre et que les tubes existent déjà, il ne démarrera pas de serveur.
\end_layout \end_layout
\begin_layout Standard
À part ça, il y a quelques points à savoir :
\end_layout
\begin_layout Itemize
À la fois le client et le serveur doivent tourner sur des machines UNIX
ou OS/2.
Il n'est pour l'instant pas possible de communiquer entre LyX sur UNIX
et des clients sur OS/2 ou vice versa.
\end_layout
\begin_layout Itemize
Sur OS/2, un seul client à la fois peut se connecter sur le serveur LyX.
\end_layout
\begin_layout Itemize
Sur OS/2, les clients doivent ouvrir le tube d'entrée (
\family typewriter
.lyxpipe.in
\family default
) en mode
\family typewriter
O_WRONLY
\family default
.
\end_layout
\begin_layout Standard \begin_layout Standard
Vous pouvez trouver un exemple complet de client écrit en C dans la distribution Vous pouvez trouver un exemple complet de client écrit en C dans la distribution
source sous le nom source sous le nom

View File

@ -3238,28 +3238,6 @@ Attenzione: se LyX va in crash, non pu
Se LyX parte e i canali sono già esistenti, non farà partire alcun server. Se LyX parte e i canali sono già esistenti, non farà partire alcun server.
\end_layout \end_layout
\begin_layout Standard
Oltre a questo, ci sono alcuni punti da considerare:
\end_layout
\begin_layout Itemize
Sia il server che i clients devono girare su macchine UNIX o OS/2.
Le comunicazioni tra LyX su UNIX e i clients su OS/2 o viceversa non sono
attualmente possibili.
\end_layout
\begin_layout Itemize
Su OS/2, solo un client per volta può connettersi al server LyX.
\end_layout
\begin_layout Itemize
Su OS/2, i clients devono aprire il canale d'ingresso in modalità
\family typewriter
O_WRONLY
\family default
.
\end_layout
\begin_layout Standard \begin_layout Standard
Potete trovare degli esempi completi scritti in C nella distribuzione dei Potete trovare degli esempi completi scritti in C nella distribuzione dei
codici come codici come

View File

@ -38,8 +38,8 @@ movies, business proposals... you get the idea.
Currently, \fBLyX\fR uses either the XForms or Qt library as a Currently, \fBLyX\fR uses either the XForms or Qt library as a
toolkit. \fBLyX\fR should run everywhere, where these libraries run. toolkit. \fBLyX\fR should run everywhere, where these libraries run.
This is on all major Unix platforms as well as Windows, Mac OS X This is on all major Unix platforms as well as Windows and Mac OS X
(which actually is a unix platform) and OS/2. (which actually is a unix platform).
.SH OPTIONS .SH OPTIONS
\fBLyX\fR supports the following command-line switches. \fBLyX\fR supports the following command-line switches.
.TP 6 .TP 6
@ -139,7 +139,7 @@ The system directory is determined by searching for the file
.br .br
4) <path of binary>/../share/<name of binary>/ 4) <path of binary>/../share/<name of binary>/
.br .br
5) hardcoded lyx_dir (usually /usr/local/share/lyx on UNIX and %X11ROOT%\\XFree86\\lib\\X11\\lyx on OS/2 with XFree) 5) hardcoded lyx_dir (usually /usr/local/share/lyx on UNIX)
.TP .TP
.B LYX_USERDIR_14x .B LYX_USERDIR_14x
can be used to specify which user directory to use. can be used to specify which user directory to use.
@ -177,7 +177,7 @@ strings in other languages.
.fi .fi
.I LIBDIR .I LIBDIR
is the system directory. This is usually /usr/local/share/lyx on UNIX and %X11ROOT%\\XFree86\\lib\\X11\\lyx on OS/2 with XFree. is the system directory. This is usually /usr/local/share/lyx on UNIX.
.SH SEE ALSO .SH SEE ALSO
tex2lyx(1), latex(1). tex2lyx(1), latex(1).

View File

@ -338,15 +338,6 @@ void newFile(BufferView * bv, string const & filename)
// Split argument by : // Split argument by :
string name; string name;
string tmpname = split(filename, name, ':'); string tmpname = split(filename, name, ':');
#ifdef __EMX__ // Fix me! lyx_cb.C may not be low level enough to allow this.
if (name.length() == 1
&& isalpha(static_cast<unsigned char>(name[0]))
&& (prefixIs(tmpname, "/") || prefixIs(tmpname, "\\"))) {
name += ':';
name += token(tmpname, ':', 0);
tmpname = split(tmpname, ':');
}
#endif
lyxerr[Debug::INFO] << "Arg is " << filename lyxerr[Debug::INFO] << "Arg is " << filename
<< "\nName is " << name << "\nName is " << name
<< "\nTemplate is " << tmpname << endl; << "\nTemplate is " << tmpname << endl;

View File

@ -56,16 +56,6 @@
#endif #endif
#include <fcntl.h> #include <fcntl.h>
#ifdef __EMX__
# include <cstdlib>
# include <io.h>
# define OS2EMX_PLAIN_CHAR
# define INCL_DOSNMPIPES
# define INCL_DOSERRORS
# include <os2.h>
# include "support/os2_errortable.h"
#endif
using lyx::support::compare; using lyx::support::compare;
using lyx::support::rtrim; using lyx::support::rtrim;
using lyx::support::split; using lyx::support::split;
@ -175,40 +165,6 @@ void LyXComm::closeConnection()
int LyXComm::startPipe(string const & filename, bool write) int LyXComm::startPipe(string const & filename, bool write)
{ {
#ifdef __EMX__
HPIPE os2fd;
APIRET rc;
int errnum;
// Try create one instance of named pipe with the mode O_RDONLY|O_NONBLOCK.
// The current emx implementation of access() won't work with pipes.
rc = DosCreateNPipe(filename.c_str(), &os2fd, NP_ACCESS_INBOUND,
NP_NOWAIT|0x01, 0600, 0600, 0);
if (rc == ERROR_PIPE_BUSY) {
lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
<< "If no other LyX program is active, please delete"
" the pipe by hand and try again." << endl;
pipename.erase();
return -1;
}
if (rc != NO_ERROR) {
errnum = translateOS2Error(rc);
lyxerr <<"LyXComm: Could not create pipe " << filename
<< strerror(errnum) << endl;
return -1;
};
// Listen to it.
rc = DosConnectNPipe(os2fd);
if (rc != NO_ERROR && rc != ERROR_PIPE_NOT_CONNECTED) {
errnum = translateOS2Error(rc);
lyxerr <<"LyXComm: Could not create pipe " << filename
<< strerror(errnum) << endl;
return -1;
};
// Imported handles can be used both with OS/2 APIs and emx
// library functions.
int const fd = _imphandle(os2fd);
#else
if (::access(filename.c_str(), F_OK) == 0) { if (::access(filename.c_str(), F_OK) == 0) {
lyxerr << "LyXComm: Pipe " << filename << " already exists.\n" lyxerr << "LyXComm: Pipe " << filename << " already exists.\n"
<< "If no other LyX program is active, please delete" << "If no other LyX program is active, please delete"
@ -224,7 +180,6 @@ int LyXComm::startPipe(string const & filename, bool write)
}; };
int const fd = ::open(filename.c_str(), int const fd = ::open(filename.c_str(),
write ? (O_RDWR) : (O_RDONLY|O_NONBLOCK)); write ? (O_RDWR) : (O_RDONLY|O_NONBLOCK));
#endif
if (fd < 0) { if (fd < 0) {
lyxerr << "LyXComm: Could not open pipe " << filename << '\n' lyxerr << "LyXComm: Could not open pipe " << filename << '\n'
@ -250,31 +205,15 @@ void LyXComm::endPipe(int & fd, string const & filename, bool write)
lyx_gui::unregister_socket_callback(fd); lyx_gui::unregister_socket_callback(fd);
} }
#ifdef __EMX__
APIRET rc;
int errnum;
rc = DosDisConnectNPipe(fd);
if (rc != NO_ERROR) {
errnum = translateOS2Error(rc);
lyxerr << "LyXComm: Could not disconnect pipe " << filename
<< '\n' << strerror(errnum) << endl;
return;
}
#endif
if (::close(fd) < 0) { if (::close(fd) < 0) {
lyxerr << "LyXComm: Could not close pipe " << filename lyxerr << "LyXComm: Could not close pipe " << filename
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
} }
// OS/2 pipes are deleted automatically
#ifndef __EMX__
if (unlink(filename) < 0) { if (unlink(filename) < 0) {
lyxerr << "LyXComm: Could not remove pipe " << filename lyxerr << "LyXComm: Could not remove pipe " << filename
<< '\n' << strerror(errno) << endl; << '\n' << strerror(errno) << endl;
}; };
#endif
fd = -1; fd = -1;
} }
@ -369,16 +308,6 @@ void LyXComm::send(string const & msg)
closeConnection(); closeConnection();
openConnection(); openConnection();
} }
#ifdef __EMX__
APIRET rc;
int errnum;
rc = DosResetBuffer(outfd); // To avoid synchronization problems.
if (rc != NO_ERROR) {
errnum = translateOS2Error(rc);
lyxerr << "LyXComm: Message could not be flushed: " << msg
<< '\n' << strerror(errnum) << endl;
}
#endif
} }
#endif // defined (HAVE_MKFIFO) #endif // defined (HAVE_MKFIFO)

View File

@ -5,7 +5,7 @@ SUBDIRS = . tests
CLEANFILES += $(BUILT_SOURCES) CLEANFILES += $(BUILT_SOURCES)
EXTRA_DIST = package.C.in pch.h \ EXTRA_DIST = package.C.in pch.h \
os_cygwin.C os_os2.C os_unix.C os_win32.C os_win32.h os_cygwin.C os_unix.C os_win32.C os_win32.h
noinst_LTLIBRARIES = libsupport.la noinst_LTLIBRARIES = libsupport.la
@ -55,8 +55,6 @@ libsupport_la_SOURCES = \
mkdir.C \ mkdir.C \
os.C \ os.C \
os.h \ os.h \
os2_defines.h \
os2_errortable.h \
path.C \ path.C \
path.h \ path.h \
package.C \ package.C \

View File

@ -22,9 +22,7 @@
int lyx::support::chdir(std::string const & name) int lyx::support::chdir(std::string const & name)
{ {
#ifdef __EMX__ #ifdef _WIN32
return ::_chdir2(name.c_str());
#elif defined(_WIN32)
return SetCurrentDirectory(name.c_str()) != 0 ? 0 : -1; return SetCurrentDirectory(name.c_str()) != 0 ? 0 : -1;
#else #else
return ::chdir(name.c_str()); return ::chdir(name.c_str());

View File

@ -196,13 +196,6 @@ string const fileOpenSearch(string const & path, string const & name,
notfound = false; notfound = false;
} }
} }
#ifdef __EMX__
if (ext.empty() && notfound) {
real_file = fileOpenSearch(path, name, "exe");
if (notfound)
real_file = fileOpenSearch(path, name, "cmd");
}
#endif
return real_file; return real_file;
} }
@ -382,10 +375,6 @@ string const createTmpDir(string const & tempdir, string const & mask)
bool destroyDir(string const & tmpdir) bool destroyDir(string const & tmpdir)
{ {
#ifdef __EMX__
Path p(user_lyxdir());
#endif
return fs::remove_all(tmpdir) > 0; return fs::remove_all(tmpdir) > 0;
} }
@ -413,9 +402,6 @@ string const createLyXTmpDir(string const & deflt)
{ {
if (!deflt.empty() && deflt != "/tmp") { if (!deflt.empty() && deflt != "/tmp") {
if (mkdir(deflt, 0777)) { if (mkdir(deflt, 0777)) {
#ifdef __EMX__
Path p(package().user_support());
#endif
if (isDirWriteable(deflt)) { if (isDirWriteable(deflt)) {
// deflt could not be created because it // deflt could not be created because it
// did exist already, so let's create our own // did exist already, so let's create our own
@ -428,9 +414,6 @@ string const createLyXTmpDir(string const & deflt)
} else } else
return deflt; return deflt;
} else { } else {
#ifdef __EMX__
Path p(package().user_support());
#endif
return createTmpDir("/tmp", "lyx_tmpdir"); return createTmpDir("/tmp", "lyx_tmpdir");
} }
} }
@ -494,19 +477,11 @@ string const makeAbsPath(string const & relPath, string const & basePath)
if (temp == "..") { if (temp == "..") {
// Remove one level of TempBase // Remove one level of TempBase
string::difference_type i = tempBase.length() - 2; string::difference_type i = tempBase.length() - 2;
#ifndef __EMX__
if (i < 0) if (i < 0)
i = 0; i = 0;
while (i > 0 && tempBase[i] != '/') while (i > 0 && tempBase[i] != '/')
--i; --i;
if (i > 0) if (i > 0)
#else
if (i < 2)
i = 2;
while (i > 2 && tempBase[i] != '/')
--i;
if (i > 2)
#endif
tempBase.erase(i, string::npos); tempBase.erase(i, string::npos);
else else
tempBase += '/'; tempBase += '/';

View File

@ -361,10 +361,7 @@ int Forkedcall::generateChild()
lyxerr << "</command>" << std::endl; lyxerr << "</command>" << std::endl;
} }
#if defined (__EMX__) #ifdef _WIN32
pid_t const cpid = spawnvp(P_SESSION|P_DEFAULT|P_MINIMIZE|P_BACKGROUND,
argv[0], &*argv.begin());
#elif defined (_WIN32)
pid_t const cpid = spawnvp(_P_NOWAIT, argv[0], &*argv.begin()); pid_t const cpid = spawnvp(_P_NOWAIT, argv[0], &*argv.begin());
#else // POSIX #else // POSIX
pid_t const cpid = ::fork(); pid_t const cpid = ::fork();

View File

@ -33,9 +33,7 @@ namespace {
inline inline
char * l_getcwd(char * buffer, size_t size) char * l_getcwd(char * buffer, size_t size)
{ {
#ifdef __EMX #ifdef _WIN32
return ::_getcwd2(buffer, size);
#elif defined(_WIN32)
GetCurrentDirectory(size, buffer); GetCurrentDirectory(size, buffer);
return buffer; return buffer;
#else #else

View File

@ -10,9 +10,7 @@
#include <config.h> #include <config.h>
#ifdef __EMX__ #if defined(__CYGWIN__) || defined(__CYGWIN32__)
#include "os_os2.C"
#elif defined(__CYGWIN__) || defined(__CYGWIN32__)
#include "os_cygwin.C" #include "os_cygwin.C"
#elif defined(_WIN32) #elif defined(_WIN32)
#include "os_win32.C" #include "os_win32.C"

View File

@ -1,56 +0,0 @@
/* -*- C++ -*- */
/**
* \file os2_defines.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* Prototypes and definitions needed for OS/2.
*/
#ifndef OS2_DEFINES_H
#define OS2_DEFINES_H
#if defined (__cplusplus)
#include <cctype>
#include <cstdlib>
extern "C"
inline int readlink(const char *, char *, size_t) {return -1;}
#else
#include <ctype.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#define readlink(s, t, l) (-1)
#endif
#include <process.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <X11/Xlocale.h>
/* #include <malloc.h> */
#define lstat stat
#define S_ISLNK(x) false
#define S_ISBLK(x) false
/*#define mkfifo(p, m) (0) *//* LyXserver is temporary disabled. */
#define chdir _chdir2
#define strcasecmp stricmp
#if defined (__cplusplus)
extern "C" {
#endif
const char* __XOS2RedirRoot(const char* pathname);
#if defined (__cplusplus)
}
#endif
#undef LYX_DIR
#define LYX_DIR __XOS2RedirRoot("/XFree86/lib/X11/lyx")
#undef LOCALEDIR
#define LOCALEDIR __XOS2RedirRoot("/XFree86/lib/X11/locale")
#undef TOP_SRCDIR
#define TOP_SRCDIR ".."
/* I have the slightest idea what I am doing here... */
#define bindtextdomain bindtextdomain__
#define textdomain textdomain__
#endif /* _OS2_DEFINES_H */

View File

@ -1,102 +0,0 @@
/* -*- C++ -*- */
/**
* \file os2_errortable.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* A table for translating OS/2 API return code into errno.
* Copied from emx library source.
*/
#ifndef OS2_ERRORTABLE_H
#define OS2_ERRORTABLE_H
//#ifndef _ERRNO_H
#include <cerrno>
//#endif
namespace {
unsigned char const errno_tab[] =
{
EINVAL, EINVAL, ENOENT, ENOENT, EMFILE, /* 0..4 */
EACCES, EBADF, EIO, ENOMEM, EIO, /* 5..9 */
EINVAL, ENOEXEC, EINVAL, EINVAL, EINVAL, /* 10..14 */
ENOENT, EBUSY, EXDEV, ENOENT, EROFS, /* 15..19 */
EIO, EIO, EIO, EIO, EIO, /* 20..24 */
EIO, EIO, EIO, ENOSPC, EIO, /* 25..29 */
EIO, EIO, EACCES, EACCES, EIO, /* 30..34 */
EIO, EIO, EIO, EIO, ENOSPC, /* 35..39 */
EIO, EIO, EIO, EIO, EIO, /* 40..44 */
EIO, EIO, EIO, EIO, EIO, /* 45..49 */
EIO, EIO, EIO, EIO, EBUSY, /* 50..54 */
EIO, EIO, EIO, EIO, EIO, /* 55..59 */
EIO, ENOSPC, ENOSPC, EIO, EIO, /* 60..64 */
EACCES, EIO, EIO, EIO, EIO, /* 65..69 */
EIO, EIO, EIO, EROFS, EIO, /* 70..74 */
EIO, EIO, EIO, EIO, EIO, /* 75..79 */
EEXIST, EIO, ENOENT, EIO, EIO, /* 80..84 */
EIO, EIO, EINVAL, EIO, EAGAIN, /* 85..89 */
EIO, EIO, EIO, EIO, EIO, /* 90..94 */
EINTR, EIO, EIO, EIO, EACCES, /* 95..99 */
ENOMEM, EINVAL, EINVAL, ENOMEM, EINVAL, /* 100..104 */
EINVAL, ENOMEM, EIO, EACCES, EPIPE, /* 105..109 */
ENOENT, E2BIG, ENOSPC, ENOMEM, EINVAL, /* 110..114 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 115..119 */
EINVAL, EINVAL, EINVAL, ENOENT, EINVAL, /* 120..124 */
ENOENT, ENOENT, ENOENT, ECHILD, ECHILD, /* 125..129 */
EACCES, EINVAL, ESPIPE, EINVAL, EINVAL, /* 130..134 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 135..139 */
EINVAL, EINVAL, EBUSY, EINVAL, EINVAL, /* 140..144 */
EINVAL, EINVAL, EINVAL, EBUSY, EINVAL, /* 145..149 */
EINVAL, EINVAL, ENOMEM, EINVAL, EINVAL, /* 150..154 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 155..159 */
EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 160..164 */
EINVAL, EINVAL, EACCES, EINVAL, EINVAL, /* 165..169 */
EBUSY, EINVAL, EINVAL, EINVAL, EINVAL, /* 170..174 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 175..179 */
EINVAL, EINVAL, EINVAL, EINVAL, ECHILD, /* 180..184 */
EINVAL, EINVAL, ENOENT, EINVAL, EINVAL, /* 185..189 */
ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 190..194 */
ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, ENOEXEC, /* 195..199 */
ENOEXEC, ENOEXEC, ENOEXEC, ENOENT, EINVAL, /* 200..204 */
EINVAL, ENAMETOOLONG, EINVAL, EINVAL, EINVAL, /* 205..209 */
EINVAL, EINVAL, EACCES, ENOEXEC, ENOEXEC, /* 210..214 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 215..219 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 220..224 */
EINVAL, EINVAL, EINVAL, ECHILD, EINVAL, /* 225..229 */
EINVAL, EBUSY, EAGAIN, ENOTCONN, EINVAL, /* 230..234 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 235..239 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 240..244 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 245..249 */
EACCES, EACCES, EINVAL, ENOENT, EINVAL, /* 250..254 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 255..259 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 260..264 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 265..269 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 270..274 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 275..279 */
EINVAL, EINVAL, EINVAL, EINVAL, EEXIST, /* 280..284 */
EEXIST, EINVAL, EINVAL, EINVAL, EINVAL, /* 285..289 */
ENOMEM, EMFILE, EINVAL, EINVAL, EINVAL, /* 290..294 */
EINVAL, EINVAL, EINVAL, EINVAL, EINVAL, /* 295..299 */
EINVAL, EBUSY, EINVAL, ESRCH, EINVAL, /* 300..304 */
ESRCH, EINVAL, EINVAL, EINVAL, ESRCH, /* 305..309 */
EINVAL, ENOMEM, EINVAL, EINVAL, EINVAL, /* 310..314 */
EINVAL, E2BIG, ENOENT, EIO, EIO, /* 315..319 */
EINVAL, EINVAL, EINVAL, EINVAL, EAGAIN, /* 320..324 */
EINVAL, EINVAL, EINVAL, EIO, ENOENT, /* 325..329 */
EACCES, EACCES, EACCES, ENOENT, ENOMEM /* 330..334 */
};
} // namespace anon
inline
int translateOS2Error(unsigned long rc)
{
if (rc >= sizeof (errno_tab))
return EINVAL;
else
return errno_tab[rc];
}
#endif /* _OS2_ERRORTABLE_H */

View File

@ -1,217 +0,0 @@
/**
* \file os_os2.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Ruurd A. Reitsma
*
* Full author contact details are available in file CREDITS.
*
* Various OS specific functions
*/
#include <config.h>
#include "support/os.h"
#include "support/filetools.h"
#define INCL_DOSFILEMGR
#define INCL_DOSMODULEMGR
#define INCL_DOSPROCESS
#define INCL_DOSNLS
#define INCL_DOSERRORS
#include <os2.h>
namespace lyx {
namespace support {
namespace os {
namespace {
shell_type shell_ = UNIX;
unsigned long cp_ = 0;
}
void init(int argc, char * argv[])
{
_wildcard(&argc, &argv);
PTIB ptib = new TIB[1];
PPIB ppib = new PIB[1];
APIRET rc = DosGetInfoBlocks(&ptib, &ppib);
if (rc != NO_ERROR)
exit(rc);
// OS/2 cmd.exe has another use for '&'
string sh = OnlyFilename(getEnvPath("EMXSHELL"));
if (sh.empty()) {
// COMSPEC is set, unless user unsets
sh = OnlyFilename(getEnvPath("COMSPEC"));
if (sh.empty())
sh = "cmd.exe";
}
sh = lowercase(sh); // DosMapCase() is an overkill here
if (contains(sh, "cmd.exe") || contains(sh, "4os2.exe"))
shell_ = os::CMD_EXE;
else
shell_ = os::UNIX;
static bool initialized = false;
if (initialized)
return;
initialized = true;
ULONG CPList[3] = {0};
ULONG CPList_size;
APIRET rc = DosQueryCp(3 * sizeof(ULONG), CPList, &CPList_size);
if (rc != NO_ERROR)
exit(rc);
// CPList[0] == process current codepage,
// CPList[1] == system default codepage, the rest are auxilary.
// Once cp_ is correctly set, you can call other routines.
cp_ = CPList[1];
}
string current_root()
{
APIRET rc;
ULONG drv_num;
ULONG drv_map;
rc = DosQueryCurrentDisk(&drv_num, &drv_map);
if (rc != NO_ERROR)
exit(rc);
char drive = 'A' + drv_num -1;
string tmp(1, drive);
tmp += ":/";
return tmp;
}
string::size_type common_path(string const & p1, string const & p2)
{
static bool initialized = false;
if (!initialized) {
init(0, 0);
initialized = true;
}
COUNTRYCODE cntry;
cntry.country = 0;
cntry.codepage = cp_;
string temp1 = internal_path(p1);
string temp2 = internal_path(p2);
char * tmp1 = const_cast<char *> (temp1.c_str());
char * tmp2 = const_cast<char *> (temp2.c_str());
/* rc = */ DosMapCase(p1.length(), &cntry, tmp1);
// if (rc != NO_ERROR)
// exit(rc);
/* rc = */ DosMapCase(p2.length(), &cntry, tmp2);
// if (rc != NO_ERROR)
// exit(rc);
// This algorithm works only if paths are slashified on DBCS systems.
string::size_type i = 0;
string::size_type p1_len = p1.length();
string::size_type p2_len = p2.length();
while (i < p1_len && i < p2_len && tmp1[i] == tmp2[i])
++i;
if ((i < p1_len && i < p2_len)
|| (i < p1_len && tmp1[i] != '/' && i == p2_len)
|| (i < p2_len && tmp2[i] != '/' && i == p1_len))
{
if (i)
--i; // here was the last match
while (i && tmp1[i] != '/')
--i;
}
return i;
}
string internal_path(string const & p)
{
static bool initialized = false;
static bool leadbyte[256] = {false};
if (!initialized) {
init(0, 0);
COUNTRYCODE cntry;
cntry.country = 0;
cntry.codepage = cp_;
unsigned char *DBCSinfo = new unsigned char[12];
/* rc = */ DosQueryDBCSEnv(12, &cntry, (char*) DBCSinfo);
// if (rc != NO_ERROR)
// exit(rc);
for (int j = 1; j < 12; j += 2)
DBCSinfo[j]++;
unsigned char i = 0;
bool isLeadByte = false;
while (*DBCSinfo != 0) {
if (i == *DBCSinfo) {
isLeadByte = !isLeadByte;
DBCSinfo++;
}
leadbyte[i++] = isLeadByte;
}
initialized = true;
}
string::iterator lit = p.begin();
string::iterator end = p.end();
for (; lit < end; ++lit) {
if (leadbyte[(*lit)])
lit += 2;
if ((*lit) == '\\')
(*lit) = '/';
}
p = subst(p, "//", "/");
return p;
}
string external_path(string const & p)
{
return p;
}
bool is_absolute_path(string const & p)
{
return (p.length() > 1
&& isalpha(static_cast<unsigned char>(p[0]))
&& p[1] == ':');
}
// returns a string suitable to be passed to popen when
// reading a pipe
char const * popen_read_mode()
{
return "r";
}
string const & nulldev()
{
static string const nulldev_ = "null";
return nulldev_;
}
shell_type shell()
{
return shell_;
}
char path_separator()
{
return ';';
}
void cygwin_path_fix(bool)
{}
} // namespace os
} // namespace support
} // namespace lyx

View File

@ -20,9 +20,6 @@ using std::string;
bool lyx::support::rename(string const & from, string const & to) bool lyx::support::rename(string const & from, string const & to)
{ {
#ifdef __EMX__
unlink(to);
#endif
if (::rename(from.c_str(), to.c_str()) == -1) if (::rename(from.c_str(), to.c_str()) == -1)
if (copy(from, to)) { if (copy(from, to)) {
unlink(from); unlink(from);