diff --git a/rosapps/applications/applications.rbuild b/rosapps/applications/applications.rbuild
index d98a6b70cfe..c1138918796 100644
--- a/rosapps/applications/applications.rbuild
+++ b/rosapps/applications/applications.rbuild
@@ -25,26 +25,10 @@
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -59,14 +43,6 @@
-->
-
-
-
-
-
-
-
-
diff --git a/rosapps/applications/mc/Make.common b/rosapps/applications/mc/Make.common
deleted file mode 100644
index 11a535b7582..00000000000
--- a/rosapps/applications/mc/Make.common
+++ /dev/null
@@ -1,105 +0,0 @@
-VERSION=4.1.36
-
-SHELL = /bin/sh
-
-# This variable makes it possible to move the installation root to another
-# directory. This is useful when you're creating a binary distribution of mc.
-# If empty, normal root will be used.
-# You can run e.g. 'make install DESTDIR=/packages/mc/3.0' to accomplish
-# that.
-# DESTDIR = /opt/apps/mc/$(VERSION)
-
-# Installation target directories & other installation stuff
-prefix = /usr/local
-exec_prefix = $(prefix)
-binprefix =
-manprefix =
-
-builddir = /cygdrive/c/user/src/local/mc-4.1.36-mingw
-bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib/mc
-suppbindir = $(libdir)/bin
-tidir = $(libdir)/term
-extfsdir = $(libdir)/extfs
-icondir = $(prefix)/share/icons/mc
-mandir = $(prefix)/man/man1
-datadir = $(prefix)/share
-localedir = $(datadir)/locale
-manext = 1
-man8dir = $(prefix)/man/man8
-man8ext = 8
-xv_bindir =
-
-# Tools & program stuff
-SEDCMD = sed 's/-man/-mandoc/'
-SEDCMD2 = sed 's%@prefix@%$(prefix)%'
-STRIP = @STRIP@
-
-CC = gcc
-CPP = gcc -E
-AR = /usr/bin/ar
-RANLIB = ranlib
-RM = /usr/bin/rm
-RMF = /usr/bin/rm -f
-MV = /usr/bin/mv
-CP = /usr/bin/cp
-LN_S = ln -s
-AWK = gawk
-AWK_VAR_OPTION = -v
-
-# Flags & libs
-# No way, to make make happy (except GNU), we cannot use := to append
-# something to these, so that's why there is a leading _
-XCFLAGS = -g
-XCPPFLAGS = -I.. -I$(vfsdir) -I$(rootdir) -I$(slangdir) -I.. -DBINDIR=\""$(bindir)/"\" -DLIBDIR=\""$(libdir)/"\" -DICONDIR=\""$(icondir)/"\" $(XINC) -DLOCALEDIR=\""$(localedir)/"\"
-XLDFLAGS =
-XDEFS = -DHAVE_CONFIG_H
-XLIBS = -lintl -lcrypt
-
-# Where do we have the sources?
-# You shouldn't have to edit this :)
-mcsrcdir = $(rootdir)/src
-docdir = $(rootdir)/doc
-mclibdir = $(rootdir)/lib
-slangdir = $(rootdir)/slang
-vfsdir = $(rootdir)/vfs
-xvdir = $(rootdir)/xv
-tkdir = $(rootdir)/tk
-gnomedir = $(rootdir)/gnome
-icodir = $(rootdir)/icons
-
-hpath = -I$(mcsrcdir) -I$(slangdir) -I$(vfsdir) -I$(xvdir) -I$(xvdir)/support/xview_private -I$(tkdir)
-
-# Rules
-first_rule: all
-
-.PHONY: all check cross TAGS clean install uninstall distcopy depend dep
-.PHONY: fastdep fastdepslang fastdepvfs fastdeploc slowdep
-
-../slang/%.o : ../slang/%.c
- cd ../slang; $(MAKE) libmcslang.a
-
-../vfs/%.o : ../vfs/%.c
- cd ../vfs; $(MAKE) libvfs.a
-
-fastdep: dummy
- if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then { cd $(srcdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(srcdir)" *.[ch];} > .depend; fi
- -$(MAKE) fastdeploc
- :
-
-fastdepslang:
- { { { cd ../slang; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(slangdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../slang libmcslang.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(slangdir)";};} >> .depend
-
-fastdepvfs:
- { { { cd ../vfs; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(vfsdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../vfs libvfs.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(vfsdir)";};} >> .depend
-
-slowdep: dummy
- if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then \
- $(CPP) -M $(CPPFLAGS) $(DEFS) $(CFLAGS) $(srcdir)/*.c > .depend; fi
- :
-
-mcdep: fastdep
-
-dummy:
-
-# End of Make.common
diff --git a/rosapps/applications/mc/Makefile.PC b/rosapps/applications/mc/Makefile.PC
deleted file mode 100644
index 6efde18dba2..00000000000
--- a/rosapps/applications/mc/Makefile.PC
+++ /dev/null
@@ -1,180 +0,0 @@
-# Makefile.PC
-#
-# This is the Makefile for Midnight Commander under OS/2 and Windows NT
-#
-# Written by Dan Nicolaescu
-# 970423 hacked by Juan f. Grigera
-# 970525 hacked again by jfg to add internal editor
-# 971127 hacked by Pavel Roskin to make it work with mc-4.1.11
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980329 changed by Pavel Roskin to make it common for OS/2 and NT
-#
-# Supported Compilers:
-#
-# For Windows NT:
-# Makefile.VC4: Microsoft Visual C++ 4.0 and above
-# Makefile.BC5: Borland C++ 5.x
-# Makefile.MIN: MinGW
-# Makefile.RSX: RSX
-# For OS/2:
-# Makefile.EMX: EMX/GCC
-# Makefile.BC2: Borland C++ 2.x
-# Makefile.IBM: IBM CSet or Visual Age C++
-# ...
-
-# ---- Directories
-MC_PC_DIR=./pc
-MC_SRC_DIR=./src
-VFS_DIR=./vfs
-MCEDIT_SRC_DIR=./edit
-MCEDIT_OBJS_DIR=$(OBJS_DIR)/edit
-SLANG_SRC_DIR=./slang
-SLANG_OBJS_DIR=$(OBJS_DIR)/slang
-MC_EXE=$(OBJS_DIR)/mc.exe
-
-# --- Midnight Defines
-COMMON_DEFINES=-DMC_$(TARGET_OS) $(SPECIFIC_DEFINES)
-MC_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MC_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-SLANG_DEFINES=$(COMMON_DEFINES)
-SLANG_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-MCEDIT_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MCEDIT_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-
-CFLAGS=$(SPECIFIC_MC_CFLAGS) $(MC_INCLUDES) $(MC_DEFINES) -c
-SLANG_CFLAGS=$(SPECIFIC_SLANG_CFLAGS) $(SLANG_INCLUDES) $(SLANG_DEFINES) -c
-MCEDIT_CFLAGS=$(SPECIFIC_MCEDIT_CFLAGS) $(MCEDIT_INCLUDES) $(MCEDIT_DEFINES) -c
-
-
-all: object-dirs mc
-object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR)
-
-mc: $(MC_EXE)
-
-clean:
- "../../reactos/tools/rdel" slang/*.o
- "../../reactos/tools/rdel" edit/*.o
- "../../reactos/tools/rdel" src/*.o
- "../../reactos/tools/rdel" pc/*.o
- "../../reactos/tools/rdel" release/*.o
-
-$(OBJS_DIR):
- mkdir "$@"
-
-$(SLANG_OBJS_DIR):
- mkdir "$@"
-
-$(MCEDIT_OBJS_DIR):
- mkdir "$@"
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_PC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_SRC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(SLANG_OBJS_DIR)/%.$(OBJ_SUFFIX): $(SLANG_SRC_DIR)/%.c
- $(CC) $(SLANG_CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCEDIT_SRC_DIR)/%.c
- $(CC) $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
-
-MC_SRCS= \
- terms.c \
- user.c \
- file.c \
- listmode.c \
- cmd.c \
- command.c \
- help.c \
- menu.c \
- view.c \
- dir.c \
- info.c \
- widget.c \
- option.c \
- dlg.c \
- panelize.c \
- profile.c \
- util.c \
- dialog.c \
- ext.c \
- color.c \
- layout.c \
- setup.c \
- regex.c \
- hotlist.c \
- tree.c \
- win.c \
- complete.c \
- find.c \
- wtools.c \
- boxes.c \
- background.c \
- main.c \
- popt.c \
- text.c \
- screen.c
-
-PC_SRCS= \
- slint_pc.c \
- chmod.c \
- drive.c
-
-NT_SRCS= \
- cons_nt.c \
- dirent_nt.c \
- key_nt.c \
- util_win32.c \
- util_winnt.c \
- util_nt.c
-
-OS2_SRCS= \
- cons_os2.c \
- dirent_os2.c \
- key_os2.c \
- util_os2.c
-
-SLANG_NT=slw32tty.c
-SLANG_OS2=slos2tty.c
-
-SLANG_SRCS= \
- slerr.c \
- slgetkey.c \
- slsmg.c \
- slvideo.c \
- $(SLANG_$(TARGET_OS))
-
-MCEDIT_SRCS= \
- edit.c \
- editcmd.c \
- editdraw.c \
- editmenu.c \
- editoptions.c \
- editwidget.c \
- syntax.c \
- wordproc.c
-
-SRCS=$(MC_SRCS) $(PC_SRCS) $($(TARGET_OS)_SRCS) $(EXTRA_MC_SRCS)
-
-OBJS=$(addprefix $(OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SRCS)))
-SLANG_OBJS=$(addprefix $(SLANG_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SLANG_SRCS)))
-MCEDIT_OBJS=$(addprefix $(MCEDIT_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(MCEDIT_SRCS)))
-
-ifdef RSC
-
-ifndef RES_SUFFIX
-RES_SUFFIX=res
-endif # RES_SUFFIX
-
-MC_RES=$(OBJS_DIR)/mc.$(RES_SUFFIX)
-
-$(MC_RES): $(MC_PC_DIR)/mc.rc $(MC_PC_DIR)/mc_nt.ico $(MC_PC_DIR)/config.h ../VERSION
- $(RSC) $(RES_PLACE)$(MC_RES) $(RC_DEFINES) $(MC_PC_DIR)/mc.rc
-
-else
-MC_RES=
-endif # !RSC
diff --git a/rosapps/applications/mc/VERSION b/rosapps/applications/mc/VERSION
deleted file mode 100644
index 7fbca0fef6b..00000000000
--- a/rosapps/applications/mc/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-#define VERSION "4.1.36"
diff --git a/rosapps/applications/mc/about-nls b/rosapps/applications/mc/about-nls
deleted file mode 100644
index dacb8b18bed..00000000000
--- a/rosapps/applications/mc/about-nls
+++ /dev/null
@@ -1,225 +0,0 @@
-Notes on the Free Translation Project
-*************************************
-
- Free software is going international! The Free Translation Project
-is a way to get maintainers of free software, translators, and users all
-together, so that will gradually become able to speak many languages.
-A few packages already provide translations for their messages.
-
- If you found this `ABOUT-NLS' file inside a distribution, you may
-assume that the distributed package does use GNU `gettext' internally,
-itself available at your nearest GNU archive site. But you do *not*
-need to install GNU `gettext' prior to configuring, installing or using
-this package with messages translated.
-
- Installers will find here some useful hints. These notes also
-explain how users should proceed for getting the programs to use the
-available translations. They tell how people wanting to contribute and
-work at translations should contact the appropriate team.
-
- When reporting bugs in the `intl/' directory or bugs which may be
-related to internationalization, you should tell about the version of
-`gettext' which is used. The information can be found in the
-`intl/VERSION' file, in internationalized packages.
-
-One advise in advance
-=====================
-
- If you want to exploit the full power of internationalization, you
-should configure it using
-
- ./configure --with-included-gettext
-
-to force usage of internationalizing routines provided within this
-package, despite the existence of internationalizing capabilities in the
-operating system where this package is being installed. So far, only
-the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias or message inheritance) as the
-implementation here. It is also not possible to offer this additional
-functionality on top of a `catgets' implementation. Future versions of
-GNU `gettext' will very likely convey even more functionality. So it
-might be a good idea to change to GNU `gettext' as soon as possible.
-
- So you need not provide this option if you are using GNU libc 2 or
-you have installed a recent copy of the GNU gettext package with the
-included `libintl'.
-
-INSTALL Matters
-===============
-
- Some packages are "localizable" when properly installed; the
-programs they contain can be made to speak your own native language.
-Most such packages use GNU `gettext'. Other packages have their own
-ways to internationalization, predating GNU `gettext'.
-
- By default, this package will be installed to allow translation of
-messages. It will automatically detect whether the system provides
-usable `catgets' (if using this is selected by the installer) or
-`gettext' functions. If neither is available, the GNU `gettext' own
-library will be used. This library is wholly contained within this
-package, usually in the `intl/' subdirectory, so prior installation of
-the GNU `gettext' package is *not* required. Installers may use
-special options at configuration time for changing the default
-behaviour. The commands:
-
- ./configure --with-included-gettext
- ./configure --with-catgets
- ./configure --disable-nls
-
-will respectively bypass any pre-existing `catgets' or `gettext' to use
-the internationalizing routines provided within this package, enable
-the use of the `catgets' functions (if found on the locale system), or
-else, *totally* disable translation of messages.
-
- When you already have GNU `gettext' installed on your system and run
-configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl.a' file and
-will decide to use this. This might be not what is desirable. You
-should use the more recent version of the GNU `gettext' library. I.e.
-if the file `intl/VERSION' shows that the library which comes with this
-package is more recent, you should use
-
- ./configure --with-included-gettext
-
-to prevent auto-detection.
-
- By default the configuration process will not test for the `catgets'
-function and therefore they will not be used. The reasons are already
-given above: the emulation on top of `catgets' cannot provide all the
-extensions provided by the GNU `gettext' library. If you nevertheless
-want to use the `catgets' functions use
-
- ./configure --with-catgets
-
-to enable the test for `catgets' (this causes no harm if `catgets' is
-not available on your system). If you really select this option we
-would like to hear about the reasons because we cannot think of any
-good one ourself.
-
- Internationalized packages have usually many `po/LL.po' files, where
-LL gives an ISO 639 two-letter code identifying the language. Unless
-translations have been forbidden at `configure' time by using the
-`--disable-nls' switch, all available translations are installed
-together with the package. However, the environment variable `LINGUAS'
-may be set, prior to configuration, to limit the installed set.
-`LINGUAS' should then contain a space separated list of two-letter
-codes, stating which languages are allowed.
-
-Using This Package
-==================
-
- As a user, if your language has been installed for this package, you
-only have to set the `LANG' environment variable to the appropriate
-ISO 639 `LL' two-letter code prior to using the programs in the
-package. For example, let's suppose that you speak German. At the
-shell prompt, merely execute `setenv LANG de' (in `csh'),
-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
-can be done from your `.login' or `.profile' file, once and for all.
-
- An operating system might already offer message localization for
-many of its programs, while other programs have been installed locally
-with the full capabilities of GNU `gettext'. Just using `gettext'
-extended syntax for `LANG' would break proper localization of already
-available operating system programs. In this case, users should set
-both `LANGUAGE' and `LANG' variables in their environment, as programs
-using GNU `gettext' give preference to `LANGUAGE'. For example, some
-Swedish users would rather read translations in German than English for
-when Swedish is not available. This is easily accomplished by setting
-`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
-
-Translating Teams
-=================
-
- For the Free Translation Project to be a success, we need interested
-people who like their own language and write it well, and who are also
-able to synergize with other translators speaking the same language.
-Each translation team has its own mailing list, courtesy of Linux
-International. You may reach your translation team at the address
-`LL@li.org', replacing LL by the two-letter ISO 639 code for your
-language. Language codes are *not* the same as the country codes given
-in ISO 3166. The following translation teams exist, as of August 1997:
-
- Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
- Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
- `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
- Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
- `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
- Swedish `sv', and Turkish `tr'.
-
-For example, you may reach the Chinese translation team by writing to
-`zh@li.org'.
-
- If you'd like to volunteer to *work* at translating messages, you
-should become a member of the translating team for your own language.
-The subscribing address is *not* the same as the list itself, it has
-`-request' appended. For example, speakers of Swedish can send a
-message to `sv-request@li.org', having this message body:
-
- subscribe
-
- Keep in mind that team members are expected to participate
-*actively* in translations, or at solving translational difficulties,
-rather than merely lurking around. If your team does not exist yet and
-you want to start one, or if you are unsure about what to do or how to
-get started, please write to `translation@iro.umontreal.ca' to reach the
-coordinator for all translator teams.
-
- The English team is special. It works at improving and uniformizing
-the terminology in use. Proven linguistic skill are praised more than
-programming skill, here.
-
-Available Packages
-==================
-
- Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of August
-1997. The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination.
-
- Ready PO files cs da de en es fi fr it ja ko nl no pl pt sl sv
- .-------------------------------------------------.
- bash | [] [] [] | 3
- bison | [] [] [] | 3
- clisp | [] [] [] [] | 4
- cpio | [] [] [] [] [] | 5
- diffutils | [] [] [] [] [] | 5
- enscript | [] [] [] [] [] [] | 6
- fileutils | [] [] [] [] [] [] [] [] [] [] | 10
- findutils | [] [] [] [] [] [] [] [] | 8
- flex | [] [] [] [] | 4
- gcal | [] [] [] [] [] | 5
- gettext | [] [] [] [] [] [] [] [] [] [] | 11
- grep | [] [] [] [] [] [] [] [] [] | 9
- hello | [] [] [] [] [] [] [] [] [] [] | 10
- id-utils | [] [] [] | 3
- indent | [] [] [] [] | 4
- libc | [] [] [] [] [] [] [] | 7
- m4 | [] [] [] [] [] | 5
- make | [] [] [] [] [] [] | 6
- music | [] [] | 2
- ptx | [] [] [] [] [] [] [] [] | 8
- recode | [] [] [] [] [] [] [] [] [] | 9
- sh-utils | [] [] [] [] [] [] [] | 7
- sharutils | [] [] [] [] [] | 5
- tar | [] [] [] [] [] [] [] [] [] [] | 10
- texinfo | [] | 1
- textutils | [] [] [] [] [] [] [] [] [] | 9
- wdiff | [] [] [] [] [] [] [] [] | 8
- `-------------------------------------------------'
- 16 languages cs da de en es fi fr it ja ko nl no pl pt sl sv
- 27 packages 3 2 24 1 17 1 26 2 1 11 20 9 19 7 7 17 167
-
- Some counters in the preceding matrix are higher than the number of
-visible blocks let us expect. This is because a few extra PO files are
-used for implementing regional variants of languages, or language
-dialects.
-
- For a PO file in the matrix above to be effective, the package to
-which it applies should also have been internationalized and
-distributed as such by its maintainer. There might be an observable
-lag between the mere existence a PO file and its wide availability in a
-distribution.
-
- If August 1997 seems to be old, you may fetch a more recent copy of
-this `ABOUT-NLS' file on most GNU archive sites.
-
diff --git a/rosapps/applications/mc/acconfig.h b/rosapps/applications/mc/acconfig.h
deleted file mode 100644
index 9a4a3702cf2..00000000000
--- a/rosapps/applications/mc/acconfig.h
+++ /dev/null
@@ -1,249 +0,0 @@
-/* This is the configuration file for the Midnight Commander. It was generated
- by autoconf's configure.
-
- Configure for Midnight Commander
- Copyright (C) 1994, 1995 Janne Kukonlehto
- Copyright (C) 1994, 1995 Miguel de Icaza
- Copyright (C) 1995 Jakub Jelinek
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-
-
-@TOP@
-
-#undef PACKAGE
-
-/* Always defined */
-#undef D_INO_IN_DIRENT
-#undef IS_AIX
-#undef MOUNTED_FREAD
-#undef MOUNTED_FREAD_FSTYP
-#undef MOUNTED_GETFSSTAT
-#undef MOUNTED_GETMNT
-#undef MOUNTED_GETMNTENT1
-#undef MOUNTED_GETMNTENT2
-#undef MOUNTED_GETMNTINFO
-#undef MOUNTED_VMOUNT
-#undef STAT_STATFS2_BSIZE
-#undef STAT_STATFS2_FSIZE
-#undef STAT_STATFS2_FS_DATA
-#undef STAT_STATFS3_OSF1
-#undef STAT_STATFS4
-#undef STAT_STATVFS
-
-/* Define umode_t if your system does not provide it */
-#undef umode_t
-
-/* Define nlink_t if your system does not provide it */
-#undef nlink_t
-
-/* Does the file command accepts the -L option */
-#undef FILE_L
-
-/* Does the file command work well with - option for stdin? */
-#undef FILE_STDIN
-
-/* Does the grep command work well with - option for stdin? */
-#undef GREP_STDIN
-
-/* Is the program using the GPM library? */
-#undef HAVE_LIBGPM
-
-/* Is the program using the distributed slang library? */
-#undef HAVE_SLANG
-
-/* Is the program using a system-installed slang library? */
-#undef HAVE_SYSTEM_SLANG
-
-/* Define if the slang.h header file is inside a directory slang
-** in the standard directories
-*/
-#undef SLANG_H_INSIDE_SLANG_DIR
-
-/* Does the program have subshell support? */
-#undef HAVE_SUBSHELL_SUPPORT
-
-/* If you don't have gcc, define this */
-#undef OLD_TOOLS
-
-/* Are you using other type of curses? */
-#undef OTHER_CURSES
-
-/* Is the subshell the default or optional? */
-#undef SUBSHELL_OPTIONAL
-
-/* Use SunOS SysV curses? */
-#undef SUNOS_CURSES
-
-/* Use old BSD curses? */
-#undef USE_BSD_CURSES
-
-/* Use SystemV curses? */
-#undef USE_SYSV_CURSES
-
-/* Use Ncurses? */
-#undef USE_NCURSES
-
-/* If you Curses does not have color define this one */
-#undef NO_COLOR_SUPPORT
-
-/* Support the Midnight Commander Virtual File System? */
-#undef USE_VFS
-
-/* Support for the Memory Allocation Debugger */
-#undef HAVE_MAD
-
-/* Extra Debugging */
-#undef MCDEBUG
-
-/* If the Slang library will be using it's own terminfo instead of termcap */
-#undef SLANG_TERMINFO
-
-/* If Slang library should use termcap */
-#undef USE_TERMCAP
-
-/* If you have socket and the rest of the net functions use this */
-#undef USE_NETCODE
-
-/* If defined, use .netrc for FTP connections */
-#undef USE_NETRC
-
-/* If your operating system does not have enough space for a file name
- * in a struct dirent, then define this
- */
-#undef NEED_EXTRA_DIRENT_BUFFER
-
-/* Define if you want the du -s summary */
-#undef HAVE_DUSUM
-
-/* Define if your du does handle -b correctly */
-#undef DUSUM_USEB
-
-/* Define to size of chunks du is displaying its information.
- * If DUSUM_USEB is defined, this should be 1
- */
-#define DUSUM_FACTOR 512
-
-/* Define this one if you want termnet support */
-#undef USE_TERMNET
-
-/* Defined if you have the file command */
-#undef HAVE_FILECMD
-
-/* Defined if you have libXpm, , libXext, */
-#undef HAVE_XPM_SHAPE
-
-/* Defined if you have shadow passwords on Linux */
-#undef LINUX_SHADOW
-
-/* Defined if you have the crypt prototype in neither unistd.h nor crypt.h */
-#undef NEED_CRYPT_PROTOTYPE
-
-/* Defined if your CPP understands ## macro token pasting method */
-#undef HAVE_PORTABLE_TOKEN_PASTING
-
-/* Define if you want to turn on SCO-specific code */
-#undef SCO_FLAVOR
-
-/* Define if your system has struct linger */
-#undef HAVE_STRUCT_LINGER
-
-/* Define if your curses has this one (AIX, OSF/1) */
-#undef USE_SETUPTERM
-
-/* Link in ext2fs code for delfs experimental file system */
-#undef USE_EXT2FSLIB
-
-/* Define if you have putenv routine */
-#undef HAVE_PUTENV
-
-/* Define if you have isascii */
-#undef HAVE_ISASCII
-
-/* Define if you want to use the HSC firewall */
-#undef HSC_PROXY
-
-/* Define if your system uses PAM for auth stuff */
-#undef HAVE_PAM
-
-/* Define if you have the pmap_getmaps function */
-#undef HAVE_PMAP_GETMAPS
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define if you have the get_process_stats function and have to use that instead of gettimeofday */
-#undef HAVE_GET_PROCESS_STATS
-
-/* Define if you want to call the internal routine edit() for the editor */
-#undef USE_INTERNAL_EDIT
-
-/* Define if your system has socketpair */
-#undef HAVE_SOCKETPAIR
-
-/* Do we have posix signals? */
-#undef HAVE_SIGACTION
-#undef HAVE_SIGPROCMASK
-#undef HAVE_SIGEMPTYSET
-#undef HAVE_SIGADDSET
-
-/* Version of ncurses */
-#undef NCURSES_970530
-
-#undef HAVE_STPCPY
-
-#undef ENABLE_NLS
-#undef HAVE_CATGETS
-#undef HAVE_GETTEXT
-#undef HAVE_LC_MESSAGES
-
-@BOTTOM@
-
-#ifdef HAVE_LIBPT
-# define HAVE_GRANTPT
-#endif
-
-#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBCRYPT_I)
-# define HAVE_CRYPT
-#endif
-
-#ifdef HAVE_XVIEW
-# include
-#endif
-
-#if defined(HAVE_SIGADDSET) && defined(HAVE_SIGEMPTYSET)
-# if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
-# define SLANG_POSIX_SIGNALS
-# endif
-#endif
-
-#ifdef __os2__
-# define OS2_NT 1
-# define S_ISFIFO(x) 0
-#endif
-
-#ifdef _OS_NT
-# define OS2_NT 1
-#endif
-
-#ifndef OS2_NT
-/* some Unices do not define this, and slang requires it: */
-#ifndef unix
-# define unix
-#endif
-#endif
-
diff --git a/rosapps/applications/mc/autogen.sh b/rosapps/applications/mc/autogen.sh
deleted file mode 100644
index b2177508ca6..00000000000
--- a/rosapps/applications/mc/autogen.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-(
-cd $srcdir
-cat macros/gnome.m4 mc-aclocal.m4 gettext.m4 > aclocal.m4
-autoheader
-autoconf
-)
-
-$srcdir/configure $*
diff --git a/rosapps/applications/mc/config.cache b/rosapps/applications/mc/config.cache
deleted file mode 100644
index 84016bab44d..00000000000
--- a/rosapps/applications/mc/config.cache
+++ /dev/null
@@ -1,179 +0,0 @@
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
-#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
-#
-ac_cv_header_sys_statfs_h=${ac_cv_header_sys_statfs_h='no'}
-ac_cv_header_sys_dustat_h=${ac_cv_header_sys_dustat_h='no'}
-ac_cv_type_size_t=${ac_cv_type_size_t='yes'}
-ac_cv_path_CHMOD=${ac_cv_path_CHMOD='/usr/bin/chmod'}
-ac_cv_prog_cc_works=${ac_cv_prog_cc_works='yes'}
-ac_cv_header_sys_statvfs_h=${ac_cv_header_sys_statvfs_h='no'}
-ac_cv_header_crypt_h=${ac_cv_header_crypt_h='yes'}
-ac_cv_path_XGETTEXT=${ac_cv_path_XGETTEXT='/usr/bin/xgettext'}
-ac_cv_func_getcwd=${ac_cv_func_getcwd='yes'}
-ac_cv_lib_nsl_t_accept=${ac_cv_lib_nsl_t_accept='no'}
-ac_cv_lib_sun_getmntent=${ac_cv_lib_sun_getmntent='no'}
-ac_cv_func_tcsetattr=${ac_cv_func_tcsetattr='yes'}
-ac_cv_header_grp_h=${ac_cv_header_grp_h='yes'}
-ac_cv_lib_ipc_shmat=${ac_cv_lib_ipc_shmat='no'}
-ac_cv_func_crypt=${ac_cv_func_crypt='no'}
-ac_cv_func_sigaddset=${ac_cv_func_sigaddset='yes'}
-ac_cv_func_initgroups=${ac_cv_func_initgroups='yes'}
-ac_cv_header_stdlib_h=${ac_cv_header_stdlib_h='yes'}
-ac_cv_make_with_percent_rules=${ac_cv_make_with_percent_rules='yes'}
-ac_cv_func_sigprocmask=${ac_cv_func_sigprocmask='yes'}
-ac_cv_func_memmove=${ac_cv_func_memmove='yes'}
-ac_cv_func_strncasecmp=${ac_cv_func_strncasecmp='yes'}
-ac_cv_header_sys_filsys_h=${ac_cv_header_sys_filsys_h='no'}
-ac_cv_header_nl_types_h=${ac_cv_header_nl_types_h='no'}
-ac_cv_prog_cc_g=${ac_cv_prog_cc_g='yes'}
-ac_cv_path_install=${ac_cv_path_install='/usr/bin/install -c'}
-ac_cv_header_mnttab_h=${ac_cv_header_mnttab_h='no'}
-ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h='yes'}
-ac_cv_func_setlocale=${ac_cv_func_setlocale='yes'}
-ac_cv_lib_ext2fs_ext2fs_close=${ac_cv_lib_ext2fs_ext2fs_close='no'}
-ac_cv_func_statlstat=${ac_cv_func_statlstat='no'}
-gt_cv_func_gettext_libintl=${gt_cv_func_gettext_libintl='no'}
-ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped='no'}
-nls_cv_use_catgets=${nls_cv_use_catgets='no'}
-ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'}
-ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'}
-ac_cv_func_socketpair=${ac_cv_func_socketpair='yes'}
-ac_cv_func_pwdauth=${ac_cv_func_pwdauth='no'}
-ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp='yes'}
-ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h='no'}
-ac_cv_mandoc=${ac_cv_mandoc='-mandoc'}
-ac_cv_func_socket=${ac_cv_func_socket='yes'}
-ac_cv_func_sigaction=${ac_cv_func_sigaction='yes'}
-ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h='yes'}
-ac_cv_lib_gen_getmntent=${ac_cv_lib_gen_getmntent='no'}
-ac_cv_func___argz_count=${ac_cv_func___argz_count='no'}
-ac_cv_prog_system=${ac_cv_prog_system='CYGWIN_98-4.10'}
-ac_cv_lib_intl_tolower=${ac_cv_lib_intl_tolower='yes'}
-ac_cv_func_grantpt=${ac_cv_func_grantpt='yes'}
-ac_cv_func_memcpy=${ac_cv_func_memcpy='yes'}
-ac_cv_func_memset=${ac_cv_func_memset='yes'}
-ac_cv_path_GMSGFMT=${ac_cv_path_GMSGFMT='/usr/bin/msgfmt'}
-ac_cv_c_const=${ac_cv_c_const='yes'}
-ac_cv_lib_socket_socket=${ac_cv_lib_socket_socket='no'}
-ac_cv_header_termios_h=${ac_cv_header_termios_h='yes'}
-ac_cv_lib_rpc_pmap_set=${ac_cv_lib_rpc_pmap_set='no'}
-ac_cv_prog_CC=${ac_cv_prog_CC='gcc'}
-ac_cv_func_pmap_getmaps=${ac_cv_func_pmap_getmaps='no'}
-ac_cv_func_remove=${ac_cv_func_remove='yes'}
-ac_cv_lib_dnet_stub_dnet_ntoa=${ac_cv_lib_dnet_stub_dnet_ntoa='no'}
-ac_cv_type_umode_t=${ac_cv_type_umode_t='no'}
-ac_cv_type_mode_t=${ac_cv_type_mode_t='yes'}
-ac_cv_func_getmntinfo=${ac_cv_func_getmntinfo='no'}
-ac_cv_func_cfgetospeed=${ac_cv_func_cfgetospeed='yes'}
-ac_cv_func_munmap=${ac_cv_func_munmap='yes'}
-ac_cv_header_values_h=${ac_cv_header_values_h='no'}
-ac_cv_header_sys_select_h=${ac_cv_header_sys_select_h='yes'}
-ac_cv_path_AR=${ac_cv_path_AR='/usr/bin/ar'}
-ac_cv_path_CP=${ac_cv_path_CP='/usr/bin/cp'}
-ac_cv_type_nlink_t=${ac_cv_type_nlink_t='yes'}
-ac_cv_header_sys_mount_h=${ac_cv_header_sys_mount_h='yes'}
-ac_cv_func_sysconf=${ac_cv_func_sysconf='yes'}
-ac_cv_func_getwd=${ac_cv_func_getwd='yes'}
-gt_cv_func_gettext_libc=${gt_cv_func_gettext_libc='no'}
-ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'}
-ac_cv_prog_gnu_make=${ac_cv_prog_gnu_make='yes'}
-ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
-fu_cv_sys_stat_statfs3_osf1=${fu_cv_sys_stat_statfs3_osf1='no'}
-ac_cv_struct_st_rdev=${ac_cv_struct_st_rdev='yes'}
-ac_cv_func_alloca_works=${ac_cv_func_alloca_works='yes'}
-ac_cv_header_alloca_h=${ac_cv_header_alloca_h='no'}
-ac_cv_prog_cc_stdc=${ac_cv_prog_cc_stdc=''}
-ac_cv_func_shmat=${ac_cv_func_shmat='no'}
-ac_cv_have_x=${ac_cv_have_x='have_x=yes ac_x_includes=/usr/X11R6/include ac_x_libraries=/usr/X11R6/lib'}
-ac_cv_header_sys_fs_types_h=${ac_cv_header_sys_fs_types_h='no'}
-ac_cv_path_MSGFMT=${ac_cv_path_MSGFMT='/usr/bin/msgfmt'}
-ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
-ac_cv_dusum=${ac_cv_dusum='dusum_useb=yes; dusum_factor=1'}
-ac_cv_lib_dnet_dnet_ntoa=${ac_cv_lib_dnet_dnet_ntoa='no'}
-ac_cv_header_sys_fstyp_h=${ac_cv_header_sys_fstyp_h='no'}
-ac_cv_func___argz_stringify=${ac_cv_func___argz_stringify='no'}
-ac_cv_header_mntent_h=${ac_cv_header_mntent_h='yes'}
-ac_cv_lib_dir_opendir=${ac_cv_lib_dir_opendir='no'}
-ac_cv_header_sys_sysmacros_h=${ac_cv_header_sys_sysmacros_h='yes'}
-ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set='yes'}
-ac_cv_lib_seq_get_process_stats=${ac_cv_lib_seq_get_process_stats='no'}
-ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname='yes'}
-ac_cv_func_statfs=${ac_cv_func_statfs='yes'}
-nls_cv_header_intl=${nls_cv_header_intl='intl/libintl.h'}
-ac_cv_func___argz_next=${ac_cv_func___argz_next='no'}
-ac_cv_func_setenv=${ac_cv_func_setenv='yes'}
-ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h='yes'}
-ac_cv_header_string_h=${ac_cv_header_string_h='yes'}
-ac_cv_header_locale_h=${ac_cv_header_locale_h='yes'}
-ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'}
-ac_cv_c_inline=${ac_cv_c_inline='inline'}
-ac_cv_func_pmap_set=${ac_cv_func_pmap_set='no'}
-ac_cv_func_statvfs=${ac_cv_func_statvfs='no'}
-fu_cv_sys_d_ino_in_dirent=${fu_cv_sys_d_ino_in_dirent='yes'}
-ac_cv_header_sys_vfs_h=${ac_cv_header_sys_vfs_h='yes'}
-ac_cv_func_strchr=${ac_cv_func_strchr='yes'}
-ac_cv_header_utime_h=${ac_cv_header_utime_h='yes'}
-ac_cv_header_memory_h=${ac_cv_header_memory_h='yes'}
-ac_cv_func_keyok=${ac_cv_func_keyok='no'}
-ac_cv_filel=${ac_cv_filel='yes'}
-ac_cv_func_rresvport=${ac_cv_func_rresvport='yes'}
-fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize='yes'}
-ac_cv_prog_gcc=${ac_cv_prog_gcc='yes'}
-ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross='no'}
-ac_cv_lib_curses_setupterm=${ac_cv_lib_curses_setupterm='yes'}
-ac_cv_grep_stdin=${ac_cv_grep_stdin='yes'}
-ac_cv_prog_HAVE_FILECMD=${ac_cv_prog_HAVE_FILECMD='true'}
-ac_cv_prog_HAVE_nroff=${ac_cv_prog_HAVE_nroff='true'}
-ac_cv_lib_seq_getmntent=${ac_cv_lib_seq_getmntent='no'}
-ac_cv_func_strerror=${ac_cv_func_strerror='yes'}
-am_cv_val_LC_MESSAGES=${am_cv_val_LC_MESSAGES='yes'}
-ac_cv_type_off_t=${ac_cv_type_off_t='yes'}
-ac_cv_func_tcgetattr=${ac_cv_func_tcgetattr='yes'}
-nls_cv_force_use_gnu_gettext=${nls_cv_force_use_gnu_gettext='no'}
-ac_cv_type_pid_t=${ac_cv_type_pid_t='yes'}
-ac_cv_struct_st_blocks=${ac_cv_struct_st_blocks='yes'}
-ac_cv_lib_intl_bindtextdomain=${ac_cv_lib_intl_bindtextdomain='yes'}
-ac_cv_path_RM=${ac_cv_path_RM='/usr/bin/rm'}
-ac_cv_header_sys_mkdev_h=${ac_cv_header_sys_mkdev_h='no'}
-ac_cv_header_sys_types_h_makedev=${ac_cv_header_sys_types_h_makedev='no'}
-ac_cv_func_connect=${ac_cv_func_connect='yes'}
-fu_cv_sys_mounted_getmntent1=${fu_cv_sys_mounted_getmntent1='yes'}
-ac_cv_func_sigemptyset=${ac_cv_func_sigemptyset='yes'}
-ac_cv_struct_st_blksize=${ac_cv_struct_st_blksize='yes'}
-nls_cv_use_gnu_gettext=${nls_cv_use_gnu_gettext='yes'}
-ac_cv_header_argz_h=${ac_cv_header_argz_h='no'}
-ac_cv_prog_AWK=${ac_cv_prog_AWK='gawk'}
-ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'}
-ac_cv_func_resizeterm=${ac_cv_func_resizeterm='no'}
-fu_cv_sys_mounted_getmntent2=${fu_cv_sys_mounted_getmntent2='no'}
-ac_cv_header_malloc_h=${ac_cv_header_malloc_h='yes'}
-ac_cv_func_getpagesize=${ac_cv_func_getpagesize='yes'}
-ac_cv_nroff_tascii=${ac_cv_nroff_tascii=' -Tascii'}
-ac_cv_func_getmntent=${ac_cv_func_getmntent='yes'}
-ac_cv_header_libintl_h=${ac_cv_header_libintl_h='yes'}
-ac_cv_dnamesize=${ac_cv_dnamesize='yes'}
-ac_cv_path_MV=${ac_cv_path_MV='/usr/bin/mv'}
-ac_cv_lib_slang_SLang_init_tty=${ac_cv_lib_slang_SLang_init_tty='no'}
-ac_cv_type_uid_t=${ac_cv_type_uid_t='yes'}
-ac_cv_filestdin=${ac_cv_filestdin='yes'}
-ac_cv_lib_crypt_crypt=${ac_cv_lib_crypt_crypt='yes'}
-ac_cv_lib_gpm_Gpm_Repeat=${ac_cv_lib_gpm_Gpm_Repeat='no'}
-ac_cv_header_rpc_pmap_clnt_h=${ac_cv_header_rpc_pmap_clnt_h='no'}
-ac_cv_func_pmap_getport=${ac_cv_func_pmap_getport='no'}
-ac_cv_lib_ICE_IceConnectionNumber=${ac_cv_lib_ICE_IceConnectionNumber='yes'}
-ac_cv_func_strdup=${ac_cv_func_strdup='yes'}
-nls_cv_header_libgt=${nls_cv_header_libgt='intl/libgettext.h'}
-ac_cv_func_putenv=${ac_cv_func_putenv='yes'}
-ac_cv_func_truncate=${ac_cv_func_truncate='yes'}
-ac_cv_func_stpcpy=${ac_cv_func_stpcpy='no'}
diff --git a/rosapps/applications/mc/config.h b/rosapps/applications/mc/config.h
deleted file mode 100644
index 4cfd30fc623..00000000000
--- a/rosapps/applications/mc/config.h
+++ /dev/null
@@ -1,575 +0,0 @@
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* This is the configuration file for the Midnight Commander. It was generated
- by autoconf's configure.
-
- Configure for Midnight Commander
- Copyright (C) 1994, 1995 Janne Kukonlehto
- Copyright (C) 1994, 1995 Miguel de Icaza
- Copyright (C) 1995 Jakub Jelinek
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
-
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
-
-/* Define to `int' if doesn't define. */
-/* #undef gid_t */
-
-/* Define if you have alloca, as a function or macro. */
-#define HAVE_ALLOCA 1
-
-/* Define if you have and it should be used (not on Ultrix). */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if you have the getmntent function. */
-#define HAVE_GETMNTENT 1
-
-/* Define if you have a working `mmap' system call. */
-/* #undef HAVE_MMAP */
-
-/* Define if your struct stat has st_blksize. */
-#define HAVE_ST_BLKSIZE 1
-
-/* Define if your struct stat has st_blocks. */
-#define HAVE_ST_BLOCKS 1
-
-/* Define if your struct stat has st_rdev. */
-#define HAVE_ST_RDEV 1
-
-/* Define if you have that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define as __inline if that's what the C compiler calls it. */
-/* #undef inline */
-
-/* Define if major, minor, and makedev are declared in . */
-/* #undef MAJOR_IN_MKDEV */
-
-/* Define if major, minor, and makedev are declared in . */
-#define MAJOR_IN_SYSMACROS 1
-
-/* Define if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to `int' if doesn't define. */
-/* #undef mode_t */
-
-/* Define to `long' if doesn't define. */
-/* #undef off_t */
-
-/* Define to `int' if doesn't define. */
-/* #undef pid_t */
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
-
-/* Define to `unsigned' if doesn't define. */
-/* #undef size_t */
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-/* #undef STACK_DIRECTION */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define to `int' if doesn't define. */
-/* #undef uid_t */
-
-/* Define if the X Window System is missing or not being used. */
-/* #undef X_DISPLAY_MISSING */
-
-#define PACKAGE "mc"
-
-/* Always defined */
-#define D_INO_IN_DIRENT 1
-/* #undef IS_AIX */
-/* #undef MOUNTED_FREAD */
-/* #undef MOUNTED_FREAD_FSTYP */
-/* #undef MOUNTED_GETFSSTAT */
-/* #undef MOUNTED_GETMNT */
-#define MOUNTED_GETMNTENT1 1
-/* #undef MOUNTED_GETMNTENT2 */
-/* #undef MOUNTED_GETMNTINFO */
-/* #undef MOUNTED_VMOUNT */
-#define STAT_STATFS2_BSIZE 1
-/* #undef STAT_STATFS2_FSIZE */
-/* #undef STAT_STATFS2_FS_DATA */
-/* #undef STAT_STATFS3_OSF1 */
-/* #undef STAT_STATFS4 */
-/* #undef STAT_STATVFS */
-
-/* Define umode_t if your system does not provide it */
-#define umode_t int
-
-/* Define nlink_t if your system does not provide it */
-/* #undef nlink_t */
-
-/* Does the file command accepts the -L option */
-#define FILE_L 1
-
-/* Does the file command work well with - option for stdin? */
-#define FILE_STDIN 1
-
-/* Does the grep command work well with - option for stdin? */
-#define GREP_STDIN 1
-
-/* Is the program using the GPM library? */
-/* #undef HAVE_LIBGPM */
-
-/* Is the program using the distributed slang library? */
-#define HAVE_SLANG 1
-
-/* Is the program using a system-installed slang library? */
-/* #undef HAVE_SYSTEM_SLANG */
-
-/* Define if the slang.h header file is inside a directory slang
-** in the standard directories
-*/
-/* #undef SLANG_H_INSIDE_SLANG_DIR */
-
-/* Does the program have subshell support? */
-#define HAVE_SUBSHELL_SUPPORT 1
-
-/* If you don't have gcc, define this */
-/* #undef OLD_TOOLS */
-
-/* Is the subshell the default or optional? */
-/* #undef SUBSHELL_OPTIONAL */
-
-/* Use SunOS SysV curses? */
-/* #undef SUNOS_CURSES */
-
-/* Use SystemV curses? */
-/* #undef USE_SYSV_CURSES */
-
-/* Use Ncurses? */
-/* #undef USE_NCURSES */
-
-/* If you Curses does not have color define this one */
-/* #undef NO_COLOR_SUPPORT */
-
-/* Support the Midnight Commander Virtual File System? */
-#define USE_VFS 1
-
-/* Support for the Memory Allocation Debugger */
-/* #undef HAVE_MAD */
-
-/* Extra Debugging */
-/* #undef MCDEBUG */
-
-/* If the Slang library will be using it's own terminfo instead of termcap */
-#define SLANG_TERMINFO 1
-
-/* If Slang library should use termcap */
-/* #undef USE_TERMCAP */
-
-/* If you have socket and the rest of the net functions use this */
-#define USE_NETCODE 1
-
-/* If defined, use .netrc for FTP connections */
-/* #undef USE_NETRC */
-
-/* If your operating system does not have enough space for a file name
- * in a struct dirent, then define this
- */
-/* #undef NEED_EXTRA_DIRENT_BUFFER */
-
-/* Define if you want the du -s summary */
-#define HAVE_DUSUM 1
-
-/* Define if your du does handle -b correctly */
-#define DUSUM_USEB 1
-
-/* Define to size of chunks du is displaying its information.
- * If DUSUM_USEB is defined, this should be 1
- */
-#define DUSUM_FACTOR 1
-
-/* Define this one if you want termnet support */
-/* #undef USE_TERMNET */
-
-/* Defined if you have libXpm, , libXext, */
-/* #undef HAVE_XPM_SHAPE */
-
-/* Defined if you have shadow passwords on Linux */
-/* #undef LINUX_SHADOW */
-
-/* Defined if you have the crypt prototype in neither unistd.h nor crypt.h */
-#define NEED_CRYPT_PROTOTYPE 1
-
-/* Define if you want to turn on SCO-specific code */
-/* #undef SCO_FLAVOR */
-
-/* Define if your system has struct linger */
-#define HAVE_STRUCT_LINGER 1
-
-/* Define if your curses has this one (AIX, OSF/1) */
-/* #undef USE_SETUPTERM */
-
-/* Link in ext2fs code for delfs experimental file system */
-/* #undef USE_EXT2FSLIB */
-
-/* Define if you want to use the HSC firewall */
-/* #undef HSC_PROXY */
-
-/* Define if your system uses PAM for auth stuff */
-/* #undef HAVE_PAM */
-
-/* Define if you have the get_process_stats function and have to use that instead of gettimeofday */
-/* #undef HAVE_GET_PROCESS_STATS */
-
-/* Define if you want to call the internal routine edit() for the editor */
-#define USE_INTERNAL_EDIT 1
-
-/* Define if your system has socketpair */
-#define HAVE_SOCKETPAIR 1
-
-/* Version of ncurses */
-/* #undef NCURSES_970530 */
-
-/* #undef HAVE_STPCPY */
-
-#define ENABLE_NLS 1
-/* #undef HAVE_CATGETS */
-/* #undef HAVE_GETTEXT */
-#define HAVE_LC_MESSAGES 1
-
-/* Define if you have the __argz_count function. */
-/* #undef HAVE___ARGZ_COUNT */
-
-/* Define if you have the __argz_next function. */
-/* #undef HAVE___ARGZ_NEXT */
-
-/* Define if you have the __argz_stringify function. */
-/* #undef HAVE___ARGZ_STRINGIFY */
-
-/* Define if you have the cfgetospeed function. */
-#define HAVE_CFGETOSPEED 1
-
-/* Define if you have the crypt function. */
-/* #undef HAVE_CRYPT */
-
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
-
-/* Define if you have the getcwd function. */
-#define HAVE_GETCWD 1
-
-/* Define if you have the getmntinfo function. */
-/* #undef HAVE_GETMNTINFO */
-
-/* Define if you have the getpagesize function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define if you have the getwd function. */
-#define HAVE_GETWD 1
-
-/* Define if you have the grantpt function. */
-#define HAVE_GRANTPT 1
-
-/* Define if you have the initgroups function. */
-#define HAVE_INITGROUPS 1
-
-/* Define if you have the keyok function. */
-/* #undef HAVE_KEYOK */
-
-/* Define if you have the memcpy function. */
-#define HAVE_MEMCPY 1
-
-/* Define if you have the memmove function. */
-#define HAVE_MEMMOVE 1
-
-/* Define if you have the memset function. */
-#define HAVE_MEMSET 1
-
-/* Define if you have the munmap function. */
-#define HAVE_MUNMAP 1
-
-/* Define if you have the pmap_getmaps function. */
-/* #undef HAVE_PMAP_GETMAPS */
-
-/* Define if you have the pmap_getport function. */
-/* #undef HAVE_PMAP_GETPORT */
-
-/* Define if you have the pmap_set function. */
-/* #undef HAVE_PMAP_SET */
-
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the pwdauth function. */
-/* #undef HAVE_PWDAUTH */
-
-/* Define if you have the resizeterm function. */
-/* #undef HAVE_RESIZETERM */
-
-/* Define if you have the rresvport function. */
-#define HAVE_RRESVPORT 1
-
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
-
-/* Define if you have the setlocale function. */
-#define HAVE_SETLOCALE 1
-
-/* Define if you have the sigaction function. */
-#define HAVE_SIGACTION 1
-
-/* Define if you have the sigaddset function. */
-#define HAVE_SIGADDSET 1
-
-/* Define if you have the sigemptyset function. */
-#define HAVE_SIGEMPTYSET 1
-
-/* Define if you have the sigprocmask function. */
-#define HAVE_SIGPROCMASK 1
-
-/* Define if you have the socket function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the socketpair function. */
-#define HAVE_SOCKETPAIR 1
-
-/* Define if you have the statfs function. */
-#define HAVE_STATFS 1
-
-/* Define if you have the statlstat function. */
-/* #undef HAVE_STATLSTAT */
-
-/* Define if you have the statvfs function. */
-/* #undef HAVE_STATVFS */
-
-/* Define if you have the stpcpy function. */
-/* #undef HAVE_STPCPY */
-
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* Define if you have the strchr function. */
-#define HAVE_STRCHR 1
-
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strncasecmp function. */
-#define HAVE_STRNCASECMP 1
-
-/* Define if you have the sysconf function. */
-#define HAVE_SYSCONF 1
-
-/* Define if you have the tcgetattr function. */
-#define HAVE_TCGETATTR 1
-
-/* Define if you have the tcsetattr function. */
-#define HAVE_TCSETATTR 1
-
-/* Define if you have the truncate function. */
-#define HAVE_TRUNCATE 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_ARGZ_H */
-
-/* Define if you have the header file. */
-#define HAVE_CRYPT_H 1
-
-/* Define if you have the header file. */
-#define HAVE_DIRENT_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_EXT2FS_EXT2FS_H */
-
-/* Define if you have the header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the header file. */
-#define HAVE_GRP_H 1
-
-/* Define if you have the header file. */
-#define HAVE_LIMITS_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_LINUX_EXT2_FS_H */
-
-/* Define if you have the header file. */
-#define HAVE_LOCALE_H 1
-
-/* Define if you have the header file. */
-#define HAVE_MALLOC_H 1
-
-/* Define if you have the header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define if you have the header file. */
-#define HAVE_MNTENT_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_MNTTAB_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_NDIR_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_NL_TYPES_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_RPC_PMAP_CLNT_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SHADOW_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SHADOW_SHADOW_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SLANG_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SLANG_SLANG_H */
-
-/* Define if you have the header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define if you have the header file. */
-#define HAVE_STRING_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_DIR_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_DUSTAT_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_FILSYS_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_FS_TYPES_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_FSTYP_H */
-
-/* Define if you have the header file. */
-#define HAVE_SYS_MOUNT_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_NDIR_H */
-
-/* Define if you have the header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the header file. */
-#define HAVE_SYS_SELECT_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_STATFS_H */
-
-/* Define if you have the header file. */
-/* #undef HAVE_SYS_STATVFS_H */
-
-/* Define if you have the header file. */
-#define HAVE_SYS_VFS_H 1
-
-/* Define if you have the header file. */
-#define HAVE_TERMIOS_H 1
-
-/* Define if you have the header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the header file. */
-#define HAVE_UTIME_H 1
-
-/* Define if you have the header file. */
-/* #undef HAVE_VALUES_H */
-
-/* Define if you have the i library (-li). */
-/* #undef HAVE_LIBI */
-
-/* Define if you have the intl library (-lintl). */
-#define HAVE_LIBINTL 1
-
-/* Define if you have the nsl library (-lnsl). */
-/* #undef HAVE_LIBNSL */
-
-/* Define if you have the pt library (-lpt). */
-/* #undef HAVE_LIBPT */
-
-/* Define if you have the socket library (-lsocket). */
-/* #undef HAVE_LIBSOCKET */
-
-#ifdef HAVE_LIBPT
-# define HAVE_GRANTPT
-#endif
-
-#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBCRYPT_I)
-# define HAVE_CRYPT
-#endif
-
-#ifdef HAVE_XVIEW
-# include
-#endif
-
-#if defined(HAVE_SIGADDSET) && defined(HAVE_SIGEMPTYSET)
-# if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
-# define SLANG_POSIX_SIGNALS
-# endif
-#endif
-
-#ifdef __os2__
-# define OS2_NT 1
-# define S_ISFIFO(x) 0
-#endif
-
-#ifdef _OS_NT
-# define OS2_NT 1
-#endif
-
-#ifndef OS2_NT
-/* some Unices do not define this, and slang requires it: */
-#ifndef unix
-# define unix
-#endif
-#endif
-
diff --git a/rosapps/applications/mc/config.h.in b/rosapps/applications/mc/config.h.in
deleted file mode 100644
index 1c5e449afb8..00000000000
--- a/rosapps/applications/mc/config.h.in
+++ /dev/null
@@ -1,574 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* This is the configuration file for the Midnight Commander. It was generated
- by autoconf's configure.
-
- Configure for Midnight Commander
- Copyright (C) 1994, 1995 Janne Kukonlehto
- Copyright (C) 1994, 1995 Miguel de Icaza
- Copyright (C) 1995 Jakub Jelinek
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define to `int' if doesn't define. */
-#undef gid_t
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you have the getmntent function. */
-#undef HAVE_GETMNTENT
-
-/* Define if you have a working `mmap' system call. */
-#undef HAVE_MMAP
-
-/* Define if your struct stat has st_blksize. */
-#undef HAVE_ST_BLKSIZE
-
-/* Define if your struct stat has st_blocks. */
-#undef HAVE_ST_BLOCKS
-
-/* Define if your struct stat has st_rdev. */
-#undef HAVE_ST_RDEV
-
-/* Define if you have that is POSIX.1 compatible. */
-#undef HAVE_SYS_WAIT_H
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if major, minor, and makedev are declared in . */
-#undef MAJOR_IN_MKDEV
-
-/* Define if major, minor, and makedev are declared in . */
-#undef MAJOR_IN_SYSMACROS
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define to `int' if doesn't define. */
-#undef mode_t
-
-/* Define to `long' if doesn't define. */
-#undef off_t
-
-/* Define to `int' if doesn't define. */
-#undef pid_t
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define to `unsigned' if doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define to `int' if doesn't define. */
-#undef uid_t
-
-/* Define if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-#undef PACKAGE
-
-/* Always defined */
-#undef D_INO_IN_DIRENT
-#undef IS_AIX
-#undef MOUNTED_FREAD
-#undef MOUNTED_FREAD_FSTYP
-#undef MOUNTED_GETFSSTAT
-#undef MOUNTED_GETMNT
-#undef MOUNTED_GETMNTENT1
-#undef MOUNTED_GETMNTENT2
-#undef MOUNTED_GETMNTINFO
-#undef MOUNTED_VMOUNT
-#undef STAT_STATFS2_BSIZE
-#undef STAT_STATFS2_FSIZE
-#undef STAT_STATFS2_FS_DATA
-#undef STAT_STATFS3_OSF1
-#undef STAT_STATFS4
-#undef STAT_STATVFS
-
-/* Define umode_t if your system does not provide it */
-#undef umode_t
-
-/* Define nlink_t if your system does not provide it */
-#undef nlink_t
-
-/* Does the file command accepts the -L option */
-#undef FILE_L
-
-/* Does the file command work well with - option for stdin? */
-#undef FILE_STDIN
-
-/* Does the grep command work well with - option for stdin? */
-#undef GREP_STDIN
-
-/* Is the program using the GPM library? */
-#undef HAVE_LIBGPM
-
-/* Is the program using the distributed slang library? */
-#undef HAVE_SLANG
-
-/* Is the program using a system-installed slang library? */
-#undef HAVE_SYSTEM_SLANG
-
-/* Define if the slang.h header file is inside a directory slang
-** in the standard directories
-*/
-#undef SLANG_H_INSIDE_SLANG_DIR
-
-/* Does the program have subshell support? */
-#undef HAVE_SUBSHELL_SUPPORT
-
-/* If you don't have gcc, define this */
-#undef OLD_TOOLS
-
-/* Is the subshell the default or optional? */
-#undef SUBSHELL_OPTIONAL
-
-/* Use SunOS SysV curses? */
-#undef SUNOS_CURSES
-
-/* Use SystemV curses? */
-#undef USE_SYSV_CURSES
-
-/* Use Ncurses? */
-#undef USE_NCURSES
-
-/* If you Curses does not have color define this one */
-#undef NO_COLOR_SUPPORT
-
-/* Support the Midnight Commander Virtual File System? */
-#undef USE_VFS
-
-/* Support for the Memory Allocation Debugger */
-#undef HAVE_MAD
-
-/* Extra Debugging */
-#undef MCDEBUG
-
-/* If the Slang library will be using it's own terminfo instead of termcap */
-#undef SLANG_TERMINFO
-
-/* If Slang library should use termcap */
-#undef USE_TERMCAP
-
-/* If you have socket and the rest of the net functions use this */
-#undef USE_NETCODE
-
-/* If defined, use .netrc for FTP connections */
-#undef USE_NETRC
-
-/* If your operating system does not have enough space for a file name
- * in a struct dirent, then define this
- */
-#undef NEED_EXTRA_DIRENT_BUFFER
-
-/* Define if you want the du -s summary */
-#undef HAVE_DUSUM
-
-/* Define if your du does handle -b correctly */
-#undef DUSUM_USEB
-
-/* Define to size of chunks du is displaying its information.
- * If DUSUM_USEB is defined, this should be 1
- */
-#define DUSUM_FACTOR 512
-
-/* Define this one if you want termnet support */
-#undef USE_TERMNET
-
-/* Defined if you have libXpm, , libXext, */
-#undef HAVE_XPM_SHAPE
-
-/* Defined if you have shadow passwords on Linux */
-#undef LINUX_SHADOW
-
-/* Defined if you have the crypt prototype in neither unistd.h nor crypt.h */
-#undef NEED_CRYPT_PROTOTYPE
-
-/* Define if you want to turn on SCO-specific code */
-#undef SCO_FLAVOR
-
-/* Define if your system has struct linger */
-#undef HAVE_STRUCT_LINGER
-
-/* Define if your curses has this one (AIX, OSF/1) */
-#undef USE_SETUPTERM
-
-/* Link in ext2fs code for delfs experimental file system */
-#undef USE_EXT2FSLIB
-
-/* Define if you want to use the HSC firewall */
-#undef HSC_PROXY
-
-/* Define if your system uses PAM for auth stuff */
-#undef HAVE_PAM
-
-/* Define if you have the get_process_stats function and have to use that instead of gettimeofday */
-#undef HAVE_GET_PROCESS_STATS
-
-/* Define if you want to call the internal routine edit() for the editor */
-#undef USE_INTERNAL_EDIT
-
-/* Define if your system has socketpair */
-#undef HAVE_SOCKETPAIR
-
-/* Version of ncurses */
-#undef NCURSES_970530
-
-#undef HAVE_STPCPY
-
-#undef ENABLE_NLS
-#undef HAVE_CATGETS
-#undef HAVE_GETTEXT
-#undef HAVE_LC_MESSAGES
-
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
-
-/* Define if you have the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
-
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
-
-/* Define if you have the cfgetospeed function. */
-#undef HAVE_CFGETOSPEED
-
-/* Define if you have the crypt function. */
-#undef HAVE_CRYPT
-
-/* Define if you have the dcgettext function. */
-#undef HAVE_DCGETTEXT
-
-/* Define if you have the getcwd function. */
-#undef HAVE_GETCWD
-
-/* Define if you have the getmntinfo function. */
-#undef HAVE_GETMNTINFO
-
-/* Define if you have the getpagesize function. */
-#undef HAVE_GETPAGESIZE
-
-/* Define if you have the getwd function. */
-#undef HAVE_GETWD
-
-/* Define if you have the grantpt function. */
-#undef HAVE_GRANTPT
-
-/* Define if you have the initgroups function. */
-#undef HAVE_INITGROUPS
-
-/* Define if you have the keyok function. */
-#undef HAVE_KEYOK
-
-/* Define if you have the memcpy function. */
-#undef HAVE_MEMCPY
-
-/* Define if you have the memmove function. */
-#undef HAVE_MEMMOVE
-
-/* Define if you have the memset function. */
-#undef HAVE_MEMSET
-
-/* Define if you have the munmap function. */
-#undef HAVE_MUNMAP
-
-/* Define if you have the pmap_getmaps function. */
-#undef HAVE_PMAP_GETMAPS
-
-/* Define if you have the pmap_getport function. */
-#undef HAVE_PMAP_GETPORT
-
-/* Define if you have the pmap_set function. */
-#undef HAVE_PMAP_SET
-
-/* Define if you have the putenv function. */
-#undef HAVE_PUTENV
-
-/* Define if you have the pwdauth function. */
-#undef HAVE_PWDAUTH
-
-/* Define if you have the resizeterm function. */
-#undef HAVE_RESIZETERM
-
-/* Define if you have the rresvport function. */
-#undef HAVE_RRESVPORT
-
-/* Define if you have the setenv function. */
-#undef HAVE_SETENV
-
-/* Define if you have the setlocale function. */
-#undef HAVE_SETLOCALE
-
-/* Define if you have the sigaction function. */
-#undef HAVE_SIGACTION
-
-/* Define if you have the sigaddset function. */
-#undef HAVE_SIGADDSET
-
-/* Define if you have the sigemptyset function. */
-#undef HAVE_SIGEMPTYSET
-
-/* Define if you have the sigprocmask function. */
-#undef HAVE_SIGPROCMASK
-
-/* Define if you have the socket function. */
-#undef HAVE_SOCKET
-
-/* Define if you have the socketpair function. */
-#undef HAVE_SOCKETPAIR
-
-/* Define if you have the statfs function. */
-#undef HAVE_STATFS
-
-/* Define if you have the statlstat function. */
-#undef HAVE_STATLSTAT
-
-/* Define if you have the statvfs function. */
-#undef HAVE_STATVFS
-
-/* Define if you have the stpcpy function. */
-#undef HAVE_STPCPY
-
-/* Define if you have the strcasecmp function. */
-#undef HAVE_STRCASECMP
-
-/* Define if you have the strchr function. */
-#undef HAVE_STRCHR
-
-/* Define if you have the strdup function. */
-#undef HAVE_STRDUP
-
-/* Define if you have the strerror function. */
-#undef HAVE_STRERROR
-
-/* Define if you have the strncasecmp function. */
-#undef HAVE_STRNCASECMP
-
-/* Define if you have the sysconf function. */
-#undef HAVE_SYSCONF
-
-/* Define if you have the tcgetattr function. */
-#undef HAVE_TCGETATTR
-
-/* Define if you have the tcsetattr function. */
-#undef HAVE_TCSETATTR
-
-/* Define if you have the truncate function. */
-#undef HAVE_TRUNCATE
-
-/* Define if you have the header file. */
-#undef HAVE_ARGZ_H
-
-/* Define if you have the header file. */
-#undef HAVE_CRYPT_H
-
-/* Define if you have the header file. */
-#undef HAVE_DIRENT_H
-
-/* Define if you have the header file. */
-#undef HAVE_EXT2FS_EXT2FS_H
-
-/* Define if you have the header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if you have the header file. */
-#undef HAVE_GRP_H
-
-/* Define if you have the header file. */
-#undef HAVE_LIMITS_H
-
-/* Define if you have the header file. */
-#undef HAVE_LINUX_EXT2_FS_H
-
-/* Define if you have the header file. */
-#undef HAVE_LOCALE_H
-
-/* Define if you have the header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the header file. */
-#undef HAVE_MEMORY_H
-
-/* Define if you have the header file. */
-#undef HAVE_MNTENT_H
-
-/* Define if you have the header file. */
-#undef HAVE_MNTTAB_H
-
-/* Define if you have the header file. */
-#undef HAVE_NDIR_H
-
-/* Define if you have the header file. */
-#undef HAVE_NL_TYPES_H
-
-/* Define if you have the header file. */
-#undef HAVE_RPC_PMAP_CLNT_H
-
-/* Define if you have the header file. */
-#undef HAVE_SHADOW_H
-
-/* Define if you have the header file. */
-#undef HAVE_SHADOW_SHADOW_H
-
-/* Define if you have the header file. */
-#undef HAVE_SLANG_H
-
-/* Define if you have the header file. */
-#undef HAVE_SLANG_SLANG_H
-
-/* Define if you have the header file. */
-#undef HAVE_STDLIB_H
-
-/* Define if you have the header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_DIR_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_DUSTAT_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_FILSYS_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_FS_TYPES_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_FSTYP_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_MOUNT_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_NDIR_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_PARAM_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_SELECT_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_STATFS_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_STATVFS_H
-
-/* Define if you have the header file. */
-#undef HAVE_SYS_VFS_H
-
-/* Define if you have the header file. */
-#undef HAVE_TERMIOS_H
-
-/* Define if you have the header file. */
-#undef HAVE_UNISTD_H
-
-/* Define if you have the header file. */
-#undef HAVE_UTIME_H
-
-/* Define if you have the header file. */
-#undef HAVE_VALUES_H
-
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
-
-/* Define if you have the intl library (-lintl). */
-#undef HAVE_LIBINTL
-
-/* Define if you have the nsl library (-lnsl). */
-#undef HAVE_LIBNSL
-
-/* Define if you have the pt library (-lpt). */
-#undef HAVE_LIBPT
-
-/* Define if you have the socket library (-lsocket). */
-#undef HAVE_LIBSOCKET
-
-#ifdef HAVE_LIBPT
-# define HAVE_GRANTPT
-#endif
-
-#if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBCRYPT_I)
-# define HAVE_CRYPT
-#endif
-
-#ifdef HAVE_XVIEW
-# include
-#endif
-
-#if defined(HAVE_SIGADDSET) && defined(HAVE_SIGEMPTYSET)
-# if defined(HAVE_SIGACTION) && defined(HAVE_SIGPROCMASK)
-# define SLANG_POSIX_SIGNALS
-# endif
-#endif
-
-#ifdef __os2__
-# define OS2_NT 1
-# define S_ISFIFO(x) 0
-#endif
-
-#ifdef _OS_NT
-# define OS2_NT 1
-#endif
-
-#ifndef OS2_NT
-/* some Unices do not define this, and slang requires it: */
-#ifndef unix
-# define unix
-#endif
-#endif
-
diff --git a/rosapps/applications/mc/config.status b/rosapps/applications/mc/config.status
deleted file mode 100644
index 0733db4a8a1..00000000000
--- a/rosapps/applications/mc/config.status
+++ /dev/null
@@ -1,810 +0,0 @@
-#! /bin/sh
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host ROSBOX:
-#
-# ./configure --build=mingw32 --host=mingw32 --target=mingw32
-#
-# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
-
-ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
-for ac_option
-do
- case "$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running ${CONFIG_SHELL-/bin/sh} ./configure --build=mingw32 --host=mingw32 --target=mingw32 --no-create --no-recursion"
- exec ${CONFIG_SHELL-/bin/sh} ./configure --build=mingw32 --host=mingw32 --target=mingw32 --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "./config.status generated by autoconf version 2.12"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "$ac_cs_usage"; exit 0 ;;
- *) echo "$ac_cs_usage"; exit 1 ;;
- esac
-done
-
-ac_given_srcdir=.
-ac_given_INSTALL="/usr/bin/install -c"
-
-trap 'rm -fr
-Make.common
-Makefile
-doc/Makefile
-vfs/Makefile
-lib/Makefile
-tk/Makefile
-gnome/Makefile
-xv/Makefile
-src/Makefile
-slang/Makefile
-edit/Makefile
-icons/Makefile
-
-lib/mc.ext
-mcfn_install
-vfs/extfs/ftplist vfs/extfs/zip vfs/extfs/zoo vfs/extfs/lslR
-vfs/extfs/lha vfs/extfs/cpio vfs/extfs/deb vfs/extfs/rar
-
-doc/mc.1 doc/mcedit.1 doc/mcserv.8
-
-intl/Makefile po/Makefile.in
- config.h conftest*; exit 1' 1 2 15
-
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
-/^[ ]*VPATH[ ]*=[^:]*$/d
-
-s%@CFLAGS@%-g%g
-s%@CPPFLAGS@%-I.. -I$(vfsdir) -I$(rootdir) -I$(slangdir)%g
-s%@CXXFLAGS@%%g
-s%@DEFS@%-DHAVE_CONFIG_H%g
-s%@LDFLAGS@%%g
-s%@LIBS@%-lintl -lcrypt %g
-s%@exec_prefix@%${prefix}%g
-s%@prefix@%/usr/local%g
-s%@program_transform_name@%s,x,x,%g
-s%@bindir@%${exec_prefix}/bin%g
-s%@sbindir@%${exec_prefix}/sbin%g
-s%@libexecdir@%${exec_prefix}/libexec%g
-s%@datadir@%${prefix}/share%g
-s%@sysconfdir@%${prefix}/etc%g
-s%@sharedstatedir@%${prefix}/com%g
-s%@localstatedir@%${prefix}/var%g
-s%@libdir@%${exec_prefix}/lib%g
-s%@includedir@%${prefix}/include%g
-s%@oldincludedir@%/usr/include%g
-s%@infodir@%${prefix}/info%g
-s%@mandir@%${prefix}/man%g
-s%@MC@%%g
-s%@SET_MAKE@%%g
-s%@CC@%gcc%g
-s%@CPP@%gcc -E%g
-s%@RANLIB@%ranlib%g
-s%@LN_S@%ln -s%g
-s%@AWK@%gawk%g
-s%@AWK_VAR_OPTION@%-v%g
-s%@dep@%fastdep%g
-s%@GNU_MAKE@%GNU_MAKE=yes%g
-s%@MV@%/usr/bin/mv%g
-s%@CP@%/usr/bin/cp%g
-s%@RM@%/usr/bin/rm%g
-s%@CHMOD@%/usr/bin/chmod%g
-s%@AR@%/usr/bin/ar%g
-s%@system@%CYGWIN_98-4.10%g
-s%@X11_WWW@%lynx%g
-s%@ALLOCA@%%g
-s%@USE_NLS@%yes%g
-s%@MSGFMT@%/usr/bin/msgfmt%g
-s%@GMSGFMT@%/usr/bin/msgfmt%g
-s%@XGETTEXT@%/usr/bin/xgettext%g
-s%@GENCAT@%%g
-s%@USE_INCLUDED_LIBINTL@%yes%g
-s%@CATALOGS@% es.gmo fr.gmo ru.gmo ko.gmo it.gmo%g
-s%@CATOBJEXT@%.gmo%g
-s%@DATADIRNAME@%share%g
-s%@GMOFILES@% es.gmo fr.gmo ru.gmo ko.gmo it.gmo%g
-s%@INSTOBJEXT@%.mo%g
-s%@INTLDEPS@%$(top_builddir)/intl/libintl.a%g
-s%@INTLLIBS@%$(top_builddir)/intl/libintl.a%g
-s%@INTLOBJS@%$(GETTOBJS)%g
-s%@POFILES@% es.po fr.po ru.po ko.po it.po%g
-s%@POSUB@%po%g
-s%@INCLUDE_LOCALE_H@%#include %g
-s%@GT_NO@%%g
-s%@GT_YES@%#YES#%g
-s%@MKINSTALLDIRS@%$(top_srcdir)/mkinstalldirs%g
-s%@l@%%g
-s%@INSTALL_PROGRAM@%${INSTALL}%g
-s%@INSTALL_DATA@%${INSTALL} -m 644%g
-s%@REGEX_O@%regex.o%g
-s%@LIBOBJS@%%g
-s%@SHADOWLIB@%%g
-s%@X_CFLAGS@% -I/usr/X11R6/include%g
-s%@X_PRE_LIBS@% -lSM -lICE%g
-s%@X_LIBS@% -L/usr/X11R6/lib%g
-s%@X_EXTRA_LIBS@%%g
-s%@XVIEW_CFLAGS@% -DXVIEW_MISSING%g
-s%@XVIEW_CPPFLAGS@%%g
-s%@XVIEW_LIBS@%%g
-s%@HAVE_XVIEW@%no%g
-s%@HAVE_XVIEW_PRIVATE_HEADERS@%yes%g
-s%@insticons@%%g
-s%@mxc@%%g
-s%@xvdep@%%g
-s%@ac_my_xp@%%g
-s%@xv_bindir@%%g
-s%@NETFILES@%$(NETFILES)%g
-s%@XCURSES@%%g
-s%@tkmc@%%g
-s%@tkdep@%%g
-s%@tk_includes@%%g
-s%@tk_libs@%%g
-s%@GNOME_LIBS@%%g
-s%@GNOMEUI_LIBS@%%g
-s%@GTKXMHTML_LIBS@%%g
-s%@GNOME_LIBDIR@%%g
-s%@GNOME_INCLUDEDIR@%%g
-s%@gmc@%%g
-s%@gmcdep@%%g
-s%@HAVE_nroff@%true%g
-s%@MANDOC@%-mandoc%g
-s%@TROFFASCII@% -Tascii%g
-s%@HAVE_FILECMD@%true%g
-s%@INTLSUB@%intl%g
-s%@LINTL@%%g
-s%@LIBSLANG@%libmcslang.a%g
-s%@LSLANG@%-lmcslang%g
-s%@fastdepslang@%fastdepslang%g
-s%@TERMNET@%%g
-s%@LIBVFS@%libvfs.a%g
-s%@LVFS@%-lvfs%g
-s%@fastdepvfs@%fastdepvfs%g
-s%@mcserv@%mcserv%g
-s%@LIBEDIT_A@%libedit.a%g
-s%@MCEDIT@%mcedit%g
-s%@LEDIT@%-ledit%g
-s%@undelfs_o@%%g
-s%@saver_target@%%g
-s%@saver@%%g
-s%@vcs@%%g
-s%@PAMLIBS@%%g
-s%@SEDCMD@%sed 's/-man/-mandoc/'%g
-s%@SEDCMD2@%sed 's%@prefix@%$(prefix)%'%g
-s%@XPM_LIB@%%g
-s%@XEXT_LIB@%%g
-s%@PHONY@%.PHONY:%g
-s%@WRITEDEP@%:%g
-s%@MCFG@%include ../Make.common%g
-s%@MCFGR@%include ./Make.common%g
-s%@DOTDEPEND@%ifeq (.depend,$(wildcard .depend)) \
-include .depend \
-endif%g
-/@MCF@/r /dev/null
-s%@MCF@%%g
-s%@PCENTRULE@%%g
-s%@builddir@%/cygdrive/c/user/src/local/mc-4.1.36-mingw%g
-
-CEOF
-
-# Split the substitutions into bite-sized pieces for seds with
-# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
-ac_file=1 # Number of current file.
-ac_beg=1 # First line for current file.
-ac_end=$ac_max_sed_cmds # Line after last line for current file.
-ac_more_lines=:
-ac_sed_cmds=""
-while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
- else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
- fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
- else
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f conftest.s$ac_file"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
- fi
- ac_file=`expr $ac_file + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_cmds`
- fi
-done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
-fi
-
-CONFIG_FILES=${CONFIG_FILES-"Make.common
-Makefile
-doc/Makefile
-vfs/Makefile
-lib/Makefile
-tk/Makefile
-gnome/Makefile
-xv/Makefile
-src/Makefile
-slang/Makefile
-edit/Makefile
-icons/Makefile
-
-lib/mc.ext
-mcfn_install
-vfs/extfs/ftplist vfs/extfs/zip vfs/extfs/zoo vfs/extfs/lslR
-vfs/extfs/lha vfs/extfs/cpio vfs/extfs/deb vfs/extfs/rar
-
-doc/mc.1 doc/mcedit.1 doc/mcserv.8
-
-intl/Makefile po/Makefile.in
-"}
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
-
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dir_suffix= ac_dots=
- fi
-
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
-
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
- esac
-
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
-ac_dC='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
-ac_uC=' '
-ac_uD='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-if test "${CONFIG_HEADERS+set}" != set; then
- CONFIG_HEADERS="config.h"
-fi
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
- esac
-
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
- cat $ac_file_inputs > conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- cat > conftest.frag < conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
- else
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- fi
- rm -f $ac_file
- mv conftest.h $ac_file
- fi
-fi; done
-
-ac_sources="intl/libgettext.h"
-ac_dests="intl/libintl.h"
-srcdir=$ac_given_srcdir
-while test -n "$ac_sources"; do
- set $ac_dests; ac_dest=$1; shift; ac_dests=$*
- set $ac_sources; ac_source=$1; shift; ac_sources=$*
-
- echo "linking $srcdir/$ac_source to $ac_dest"
-
- if test ! -r $srcdir/$ac_source; then
- { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; }
- fi
- rm -f $ac_dest
-
- # Make relative symlinks.
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then
- # The dest file is in a subdirectory.
- test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir"
- ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`"
- # A "../" for each directory in $ac_dest_dir_suffix.
- ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'`
- else
- ac_dest_dir_suffix= ac_dots=
- fi
-
- case "$srcdir" in
- [/$]*) ac_rel_source="$srcdir/$ac_source" ;;
- *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;;
- esac
-
- # Make a symlink if possible; otherwise try a hard link.
- if ln -s $ac_rel_source $ac_dest 2>/dev/null ||
- ln $srcdir/$ac_source $ac_dest; then :
- else
- { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; }
- fi
-done
-
-sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
-exit 0
diff --git a/rosapps/applications/mc/create_vcs b/rosapps/applications/mc/create_vcs
deleted file mode 100644
index 389216f566a..00000000000
--- a/rosapps/applications/mc/create_vcs
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-#
-# Script by Jakub Jelinek
-#
-if test -e /dev/vcs0
-then
- exit
-fi
-
-I=0
-while [ $I -lt 64 ]
-do
- mknod /dev/vcs$I c 7 $I
- chmod 622 /dev/vcs$I
- chown root.tty /dev/vcs$I
- mknod /dev/vcsa$I c 7 `expr $I + 128`
- chmod 622 /dev/vcsa$I
- chown root.tty /dev/vcsa$I
- I=`expr $I + 1`
-done
diff --git a/rosapps/applications/mc/doc/faq b/rosapps/applications/mc/doc/faq
deleted file mode 100644
index df9f119ac54..00000000000
--- a/rosapps/applications/mc/doc/faq
+++ /dev/null
@@ -1,934 +0,0 @@
-
- Midnight Commander
- Questions and Answers
-
- The newest version of this document is available at
- http://mc.blackdown.org/mc/answers0.html
-
- * 1 Getting started
- + 1.1 What is Midnight Commander?
- + 1.2 [UPDATED] Does it run on my machine?
- + 1.3 Does it work with my terminal?
- + 1.4 What else do I need to run MC?
- + 1.5 Is Midnight Commander PD? Copyrighted?
- + 1.6 Where can I get Midnight Commander?
- + 1.7 I don't have FTP access. Where can I get MC?
- * 2 Keyboard
- + 2.1 What does documentation mean with the C-?, M-? and F?
- keys?
- + 2.2 [UPDATED] Why don't function keys (or some other key)
- work?
- + 2.3 How do I use function keys F11 to F20?
- + 2.4 Why does the ESC key behave funny?
- + 2.5 How can I add the plus sign (+) on the command line?
- * 3 Mouse
- + 3.1 How do I enable mouse support?
- + 3.2 How do I cut and paste text with mouse?
- * 4 Display
- + 4.1 Why do I keep getting "Terminal not powerful enough for
- SLang"?
- + 4.2 [UPDATED] Why don't line drawing characters work?
- + 4.3 Can one use latin-1 characters without losing the lines?
- + 4.4 I have problems with entering/viewing national
- characters!
- + 4.5 How can I get colors?
- + 4.6 My color_xterm goes completely (or partially) black!
- + 4.7 Where can I get color_xterm?
- + 4.8 I got colors working with MC but the other programs don't
- work at all anymore!
- + 4.9 Why are there both terminfo and termcap? Wouldn't one
- database be enough?
- * 5 Graphical user interface
- + 5.1 Xview and Tk editions?
- * 6 Command line problems
- + 6.1 How do I stay in the last directory when I exit Midnight
- Commander?
- + 6.2 How can I access command line history?
- + 6.3 How can I complete commands, file names, variable names
- and so on?
- + 6.4 [NEW] I am using ksh. Can I use functions defined in the
- .kshrc within MC?
- + 6.5 [NEW] Is there any way to include additional options or
- hot keys to MC?
- * 7 Virtual file systems
- + 7.1 How can I see the contents of a tar archive?
- + 7.2 How do I get out of a tar archive?
- + 7.3 How do I do anonymous ftp with MC?
- + 7.4 How do I do non-anonymous ftp with MC?
- + 7.5 How do I close an ftp connection?
- + 7.6 Why aren't the contents of ftp panel updated?
- + 7.7 [NEW] What kind of proxy server works with Midnight
- Commander?
- * 8 Other common problems
- + 8.1 [UPDATED] How do I get the internal editor to work?
- + 8.2 Why doesn't "mcedit newfile" work?
- + 8.3 [UPDATED] Is there any way to 'bookmark' favourite ftp-fs
- links?
- + 8.4 When copying the directories lose their original date,
- uid and gid!
- + 8.5 [UPDATED] Why I keep getting: "There is no disk in the
- drive. Please insert a disk into drive D:"?
- + 8.6 [NEW] When I start Midnight Commander, nothing happens!
- + 8.7 [NEW] When I try to view a file MC hangs!
- * 9 Development
- + 9.1 Who has written Midnight Commander?
- + 9.2 Do I dare to use a development version?
- + 9.3 How can I report a bug/request for a feature?
- + 9.4 How can I join the development?
- * 10 More information
- + 10.1 [UPDATED] This document didn't answer my question. Where
- else can I look for an answer?
- + 10.2 What mailing lists are there for Midnight Commander?
- + 10.3 Where should I look on the World Wide Web for MC stuff?
- + 10.4 Are the mailing lists archived anywhere?
- * 11 Administrivia
- + 11.1 Authorship
- + 11.2 [UPDATED] File formats
- + 11.3 Feedback is invited
- + 11.4 Disclaimer and copyright
-
-1 Getting started
-
- 1.1 What is Midnight Commander?
-
- The Midnight Commander is a user-friendly yet powerful file manager
- and visual shell, useful to novice and guru alike. It provides a
- clear, user-friendly, and somewhat protected interface to a Unix
- system while making many frequent file operations more efficient and
- preserving the full power of the command prompt. You will wonder how
- you could ever live without it.
-
- For more thorough description take a look at the announcement of
- Midnight Commander 4.0.
-
- 1.2 [UPDATED] Does it run on my machine?
-
- Yes, Midnight Commander can run on almost any machine, including Unix
- clones, Windows 95/NT and OS/2. Midnight Commander does not run on
- Macintosh.
-
- Midnight Commander uses GNU autoconfigure which can automatically
- configure Midnight Commander for use on almost any (if not every) Unix
- clone. Following configurations have been tested:
- * i386-*-linux1.x, 2.x
- * alpha-linux-linux2
- * sparc-linux-linux2.x
- * sparc64-linux-linux2.1
- * mips-sgi-irix5.x, 6.x
- * mips-dec-ultrix4.3
- * rs6000-ibm-aix3.2.5
- * sparc-sun-sunos4.1
- * sparc-sun-solaris2.3, 2.4, 2.5
- * sparc-sun-netbsd1.0
- * hppa-hp-hpux9
- * hppa-hp-hpux7
- * m68k-apple-aux
- * unixware
- * mc88110-aviion-dgux5.4R2.01
- * i386-*-sco3.2v4.2
- * i386-*-sco3.2v5
- * i386-*-windows-nt-3.51, 4.0
- * i386-*-windows95
- * i386-*-os2
-
- See http://mc.blackdown.org/mc/download.html.
-
- There is also a preliminary Ms-Dos port at
- http://mc.blackdown.org/cgi-mc/download/DOS/.html (but no Ms-Dos
- binary).
-
- Windows 95/NT port is compiled with Microsoft Visual C++ but it might
- be possible to use cygwin32 or djgpp instead.
-
- 1.3 Does it work with my terminal?
-
- Yes, it does.
-
- Because Midnight Commander is a full screen program it doesn't run on
- dummy terminals but anything more advanced will do (like vt100). If
- your terminal works with vi, emacs, elm or pine it will work with
- Midnight Commander.
-
- The XView and Tk editions currently under development will require an
- X terminal.
-
- 1.4 What else do I need to run MC?
-
- You need an Unix compatible operating system or Windows 95/NT or OS/2.
-
- If you want to use mouse on the Linux console you need General Purpose
- Mouse server from iride.unipv.it: /pub/gpm/. You need nothing extra to
- use mouse on xterm.
-
- To compile the XView edition (currently under development) you need
- XView library. Xpm library and X11 non-rectangular shape extensions
- are recommended.
-
- To compile the Tk edition (currently under development) you need
- Tk-4.0 libraries. Compilation of the Tk version won't be easy. Contact
- Miguel for details.
-
- If you do not want to use the slang library you could try using
- ncurses (we recommend only version 4.1 and above).
-
- You can get it along with other curses libraries, too, but results may
- not be pretty or even usable.
-
- 1.5 Is Midnight Commander PD? Copyrighted?
-
- Midnight Commander is under GNU Public License which basically means
- that you may freely copy, change and distribute it, but that you may
- not impose any restrictions on further distribution, and that you must
- make the source code available. This is not the same as Public Domain.
- For details, the GNU license is included in the Midnight Commander
- source distribution (the COPYING file).
-
- Midnight Commander is nowadays officially a part of GNU project. All
- the authors of the Midnight Commander have given all their rights on
- the program to the Free Software Foundation.
-
- 1.6 Where can I get Midnight Commander?
-
- See http://mc.blackdown.org/mc/download.html. There are about seventy
- download sites. Note that the newest files might not be present on all
- the download sites yet.
-
- In short: the main site is ftp://ftp.nuclecu.unam.mx/linux/local/ and
- the sunsite.unc.edu mirrors have MC in the
- /pub/Linux/utils/file/managers/mc directory.
-
- 1.7 I don't have FTP access. Where can I get MC?
-
- Most Linux CD-ROMs include Midnight Commander. For example, Slackware,
- Yggdrasil, S.U.S.E., Jurix, RedHat, Caldera and Debian.
-
-2 Keyboard
-
- 2.1 What does documentation mean with the C-?, M-? and F? keys?
-
- Midnight Commander documentation uses emacs style names for keyboard
- keys.
-
- C stands for the Ctrl key. For example, C-f means that you should hold
- down the Ctrl key and press the f key.
-
- M stands for the Meta key. Your terminal might call it Alt or Compose
- instead of Meta. For example, M-f means that you should hold down the
- Meta/Alt/Compose key and press the f key. If your terminal doesn't
- have Meta, Alt or Compose or they don't work you can use Esc. For M-f
- press the Esc key and then press the f key.
-
- F? stands for a function key. If your terminal doesn't have function
- keys or they don't work you can use Esc. For example, for F3 press the
- Esc key and then press the 3 key.
-
- 2.2 [UPDATED] Why don't function keys (or some other key) work?
-
- Your terminfo or termcap database has missing or incorrect definations
- for function keys. Type "mc -V" to see what terminal database is being
- used. If the result is "using the S-Lang library with terminfo
- database" you should install one of the enhanced terminfo databases
- included in the Midnight Commander source distribution. For example,
- if you are using xterm type "tic xterm.ti".
-
- If the result is "using the S-Lang library with termcap database" you
- should fix your /etc/termcap database.
-
- Best terminfo database is bundled with ncurses 4.2
-
- You can select whether Midnight Commander will use terminfo or termcap
- database by giving --with-terminfo or --with-termcap option to the
- configure. Default is terminfo if found, otherwise termcap.
-
- If you don't have permissions to edit terminal databases you can use
- Learn keys feature of Midnight Commander instead. Press Esc 9 o k and
- follow instructions.
-
- If all else fails you can emulate function keys by first pressing the
- ESC key and then one of the number keys. For example, if you want to
- produce F9, press ESC, then 9. If you don't have a ESC key on your
- keyboard you can try alt-9 or meta-9.
-
- 2.3 How do I use function keys F11 to F20?
-
- These can mapped to function keys F1 to F10 with Shift held. eg.
- function key F13 can be activated by pressing Shift-F3. You can define
- the keys this way in the Options menu. The convention for PC keyboards
- is that F11-20 always means Shift with F1-10
-
- Note! Windows 95/NT and OS/2 ports use F11 and F12 keys to change the
- current disk drive. In this case F11 and F12 mean the real F11 and F12
- keys, not shift-F1 and shift-F2.
-
- 2.4 Why does the ESC key behave funny?
-
- Midnight Commander uses the ESC key as a prefix for simulating the
- Meta and Alt keys (for terminals which don't have Meta or Alt, see the
- three previous questions). For example, pressing ESC-a is the same as
- pressing Meta-a. In addition most terminals use ESC for internal
- representation of arrow keys, function keys and other enhanced keys.
- If you want to use ESC to cancel things you have to press it twice i.
- e. ESC-ESC. If you find this cumbersome you can generally use F10 to
- cancel. Alternatively turn on the old_esc_mode setting in the
- ~/.mc.ini file. The old_esc_mode setting makes ESC work as a prefix
- only if another key is pressed within 0.5 seconds. After 0.5 seconds
- the ESC key cancels. There is no way to make ESC cancel immediately
- (if we want to be able to use arrows keys and function keys).
-
- X terminals allow more control over keyboard, so these ESC limitations
- might not concern the forthcoming XView and Tk editions of the
- Midnight Commander.
-
- 2.5 How can I add the plus sign (+) on the command line?
-
- Press C-q first, then press the + sign.
-
- The plus key is the hotkey for the select files command. If you want
- to add a literal plus on to the command line you must quote it by
- pressing C-q first.
-
- Another common key which needs the C-q prefix is backslash "\".
-
-3 Mouse
-
- 3.1 How do I enable mouse support?
-
- Invoke mc like this (without quotes): "mc -x". If this doesn't work
- upgrade to a terminal which compatible with the Xterm mouse sequences.
-
- Alternatively, on Linux console you can use GPM.
-
- 3.2 How do I cut and paste text with mouse?
-
- Hold down shift key while using mouse to cut'n'paste.
-
-4 Display
-
- 4.1 Why do I keep getting "Terminal not powerful enough for SLang"?
-
- This means that your terminfo databases do not contain the correct
- definitions for your terminal.
-
- You could try using a different terminal setting. If you use csh or
- tcsh:
-
- setenv TERM vt100
-
- or if you use sh, bash, ksh or zsh:
-
- export TERM=vt100
-
- If this doesn't help you can recompile MC to use termcap instead of
- terminfo:
-
- ./configure --with-termcap
- make
-
- 4.2 [UPDATED] Why don't line drawing characters work?
-
- Since version 4.0.13 there's the commandline option -a to force use of
- +, |, - for line drawing (only available when compiled with SLang).
- Use this -a option if any of the suggestions below doesn't help.
-
- In general, there are three subcases:
- * Lines are shown as ASCII characters like this
-
- +---------+
- | |
- +---------+
- This also happens when you use the -a option. Other than that possible
- reason is 1, 2 or 3 (see below).
- * Lines are shown as lower case characters like this
-
- lqqqqqqqqqk
- x x
- mqqqqqqqqqj
- Possible reason is 2 or 3 (see below).
- * Lines are shown as blanks or missing characters. Possible reason
- is 3 or 4 (see below).
-
- The reason for the problem is one of following:
- 1. Your curses library might not support line drawing characters.
- Slang, Ncurses and System V curses do support them, BSD curses
- doesn't. MC uses Slang by default so this is not usually a
- problem.
- 2. Your terminal might not support line drawing characters. Vt100
- compatible terminals, rxvt, xterm and color_xterm do support them.
- 3. Your terminfo or termcap database might have missing or incorrect
- definations for line drawing characters. Set the acsc variable in
- the terminfo database like this:
- acsc=a\376k\277l\332m\300j\331n\305w\302v\301u\264t\303q\304x\263h
- \2600\333
- Don't forget issue 'tic' command. This supposes you are using pc
- character set. The octal values might be different for other
- character sets. If you are using termcap instead of terminfo, you
- should modify above solution appropriately.
- 4. Your terminal font might not support line drawing characters. Try
- changing the font.
-
- Here is Miguel's answer to Torben on this subject.
-
- Torben:
-
- When I load consolefonts/iso01.f16, I get perfectly right national
- characters, but the line drawing characters in mc get wrong. Is it
- a mc problem, or is it a problem with the font? (I guess it is).
-
- Is there a trick?
-
- Miguel:
-
- First of all, we should determine whether the font has line drawing
- characters or not.
-
- If it has line drawing characters, then a new terminfo entry should
- be written for this specific case. Let's call this linux-iso01. The
- acsc variable should be modified to reflect which characters are
- used to do the line drawing.
-
- If it does not have line drawing characters, then we should get rid
- of the switch to acsc sequences and make the acsc sequence be just
- a mapping to the ugly +, -, |, - characters.
-
- You can get your terminfo definition by running the infocmp
- program, making the proper changes and running the tic program to
- compile your new terminfo database.
-
- 4.3 Can one use latin-1 characters without losing the lines?
-
- Yes, you need a correct font and a correct termcap/terminfo database.
-
- For font, if you use xterm try "xterm -fn fixed".
-
- For termcap/terminfo database, change the acsc capability in the
- database.
-
- 4.4 I have problems with entering/viewing national characters!
-
- Upgrade to version 4.0.12 or newer.
-
- From the Options - Display Bits dialog select Full 8 bits or ISO
- 8859-1. In addition, select 8 bit input from the same dialog.
-
- 4.5 How can I get colors?
-
- Invoke mc like this (without quotes): "mc -c".
-
- If you get colors, be happy.
-
- If your terminal stays black and white, your terminal doesn't support
- color. You might want to upgrade to a terminal which compatible with
- the ANSI color sequences.
-
- If your terminal goes compelety black, see the next question.
-
- More detailed answer:
-
- First, check that your terminal supports color. Color_xterm, rxvt and
- Linux console do support, most other terminals don't. You can test
- color support with following simple C program:
-
- #include
-
- int main (void){
- printf ("\033[32m Hello world! \033[m\n");
- return 0;
- }
-
- Compile and run it. If you see "Hello world!" text in green your
- terminal supports color, otherwise not (however, for color_xterm see
- also the next question).
-
- Second, check that you are using Ncurses or the Slang library (type
- "mc -V" to find out), in addition some System V curses implementations
- do support color, most don't.
-
- With Slang library you can force color support by setting the
- environment variable COLORTERM to any value.
-
- Third, if you use ncurses library, check that your terminfo database
- supports color. If not you should install one of the enhanced terminfo
- databases included in the Midnight Commander source distribution.
-
- Fourth, you might want to set the TERM environment variable so that
- you use the correct terminfo database or termcap entry.
-
- If you use color_xterm (or rxvt) the correct value might be
- xterm-color, xtermc or simply xterm.
-
- If you use Linux console the correct value for TERM is linux or
- console.
-
- 4.6 My color_xterm goes completely (or partially) black!
-
- Some color_xterm terminals define all colors as black instead of the
- standard ANSI colors. This makes them go completely black when you try
- to use Midnight Commander with colors.
-
- You will have to override the defaults. Create a file "color.defaults"
- which has the following contents:
-
- color_xterm*color0: Black
- color_xterm*color1: Red
- color_xterm*color2: Green
- color_xterm*color3: Yellow
- color_xterm*color4: Blue
- color_xterm*color5: Magenta
- color_xterm*color6: Cyan
- color_xterm*color7: White
- color_xterm*background: White
- color_xterm*foreground: Black
-
- (replace color_xterm with the name of your color_xterm, color_xterm
- mentions its name in its title bar)
-
- Now type:
-
- xrdb -merge color.defaults
-
- Alternatively you can add the suggested contents of the color.defaults
- file to your .Xdefaults or .Xresources file (or what ever the name of
- your X configuration file is). Or you can replace your non-ANSI
- color_xterm with an ANSI color_xterm.
-
- 4.7 Where can I get color_xterm?
-
- Try ftp.x.org: /contrib/utilities/colour_xterm.tar.gz.
-
- Alternatively, rxvt is a better choice, see
- http://mc.blackdown.org/cgi-mc/download/rxvt/.html
-
- 4.8 I got colors working with MC but the other programs don't work at all
- anymore!
-
- Midnight Commander uses terminfo database (if available) but many
- other programs use termcap database. If you set the TERM environment
- variable to a value which has no corresponding entry in termcap
- database those programs stop working. You should add the new value of
- TERM to the termcap database.
-
- Example: If you have set TERM to xterm-color locate from /etc/termcap
- the line which starts:
-
- xterm|vs100|xterm terminal emulator
-
- Change it to start:
-
- xterm|xterm-color|vs100|xterm terminal emulator
-
- 4.9 Why are there both terminfo and termcap? Wouldn't one database be enough?
-
- You might want to read the Unix-haters handbook at
- http://www.digital.de/people/jmh/Unix_Haters/unix-haters.html. It
- lists many more reasons why Unix sucks.
-
- You can configure which terminal database you want to use with the
- "--with-termcap" and "--with-terminfo" flags of configure. If you
- don't specify them, the configure script will try to use terminfo if
- available otherwise it will use termcap.
-
-5 Graphical user interface
-
- 5.1 Xview and Tk editions?
-
- Get the newest development version, give the "--with-xview" or
- "--with-tk" option to the configure and otherwise compile as usual.
- See Download.
-
- Xview and Tk editions are work in progress, they are not as robust as
- the text mode edition.
-
-6 Command line problems
-
- 6.1 How do I stay in the last directory when I exit Midnight Commander?
-
- See the description of the -P option in the Options section of the
- manual.
-
- 6.2 How can I access command line history?
-
- You can browse previous commands with M-p and M-n. Alternatively, you
- can summon the command history listbox by pressing F9 c h.
-
- 6.3 How can I complete commands, file names, variable names and so on?
-
- Just press M-Tab. Press M-Tab again to get a listbox if there are
- multiple possible completions.
-
- 6.4 [NEW] I am using ksh. Can I use functions defined in the .kshrc within
- MC?
-
- Sorry, MC only supports bash, tcsh and zsh functions. Ksh functions
- are not supported because ksh lacks the necessary hooks needed for
- subshell integration.
-
- Switch to bash or zsh. They are both quite compatible with ksh. Your
- ksh functions should work as such or after minimal changes.
-
- 6.5 [NEW] Is there any way to include additional options or hot keys to MC?
-
- Yes, F2 invokes an user menu which fully configurable. You can add any
- shell commands to the user menu. See
- http://mc.blackdown.org/mc/manual-d.html#8 for more info.
-
- Another way to add functionality is the external panelize feature. See
- http://mc.blackdown.org/mc/manual-d.html#4 for more info.
-
- And finally, you can code any feature you want yourself. MC source
- code is free which means you can change it anyway you want. There are
- some limitations to make sure MC stays free. See GNU General Public
- License for details.
-
-7 Virtual file systems
-
- Note! Virtual file systems are supported by Unix ports only. The
- Windows 95/NT and OS/2 ports do NOT support virtual file systems. This
- means you haven't got ftp, zip or tar support on Windows 95/NT and
- OS/2.
-
- 7.1 How can I see the contents of a tar archive?
-
- If you use keyboard just move the selection bar on the tar file and
- press enter.
-
- If you use mouse just doubleclick on the tar file.
-
- If these procedures don't work, your .mc.ext file is faulty. Replace
- it with one from the MC source distribution.
-
- You can also enter a tar archive by typing "cd tar:filename.tar.gz"
- where filename.tar.gz is the name of the archive.
-
- The recognized suffixes for tar archives are .tar, .tar.gz and .tgz.
- If your tar archive uses different suffix you have to rename it.
-
- 7.2 How do I get out of a tar archive?
-
- Just press enter on the toplevel ".." file or chdir to a non-tar
- directory. Just typing "cd" with no parameters is enough (it will take
- you to your home directory).
-
- 7.3 How do I do anonymous ftp with MC?
-
- Just type "cd ftp://hostname" where hostname is the name of the host
- you want to connect. Alternatively, select FTP link from the Left or
- Right menu and type the name of the host you want to connect.
-
- 7.4 How do I do non-anonymous ftp with MC?
-
- Non-anonymous ftp works just like the anonymous ftp but you give the
- login name with the host name. For example, type "cd
- ftp://username@hostname".
-
- 7.5 How do I close an ftp connection?
-
- Just chdir to a non-ftp directory. Just typing "cd" with no parameters
- is enough (it will take you to your home directory).
-
- Internally Midnight Commander closes ftp connection only after a
- timeout. This isn't visible to the end user.
-
- 7.6 Why aren't the contents of ftp panel updated?
-
- Update is skipped because there would be a serious performance
- penalty. Constantly updating directory panels through a ftp connection
- would take too much time.
-
- You can use C-r to force an update.
-
- 7.7 [NEW] What kind of proxy server works with Midnight Commander?
-
- Midnight Commander only supports ftp-like ftp proxies. Common WWW
- proxies (like Squid) are not supported yet because they make ftp
- connections look like http connections.
-
-8 Other common problems
-
- 8.1 [UPDATED] How do I get the internal editor to work?
-
- The F4 key defaults to an external editor because thats what most
- people are used to. To use the internal editor, select Configuration
- from the Options menu and check the 'use internal edit' option.
-
- Alternatively add the line
- use_internal_edit=1
-
- under the [Midnight-Commander] section in your .mc.ini file (which is
- in your home directory).
-
- To make the editor work all the time, go to the default/* section in
- the file lib/mc/mc.ext file and remove the line
-
- Edit=%var{EDITOR:vi} %f
-
- The internal editor will now be invoked for anything not specified
- elsewhere in the mc.ext file.
-
- Make sure that you edit the correct mc.ext file. The Midnight
- Commander first checks the existance of $HOME/.mc.ext. If this file is
- missing MC will use $prefix/lib/mc/mc.ext instead ($prefix can be
- changed with configure before compilation and it defaults to
- /usr/local).
-
- When you run `F9/Command/Extension file edit' for the very first time
- Midnight Commander copies the system-wide mc.ext from $prefix/lib/mc
- into your home directory because you need write access in order to
- change it.
-
- And please don't forget that "make install" overwrites
- $prefix/lib/mc/mc.ext.
-
- 8.2 Why doesn't "mcedit newfile" work?
-
- This is a known bug.
-
- If the newfile doesn't exist, mcedit fails.
-
- Start mcedit with no parameters, this will create a blank file. Then
- save the file with whatever name you like.
-
- 8.3 [UPDATED] Is there any way to 'bookmark' favourite ftp-fs links?
-
- Use the directory hotlist. Just press control-backslash. If your
- national keyboard layout doesn't have backslash key, just press the
- control key with the key which is the backslash key in the English
- keyboard layout.
-
- 8.4 When copying the directories lose their original date, uid and gid!
-
- This is a known bug. At moment only files preserve their original
- settings when copying, not directories.
-
- Uid and gid is fixed since 4.0.1. "Preserve UIDs/GIDs" in the copy
- dialog needs to be checked and you must be root.
-
- Date problem is supposed to be fixed with 4.0.13.
-
- 8.5 [UPDATED] Why I keep getting: "There is no disk in the drive. Please
- insert a disk into drive D:"?
-
- This is a known bug of the Windows 95/NT and OS/2 ports. MC looks its
- configuration files from the D:\MC directory and if the D: drive is a
- removable drive (like a CD ROM drive) and there is no disk in drive
- you get this message everytime you try to do anything.
-
- Since version 4.0.6 you can specify the actual location of the
- Midnight Commander configuration files with the MCHOME environment
- variable.
-
- 8.6 [NEW] When I start Midnight Commander, nothing happens!
-
- First, invoke MC without subshell support: "mc -u". If this helps
- check the shell you are using. Subshell support works best with bash
- although tcsh and zsh are also supported. You might want to upgrade
- your shell to a newer version. If you use something else than bash,
- tcsh or zsh, subshell support is disabled automatically.
-
- If disabling subshell doesn't help, try to reconfigure MC with
- "--with-our-slang" and "--with-termcap" options and recompile. If this
- helps, there is something wrong with your terminfo database or shared
- slang library. For better terminfo databases see chapter 4. For a
- better slang library, upgrade to a newer version or keep using the
- "--with-our-slang" option.
-
- 8.7 [NEW] When I try to view a file MC hangs!
-
- This is known bug. A quick fix is "chmod 666 /dev/tty". For a more
- complete fix, see http://mc.blackdown.org/mc/maillist/97-10/98.html.
-
- This bug will probably be fixed in 4.1.6.
-
-9 Development
-
- 9.1 Who has written Midnight Commander?
-
- Midnight Commander was started by Miguel de Icaza and he is the
- maintainer of the package. Other authors have joined the project
- later:
- * Mauricio Plaza (early releases, retired)
- * Janne Kukonlehto (joined Sep 27 1994, retired Mar 8 1995, nowadays
- Janne is the webmaster of the Midnight Commander web site)
- * Radek Doulik (joined Oct 30 1994)
- * Fred Leeflang (joined Nov 2 1994)
- * Dugan Porter (joined Dec 1 1994)
- * Jakub Jelinek (joined Feb 8 1995)
- * Ching Hui (joined Jun 27 1995)
- * Andrej Borsenkow (joined Jul 1996)
- * Paul Sheer (joined Nov 1 1996)
- * Norbert Warmuth
- * Alex I. Tkachenko
-
- Alessandro Rubini has been specially helpful with debugging and
- enhancing of the mouse support. John Davis has made his S-Lang library
- available to us and answered many questions about it.
-
- The photographs of the authors are available as:
-
- http://mc.blackdown.org/mc/about.html
-
- Many people have contributed bug reports, feature suggestions and
- small code bits (alphabetical order):
- * Thomasz Cholewo
- * Juan Jose Ciarlante
- * Alexander Dong (OS/2 port, NT port updates)
- * Erwin van Eijk
- * Torben Fjerdingstad
- * Massimo Fontanelli
- * Juan Grigera (NT port)
- * Gerd Knorr
- * Sergey Ya. Korshunoff
- * Jean-Daniel Luiset
- * Wim Osterholt
- * Antonio Palama (old DOS port)
- * Thomas Pundt
- * Marcelo Roccasalva
- * Ilya Rybkin
- * Vadim Sinolits
- * Jon Stevens
- * Adam Tla/lka
-
- 9.2 Do I dare to use a development version?
-
- I am afraid you have to answer to this question yourself. Development
- versions seldom cause data loss but they have usually got many bugs.
- It's up to you to judge whether new features outweight the bugs.
-
- 9.3 How can I report a bug/request for a feature?
-
- You might first want to get the newest development version to see if
- the bug is fixed or the feature is added already.
-
- Send your report/request to mc-devel@roxanne.nuclecu.unam.mx or
- mc@roxanne.nuclecu.unam.mx. These mailing lists are the most certain
- way to contact the developers. Remember to mention if you are not on
- the mailing list to make sure that you will receive a copy of replies.
-
- Give as much details as possible. A too long message is a lot better
- than a too short message.
-
- For segmentation faults a stack backtrace is appreciated. You can
- produce stack backtrace as follows:
- * If segmentation fault produced a core file:
- 1. Load the core file by typing "gdb mc core" or "dbx mc core".
- 2. Type "where".
- 3. Cut and paste the results to your message.
- * If segmentation fault didn't produce a core file:
- 1. Load mc by typing "gdb mc" or "dbx mc".
- 2. Start mc by typing "run".
- 3. Try to reproduce the segmentation fault by doing whatever you
- did last time when the segmentation fault occurred.
- 4. Type "where".
- 5. Cut and paste the results to your message.
- 6. For the future you might want to check out what is the
- command in your shell to allow producing of the core files.
- Usually it is "limit coredumpsize unlimited" or "ulimit
- coredumpsize" or "ulimit -c unlimited".
-
- 9.4 How can I join the development?
-
- To join the development just code the feature you want to add and send
- your patch for inclusion. Email address is mc-devel@nuclecu.unam.mx.
- Before you start coding check the latest development version. It might
- be that your feature has already been implemented.
-
- Note that the authors of the Midnight Commander have given all their
- rights on the program to the Free Software Foundation. You will have
- to do the same if you contribute non-trivial patches. Otherwise we
- have to reject your patches in order to avoid copyright problems.
-
-10 More information
-
- 10.1 [UPDATED] This document didn't answer my question. Where else can I look
- for an answer?
-
- Read messages from the Discussion (mailing list archive), search the
- web site or read the Manual.
-
- Upgrade to a newer version of Midnight Commander. Many problems are
- fixed in the new versions.
-
- If you still can't find an answer, post your question to the Midnight
- Commander mailing list. Its address is mc@nuclecu.unam.mx.
-
- 10.2 What mailing lists are there for Midnight Commander?
-
- Following mailing lists discuss about Midnight Commander:
-
- mc
- General discussion of the Midnight Commander
-
- mc-digest
- The mc list, in digest format
-
- mc-announce
- Major announcements about the Commander
-
- mc-patch
- The latest Commander patches
-
- mc-devel
- Technical development discussion
-
- mc-chat
- Non-MC related chatting by the developers (contact Miguel to
- subscribe)
-
- To subscribe, send e-mail to majordomo@roxanne.nuclecu.unam.mx with
- the following line in the body of the message:
-
- subscribe [optional-address]
-
- Replace with the name of the list you want to subscribe
- and [optional-address] with your email address.
-
- 10.3 Where should I look on the World Wide Web for MC stuff?
-
- There is a WWW page for Midnight Commander. The URL is:
-
- http://mc.blackdown.org/mc/
-
- The WWW page features MC screen shots, photographs of the authors,
- mailing list archive and a few other things.
-
- 10.4 Are the mailing lists archived anywhere?
-
- The mc and mc-devel lists are archived on the World Wide Web page (see
- the previous question). Other lists are not currently archived though
- Miguel keeps a private archive. Contact him if you want copies of past
- messages.
-
-11 Administrivia
-
- 11.1 Authorship
-
- Questions and Answers is written by Janne Kukonlehto. Parts of it
- originate from Ian Jackson, Miguel de Icaza, Dugan Porter, Norbert
- Warmuth and Paul Sheer.
-
- 11.2 [UPDATED] File formats
-
- This document is available in HTML, postscript and PDF formats at
- http://mc.blackdown.org/mc/answers0.html.
-
- This document is available in ASCII format in the Midnight Commander
- source package.
-
- 11.3 Feedback is invited
-
- Send your comments about this document to janne@mc.blackdown.org
-
- Send your comments about the Midnight Commander to mc@nuclecu.unam.mx
-
- 11.4 Disclaimer and copyright
-
- Note that this document is provided as is. The information in it is
- not warranted to be correct; you use it at your own risk.
-
- You can use Questions and Answers according to GNU Public License (see
- the COPYING file in the Midnight Commander source distribution).
- Questions and Answers is not public domain.
- __________________________________________________________________
-
- This document is maintained by Janne Kukonlehto
- .
-
diff --git a/rosapps/applications/mc/doc/install b/rosapps/applications/mc/doc/install
deleted file mode 100644
index c6d28d83312..00000000000
--- a/rosapps/applications/mc/doc/install
+++ /dev/null
@@ -1,529 +0,0 @@
--*-text-*-
-
-This file contains:
-
-- Installation instructions and notes for the Midnight Commander
-- Where to get more information on the Midnight Commander
-- Common problems
-- Information on porting the program
-- Obtaining the missing pieces of the Midnight Commander
-
-
-Installation instructions for the Midnight Commander
-----------------------------------------------------
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation, and creates
-the Makefile. It also creates a file `config.status' that you can run
-in the future to recreate the current configuration.
-
-(Nextstep users, make sure you read the "Compiling under Nextstep"
-section)
-
-To compile this package:
-
-1. Configure the package for your system.
-
- Normally, you just `cd' to the directory containing the package's
-source code and type `./configure'. If you're using `csh' on an old
-version of System V, you might need to type `sh configure' instead to
-prevent `csh' from trying to execute `configure' itself (under AIX,
-you may need to use ksh instead of sh).
-
- Running `configure' takes a while. While it is running, it
-prints some messages that tell what it is doing. If you don't want to
-see any messages, run `configure' with its standard output redirected
-to `/dev/null'; for example, `./configure >/dev/null'.
-
- To compile the package in a different directory from the one
-containing the source code, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'. If
-for some reason `configure' is not in the source code directory that
-you are configuring, then it will report that it can't find the source
-code. In that case, run `configure' with the option `--srcdir=DIR',
-where DIR is the directory that contains the source code.
-
- By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PATH'. Alternately, you can do so by consistently
-giving a value for the `prefix' variable when you run `make', e.g.,
- make prefix=/usr/gnu
- make prefix=/usr/gnu install
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If
-you give `configure' the option `--exec-prefix=PATH' or set the `make'
-variable `exec_prefix' to PATH, the package will use PATH as the
-prefix for installing programs and libraries. Data files and
-documentation will still use the regular prefix. Normally, all files
-are installed using the same prefix.
-
- The program detects if you have the gpm library installed. If you
-installed the gpm mouse library in a non-standard place, you will need
-to use the --with-gpm-mouse flag with the directory base where you
-installed the gpm package.
-
- `configure' also recognizes the following options:
-
-`--help'
- Print a summary of the options to `configure', and exit.
-
-`--quiet'
-`--silent'
- Do not print messages saying which checks are being made.
-
-`--verbose'
- Print the results of the checks.
-
-`--version'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--with-debug'
- Enables the built-in memory allocation debugger and forces
- compilation with -Wall. This is an option intended to be used by
- the program developers.
-
-`--without-edit'
- Configures the program to be compiled without the built-in file
- editor. The built-in editor is compiled in by default.
-
-`--with-ext2undel[=PATH]'
- On systems that use the Extended 2 file system and have the
- libext2fs.a library available, this compiles into the Midnight
- Commander the support code for recovering deleted files (the
- undel virtual file system).
- Use =PATH if libext2fs.a is installed in a non-standard place.
- The configure will append `lib' and `include' to find the ext2fs
- libraries and include files respectively.
-
-`--with-gpm-mouse[=PATH]'
- Use this flag if your GPM mouse package cannot be detected by the
- configure. Use =PATH if it is installed in a non-standard place.
- The configure will append `lib' and `include' to find the libgpm.a
- and gpm.h files respectively.
-
-`--without-gpm-mouse'
- Use this flag to disable GPM mouse support (e.g. if you want to
- use mouse only on X terminals).
-
-`--with-hsc'
- Compiles support into the ftp virtual file system to support the
- HSC firewall.
-
-`--with-mmap'
- Needed when compiling under AIX if you want the fast viewer.
-
-`--with-sco'
- This option is used to compile on SCO: it turns on SCO-specific
- code, i.e. disables the terminal resizing mechanism, uses the
- BSD-like pseudoterminal handling, adds screen-saving capabilities
- on console, etc.
-
-`--with-subshell[=optional]', `--without-subshell'
- The subshell support is by default turned on, you can disable
- this by using the --without-subshell option. If you pass the
- =optional parameter, then the subshell support is turned off by
- default, to turn it on, you have to specify the `-U' flag when
- running the program.
-
-`--with-termnet'
- Enables the network support with the Term package.
-
-`--with-tk' [WARNING: X code is not released]
- This option enables including the Tcl/Tk version.
-
-`--with-tk-includes=DIR' [WARNING: X code is not released]
- Lets you specify the place where you have your Tcl/Tk headers installed.
- It should be a directory containing tcl.h and tk.h.
-
-`--with-tk-libraries=DIR' [WARNING: X code is not released]
- Lets you specify the place where you have your Tcl/Tk libraries -
- libtcl and libtk.
-
-`--with-xview' [WARNING: X code is not released]
- This option enables including the XView version.
-
-`--with-xview-includes=DIR' [WARNING: X code is not released]
- Lets you specify the place where you have your xview headers installed.
- It should be the directory, which has subdirectories xview and
- hopefuly xview_private.
-
-`--with-xview-libraries=DIR' [WARNING: X code is not released]
- Lets you specify the place where you have your xview libraries -
- libolgx and libxview.
-
-`--with-xv-bindir=DIR' [WARNING: X code is not released]
- Lets you specify the place where program mxc will be installed.
- Default is somewhere in your XView binaries directory,
- $OPENWINHOME/bin.
-
-`--without-dusum'
- This option disables a feature of the Midnight Commander, which is
- forking the du command with the -s option when you want to calculate
- directory sizes.
-
-`--without-vfs'
- This option disables the Virtual File System switch code in the
- Midnight Commander and uses the standard file system calls for
- file access. If you specify this option you will not get the
- transparent tar File system manipulation as well nor the
- networked Midnight Commander file system.
-
-You may also tell configure which display manager you want to use with
-the Midnight Commander. The configure script will use SLang as default,
-but you can override this by using any of the following flags (please
-note that slang is included as part of the distribution),
-
-`--with-slang' (default)
- This is used to configure the program to use the SLang screen
- manager. This is included as part of the Midnight Commander,
- you don't need it installed on your system. If SLang is installed
- on your system it will be used if possible. You can force usage of
- the included SLang with the `--with-included-slang' option.
- Slang is the only library that will let you resize the Midnight
- Commander window on an xterm.
-
- This option will usually try to use the terminfo database if it
- is available, otherwise it will use the termcap database. At
- compile time, you may force the use the terminal database with
- the `--with-termcap' and `--with-terminfo' options (both options
- automaticly turn `--with-included-slang' on).
-
-`--with-ncurses[=directory]'
- Use this flag (either with or without the =directory part), if
- you want to compile with ncurses instead of the default SLang.
-
- Use the =directory part if your ncurses is not installed in any of the
- places configure will check (/usr/include, /usr/include/ncurses,
- /usr/local/include and /usr/local/include/ncurses).
- The argument to this flag is the base directory where the ncurses
- files are located. The configure will append lib and include to
- find the libncurses.a and ncurses.h file respectively. For
- example, if you have installed ncurses under /gnu/lib and
- /gnu/include, you specify: --with-ncurses=/gnu
-
- You will need the ncurses package only if your system does not
- provide a compatible curses. If after compiling, the program
- says that it can't resolve the has_colors function, then you need
- the ncurses package or you may always go back to the included SLang
- screen manager.
-
-`--with-vcurses[=directory]'
- Use this flag to force the Midnight Commander to use a SystemV
- type ncurses, the optional directory specifies where should
- the C compiler find the include files.
-
-`--with-sunos-curses'
- You use this flag on SunOS machines if you want to use SunOS 4.x
- curses instead of ncurses. You don't need this flag if you don't
- have ncurses installed: it's only needed to force the usage of
- SunOS curses over ncurses.
-
- `configure' also accepts and ignores some other options.
-
- On systems that require unusual options for compilation or linking
-that the package's `configure' script does not know about, you can give
-`configure' initial values for variables by setting them in the
-environment. In Bourne-compatible shells, you can do that on the
-command line like this:
-
- CC='gcc -traditional' LIBS=-lposix ./configure
-
-On systems that have the `env' program, you can do it like this:
-
- env CC='gcc -traditional' LIBS=-lposix ./configure
-
- Here are the `make' variables that you might want to override with
-environment variables when running `configure'.
-
- For these variables, any value given in the environment overrides the
-value that `configure' would choose:
-
- - Variable: CC
- C compiler program. The default is `cc'.
-
- - Variable: CFLAGS
- The default flags used to build the program.
-
- - Variable: INSTALL
- Program to use to install files. The default is `install' if you
- have it, `cp' otherwise.
-
- For these variables, any value given in the environment is added to
-the value that `configure' chooses:
-
- - Variable: LIBS
- Libraries to link with, in the form `-lfoo -lbar...'.
-
- If you need to do unusual things to compile the package, we encourage
-you to figure out how `configure' could check whether to do them, and
-mail diffs or instructions to the address given in the README so we
-can include them in the next release.
-
-2. Type `make' to compile the package.
-
-3. If the package comes with self-tests and you want to run them,
-type `make check'. If you're not sure whether there are any, try it;
-if `make' responds with something like
- make: *** No way to make target `check'. Stop.
-then the package does not come with self-tests.
-
-4. Type `make install' to install programs, data files, and
-documentation.
-If your system is Linux, then install installs the Linux console screen
-saver as well.
-
-5. You can remove the program binaries and object files from the
-source directory by typing `make clean'. To also remove the
-Makefile(s), the header file containing system-dependent definitions
-(if the package uses one), and `config.status' (all the files that
-`configure' created), type `make realclean'. If you want to clean the source
-tree completely, so that it contains only those files that should be
-packaged in the archive, issue `make distclean'. If you've run configure in
-a different directory than the source tree, distclean won't remove your *.o
-and linked programs in that directory.
-
-6. The Midnight Commander allows you to be kept on the directory you
-were when you quit the program, this is done with a shell function,
-the man page has more information about this. If you want to let the
-install program make the change to your /etc/profile or your
-~/.profile or ~/.bashrc, then type: `make mcfninstall'.
-
- The file `configure.in' is used to create `configure' by a program
-called `autoconf'. You only need it if you want to regenerate
-`configure' using a newer version of `autoconf'.
-
-Compiling under NeXTStep
-------------------------
-
-These instructions were provided by Gregor Hoffleit
-, he recommends configuring the
-program like this:
-
-
-export CC="cc -posix"
-configure --without-subshell --with-termcap
-Edie config.h and make sure you have #undef HAVE_GETWD
-make
-
-
-
-- Where to get more information on the Midnight Commander
----------------------------------------------------------
-
-Janne Kukonlehto set up a WWW page, here is the URL:
-http://mc.blackdown.org/mc/
-
-We also a set of mailing lists for the program:
-
-mc-announce: Announcements of new version of the Midnight Commander.
-mc-digest: Digest version of the mc list.
-mc-patches: Patches by mail (also on the ftp site).
-mc: Discussion on the Midnight Commander file manager.
-mc-devel: For discussion between the developers of the program.
-
-to subscribe to the mailing lists, send a message to:
-
-majordomo@roxanne.nuclecu.unam.mx
-
-with the following text in the body of the message:
-
-subscribe [address]
-
-The address is optional and list-name is one of the above list names
-(mc, mc-announce, mc-patches or mc-digest).
-
-
-Notes about the Midnight Commander installation
-------------------------------------------------
-
-The Midnight Commander has been run in the following configurations:
-
-i386-*-linux
-sparc-*-linux
-alpha-*-linux
-mips-dec-ultrix4.3
-mips-dec-{open,net}bsd1.0
-mips-sgi-irix5.2
-mips-sgi-irix5.3
-rs6000-ibm-aix3.2.5
-sparc-sun-sunos4.1
-sparc-sun-netbsd1.0
-sparc-sun-solaris2.3
-hppa-hp-hpux9
-hppa-hp-hpux7
-m68k-apple-aux
-mc88110-aviion-dgux5.4
-i386-*-{bsdi2,freebsd}
-
-Since the Midnight Commander is configured via the GNU autoconf
-program, it's not difficult to run it in other operating systems.
-
-If you're using AIX, with the cc6000 compiler, you have to specify the
-`--with-mmap' command line option.
-
-You will need GNU C (or an ANSI C Compiler) and optionally a color
-curses library (ncurses is a good choice). The Midnight Commander now
-comes with the Slang screen manager, a fast screen manager, so ncurses
-is not required anymore unless you want to use it.
-
-Many Linux systems ship with ncurses version 1.9.9e, however, we recommend
-ncurses 4.1 or above, since the former version does not support resizing
-of the xterm window.
-
-Since version 0.9 the Midnight Commander comes with mouse support on
-xterms and in the Linux console. In order to take advantage of the
-mouse support on the Linux console you will need the gpm mouse server
-(see the section "Obtaining the Missing Pieces" in this file).
-
-Once you get the Mouse Server, compile it and install it, then you
-will have to specify the `--with-gpm-mouse' flag to the configure
-program if you installed it in a non-standard directory. If you
-installed the gpm package under /usr or /usr/local, you don't need to
-specify this flag; configure will find gpm for you. The support for
-mice on xterms is always compiled in.
-
-We are working on further enhancements to the program, but we're not
-sure which ones must go first. If you would like to point us in the
-Right Direction we will be glad to hear from you (you could check the
-file TODO included with this distribution for the current projects).
-
-If you happen to find an undocumented feature that doesn't do what you
-expected, please drop us a note telling us as much as you can about
-the problem you're experiencing (to miguel@roxanne.nuclecu.unam.mx).
-
-
-Porting the program
--------------------
-
-Random notes on porting to other architectures.
-
-The Midnight Commander uses now by default the Slang library for
-handling the display. If you can't port Slang (which should be a
-pretty trivial job), you may want to attempt using ncurses (the
-Midnight Commander can use ncurses as well as the display engine).
-
-If you don't want to install ncurses and your OS is a SystemV Release
-4 variant, maybe the curses supplied with your system will do the
-work. If you experience display problems, then it means that we are
-dealing with a buggy implementation of curses. You have two options:
-one, download ncurses and recompile with ncurses or recompile all your
-source code with the symbol BUGGY_CURSES defined. But you can always
-switch to the default SLang screen manager.
-
-The fast way to do this is to:
-
-make clean; make XINC=-DBUGGY_CURSES
-
-
-Obtaining the missing pieces of the Midnight Commander
-------------------------------------------------------
-
-The Midnight Commander will build without requiring you to get any
-other software packages, however, you may be interested in enhancing
-the Midnight Commander environment with some of these:
-
-o Terminal database
-
- There are many incomplete terminal databases out there, however, a
- complete terminfo is bundled with ncurses. (It is simple to generate
- the termcap database using the infocmp utility in ncurses).
-
- Some terminfo data are included with the mc distribution (lib/*.ti).
- Particularly linux, xterm and vt100. Use e.g. ''tic linux.ti'' to
- use them.
-
- If you want to run mc on xterm/color_xterm/ansi_xterm (not rxvt), then
- you might read lib/README.xterm for further information.
-
-o In the past the Midnight Commander required the NCurses library to
- build, now it's optional. You can get Ncurses from
-
- ftp.gnu.org:/pub/gnu
- ftp.clark.net:/pub/dickey/ncurses
-
-o The GPM Mouse Server is available at:
-
- iride.unipv.it:/pub/gpm
-
-o The X Windows System libraries are only used if you are going to
- build the X11 versions of the program. Please note that this code
- is not finished, so it's only useful if you want to look at what we
- are doing or want to help in one of the two X11 versions.
-
-o The XView library can be obtained from (currently the newest is
- XView3.2p1-X11R6.tar.gz):
-
- ftp.nuclecu.unam.mx:/Midnight/devel/XView.libs
- ftp.x.org:/contrib/libraries
- ftp.cvut.cz:/pub/x11/contrib/libraries
-
- - Linux/ELF shared binaries:
-
- sunsite.unc.edu:/pub/Linux/libs/X/xview
- ftp.cvut.cz:/pub/linux/sunsite/libs/X/xview
-
-o The Tcl/Tk libraries can be obtained from:
-
- ftp.smli.com:/pub/tcl
- ftp.aud.alcatel.com:/tcl/ftp.smli.com
- ftp.cvut.cz:/pub/tcl/ftp.smli.com
-
- - Linux/ELF shared binaries:
-
- ftp.ods.com:/pub/linux
- ftp.cvut.cz:/pub/linux/ods
-
-o The Xpm library (used by the XView version) can be obtained from
- (currently xpm-3.4f.tar.gz):
-
- koala.inria.fr:/pub/xpm
- ftp.x.org:/contrib/libraries
- ftp.cvut.cz:/pub/x11/contrib/libraries
-
- - Linux/ELF shared binaries:
-
- ftp.ctd.comsat.com:/pub/linux/ELF
- ftp.cvut.cz:/pub/linux/comsat
-
-To get the mouse support working on the Linux console:
-
-If you're using Linux version >= 1.1.34, then you will have to choose yes
-to selection when you compile your kernel. If your Linux version is
-older than this one, you may try to apply one of the patches included in
-the gpm package.
-
-And the GNU C Compiler may be obtained from the following sites:
-
- ASIA: ftp.cs.titech.ac.jp, utsun.s.u-tokyo.ac.jp:/ftpsync/prep,
- cair.kaist.ac.kr:/pub/gnu
- AUSTRALIA: archie.au:/gnu (archie.oz or archie.oz.au for ACSnet)
- AFRICA: ftp.sun.ac.za:/pub/gnu
- MIDDLE-EAST: ftp.technion.ac.il:/pub/unsupported/gnu
- EUROPE: ftp.cvut.cz:/pub/gnu, irisa.irisa.fr:/pub/gnu,
- ftp.univ-lyon1.fr:pub/gnu, ftp.mcc.ac.uk,
- unix.hensa.ac.uk:/pub/uunet/systems/gnu,
- src.doc.ic.ac.uk:/gnu, ftp.win.tue.nl, ugle.unit.no,
- ftp.denet.dk, ftp.informatik.rwth-aachen.de:/pub/gnu,
- ftp.informatik.tu-muenchen.de, ftp.eunet.ch,
- nic.switch.ch:/mirror/gnu, nic.funet.fi:/pub/gnu, isy.liu.se,
- ftp.stacken.kth.se, ftp.luth.se:/pub/unix/gnu, archive.eu.net
- CANADA: ftp.cs.ubc.ca:/mirror2/gnu
- USA: wuarchive.wustl.edu:/mirrors/gnu, labrea.stanford.edu,
- ftp.kpc.com:/pub/mirror/gnu, ftp.cs.widener.edu, uxc.cso.uiuc.edu,
- col.hp.com:/mirrors/gnu, ftp.cs.columbia.edu:/archives/gnu/prep,
- gatekeeper.dec.com:/pub/GNU, ftp.uu.net:/systems/gnu
-
-
-Unsupported options to configure:
----------------------------------
-`--with-bsd-curses'
- If you don't want to use ncurses and are using an Ultrix box, you
- can use this switch. Be aware that ncurses is a better option
- than the curses included in Ultrix.
-
diff --git a/rosapps/applications/mc/doc/install.fast b/rosapps/applications/mc/doc/install.fast
deleted file mode 100644
index 1bb3453e619..00000000000
--- a/rosapps/applications/mc/doc/install.fast
+++ /dev/null
@@ -1,70 +0,0 @@
--*-text-*-
-
-Read the INSTALL file for the complete instructions.
-
- The Midnight Commander by default will use the Slang screen
-manager, if something fails with the Slang screen manager, you may
-compile the program with your system curses (You will need a SysV
-compatible curses, in case you don't have such, read the README file
-for directions on getting the ncurses package, a freely available
-replacement for SysV curses).
-
-1. Configure the package for your system.
-
- Normally, you just `cd' to the package main directory and type
-`./configure'.
-
- The most often needed options to configure are following:
-
-`--prefix=PATH'
- By default, `make install' will install the package's files in
- `/usr/local/bin', `/usr/local/man', etc. or to `/usr/bin',
- `/usr/man', etc. depending on the location of an old mc binary.
- If you have none in your system, default will be `/usr/local'.
- You can specify an installation prefix other than default by giving
- `configure' the option `--prefix=PATH'.
-
-`--with-slang' (default)
- The easy way to get the Commander running: Slang is part of
- the distribution. This is the default screen manager, if you run
- configure without any --with-*curses parameter.
-
-`--with-ncurses[=PATH]'
- Use the flag without =PATH if you want to compile with ncurses
- (default is in version 3.0 the SLang screen manager included
- in the distribution).
- Use this flag with =PATH part, if you want to compile with ncurses
- and your ncurses is not installed in any of the
- places configure checks (/usr/include, /usr/include/ncurses,
- /usr/local/include and /usr/local/include/ncurses). The
- configure script will append `lib' and `include' to find the
- libncurses.a and ncurses.h files respectively.
-
-`--with-gpm-mouse[=PATH]'
- Use this flag if your GPM mouse package cannot be detected by the
- configure. Use =PATH if it is installed in a non-standard place.
- The configure will append `lib' and `include' to find the libgpm.a
- and gpm.h files respectively.
-
-`--with-sco'
- If you are compiling on a SCO machine.
-
- You may also want to specify CFLAGS for the compiler, even if it finds
- itself some defaults by typing e.g.
-
- `CFLAGS=-O2 ./configure'
-
-2. Type `make' to compile the package.
-
-3. Type `make install' (as root) to install programs, data files, and
-documentation. If you're on a Linux system, this will install the
-`cons.saver' utility, which allows the Midnight Commander to save and
-restore the screen contents. If you're making a mc binary distribution for
-other people and want to tar the whole binary later, you may want to specify
-`make install DESTDIR=PATH', which will make PATH the root for installation
-(but in the installed stuff will be still stored only --prefix).
-
-3a. Type `make mcfninstall' to get an interactive program check if you
-want to define an useful alias for the Midnight Commander.
-
-4. Type `mc' and enjoy!
diff --git a/rosapps/applications/mc/doc/mc.1 b/rosapps/applications/mc/doc/mc.1
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/rosapps/applications/mc/doc/mcedit.1 b/rosapps/applications/mc/doc/mcedit.1
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/rosapps/applications/mc/doc/mcserv.8 b/rosapps/applications/mc/doc/mcserv.8
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/rosapps/applications/mc/doc/news b/rosapps/applications/mc/doc/news
deleted file mode 100644
index 136a8855f92..00000000000
--- a/rosapps/applications/mc/doc/news
+++ /dev/null
@@ -1,516 +0,0 @@
-
-Version 3.5
-
-- New hotlist code.
- - The bookmark code has been completely revamped and now it supports
- folders. New format for the hot list file.
- - It is possible to copy a selected path name into the input line
- (C-Enter).
-
-- Tk enhancements.
- - New built in GUI designer to help developers modify the look
- of the program at run time (no penaly for users).
- - Many dialog boxes now work.
- - Right button now pops up a context sensitive action menu.
- - Added many visual enhancements.
- - The Tk edition is not yet finished though.
-
-- File management.
- - Now we do background copy and move operations.
- (you can ftp your files in the background now, for example).
-
-- Built in text editor
- - This is an easy to use text editor with pull-down menus.
- The features it presently supports are: Block copy, move,
- delete, cut, paste; key for key undo; file insertion; macro
- definition; regular expression search and replace (and our
- own scanf-printf search and replace); shift-arrow MSW-MAC
- text highlighting (for the linux console only);
- insert-overwrite toggle; and an option to pipe text blocks
- through shell commands like indent.
-
- Comes with Emacs keybindings as well.
-
- mcedit is a link to mc which bring it up in editor mode.
-
-- FTP File system
- - Many fixes and enhacements, better support for proxy
- machines.
- - Now we support both active and passive opens.
- - Estimated time of arrival for ftp transfers.
- - stalled detection.
- - Much better support for proxies.
- - ftp URL's now allow a password to be provided.
-
-- ext2fs Undelete File system
- - Minor enhancements.
-
-- TAR File system
- - Now we flush the tarfs if the tar file has been modified
-
-- External File systems:
- - Speeded up RPM file system.
- - New LHA file system.
- - New ARC file system.
- - New DEB file system (for those users of Debian).
- - New RAR file system.
- - Fixed problems with different zipfs.
-
-- MC file system:
- - We get can use a mc file system by using either mc: or mc:// prefixes.
-
-- Viewer changes:
- - Now we include a program that preprocesses mail if you view it
- so, you get colored mails in the viewer.
- - A simple ruler has been implemented (press Alt-r to enable it).
-
-- New hex editor
- - Now you can do hex editions in your files with a single keystroke.
- (invoke it by using the hex-viewer and then clicking on edit).
-
-- Find file command:
- - Now we can search inside files using a piped grep (particularly
- interesting to search inside virtual file system: tar files,
- tar files on remote ftp sites, or searching information on an
- ftp site)
-
-- Widgets:
- - Input lines now support control-left, control-right movement on the
- Linux console.
-
-- Extension file:
- - We now support extra entries in a given rule with the Include=
- tag.
-
-- Ports:
- - Windows NT, Windows 95 by Juan Grigera
- - OS/2 by Alexander Dong.
-
-
-- Many many many bug fixes and memory leaks have been fixed.
-
-
-Version 3.2
-
-- External File system:
- - Mtools file system works.
- - New Cpio file system.
- - New RPM file system.
-
-- FTP file system:
- - support for HSC firewall
-
-- Lots of subshell fixes
-
-- Regexp-extension:
- - Editing of non-local files works now.
-
-- Bunch of bug fixes.
-
-- Panelize now works properly.
-
-- Can work on Nextstep now.
-
-- Windows NT port by Juan Grigera.
-
-- Midnight Commander file system server:
- - Fixed errno handling in the server.
- - Fixed time handling in the server.
- - Better caching.
- - Works with PAM if supported on the system.
-
-Version 3.1
-
-This has been finished:
-
-- Enhanced ftpfs:
- - Displays progress bars.
- - Supports netware and windows nt servers
- - Better support for symlinked files.
- - Handles those warez sites file names.
- - Increase the directory cache timeout.
- - Cache flushing (C-r)
- - If you append a /~ to the directory, you will log into your home
- directory (this is done by default if you use the menus to connect).
- - More robust.
-- Subshell fixes (it should not hang any longer).
- - Fixes prompt handling for zsh and tcsh users.
- - Fixes variable expansion for tcsh (now you may edit files).
- - Rewrote the sync code between the parend and child, should not hang
- any longer.
-- Better command completion.
-- Keypad handling enhanced:
- - Special key treatment for +, -, \ and now may be configure to
- only take place if you do not have a command typed in.
- - Now the + and \ bindings when ran on the Linux console work
- may use the keypad and M-+ and M-\ and leave the + and \ keys
- free.
-- Better handling of the line drawing chars on OSF/1 and AIX.
-- Enhanced tar/compressed tar file systems.
-- Global kill ring.
-- Added undelete feature for Linux systems: now you may recover deleted files
- on ext2 file systems with the Undelete file system.
-- Symlink commands (for symlink lovers).
- see the docs on C-x C-r, C-x C-l, C-x C-s keystrokes.
-- New macros:
- %b and %B return the basename of the selected filename
- %var{ENV-VAR} expands to the contents of ENV-VAR variable.
-- MC may be invoked as a viewer (mc -f flag).
-- Added Unicode support on the Linux console (run with mc -N)
-- Tons of bug fixes, the code is cleaner and hopefully
-- Allow a vfs pathname to be passed as a startup directory.
-
-This is a list of people that put their effort into making the 3.1
-release:
-
-Adam Tla/lka, Antonio Palama, Carl Thompson, Ching Hui, Dugan Porter, Gerd
-Knorr, Ilya Rybkin, Jakub Jelinek, Janne Kikonlehto, Juan Grigera, Juan Jose
-Ciarlante, John Davis, Marcelo Fabian Roccasalva, Perry Francis Nguyen,
-Sergey Ya Korshunoff Steven Hirsch, Thanh Ma and Torben Fjerdingstad.
-
-Version 3.0
-
-This has been finished:
-
-- Virtual File System: You now can browse tar, compressed tar and
- file systems over the network as if they were local subdirectories;
-- Slang support, you don't need ncurses anymore (but you can still compile
- with ncurses, if you want).
-- New mc.ext format, for details see the sample mc.ext file provided.
-- Append option if you try to copy/move a file onto already existing one.
-- Internal cd command uses CDPATH variable if set (like in BASH).
-- Find file command is much faster.
-- External panelize command - finding files using unlimited number of
- criteria - actually spawns an external command and it can be find, awk,
- grep -l or anything else.
-- Learn keys makes setting up of mc on terminals with broken
- terminfo/termcap databases easier. It just asks you to press keys which
- are not working.
-- Advanced chown command.
-- C-PgUp and C-PgDn takes you to the previous and currently selected
- directory respectively on the Linux console.
-- You can choose between 7 data bits, iso-latin-1 (0-127+160-255) or
- other (0-255).
-- Confirmation for overwriting, deleting and exiting added.
-- Viewer has growing buffers.
-- Filename, username, hostname and variable completion (M-Tab) on all
- input lines plus command completion on appropriate places of command
- line.
-- Following of symlinks at changing directory.
-- Viewer now supports bold faces and underlines, and it fits the
- information on the screen better. Now you can also specify the starting
- mode for the viewer depending on the contents of the viewed file.
-- Mask rename and copy.
-- Colors now let you specify the intensity of the colors you want.
-
-This is being worked on:
-- Virtual File System: FTP file system.
-- Tcl/Tk and XView versions of the program (preliminary versions are
- up and running).
-
-
-Version 2.0
-
-Now users are able to define their own display
-
-- User defined display formats.
-
- Now you can configure the file display to suit your needs.
- For example, you can say which information you want to see displayed
- instead of our defaults.
-
-- User definable program layout.
-
- Panels could be shown vertically or horizontally;
- panels could be different sizes, you can hide or show most
- program windows (command line, keybar or menubar).
-
-- Output window.
-
- Now, it's possible to see part of the last program output on the Linux
- console without having to switch screens via an option in the layout
- menu.
-
-- New View modes:
-
- Quick view: as you browse your files, each one is displayed on
- the other panel on the idle time.
-
- Tree view: let's you browse your directories by traveling a tree.
- We have two traveling modes available. And the tree does
- not take your precious time: it's build on the fly, as you
- browse your disk (you can always loose your time if you
- want to :-).
-
- Info view: Gives you information on the currently select file and
- the current file system as you move.
-
- User view: Let's you define a directory listing and the format you
- want to use.
-
-- New subshell support (concurrent shell execution)
-
- The Midnight Commander will now spawn one copy of the shell, so you
- get better performance and you can use shell functions, define variables
- and execute complete shell commands. Supported shells: bash, zsh and
- tcsh. If your shell is not supported, then the old mode is still
- available.
-
-- Dialog box manager
-
- Almost all the new configuration options are configured with this
- new dialog manager, easy to use if you are familiar with dialog boxes
- in DOS and Windows.
-
- Available widgets: check buttons, buttons, radio buttons,
- input lines and list boxes (So you can take our code and use it on
- your applications).
-
-- New option configuration.
-
- Now the program options are configured with a dialog box.
-
-- Chmod and Chown commands:
-
- For changing permissions as well as ownership of files and
- directories, uses our new dialog manager.
-
-- Color customization support
-
- Now you can change the default color of the program with any of
- these:
- environment variable, Colors section in the init file (colors per
- terminal type) and command line.
-
-- User menu and extension enhancements:
-
- Execution understand the %t macro (tagged files).
-
- User menu also has a new macro to let the user specify options.
-
- You can hide and show entries in the user menus by using conditions.
-
- Auto detect best match depending on a regexp.
-
-- Viewer:
- Goto line command,
- horizontal scrolling,
- on the fly uncompression (and we don't eat unneeded cycles of CPU),
- allow non gunzip operation.
-
-- Internal move command:
-
- Now, we don't rely anymore on system commands in /bin, so the
- program is more robust and is much faster. Bunchs of code come
- from the GNU fileutils.
-
-- The Tree view and normal views allows wrapped incremental searchs of
- file names.
-
-- Mask rename:
-
- Now it's possible to do things like rename *.pas in *.bak
-
-- Compare directories command
-
-- Allow panels to be in Long mode without forcing the user to a single panel.
-
- (You can even have two long panels).
-
-- F10, C-g cancels as well as ESC ESC.
-
-- Improved help system.
-
- We updated and spelled the help system and added a lots of links.
- The Web page is constructed with the same tools.
-
-- Allows tagging of directories:
-
- Now you can copy, rename, move and delete complete directories. You
- are not limited anymore to files.
-
-- View output (screen save/restore) on Linux console.
-
- On old Linux systems, only b&w is supported, on newer Linux systems
- (1.1.67 and newer), we also support color screen save/restore and
- cursos positions.
-
-- 8 bit clean support.
-
-- Visual feedback while i-searching files.
-
-- Much more intuitive, you have to use it.
-
-- It's better than aspirin.
-
-- New memory allocation debugger.
-
- During testing time, we used a powerfull memory allocation debugger,
- so the program will not eat all your memory, and will make a good use of
- your memory.
-
-- Now it also runs on hppa-hp-hpux9, hppa-hp-hpux7, m68k-apple-aux and
- sparc-sun-netbsd1.0. The best platform to run it is Linux, of course,
- since that's where most of us develop it.
-
-- Inode sort option.
-
-- Nice progress status indicator.
-
- We have two of them: a moving dash indicator and a progress bar
- indicator for file operations.
-
-Version 0.15
-
-- Uses GNU autoconf.
- Currently, it has been ported to this configurations:
- i386-*-linux1.0
- i386-*-linux1.1
- mips-sgi-irix5.2
- mips-dec-ultrix4.3
- rs6000-ibm-aix3.2.5
- sparc-sun-sunos4.1
- sparc-sun-solaris2.3
-
-- Improvements to the internal file viewer:
- Wrap/Unwrap mode.
- Hex mode.
- Hex searches.
- Now you can view compressed files (gzip, compress, zip, pack and lzh).
- Performance enhancements, now it's much faster.
- Works on systems without mmap.
-
-- Mouse Support now also works on xterms.
- If you run in the Linux console, you will still need the gpm mouse server
- to use the mouse support, but if you use xterms, then you're lucky
- and can use the mouse support when using xterms.
-
-- Help system and man page.
- Both were updated and has many more hypertext links inside, the
- help system can also be used with a mouse.
-
-- If running on xterms, now you can see the output of the last program
- you ran by using the C-o key combination.
-
-- Switch panels command (C-u)
-- With filter command per panel.
-- With auto mounting/umounting on chdir feature.
-- cd now expands tildes (~, ~user).
-- Much more portable.
-- Many bugs were fixed.
-
-Version 0.14
-
-- Now can handle directories with an unlimited number of files.
-- New link and symlink commands (C-x l, C-x s).
-- New insert tagged files or selection command (C-x t).
-
-Version 0.13
-
-- Behave more like the Norton Commander.
-- Added menu file edit.
-- If there is no permission to load a directory, now it loads a dummy
- directory.
-- When a panel is re-sorted, keep the selected file selected.
-- forward_word and backward_word command on the input line now skip
- over letters and numbers.
-- Fixed backward scrolling in the internal viewer.
-- The internal viewer now computes the percentage in a more natural
- way.
-- Added handling of the Home and End keys to the internal viewer
-- Bug fixes.
-
-Version 0.12
-
-- Preliminary support for System V compilation.
-- Bug fix: didn't call closedir in all cases.
-- bug fixes.
-
-Version 0.11
-
-- Support cd -.
-- Corrected Makefile.
-
-Version 0.10
-
-- Added new Alt-G, Alt-H, Alt-J to select the top file, middle file
- and bottom file in the current panel.
-- Now it's allowed to select option in query boxes by the first initial
-- Fixed mouse repeat rate.
-- Fixed a bug that prevent copying individual files to another file.
-- Some minor bug fixes.
-
-Version 0.9
-
-- Mouse Support.
-- Internal Copy command (it no longer uses cp).
-- Verbose Copying of files.
-- Confirmation on Overwrite and on Delete.
-- Support reverse sorting.
-- Many visual enhancements.
-- Per panel options are saved and restored.
-- New truncation of names in the panels.
-- History in Input Lines (M-p and M-n).
-- Input line enhancements.
-- Dialog boxes are nicer than before.
-- Cache in gid and uid translators.
-- More keybindings for the Input lines.
-- Better kill management in Input Lines.
-- Bug fixes.
-
-Version 0.8
-
-- The online help now comes with the complete man page.
-- Input lines now support M-b and M-f for movement by word.
-- Unlimited input lines (command line).
-- Filename searches now must be started with C-s or M-s.
-- Many bug fixes.
-
-Version 0.7
-
-- The stat() reloading optimization is now a configuration option.
-- Many bug fixes went to the find file command.
-- New history in the hypertext viewer.
-- ESC-Tab will copy the name of the other-panel selected file to the
- input line.
-- Now it's possible to display files and directories mixed together or
- separated (like the Norton Commander).
-- Many bug fixes, see the ChangeLog for details.
-
-Version 0.6
-
-- Extension dependent execution implemented (now you can execute
- things like tar tzvf over compressed tar files, just a tap in the
- Enter key).
-- Added simple expansion of useful variables in the user menu.
-- Avoid unnecessary reloading of subdirectories using stat (suggested
- by Torben Fjerdingstad ).
-- Added options to disable colors and display version number.
-- Allow start up directory specification (ex: mc /usr/local/bin /tmp).
-- Fixed bug that operated on the selection instead of the tagged file
-(when only one file was tagged).
-- Some cosmetic changes.
-- Bug fixes.
-
-Version 0.5
-
-- Fixed bug in the help browser that crashed the program.
-- New internal viewer.
-- New long directory listing format.
-- some bug fixes.
-
-Version 0.4
-
-- User Menus (F2 key).
-- Quick search of files in a panel (Alt-filename takes you to that file).
-- Char quoting (C-q).
-- exec() enhancements.
-- now you can suspend the program (C-z).
-- The find file command now seems to be very stable.
-- misc bug fixes.
-
-Version 0.3
-
-- Setup loading/saving.
-- Support for any size screen.
-- Many, many bug fixes.
diff --git a/rosapps/applications/mc/doc/readme b/rosapps/applications/mc/doc/readme
deleted file mode 100644
index 6d118941cb9..00000000000
--- a/rosapps/applications/mc/doc/readme
+++ /dev/null
@@ -1,191 +0,0 @@
--*-Text-*-
-
-Contents:
----------
- Intro text
- Midnight Commander editions
- Where to get more information
- The Midnight Commander
- Mini-docs
- Obtaining the Midnight Commander
- Reporting problems.
-
-This is version 4 of the Midnight Commander, a free Norton Commander
-Clone with many useful features. The Midnight Commander comes with
-mouse support on xterms and optionally on the Linux console.
-
-The Midnight Commander is a directory browsing tool which bears a
-certain remote resemblance to John Socha's Norton Commander for DOS.
-It is feature packed:
-
- o Built in Virtual File System: manipulate remote files
- systems through the ftp protocol or Midnight Commander's own
- mcfs protocol. Browse tar, compressed tar files, rpm, zip,
- cpio, lha and rar files with a single click.
-
- o All of the Midnight Commander operations work with the virtual
- file system, enabling you to do complex tasks.
-
- o Mouse support on the Linux console and under X11's xterms.
-
- o Learn Keys: The Midnight Commander may be configured at run
- time to support any kind of input keys for a given terminal,
- making its operation even on the most wierd terminals a
- breeze.
-
- o Text and hex editors are available for you to use.
-
- o Hotlist allows you to keep a list of common visited
- locations (including ftp sites).
-
- o Command completion: By pressing Alt-Tab in any place where a
- filename or an executable are expected, the Midnight Commander
- will complete for you the name. If you quickly press Alt-Tab
- twice you can get a listbox with the possible completions
- available.
-
- o Subshell support: Run your commands by a real shell
- interpreter. The Midnight Commander interacts with bash, tcsh
- and zsh to provide you with all of the facilities available in
- your shell.
-
- o Find file command can now search inside the contents of
- files.
-
- o Background operations allows you to copy or move files from
- any virtual file system while you do other tasks (ie, you can
- do background ftp copies).
-
- o Proxy support with our ftpfs.
-
- o Linux file recovery: If you are using Linux system, you can
- recover deleted files from an ext2fs partition with the
- undelete file system. This is a low level file recovery
- function that will recover files deleted by any program in
- Linux.
-
- Please note that the undelete file system can only recover
- 12 file system blocks if the file was deleted with a kernel
- in the 2.0.x series. The 2.1.x series have fixed this and you
- can recover all of the file contents there.
-
- o External panelization: You can run any arbitrary external
- command and the Midnight Commander will display the output
- generated as a file listing that can be manipulated as a
- regular directory.
-
- o Emacs like key bindings in all of our widgets.
-
- o Powerfull context dependant actions are available.
-
- o Powerfull built-in file viewer: The file viewer, together
- with the context dependant actions is used to format man pages
- on the fly, coloring mail messages and more.
-
-
-Midnight Commander editions:
-----------------------------
-
-The Midnight Commander may be compiled into three different editions:
-the text mode edition, the Tk edition and the XView edition. Please
-note that currently the only supported edition is the text mode
-edition. The Tk and XView editions are included with the tar file but
-are not finished and thus not supported.
-
-
-Where to get more information:
-------------------------------
-
-There is a mailing list for discussion on enhancing the program, future
-directions and announcements; if you want to subscribe, send mail to:
-
-majordomo@roxanne.nuclecu.unam.mx
-
-There is a WWW page for the Midnight Commander with the URL:
-.
-
-
-The Midnight Commander:
------------------------
-
-The Midnight Commander is released under the GNU General Public License
-version 2.0 or any later version. A copy of the file is included with
-this distribution package.
-
-If you have comments, you can send them to me:
-
-miguel@roxanne.nuclecu.unam.mx
-
-or if it would benefit more people, to the mailing list:
-
-mc@roxanne.nuclecu.unam.mx
-
-Help develop and enhance free software.
-
-
-Mini-documentation:
--------------------
-
-o Use the F-Keys for invoking the commands in the function key bar.
- If your terminal doesn't support F-keys, you can use the
- sequence to invoke the corresponding F-digit key.
-
-o Tab changes the current panel.
-
-o All input lines have emacs-like key-bindings (command history is
- accessed through the M-p and M-n keys).
-
-o The panels accept C-n, C-p for browsing the panel (like in emacs).
-
-o M-Enter copies the currently selected file name to the input line.
-
-o M-Tab completes the current word (or tries to).
-
-o The Virtual File System is a cute addition to the project, you may
- browse in tar and compressed tar files as well as browsing remote
- machines with the mcfs file system.
-
-o Please read the manual page.
-
-o Read the file src/TODO for the current projects.
-
-You can access the whole documentation online with the F1 key,
-although it's not as nice as the groff printed manual page :-)
-
-
-Where you may obtain the Midnight Commander
--------------------------------------------
-
-The software should be available by anonymous ftp at sunsite.unc.edu
-in the directory /pub/Linux/utils/file and at ftp.nuclecu.unam.mx
-in the directory /linux/local.
-
-The last alpha versions are available at ftp.nuclecu.unam.mx in the
-directory /linux/local/devel.
-
-European mirrors of both version 3.1 and alpha versions are available
-at sunsite.mff.cuni.cz in the directory /GNU/mc and at ftp.teuto.de
-in the directory /lmb/mc.
-
-
-Reporting problems
-------------------
-
-Please, send a detailed description of your problem to the
-mc-bugs@roxanne.nuclecu.unam.mx address.
-
-Include the version of the program, the operating system that you are
-using, the compiler and compiler flags used to compile the program (if
-you know them), what kind of distribution you are using (if a
-GNU/Linux system).
-
-If the program crashed and produces a core dump, please provide a
-stack trace of the program.
-
-You can do this by running dbx or gdb like this:
-
-gdb mc core
-(gdb) where
-
-
-
diff --git a/rosapps/applications/mc/doc/readme.nt b/rosapps/applications/mc/doc/readme.nt
deleted file mode 100644
index 8f13dd67f44..00000000000
--- a/rosapps/applications/mc/doc/readme.nt
+++ /dev/null
@@ -1,126 +0,0 @@
-
-Midnight Commander for Windows NT and Windows '95
--------------------------------------------------
-
-0. Hello
-1. Compiling
-2. Changes made
-
-0. Hello
---------
-Hello, this is the Midnight Commander port to Win32. It has many bugs, but is
-quite stable now. Maybe you can help as an beta tester or as a programmer. In
-either case you would like subscribe to mc-devel list
-(see readme files in main doc on how to do this) and contact us.
-
-1. Compiling
-------------
-
-1.1. Compiler
-----------------
-Microsoft Visual C++ for Windows NT (all versions, including 4.x) are supported.
-In nt/makefile you can find an external makefile, and in nt/makefile.vc1.nt, vc4.nt
-projects for the visual IDE. Two makefiles are add since the version 3.5.39. They
-are produced from MS VC 4.x and are named as ntaxp.mak (for Windows NT AXP)
-and ntint.mak (for Windows NT Intel). If you want to use them, you will have to
-change the path coded in these two files.
-
-Other compilers such as Watcom, or Borland tools should be quite
-straightforward, but has not been tested.
-
-Under Cygnus tools, apparently everything works just fine.
-
-1.2. General issues
---------------------
-Preprocessor
- Define:
- LIBDIR
- _OS_NT - OS flag
- OS2_NT - Flag for OS/2 and NT
- HAVE_CONFIG_H - config.h flag
-
- Includes:
- So as to avoid chaos in include files, I decided to create some
- fake includes for UNIX counterparts. The empty files you need to create are:
- pwd.h grp.h
- sys/param.h sys/time.h
-
-1.3 Windowing Library
---------------------------------
-Currently only support for S-lang windowing library is given. I know no curses
-public library ported to Win32 consoles, and I think it is useless to port
-it now. You may want to download the complete distribution it from
-ftp://space.mit.edu/pub/davis.
-
-
-2. Changes made
----------------
-
-2.1. Changes to main code
--------------------------
-They are enclosed in #ifdef _OS_NT or OS2_NT blocks.
-
-Wrote something similar to statfs in UTIL.C
-Wrote truncate.
-Changed (almost) all references to "/" path slash with PATH_CHAR and strPATH_CHAR.
-Changed name of CONTROL_FILE.
-Changed name of shell and call to shell.
-
-In some cases we supressed code. This is temporal (so that mc can compile). In
-the future we will provide fake or true interfaces for these features.
- - Links: creation and information on links are not supported in NT. We
- should provide a fake interface for the local filesystem and
- a true one for networked.
- - GID/UID queries (get_user, owner, preserve UID/GID on copy, ...).
- - TERMinals: all the code directly done with terminals must be supressed.
- - Signals: deleted. Should support the native ones.
- - pipes: had some trouble in ext.c and with error_pipes but soon will be fixed.
- - Chown command: Not supported yet.
-
-2.2. Files rewritten
---------------------
-There are 3 files with so many changes that they have been moved to independent
-archives (or OS dependent).
- - Chmod.nt.c: this command will query and change attributes (hidden, system,
- archive,...). Maybe we should write a real chmod (and also a
- chown). It is not finished, but works almost fine. Look that
- the stat st_mode member is filled with attributes, not modes.
- - Cons.handler.nt.c: Supports same API as linux cons.handler.c. It allocates
- a new console buffer and switches between the two when doing a
- shell. The new allocated one is the used by Midnight commander.
- (look that to make this we should also redirect standard handles)
- - Key.nt.c: a static table maps Virtual Key codes to Curses-like Key codes.
- Also mouse events are supported.
- still preliminar.
- - utilnt.c: Contains utilunix.c functions, with Win32 implementation
-
-2.3. New files
---------------
- - drive.nt.c: A Change Drive command has been implemented. Two lines
- in main.c were included (in the left/right panel menus).
- The funcs drive_cmd_a/b are implemented in this new file.
- It will build a dialog with available drives as buttons.
- bug: too many drives are not supported (think just 7). have
- to rewrite to support more than one line.
-
- - util.debug.c: developers-only utilities to trace Win32 API call error codes
- - util.WinNT.c: Windows NT specific functions:
- getuid(): Will check your priviledges and return 0 (root)
- if you have Administrator priviledges.
- - util.Win32.c: Windows NT & 95 utilities: (specific to Win32, no UNIX counterpart)
- getEXEtype(): check if executable is CUI or GUI.
-
-2.4. Changes made from me (Alexander Dong, ado@software-ag.de)
---------------------
-
-I have hacked some codes for Windows NT AXP and NT Intel.
-Drive.nt.c was rewritten for a beautiful Drive_Change dialog window.
-
-All main source changed from me are marked with the comment /* .ado */.
-
-I have also included two own Makefiles:
- ntaxp.mak (for Windows NT Alpha) and
- ntint.mak (for Windows 95/NT Intel).
-You will have to change the path in these files before use them. They
-are both for Microsoft Visual C++ 4.x.
-
diff --git a/rosapps/applications/mc/edit/edit.c b/rosapps/applications/mc/edit/edit.c
deleted file mode 100644
index 4d65551a56a..00000000000
--- a/rosapps/applications/mc/edit/edit.c
+++ /dev/null
@@ -1,2279 +0,0 @@
-/* editor low level data handling and cursor fundamentals.
-
- Copyright (C) 1996, 1997 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#define _EDIT_C THIS_IS
-
-#include
-#if defined(OS2_NT)
-# include
-# include
-# define CR_LF_TRANSLATION
-#endif
-#include "edit.h"
-
-#ifdef SCO_FLAVOR
-# include
-#endif /* SCO_FLAVOR */
-#include /* for ctime() */
-
-/*
- *
- * here's a quick sketch of the layout: (don't run this through indent.)
- *
- * (b1 is buffers1 and b2 is buffers2)
- *
- * |
- * \0\0\0\0\0m e _ f i l e . \nf i n . \n|T h i s _ i s _ s o\0\0\0\0\0\0\0\0\0
- * ______________________________________|______________________________________
- * |
- * ... | b2[2] | b2[1] | b2[0] | b1[0] | b1[1] | b1[2] | ...
- * |-> |-> |-> |-> |-> |-> |
- * |
- * _<------------------------->|<----------------->_
- * WEdit->curs2 | WEdit->curs1
- * ^ | ^
- * | ^|^ |
- * cursor ||| cursor
- * |||
- * file end|||file beginning
- * |
- * |
- *
- * _
- * This_is_some_file
- * fin.
- *
- *
- */
-
-/*
- returns a byte from any location in the file.
- Returns '\n' if out of bounds.
- */
-int edit_get_byte (WEdit * edit, long byte_index)
-{
- unsigned long p;
- if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0)
- return '\n';
-
- if (byte_index >= edit->curs1) {
- p = edit->curs1 + edit->curs2 - byte_index - 1;
- return edit->buffers2[p >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (p & M_EDIT_BUF_SIZE) - 1];
- } else {
- return edit->buffers1[byte_index >> S_EDIT_BUF_SIZE][byte_index & M_EDIT_BUF_SIZE];
- }
-}
-
-char *edit_get_buffer_as_text (WEdit * e)
-{
- int l, i;
- char *t;
- l = e->curs1 + e->curs2;
- t = CMalloc (l + 1);
- for (i = 0; i < l; i++)
- t[i] = edit_get_byte (e, i);
- t[l] = 0;
- return t;
-}
-
-/* Initialisation routines */
-
-/* returns 1 on error */
-/* loads file OR text into buffers. Only one must be none-NULL. */
-/* cursor set to start of file */
-int init_dynamic_edit_buffers (WEdit * edit, const char *filename, const char *text)
-{
-
-#if defined CR_LF_TRANSLATION
- /* Variables needed for safe handling of Translation from Microsoft CR/LF EOL to
- Unix Style LF EOL - Franco */
- long bytes_wanted,bytes_read,bytes_missing;
- char *p;
-#endif
-
- long buf;
- int j, file = 0, buf2;
-
- for (j = 0; j <= MAXBUFF; j++) {
- edit->buffers1[j] = NULL;
- edit->buffers2[j] = NULL;
- }
-
- if (filename)
- if ((file = open ((char *) filename, O_RDONLY | MY_O_TEXT)) == -1) {
-/* The file-name is printed after the ':' */
- edit_error_dialog (_(" Error "), get_sys_error (catstrs (_(" Fail trying to open file for reading: "), filename, " ", 0)));
- return 1;
- }
- edit->curs2 = edit->last_byte;
-
- buf2 = edit->curs2 >> S_EDIT_BUF_SIZE;
-
- edit->buffers2[buf2] = CMalloc (EDIT_BUF_SIZE);
-
-/*
-_read returns the number of bytes read,
-which may be less than count if there are fewer than count bytes left in the file
-or if the file was opened in text mode,
-in which case each carriage return–linefeed (CR-LF) pair is replaced
-with a single linefeed character. Only the single linefeed character is counted
-in the return value. The replacement does not affect the file pointer.
-
-_eof returns 1 if the current position is end of file, or 0 if it is not.
-A return value of -1 indicates an error; in this case, errno is set to EBADF,
-which indicates an invalid file handle.
-*/
- if (filename){
-
-#if defined CR_LF_TRANSLATION
- bytes_wanted=edit->curs2 & M_EDIT_BUF_SIZE;
- p = (char *) edit->buffers2[buf2] + EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE);
- bytes_read = read (file, p , edit->curs2 & M_EDIT_BUF_SIZE);
- bytes_missing = bytes_wanted - bytes_read ;
- while(bytes_missing ){
- p += bytes_read;
- bytes_read = read(file,p,bytes_missing);
- if(bytes_read <= 0) break;
- bytes_missing -= bytes_read ;
- }
-#else
- read (file, (char *) edit->buffers2[buf2] + EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE), edit->curs2 & M_EDIT_BUF_SIZE);
-#endif
- }
- else {
- memcpy (edit->buffers2[buf2] + EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE), text, edit->curs2 & M_EDIT_BUF_SIZE);
- text += edit->curs2 & M_EDIT_BUF_SIZE;
- }
-
- for (buf = buf2 - 1; buf >= 0; buf--) {
- edit->buffers2[buf] = CMalloc (EDIT_BUF_SIZE);
- if (filename){
-#if defined CR_LF_TRANSLATION
- bytes_wanted = EDIT_BUF_SIZE;
- p = (char *) edit->buffers2[buf];
- bytes_read = read (file, p, EDIT_BUF_SIZE);
- bytes_missing = bytes_wanted - bytes_read ;
- while(bytes_missing ){
- p += bytes_read;
- bytes_read = read(file,p,bytes_missing);
- if(bytes_read <= 0) break;
- bytes_missing -= bytes_read ;
- }
-#else
- read (file, (char *) edit->buffers2[buf], EDIT_BUF_SIZE);
-#endif
- }
- else {
- memcpy (edit->buffers2[buf], text, EDIT_BUF_SIZE);
- text += EDIT_BUF_SIZE;
- }
- }
-
- edit->curs1 = 0;
- if (filename)
- close (file);
-
- return 0;
-}
-
-/* returns 1 on error */
-int edit_load_file (WEdit * edit, const char *filename, const char *text, unsigned long text_size)
-{
- struct stat s;
- int file;
-
-/* VARS for Lastbyte calculation in TEXT mode FRANCO */
-#if defined CR_LF_TRANSLATION
- char tmp_buf[1024];
- long real_size,bytes_read;
-#endif
-
- if (text) {
- edit->last_byte = text_size;
- filename = NULL;
- } else {
-#if defined(MIDNIGHT) || defined(GTK)
- if ((file = open ((char *) filename, O_RDONLY | MY_O_TEXT )) < 0)
- {
- close(creat((char *) filename, 0666));
- if ((file = open ((char *) filename, O_RDONLY | MY_O_TEXT )) < 0) {
- edit_error_dialog (_(" Error "), get_sys_error (catstrs (" Fail trying to open the file, ", filename, ", for reading ", 0)));
- return 1;
- }
- edit->delete_file = 1;
- }
-#else
- if ((file = open ((char *) filename, O_RDONLY)) < 0) {
- edit_error_dialog (_(" Error "), get_sys_error (catstrs (_(" Fail trying to open file for reading: "), filename, " ", 0)));
- return 1;
- }
-#endif
- if (stat ((char *) filename, &s) < 0) {
- close (file);
-/* The file-name is printed after the ':' */
- edit_error_dialog (_(" Error "), get_sys_error (catstrs (_(" Cannot get size/permissions info on file: "), filename, " ", 0)));
- return 1;
- }
- if (S_ISDIR (s.st_mode) || S_ISSOCK (s.st_mode)
- || S_ISFIFO (s.st_mode)) {
- close (file);
-/* The file-name is printed after the ':' */
- edit_error_dialog (_(" Error "), catstrs (_(" Not an ordinary file: "), filename, " ", 0));
- return 1;
- }
- if (s.st_size >= SIZE_LIMIT) {
- close (file);
-/* The file-name is printed after the ':' */
- edit_error_dialog (_(" Error "), catstrs (_(" File is too large: "), \
- filename, _(" \n Increase edit.h:MAXBUF and recompile the editor. "), 0));
- return 1;
- }
-
-/* Lastbyte calculation in TEXT mode FRANCO */
-#if defined CR_LF_TRANSLATION
- if(file && (!text)){
- real_size=0;
- tmp_buf[1024]=0;
- while((bytes_read = read(file,tmp_buf,1024)) > 0){
- real_size += bytes_read;
- }
- s.st_size = real_size;
- }
-
-#endif
-
- close (file);
- edit->last_byte = s.st_size;
- edit->stat = s;
- }
-
- return init_dynamic_edit_buffers (edit, filename, text);
-}
-
-#ifdef MIDNIGHT
-#define space_width 1
-#else
-int space_width;
-extern int option_long_whitespace;
-extern unsigned char per_char[256];
-
-void edit_set_space_width (int s)
-{
- space_width = s;
-}
-
-#endif
-
-/* fills in the edit struct. returns 0 on fail. Pass edit as NULL for this function to do an malloc for you */
-WEdit *edit_init (WEdit * edit, int lines, int columns, const char *filename, const char *text, const char *dir, unsigned long text_size)
-{
- char *f;
-#ifndef MIDNIGHT
- if (option_long_whitespace)
- edit_set_space_width (per_char[' '] * 2);
- else
- edit_set_space_width (per_char[' ']);
-#endif
- if (!edit)
- edit = malloc (sizeof (WEdit));
- if (!edit) {
- edit_error_dialog (_(" Error "), _(" Error allocating memory "));
- return 0;
- }
- memset (&(edit->from_here), 0, (unsigned long) &(edit->to_here) - (unsigned long) &(edit->from_here));
-#ifndef MIDNIGHT
- edit->max_column = columns * FONT_MEAN_WIDTH;
-#endif
- edit->num_widget_lines = lines;
- edit->num_widget_columns = columns;
- edit->stat.st_mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
- edit->stat.st_uid = getuid ();
- edit->stat.st_gid = getgid ();
- edit->bracket = -1;
- if (!dir)
- dir = "";
- f = (char *) filename;
- if (filename)
- f = catstrs (dir, filename, 0);
- if (edit_load_file (edit, f, text, text_size)) {
-/* edit_load_file already gives an error message */
- free (edit);
- return 0;
- }
- edit->force |= REDRAW_PAGE;
- if (filename) {
- filename = catstrs (dir, filename, 0);
- edit_split_filename (edit, (char *) filename);
- } else {
- edit->filename = strdup ("");
- edit->dir = strdup(dir);
- }
- edit->stack_size = START_STACK_SIZE;
- edit->stack_size_mask = START_STACK_SIZE - 1;
- edit->undo_stack = malloc ((edit->stack_size + 10) * sizeof (long));
- if (!edit->undo_stack) {
- edit_error_dialog (_(" Error "), _(" Error allocating memory "));
- free (edit);
- return 0;
- }
- edit->total_lines = edit_count_lines (edit, 0, edit->last_byte);
- edit_load_syntax (edit, 0, 0);
- {
- int fg, bg;
- edit_get_syntax_color (edit, -1, &fg, &bg);
- }
- return edit;
-}
-
-
-/* clear the edit struct, freeing everything in it. returns 1 on success */
-int edit_clean (WEdit * edit)
-{
- if (edit) {
- int j = 0;
- edit_free_syntax_rules (edit);
- for (; j <= MAXBUFF; j++) {
- if (edit->buffers1[j] != NULL)
- free (edit->buffers1[j]);
- if (edit->buffers2[j] != NULL)
- free (edit->buffers2[j]);
- }
-
- if (edit->undo_stack)
- free (edit->undo_stack);
- if (edit->filename)
- free (edit->filename);
- if (edit->dir)
- free (edit->dir);
-/* we don't want to clear the widget */
- memset (&(edit->from_here), 0, (unsigned long) &(edit->to_here) - (unsigned long) &(edit->from_here));
- return 1;
- }
- return 0;
-}
-
-
-/* returns 1 on success */
-int edit_renew (WEdit * edit)
-{
- int lines = edit->num_widget_lines;
- int columns = edit->num_widget_columns;
- char *dir;
-
- if (edit->dir)
- dir = strdup (edit->dir);
- else
- dir = 0;
-
- edit_clean (edit);
- if (!edit_init (edit, lines, columns, 0, "", dir, 0))
- return 0;
- return 1;
-}
-
-/* returns 1 on success */
-int edit_reload (WEdit * edit, const char *filename, const char *text, const char *dir, unsigned long text_size)
-{
- int lines = edit->num_widget_lines;
- int columns = edit->num_widget_columns;
- edit_clean (edit);
- if (!edit_init (edit, lines, columns, filename, text, dir, text_size)) {
- return 0;
- }
- return 1;
-}
-
-
-/*
- Recording stack for undo:
- The following is an implementation of a compressed stack. Identical
- pushes are recorded by a negative prefix indicating the number of times the
- same char was pushed. This saves space for repeated curs-left or curs-right
- delete etc.
-
- eg:
-
- pushed: stored:
-
- a
- b a
- b -3
- b b
- c --> -4
- c c
- c d
- c
- d
-
- If the stack long int is 0-255 it represents a normal insert (from a backspace),
- 256-512 is an insert ahead (from a delete), If it is betwen 600 and 700 it is one
- of the cursor functions #define'd in edit.h. 1000 through 700'000'000 is to
- set edit->mark1 position. 700'000'000 through 1400'000'000 is to set edit->mark2
- position.
-
- The only way the curser moves or the buffer is changed is through the routines:
- insert, backspace, insert_ahead, delete, and cursor_move.
- These record the reverse undo movements onto the stack each time they are
- called.
-
- Each key press results in a set of actions (insert; delete ...). So each time
- a key is pressed the current position of start_display is pushed as
- KEY_PRESS + start_display. Then for undoing, we pop until we get to a number
- over KEY_PRESS. We then assign this number less KEY_PRESS to start_display. So undo
- tracks scrolling and key actions exactly. (KEY_PRESS is about (2^31) * (2/3) = 1400'000'000)
-
-*/
-
-static int push_action_disabled = 0;
-
-void edit_push_action (WEdit * edit, long c,...)
-{
- unsigned long sp = edit->stack_pointer;
- unsigned long spm1;
- long *t;
-/* first enlarge the stack if necessary */
- if (sp > edit->stack_size - 10) { /* say */
- if (option_max_undo < 256)
- option_max_undo = 256;
- if (edit->stack_size < option_max_undo) {
- t = malloc ((edit->stack_size * 2 + 10) * sizeof (long));
- if (t) {
- memcpy (t, edit->undo_stack, sizeof (long) * edit->stack_size);
- free (edit->undo_stack);
- edit->undo_stack = t;
- edit->stack_size <<= 1;
- edit->stack_size_mask = edit->stack_size - 1;
- }
- }
- }
- spm1 = (edit->stack_pointer - 1) & edit->stack_size_mask;
- if (push_action_disabled)
- return;
-
-#ifdef FAST_MOVE_CURSOR
- if (c == CURS_LEFT_LOTS || c == CURS_RIGHT_LOTS) {
- va_list ap;
- edit->undo_stack[sp] = c == CURS_LEFT_LOTS ? CURS_LEFT : CURS_RIGHT;
- edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask;
- va_start (ap, c);
- c = -(va_arg (ap, int));
- va_end (ap);
- } else
-#endif /* ! FAST_MOVE_CURSOR */
- if (spm1 != edit->stack_bottom && ((sp - 2) & edit->stack_size_mask) != edit->stack_bottom) {
- int d;
- if (edit->undo_stack[spm1] < 0) {
- d = edit->undo_stack[(sp - 2) & edit->stack_size_mask];
- if (d == c) {
- if (edit->undo_stack[spm1] > -1000000000) {
- if (c < KEY_PRESS) /* --> no need to push multiple do-nothings */
- edit->undo_stack[spm1]--;
- return;
- }
- }
-/* #define NO_STACK_CURSMOVE_ANIHILATION */
-#ifndef NO_STACK_CURSMOVE_ANIHILATION
- else if ((c == CURS_LEFT && d == CURS_RIGHT)
- || (c == CURS_RIGHT && d == CURS_LEFT)) { /* a left then a right anihilate each other */
- if (edit->undo_stack[spm1] == -2)
- edit->stack_pointer = spm1;
- else
- edit->undo_stack[spm1]++;
- return;
- }
-#endif
- } else {
- d = edit->undo_stack[spm1];
- if (d == c) {
- if (c >= KEY_PRESS)
- return; /* --> no need to push multiple do-nothings */
- edit->undo_stack[sp] = -2;
- goto check_bottom;
- }
-#ifndef NO_STACK_CURSMOVE_ANIHILATION
- else if ((c == CURS_LEFT && d == CURS_RIGHT)
- || (c == CURS_RIGHT && d == CURS_LEFT)) { /* a left then a right anihilate each other */
- edit->stack_pointer = spm1;
- return;
- }
-#endif
- }
- }
- edit->undo_stack[sp] = c;
- check_bottom:
-
- edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask;
-
-/*if the sp wraps round and catches the stack_bottom then erase the first set of actions on the stack to make space - by moving stack_bottom forward one "key press" */
- c = (edit->stack_pointer + 2) & edit->stack_size_mask;
- if (c == edit->stack_bottom || ((c + 1) & edit->stack_size_mask) == edit->stack_bottom)
- do {
- edit->stack_bottom = (edit->stack_bottom + 1) & edit->stack_size_mask;
- } while (edit->undo_stack[edit->stack_bottom] < KEY_PRESS && edit->stack_bottom != edit->stack_pointer);
-
-/*If a single key produced enough pushes to wrap all the way round then we would notice that the [stack_bottom] does not contain KEY_PRESS. The stack is then initialised: */
- if (edit->stack_pointer != edit->stack_bottom && edit->undo_stack[edit->stack_bottom] < KEY_PRESS)
- edit->stack_bottom = edit->stack_pointer = 0;
-}
-
-/*
- TODO: if the user undos until the stack bottom, and the stack has not wrapped,
- then the file should be as it was when he loaded up. Then set edit->modified to 0.
- */
-long pop_action (WEdit * edit)
-{
- long c;
- unsigned long sp = edit->stack_pointer;
- if (sp == edit->stack_bottom) {
- return STACK_BOTTOM;
- }
- sp = (sp - 1) & edit->stack_size_mask;
- if ((c = edit->undo_stack[sp]) >= 0) {
-/* edit->undo_stack[sp] = '@'; */
- edit->stack_pointer = (edit->stack_pointer - 1) & edit->stack_size_mask;
- return c;
- }
- if (sp == edit->stack_bottom) {
- return STACK_BOTTOM;
- }
- c = edit->undo_stack[(sp - 1) & edit->stack_size_mask];
- if (edit->undo_stack[sp] == -2) {
-/* edit->undo_stack[sp] = '@'; */
- edit->stack_pointer = sp;
- } else
- edit->undo_stack[sp]++;
-
- return c;
-}
-
-
-/* is called whenever a modification is made by one of the four routines below */
-static inline void edit_modification (WEdit * edit)
-{
- edit->modified = 1;
-}
-
-
-/*
- Basic low level single character buffer alterations and movements at the cursor.
- Returns char passed over, inserted or removed.
- */
-
-void edit_insert (WEdit * edit, int c)
-{
-/* check if file has grown to large */
- if (edit->last_byte >= SIZE_LIMIT)
- return;
-
-/* first we must update the position of the display window */
- if (edit->curs1 < edit->start_display) {
- edit->start_display++;
- if (c == '\n')
- edit->start_line++;
- }
-/* now we must update some info on the file and check if a redraw is required */
- if (c == '\n') {
- edit->curs_line++;
- edit->total_lines++;
- edit->force |= REDRAW_LINE_ABOVE | REDRAW_AFTER_CURSOR;
- }
-/* tell that we've modified the file */
- edit_modification (edit);
-
-/* save the reverse command onto the undo stack */
- edit_push_action (edit, BACKSPACE);
-
-/* update markers */
- edit->mark1 += (edit->mark1 > edit->curs1);
- edit->mark2 += (edit->mark2 > edit->curs1);
- edit->last_get_rule += (edit->last_get_rule > edit->curs1);
-
-/* add a new buffer if we've reached the end of the last one */
- if (!(edit->curs1 & M_EDIT_BUF_SIZE))
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
-
-/* perfprm the insertion */
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit->curs1 & M_EDIT_BUF_SIZE] = (unsigned char) c;
-
-/* update file length */
- edit->last_byte++;
-
-/* update cursor position */
- edit->curs1++;
-}
-
-
-/* same as edit_insert and move left */
-void edit_insert_ahead (WEdit * edit, int c)
-{
- if (edit->last_byte >= SIZE_LIMIT)
- return;
- if (edit->curs1 < edit->start_display) {
- edit->start_display++;
- if (c == '\n')
- edit->start_line++;
- }
- if (c == '\n') {
- edit->total_lines++;
- edit->force |= REDRAW_AFTER_CURSOR;
- }
- edit_modification (edit);
- edit_push_action (edit, DELETE);
-
- edit->mark1 += (edit->mark1 >= edit->curs1);
- edit->mark2 += (edit->mark2 >= edit->curs1);
- edit->last_get_rule += (edit->last_get_rule >= edit->curs1);
-
- if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE))
- edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c;
-
- edit->last_byte++;
- edit->curs2++;
-}
-
-
-int edit_delete (WEdit * edit)
-{
- int p;
- if (!edit->curs2)
- return 0;
-
- edit->mark1 -= (edit->mark1 > edit->curs1);
- edit->mark2 -= (edit->mark2 > edit->curs1);
- edit->last_get_rule -= (edit->last_get_rule > edit->curs1);
-
- p = edit->buffers2[(edit->curs2 - 1) >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - ((edit->curs2 - 1) & M_EDIT_BUF_SIZE) - 1];
-
- if (!(edit->curs2 & M_EDIT_BUF_SIZE)) {
- free (edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE]);
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = NULL;
- }
- edit->last_byte--;
- edit->curs2--;
-
- if (p == '\n') {
- edit->total_lines--;
- edit->force |= REDRAW_AFTER_CURSOR;
- }
- edit_push_action (edit, p + 256);
- if (edit->curs1 < edit->start_display) {
- edit->start_display--;
- if (p == '\n')
- edit->start_line--;
- }
- edit_modification (edit);
-
- return p;
-}
-
-
-int edit_backspace (WEdit * edit)
-{
- int p;
- if (!edit->curs1)
- return 0;
-
- edit->mark1 -= (edit->mark1 >= edit->curs1);
- edit->mark2 -= (edit->mark2 >= edit->curs1);
- edit->last_get_rule -= (edit->last_get_rule >= edit->curs1);
-
- p = *(edit->buffers1[(edit->curs1 - 1) >> S_EDIT_BUF_SIZE] + ((edit->curs1 - 1) & M_EDIT_BUF_SIZE));
- if (!((edit->curs1 - 1) & M_EDIT_BUF_SIZE)) {
- free (edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE]);
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = NULL;
- }
- edit->last_byte--;
- edit->curs1--;
-
- if (p == '\n') {
- edit->curs_line--;
- edit->total_lines--;
- edit->force |= REDRAW_AFTER_CURSOR;
- }
- edit_push_action (edit, p);
-
- if (edit->curs1 < edit->start_display) {
- edit->start_display--;
- if (p == '\n')
- edit->start_line--;
- }
- edit_modification (edit);
-
- return p;
-}
-
-#ifdef FAST_MOVE_CURSOR
-
-#define memqcpy(edit,d,s,i) \
- { \
- unsigned long next; \
- char *dest = d; \
- char *src = s; \
- int n = i; \
- while ((next = \
- (unsigned long) memccpy (dest, src, '\n', n))) { \
- edit->curs_line--; \
- next -= (unsigned long) dest; \
- n -= next; \
- src += next; \
- dest += next; \
- } \
- }
-
-int edit_move_backward_lots (WEdit * edit, long increment)
-{
- int r, s, t;
- char *p;
-
- if (increment > edit->curs1)
- increment = edit->curs1;
- if (increment <= 0)
- return -1;
- edit_push_action (edit, CURS_RIGHT_LOTS, increment);
-
- t = r = EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE);
- if (r > increment)
- r = increment;
- s = edit->curs1 & M_EDIT_BUF_SIZE;
-
- p = 0;
- if (s > r) {
- memqcpy (edit, edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] + t - r,
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] + s - r, r);
- } else {
- if (s) {
- memqcpy (edit, edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] + t - s,
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE], s);
- p = edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE];
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = 0;
- }
- memqcpy (edit, edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] + t - r,
- edit->buffers1[(edit->curs1 >> S_EDIT_BUF_SIZE) - 1] + EDIT_BUF_SIZE - (r - s), r - s);
- }
- increment -= r;
- edit->curs1 -= r;
- edit->curs2 += r;
- if (!(edit->curs2 & M_EDIT_BUF_SIZE)) {
- if (p)
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p;
- else
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
- } else {
- if (p)
- free (p);
- }
-
- s = edit->curs1 & M_EDIT_BUF_SIZE;
- while (increment) {
- p = 0;
- r = EDIT_BUF_SIZE;
- if (r > increment)
- r = increment;
- t = s;
- if (r < t)
- t = r;
- memqcpy (edit,
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] + EDIT_BUF_SIZE - t,
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] + s - t,
- t);
- if (r >= s) {
- if (t) {
- p = edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE];
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = 0;
- }
- memqcpy (edit,
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] + EDIT_BUF_SIZE - r,
- edit->buffers1[(edit->curs1 >> S_EDIT_BUF_SIZE) - 1] + EDIT_BUF_SIZE - (r - s),
- r - s);
- }
- increment -= r;
- edit->curs1 -= r;
- edit->curs2 += r;
- if (!(edit->curs2 & M_EDIT_BUF_SIZE)) {
- if (p)
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p;
- else
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
- } else {
- if (p)
- free (p);
- }
- }
- return edit_get_byte (edit, edit->curs1);
-}
-
-#endif /* ! FAST_MOVE_CURSOR */
-
-/* moves the curser right or left: increment positive or negative respectively */
-int edit_cursor_move (WEdit * edit, long increment)
-{
-/* this is the same as a combination of two of the above routines, with only one push onto the undo stack */
- int c;
-
-#ifdef FAST_MOVE_CURSOR
- if (increment < -256) {
- edit->force |= REDRAW_PAGE;
- return edit_move_backward_lots (edit, -increment);
- }
-#endif /* ! FAST_MOVE_CURSOR */
-
- if (increment < 0) {
- for (; increment < 0; increment++) {
- if (!edit->curs1)
- return -1;
-
- edit_push_action (edit, CURS_RIGHT);
-
- c = edit_get_byte (edit, edit->curs1 - 1);
- if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE))
- edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c;
- edit->curs2++;
- c = edit->buffers1[(edit->curs1 - 1) >> S_EDIT_BUF_SIZE][(edit->curs1 - 1) & M_EDIT_BUF_SIZE];
- if (!((edit->curs1 - 1) & M_EDIT_BUF_SIZE)) {
- free (edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE]);
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = NULL;
- }
- edit->curs1--;
- if (c == '\n') {
- edit->curs_line--;
- edit->force |= REDRAW_LINE_BELOW;
- }
- }
-
- return c;
- } else if (increment > 0) {
- for (; increment > 0; increment--) {
- if (!edit->curs2)
- return -2;
-
- edit_push_action (edit, CURS_LEFT);
-
- c = edit_get_byte (edit, edit->curs1);
- if (!(edit->curs1 & M_EDIT_BUF_SIZE))
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = malloc (EDIT_BUF_SIZE);
- edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit->curs1 & M_EDIT_BUF_SIZE] = c;
- edit->curs1++;
- c = edit->buffers2[(edit->curs2 - 1) >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - ((edit->curs2 - 1) & M_EDIT_BUF_SIZE) - 1];
- if (!(edit->curs2 & M_EDIT_BUF_SIZE)) {
- free (edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE]);
- edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = 0;
- }
- edit->curs2--;
- if (c == '\n') {
- edit->curs_line++;
- edit->force |= REDRAW_LINE_ABOVE;
- }
- }
- return c;
- } else
- return -3;
-}
-
-/* These functions return positions relative to lines */
-
-/* returns index of last char on line + 1 */
-long edit_eol (WEdit * edit, long current)
-{
- if (current < edit->last_byte) {
- for (;; current++)
-#if 0
- if (current == edit->last_byte || edit_get_byte (edit, current) == '\n')
-#else
- if (edit_get_byte (edit, current) == '\n')
-#endif
- break;
- } else
- return edit->last_byte;
- return current;
-}
-
-/* returns index of first char on line */
-long edit_bol (WEdit * edit, long current)
-{
- if (current > 0) {
- for (;; current--)
-#if 0
- if (current == 0 || edit_get_byte (edit, current - 1) == '\n')
-#else
- if (edit_get_byte (edit, current - 1) == '\n')
-#endif
- break;
- } else
- return 0;
- return current;
-}
-
-
-int edit_count_lines (WEdit * edit, long current, int upto)
-{
- int lines = 0;
- if (upto > edit->last_byte)
- upto = edit->last_byte;
- if (current < 0)
- current = 0;
- while (current < upto)
- if (edit_get_byte (edit, current++) == '\n')
- lines++;
- return lines;
-}
-
-
-/* If lines is zero this returns the count of lines from current to upto. */
-/* If upto is zero returns index of lines forward current. */
-long edit_move_forward (WEdit * edit, long current, int lines, long upto)
-{
- if (upto) {
- return edit_count_lines (edit, current, upto);
- } else {
- int next;
- if (lines < 0)
- lines = 0;
- while (lines--) {
- next = edit_eol (edit, current) + 1;
- if (next > edit->last_byte)
- break;
- else
- current = next;
- }
- return current;
- }
-}
-
-
-/* Returns offset of 'lines' lines up from current */
-long edit_move_backward (WEdit * edit, long current, int lines)
-{
- if (lines < 0)
- lines = 0;
- current = edit_bol (edit, current);
- while((lines--) && current != 0)
- current = edit_bol (edit, current - 1);
- return current;
-}
-
-#ifdef MIDNIGHT
-/* If cols is zero this returns the count of columns from current to upto. */
-/* If upto is zero returns index of cols across from current. */
-long edit_move_forward3 (WEdit * edit, long current, int cols, long upto)
-{
- long p, q;
- int col = 0;
-
- if (upto) {
- q = upto;
- cols = -10;
- } else
- q = edit->last_byte + 2;
-
- for (col = 0, p = current; p < q; p++) {
- int c;
- if (cols != -10) {
- if (col == cols)
- return p;
- if (col > cols)
- return p - 1;
- }
- c = edit_get_byte (edit, p);
- if (c == '\r')
- continue;
- else
- if (c == '\t')
- col += TAB_SIZE - col % TAB_SIZE;
- else
- col++;
- /*if(edit->nroff ... */
- if (c == '\n') {
- if (upto)
- return col;
- else
- return p;
- }
- }
- return (float) col;
-}
-#endif
-
-/* returns the current column position of the cursor */
-int edit_get_col (WEdit * edit)
-{
- return edit_move_forward3 (edit, edit_bol (edit, edit->curs1), 0, edit->curs1);
-}
-
-
-/* Scrolling functions */
-
-void edit_update_curs_row (WEdit * edit)
-{
- edit->curs_row = edit->curs_line - edit->start_line;
-}
-
-void edit_update_curs_col (WEdit * edit)
-{
- edit->curs_col = edit_move_forward3(edit, edit_bol(edit, edit->curs1), 0, edit->curs1);
-}
-
-/*moves the display start position up by i lines */
-void edit_scroll_upward (WEdit * edit, unsigned long i)
-{
- int lines_above = edit->start_line;
- if (i > lines_above)
- i = lines_above;
- if (i) {
- edit->start_line -= i;
- edit->start_display = edit_move_backward (edit, edit->start_display, i);
- edit->force |= REDRAW_PAGE;
- edit->force &= (0xfff - REDRAW_CHAR_ONLY);
- }
- edit_update_curs_row(edit);
-}
-
-
-/* returns 1 if could scroll, 0 otherwise */
-void edit_scroll_downward (WEdit * edit, int i)
-{
- int lines_below;
- lines_below = edit->total_lines - edit->start_line - (edit->num_widget_lines - 1);
- if (lines_below > 0) {
- if (i > lines_below)
- i = lines_below;
- edit->start_line += i;
- edit->start_display = edit_move_forward (edit, edit->start_display, i, 0);
- edit->force |= REDRAW_PAGE;
- edit->force &= (0xfff - REDRAW_CHAR_ONLY);
- }
- edit_update_curs_row(edit);
-}
-
-void edit_scroll_right (WEdit * edit, int i)
-{
- edit->force |= REDRAW_PAGE;
- edit->force &= (0xfff - REDRAW_CHAR_ONLY);
- edit->start_col -= i;
-}
-
-void edit_scroll_left (WEdit * edit, int i)
-{
- if (edit->start_col) {
- edit->start_col += i;
- if (edit->start_col > 0)
- edit->start_col = 0;
- edit->force |= REDRAW_PAGE;
- edit->force &= (0xfff - REDRAW_CHAR_ONLY);
- }
-}
-
-/* high level cursor movement commands */
-
-static int is_in_indent (WEdit *edit)
-{
- long p = edit_bol (edit, edit->curs1);
- while (p < edit->curs1)
- if (!strchr (" \t", edit_get_byte (edit, p++)))
- return 0;
- return 1;
-}
-
-static int left_of_four_spaces (WEdit *edit);
-
-static void edit_move_to_prev_col (WEdit * edit, long p)
-{
- edit_cursor_move (edit, edit_move_forward3 (edit, p, edit->prev_col, 0) - edit->curs1);
-
- if (is_in_indent (edit) && option_fake_half_tabs) {
- edit_update_curs_col (edit);
- if (edit->curs_col % (HALF_TAB_SIZE * space_width)) {
- int q = edit->curs_col;
- edit->curs_col -= (edit->curs_col % (HALF_TAB_SIZE * space_width));
- p = edit_bol (edit, edit->curs1);
- edit_cursor_move (edit, edit_move_forward3 (edit, p, edit->curs_col, 0) - edit->curs1);
- if (!left_of_four_spaces (edit))
- edit_cursor_move (edit, edit_move_forward3 (edit, p, q, 0) - edit->curs1);
- }
- }
-}
-
-
-/* move i lines */
-static void edit_move_up (WEdit * edit, unsigned long i, int scroll)
-{
- long p, l = edit->curs_line;
-
- if (i > l)
- i = l;
- if (i) {
- if (i > 1)
- edit->force |= REDRAW_PAGE;
- if (scroll)
- edit_scroll_upward (edit, i);
-
- p = edit_bol (edit, edit->curs1);
- edit_cursor_move (edit, (p = edit_move_backward (edit, p, i)) - edit->curs1);
- edit_move_to_prev_col (edit, p);
-
- edit->search_start = edit->curs1;
- edit->found_len = 0;
- }
-}
-
-int is_blank (WEdit * edit, long offset)
-{
- long s, f;
- int c;
- s = edit_bol (edit, offset);
- f = edit_eol (edit, offset) - 1;
- while (s <= f) {
- c = edit_get_byte (edit, s++);
- if ((c > ' ' && c <= '~') || c >= 160) /* non-printables on a line are considered "blank" */
- return 0;
- }
- return 1;
-}
-
-int line_is_blank (WEdit * edit, long line)
-{
- static long p = -1, l = 0;
- if (p == -1 || abs (l - line) > abs (edit->curs_line - line)) {
- l = edit->curs_line;
- p = edit->curs1;
- }
- if (line < l)
- p = edit_move_backward (edit, p, l - line);
- else if (line > l)
- p = edit_move_forward (edit, p, line - l, 0);
- l = line;
- return is_blank (edit, p);
-}
-
-/* moves up until a blank line is reached, or until just
- before a non-blank line is reached */
-static void edit_move_up_paragraph (WEdit * edit, int scroll)
-{
- int i;
- if (edit->curs_line <= 1) {
- i = 0;
- } else {
- if (line_is_blank (edit, edit->curs_line)) {
- if (line_is_blank (edit, edit->curs_line - 1)) {
- for (i = edit->curs_line - 1; i; i--)
- if (!line_is_blank (edit, i)) {
- i++;
- break;
- }
- } else {
- for (i = edit->curs_line - 1; i; i--)
- if (line_is_blank (edit, i))
- break;
- }
- } else {
- for (i = edit->curs_line - 1; i; i--)
- if (line_is_blank (edit, i))
- break;
- }
- }
- edit_move_up (edit, edit->curs_line - i, scroll);
-}
-
-/* move i lines */
-static void edit_move_down (WEdit * edit, int i, int scroll)
-{
- long p, l = edit->total_lines - edit->curs_line;
-
- if (i > l)
- i = l;
- if (i) {
- if (i > 1)
- edit->force |= REDRAW_PAGE;
- if (scroll)
- edit_scroll_downward (edit, i);
- p = edit_bol (edit, edit->curs1);
- edit_cursor_move (edit, (p = edit_move_forward (edit, p, i, 0)) - edit->curs1);
- edit_move_to_prev_col (edit, p);
-
- edit->search_start = edit->curs1;
- edit->found_len = 0;
- }
-}
-
-/* moves down until a blank line is reached, or until just
- before a non-blank line is reached */
-static void edit_move_down_paragraph (WEdit * edit, int scroll)
-{
- int i;
- if (edit->curs_line >= edit->total_lines - 1) {
- i = edit->total_lines;
- } else {
- if (line_is_blank (edit, edit->curs_line)) {
- if (line_is_blank (edit, edit->curs_line + 1)) {
- for (i = edit->curs_line + 1; i; i++)
- if (!line_is_blank (edit, i) || i > edit->total_lines) {
- i--;
- break;
- }
- } else {
- for (i = edit->curs_line + 1; i; i++)
- if (line_is_blank (edit, i) || i >= edit->total_lines)
- break;
- }
- } else {
- for (i = edit->curs_line + 1; i; i++)
- if (line_is_blank (edit, i) || i >= edit->total_lines)
- break;
- }
- }
- edit_move_down (edit, i - edit->curs_line, scroll);
-}
-
-static void edit_begin_page (WEdit *edit)
-{
- edit_update_curs_row (edit);
- edit_move_up (edit, edit->curs_row, 0);
-}
-
-static void edit_end_page (WEdit *edit)
-{
- edit_update_curs_row (edit);
- edit_move_down (edit, edit->num_widget_lines - edit->curs_row - 1, 0);
-}
-
-
-/* goto beginning of text */
-static void edit_move_to_top (WEdit * edit)
-{
- if (edit->curs_line) {
- edit_cursor_move (edit, -edit->curs1);
- edit_move_to_prev_col (edit, 0);
- edit->force |= REDRAW_PAGE;
- edit->search_start = 0;
- edit_update_curs_row(edit);
- }
-}
-
-
-/* goto end of text */
-static void edit_move_to_bottom (WEdit * edit)
-{
- if (edit->curs_line < edit->total_lines) {
- edit_cursor_move (edit, edit->curs2);
- edit->start_display = edit->last_byte;
- edit->start_line = edit->total_lines;
- edit_update_curs_row(edit);
- edit_scroll_upward (edit, edit->num_widget_lines - 1);
- edit->force |= REDRAW_PAGE;
- }
-}
-
-/* goto beginning of line */
-static void edit_cursor_to_bol (WEdit * edit)
-{
- edit_cursor_move (edit, edit_bol (edit, edit->curs1) - edit->curs1);
- edit->search_start = edit->curs1;
- edit->prev_col = edit_get_col (edit);
-}
-
-/* goto end of line */
-static void edit_cursor_to_eol (WEdit * edit)
-{
- edit_cursor_move (edit, edit_eol (edit, edit->curs1) - edit->curs1);
- edit->search_start = edit->curs1;
- edit->prev_col = edit_get_col (edit);
-}
-
-/* move cursor to line 'line' */
-void edit_move_to_line (WEdit * e, long line)
-{
- if(line < e->curs_line)
- edit_move_up (e, e->curs_line - line, 0);
- else
- edit_move_down (e, line - e->curs_line, 0);
- edit_scroll_screen_over_cursor (e);
-}
-
-/* scroll window so that first visible line is 'line' */
-void edit_move_display (WEdit * e, long line)
-{
- if(line < e->start_line)
- edit_scroll_upward (e, e->start_line - line);
- else
- edit_scroll_downward (e, line - e->start_line);
-}
-
-/* save markers onto undo stack */
-void edit_push_markers (WEdit * edit)
-{
- edit_push_action (edit, MARK_1 + edit->mark1);
- edit_push_action (edit, MARK_2 + edit->mark2);
-}
-
-void free_selections (void)
-{
- int i;
- for (i = 0; i < NUM_SELECTION_HISTORY; i++)
- if (selection_history[i].text) {
- free (selection_history[i].text);
- selection_history[i].text = 0;
- selection_history[i].len = 0;
- }
- current_selection = 0;
-}
-
-/* return -1 on nothing to store or error, zero otherwise */
-void edit_get_selection (WEdit * edit)
-{
- long start_mark, end_mark;
- if (eval_marks (edit, &start_mark, &end_mark))
- return;
- if (selection_history[current_selection].len < 4096) /* large selections should not be held -- to save memory */
- current_selection = (current_selection + 1) % NUM_SELECTION_HISTORY;
- selection_history[current_selection].len = end_mark - start_mark;
- if (selection_history[current_selection].text)
- free (selection_history[current_selection].text);
- selection_history[current_selection].text = malloc (selection_history[current_selection].len + 1);
- if (!selection_history[current_selection].text) {
- selection_history[current_selection].text = malloc (1);
- *selection_history[current_selection].text = 0;
- selection_history[current_selection].len = 0;
- } else {
- unsigned char *p = selection_history[current_selection].text;
- for (; start_mark < end_mark; start_mark++)
- *p++ = edit_get_byte (edit, start_mark);
- *p = 0;
- }
- selection.text = selection_history[current_selection].text;
- selection.len = selection_history[current_selection].len;
-}
-
-void edit_set_markers (WEdit * edit, long m1, long m2, int c1, int c2)
-{
- edit->mark1 = m1;
- edit->mark2 = m2;
- edit->column1 = c1;
- edit->column2 = c2;
-}
-
-
-/* highlight marker toggle */
-void edit_mark_cmd (WEdit * edit, int unmark)
-{
- edit_push_markers (edit);
- if (unmark) {
- edit_set_markers (edit, 0, 0, 0, 0);
- edit->force |= REDRAW_PAGE;
- } else {
- if (edit->mark2 >= 0) {
- edit_set_markers (edit, edit->curs1, -1, edit->curs_col, edit->curs_col);
- edit->force |= REDRAW_PAGE;
- } else
- edit_set_markers (edit, edit->mark1, edit->curs1, edit->column1, edit->curs_col);
- }
-}
-
-int my_type_of (int c)
-{
- if (c < ' ' && c > 0)
- return 1;
- if (strchr ("+_-.", c))
- if (strchr (option_whole_chars_move, c))
- return 3;
- if (!strcasechr (option_whole_chars_move, c))
- return 2;
- if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c >= 160)
- return 3;
- return c;
-}
-
-void edit_left_word_move (WEdit * edit)
-{
- do {
- edit_cursor_move (edit, -1);
- if (!edit->curs1)
- break;
- } while (my_type_of (edit_get_byte (edit, edit->curs1))
- ==
- my_type_of (edit_get_byte (edit, edit->curs1 - 1)));
-}
-
-static void edit_left_word_move_cmd (WEdit * edit)
-{
- edit_left_word_move (edit);
- if (strchr (option_whole_chars_move, ' '))
- if (strchr ("\t ", edit_get_byte (edit, edit->curs1)))
- edit_left_word_move (edit);
- edit->force |= REDRAW_PAGE;
-}
-
-void edit_right_word_move (WEdit * edit)
-{
- do {
- edit_cursor_move (edit, 1);
- if (edit->curs1 >= edit->last_byte)
- break;
- } while (my_type_of (edit_get_byte (edit, edit->curs1 - 1))
- ==
- my_type_of (edit_get_byte (edit, edit->curs1)));
-}
-
-static void edit_right_word_move_cmd (WEdit * edit)
-{
- edit_right_word_move (edit);
- if (strchr (option_whole_chars_move, ' '))
- if (strchr ("\t ", edit_get_byte (edit, edit->curs1)))
- edit_right_word_move (edit);
- edit->force |= REDRAW_PAGE;
-}
-
-
-static void edit_right_delete_word (WEdit * edit)
-{
- int c;
- do {
- c = edit_delete (edit);
- } while (my_type_of (c) == my_type_of (edit_get_byte (edit, edit->curs1)));
-}
-
-static void edit_left_delete_word (WEdit * edit)
-{
- int c;
- do {
- c = edit_backspace (edit);
- } while (my_type_of (c) == my_type_of (edit_get_byte (edit, edit->curs1 - 1)));
-}
-
-
-/*
- the start column position is not recorded, and hence does not
- undo as it happed. But who would notice.
- */
-void edit_do_undo (WEdit * edit)
-{
- long ac;
- long count = 0;
-
- push_action_disabled = 1; /* don't record undo's onto undo stack! */
-
- while ((ac = pop_action (edit)) < KEY_PRESS) {
- switch ((int) ac) {
- case STACK_BOTTOM:
- goto done_undo;
- case CURS_RIGHT:
- edit_cursor_move (edit, 1);
- break;
- case CURS_LEFT:
- edit_cursor_move (edit, -1);
- break;
- case BACKSPACE:
- edit_backspace (edit);
- break;
- case DELETE:
- edit_delete (edit);
- break;
- }
- if (ac >= 256 && ac < 512)
- edit_insert_ahead (edit, ac - 256);
- if (ac >= 0 && ac < 256)
- edit_insert (edit, ac);
-
- if (ac >= MARK_1 - 2 && ac < MARK_2 - 2) {
- edit->mark1 = ac - MARK_1;
- } else if (ac >= MARK_2 - 2 && ac < KEY_PRESS) {
- edit->mark2 = ac - MARK_2;
- }
- if (count++)
- edit->force |= REDRAW_PAGE; /* more than one pop usually means something big */
- }
-
- if (edit->start_display > ac - KEY_PRESS) {
- edit->start_line -= edit_count_lines (edit, ac - KEY_PRESS, edit->start_display);
- edit->force |= REDRAW_PAGE;
- } else if (edit->start_display < ac - KEY_PRESS) {
- edit->start_line += edit_count_lines (edit, edit->start_display, ac - KEY_PRESS);
- edit->force |= REDRAW_PAGE;
- }
- edit->start_display = ac - KEY_PRESS; /* see push and pop above */
- edit_update_curs_row(edit);
-
- done_undo:;
- push_action_disabled = 0;
-}
-
-static void edit_delete_to_line_end (WEdit * edit)
-{
- for (;;) {
- if (edit_get_byte (edit, edit->curs1) == '\n')
- break;
- if (!edit->curs2)
- break;
- edit_delete (edit);
- }
-}
-
-static void edit_delete_to_line_begin (WEdit * edit)
-{
- for (;;) {
- if (edit_get_byte (edit, edit->curs1 - 1) == '\n')
- break;
- if (!edit->curs1)
- break;
- edit_backspace (edit);
- }
-}
-
-static void edit_delete_line (WEdit * edit)
-{
- int c;
- do {
- c = edit_delete (edit);
- } while (c != '\n' && c);
- do {
- c = edit_backspace (edit);
- } while (c != '\n' && c);
- if (c)
- edit_insert (edit, '\n');
-}
-
-static void insert_spaces_tab (WEdit * edit)
-{
- int i = option_tab_spacing;
- while (i--)
- edit_insert (edit, ' ');
-}
-
-static int is_aligned_on_a_tab (WEdit * edit)
-{
- edit_update_curs_col (edit);
- if ((edit->curs_col % (TAB_SIZE * space_width)) && edit->curs_col % (TAB_SIZE * space_width) != (HALF_TAB_SIZE * space_width))
- return 0; /* not alligned on a tab */
- return 1;
-}
-
-static int right_of_four_spaces (WEdit *edit)
-{
- int i, ch = 0;
- for (i = 1; i <= HALF_TAB_SIZE; i++)
- ch |= edit_get_byte (edit, edit->curs1 - i);
- if (ch == ' ')
- return is_aligned_on_a_tab (edit);
- return 0;
-}
-
-static int left_of_four_spaces (WEdit *edit)
-{
- int i, ch = 0;
- for (i = 0; i < HALF_TAB_SIZE; i++)
- ch |= edit_get_byte (edit, edit->curs1 + i);
- if (ch == ' ')
- return is_aligned_on_a_tab (edit);
- return 0;
-}
-
-int edit_indent_width (WEdit * edit, long p)
-{
- long q = p;
- while (strchr ("\t ", edit_get_byte (edit, q)) && q < edit->last_byte - 1) /* move to the end of the leading whitespace of the line */
- q++;
- return edit_move_forward3 (edit, p, 0, q); /* count the number of columns of indentation */
-}
-
-void edit_insert_indent (WEdit * edit, int indent)
-{
-#ifndef MIDNIGHT
- indent /= space_width;
-#endif
- if (!option_fill_tabs_with_spaces) {
- while (indent >= TAB_SIZE) {
- edit_insert (edit, '\t');
- indent -= TAB_SIZE;
- }
- }
- while (indent--)
- edit_insert (edit, ' ');
-}
-
-static void edit_auto_indent (WEdit * edit, int always)
-{
- long p;
- int indent;
- p = edit->curs1;
- while (strchr ("\t\n\r ", edit_get_byte (edit, p - 1)) && p > 0) /* move back/up to a line with text */
- p--;
- indent = edit_indent_width (edit, edit_bol (edit, p));
- if (edit->curs_col < indent)
- indent = edit->curs_col;
- edit_insert_indent (edit, indent);
-}
-
-static void edit_double_newline (WEdit * edit)
-{
- edit_insert (edit, '\n');
- if (edit_get_byte (edit, edit->curs1) == '\n')
- return;
- if (edit_get_byte (edit, edit->curs1 - 2) == '\n')
- return;
- edit->force |= REDRAW_PAGE;
- edit_insert (edit, '\n');
-}
-
-static void edit_tab_cmd (WEdit * edit)
-{
- int i;
-
- if (option_fake_half_tabs) {
- if (is_in_indent (edit)) {
- /*insert a half tab (usually four spaces) unless there is a
- half tab already behind, then delete it and insert a
- full tab. */
- if (right_of_four_spaces (edit)) {
- for (i = 1; i <= HALF_TAB_SIZE; i++)
- edit_backspace (edit);
- if (option_fill_tabs_with_spaces) {
- insert_spaces_tab (edit);
- } else {
- edit_insert (edit, '\t');
- }
- } else {
- for (i = 1; i <= HALF_TAB_SIZE; i++)
- edit_insert (edit, ' ');
- }
- return;
- }
- }
- if (option_fill_tabs_with_spaces) {
- insert_spaces_tab (edit);
- } else {
- edit_insert (edit, '\t');
- }
- return;
-}
-
-void format_paragraph (WEdit * edit, int force);
-
-static void check_and_wrap_line (WEdit * edit)
-{
- int curs, c;
- if (!option_typewriter_wrap)
- return;
- edit_update_curs_col (edit);
-#ifdef MIDNIGHT
- if (edit->curs_col < option_word_wrap_line_length)
-#else
- if (edit->curs_col < option_word_wrap_line_length * FONT_MEAN_WIDTH)
-#endif
- return;
- curs = edit->curs1;
- for (;;) {
- curs--;
- c = edit_get_byte (edit, curs);
- if (c == '\n' || curs <= 0) {
- edit_insert (edit, '\n');
- return;
- }
- if (c == ' ' || c == '\t') {
- int current = edit->curs1;
- edit_cursor_move (edit, curs - edit->curs1 + 1);
- edit_insert (edit, '\n');
- edit_cursor_move (edit, current - edit->curs1 + 1);
- return;
- }
- }
-}
-
-void edit_execute_macro (WEdit * edit, struct macro macro[], int n);
-
-/* either command or char_for_insertion must be passed as -1 */
-int edit_execute_cmd (WEdit * edit, int command, int char_for_insertion);
-
-#ifdef MIDNIGHT
-int edit_translate_key (WEdit * edit, unsigned int x_keycode, long x_key, int x_state, int *cmd, int *ch)
-{
- int command = -1;
- int char_for_insertion = -1;
-
-#include "edit_key_translator.c"
-
- *cmd = command;
- *ch = char_for_insertion;
-
- if((command == -1 || command == 0) && char_for_insertion == -1) /* unchanged, key has no function here */
- return 0;
- return 1;
-}
-#endif
-
-void edit_push_key_press (WEdit * edit)
-{
- edit_push_action (edit, KEY_PRESS + edit->start_display);
- if (edit->mark2 == -1)
- edit_push_action (edit, MARK_1 + edit->mark1);
-}
-
-/* this find the matching bracket in either direction, and sets edit->bracket */
-void edit_find_bracket (WEdit * edit)
-{
- if (option_find_bracket) {
- const char *b = "{}{[][()(", *p;
- static int last_bracket = -1;
- int i = 1, a, inc = -1, c, d, n = 0, j = 0;
- long q;
-
- edit->bracket = -1;
- c = edit_get_byte (edit, edit->curs1);
- p = strchr (b, c);
- edit_update_curs_row (edit);
- if (p) {
- d = p[1];
- if (strchr ("{[(", c))
- inc = 1;
- for (q = edit->curs1 + inc;; q += inc) {
- if (q >= edit->last_byte || q < edit->start_display || j++ > 10000)
- break;
- a = edit_get_byte (edit, q);
- if (inc > 0 && a == '\n')
- n++;
- if (n >= edit->num_widget_lines - edit->curs_row) /* out of screen */
- break;
- i += (a == c) - (a == d);
- if (!i) {
- edit->bracket = q;
- break;
- }
- }
- }
- if (last_bracket != edit->bracket)
- edit->force |= REDRAW_PAGE;
- last_bracket = edit->bracket;
- }
-}
-
-
-/* this executes a command as though the user initiated it through a key press. */
-/* callback with WIDGET_KEY as a message calls this after translating the key
- press */
-/* this can be used to pass any command to the editor. Same as sendevent with
- msg = WIDGET_COMMAND and par = command except the screen wouldn't update */
-/* one of command or char_for_insertion must be passed as -1 */
-/* commands are executed, and char_for_insertion is inserted at the cursor */
-/* returns 0 if the command is a macro that was not found, 1 otherwise */
-int edit_execute_key_command (WEdit * edit, int command, int char_for_insertion)
-{
- int r;
- if (command == CK_Begin_Record_Macro) {
- edit->macro_i = 0;
- edit->force |= REDRAW_CHAR_ONLY | REDRAW_LINE;
- return command;
- }
- if (command == CK_End_Record_Macro && edit->macro_i != -1) {
- edit->force |= REDRAW_COMPLETELY;
- edit_save_macro_cmd (edit, edit->macro, edit->macro_i);
- edit->macro_i = -1;
- return command;
- }
- if (edit->macro_i >= 0 && edit->macro_i < MAX_MACRO_LENGTH - 1) {
- edit->macro[edit->macro_i].command = command;
- edit->macro[edit->macro_i++].ch = char_for_insertion;
- }
-/* record the beginning of a set of editing actions initiated by a key press */
- if (command != CK_Undo)
- edit_push_key_press (edit);
-
- r = edit_execute_cmd (edit, command, char_for_insertion);
-
- return r;
-}
-
-#ifdef MIDNIGHT
-static const char *shell_cmd[] = SHELL_COMMANDS_i
-#else
-static void (*user_commamd) (WEdit *, int) = 0;
-void edit_set_user_command (void (*func) (WEdit *, int))
-{
- user_commamd = func;
-}
-
-#endif
-
-void edit_mail_dialog (WEdit * edit);
-
-/*
- This executes a command at a lower level than macro recording.
- It also does not push a key_press onto the undo stack. This means
- that if it is called many times, a single undo command will undo
- all of them. It also does not check for the Undo command.
- Returns 0 if the command is a macro that was not found, 1
- otherwise.
- */
-int edit_execute_cmd (WEdit * edit, int command, int char_for_insertion)
-{
- int result = 1;
- edit->force |= REDRAW_LINE;
- if (edit->found_len)
-/* the next key press will unhighlight the found string, so update whole page */
- edit->force |= REDRAW_PAGE;
-
- if (command / 100 == 6) { /* a highlight command like shift-arrow */
- if (!edit->highlight || (edit->mark2 != -1 && edit->mark1 != edit->mark2)) {
- edit_mark_cmd (edit, 1); /* clear */
- edit_mark_cmd (edit, 0); /* marking on */
- }
- edit->highlight = 1;
- } else { /* any other command */
- if (edit->highlight)
- edit_mark_cmd (edit, 0); /* clear */
- edit->highlight = 0;
- }
-
-/* first check for undo */
- if (command == CK_Undo) {
- edit_do_undo (edit);
- edit->found_len = 0;
- edit->prev_col = edit_get_col (edit);
- edit->search_start = edit->curs1;
- return 1;
- }
-/* An ordinary key press */
- if (char_for_insertion >= 0) {
- if (edit->overwrite) {
- if (edit_get_byte (edit, edit->curs1) != '\n')
- edit_delete (edit);
- }
- edit_insert (edit, char_for_insertion);
- if (option_auto_para_formatting) {
- format_paragraph (edit, 0);
- edit->force |= REDRAW_PAGE;
- } else
- check_and_wrap_line (edit);
- edit->found_len = 0;
- edit->prev_col = edit_get_col (edit);
- edit->search_start = edit->curs1;
- edit_find_bracket (edit);
- return 1;
- }
- switch (command) {
- case CK_Begin_Page:
- case CK_End_Page:
- case CK_Begin_Page_Highlight:
- case CK_End_Page_Highlight:
- case CK_Word_Left:
- case CK_Word_Right:
- case CK_Up:
- case CK_Down:
- case CK_Word_Left_Highlight:
- case CK_Word_Right_Highlight:
- case CK_Up_Highlight:
- case CK_Down_Highlight:
- if (edit->mark2 == -1)
- break; /*marking is following the cursor: may need to highlight a whole line */
- case CK_Left:
- case CK_Right:
- case CK_Left_Highlight:
- case CK_Right_Highlight:
- edit->force |= REDRAW_CHAR_ONLY;
- }
-
-/* basic cursor key commands */
- switch (command) {
- case CK_BackSpace:
- if (option_backspace_through_tabs && is_in_indent (edit)) {
- while (edit_get_byte (edit, edit->curs1 - 1) != '\n'
- && edit->curs1 > 0)
- edit_backspace (edit);
- break;
- } else {
- if (option_fake_half_tabs) {
- int i;
- if (is_in_indent (edit) && right_of_four_spaces (edit)) {
- for (i = 0; i < HALF_TAB_SIZE; i++)
- edit_backspace (edit);
- break;
- }
- }
- }
- edit_backspace (edit);
- break;
- case CK_Delete:
- if (option_fake_half_tabs) {
- int i;
- if (is_in_indent (edit) && left_of_four_spaces (edit)) {
- for (i = 1; i <= HALF_TAB_SIZE; i++)
- edit_delete (edit);
- break;
- }
- }
- edit_delete (edit);
- break;
- case CK_Delete_Word_Left:
- edit_left_delete_word (edit);
- break;
- case CK_Delete_Word_Right:
- edit_right_delete_word (edit);
- break;
- case CK_Delete_Line:
- edit_delete_line (edit);
- break;
- case CK_Delete_To_Line_End:
- edit_delete_to_line_end (edit);
- break;
- case CK_Delete_To_Line_Begin:
- edit_delete_to_line_begin (edit);
- break;
- case CK_Enter:
- if (option_auto_para_formatting) {
- edit_double_newline (edit);
- if (option_return_does_auto_indent)
- edit_auto_indent (edit, 0);
- format_paragraph (edit, 0);
- } else if (option_return_does_auto_indent) {
- edit_insert (edit, '\n');
- edit_auto_indent (edit, 0);
- } else {
- edit_insert (edit, '\n');
- }
- break;
- case CK_Return:
- edit_insert (edit, '\n');
- break;
-
- case CK_Page_Up:
- case CK_Page_Up_Highlight:
- edit_move_up (edit, edit->num_widget_lines - 1, 1);
- break;
- case CK_Page_Down:
- case CK_Page_Down_Highlight:
- edit_move_down (edit, edit->num_widget_lines - 1, 1);
- break;
- case CK_Left:
- case CK_Left_Highlight:
- if (option_fake_half_tabs) {
- if (is_in_indent (edit) && right_of_four_spaces (edit)) {
- edit_cursor_move (edit, -HALF_TAB_SIZE);
- edit->force &= (0xFFF - REDRAW_CHAR_ONLY);
- break;
- }
- }
- edit_cursor_move (edit, -1);
- break;
- case CK_Right:
- case CK_Right_Highlight:
- if (option_fake_half_tabs) {
- if (is_in_indent (edit) && left_of_four_spaces (edit)) {
- edit_cursor_move (edit, HALF_TAB_SIZE);
- edit->force &= (0xFFF - REDRAW_CHAR_ONLY);
- break;
- }
- }
- edit_cursor_move (edit, 1);
- break;
- case CK_Begin_Page:
- case CK_Begin_Page_Highlight:
- edit_begin_page (edit);
- break;
- case CK_End_Page:
- case CK_End_Page_Highlight:
- edit_end_page (edit);
- break;
- case CK_Word_Left:
- case CK_Word_Left_Highlight:
- edit_left_word_move_cmd (edit);
- break;
- case CK_Word_Right:
- case CK_Word_Right_Highlight:
- edit_right_word_move_cmd (edit);
- break;
- case CK_Up:
- case CK_Up_Highlight:
- edit_move_up (edit, 1, 0);
- break;
- case CK_Down:
- case CK_Down_Highlight:
- edit_move_down (edit, 1, 0);
- break;
- case CK_Paragraph_Up:
- case CK_Paragraph_Up_Highlight:
- edit_move_up_paragraph (edit, 0);
- break;
- case CK_Paragraph_Down:
- case CK_Paragraph_Down_Highlight:
- edit_move_down_paragraph (edit, 0);
- break;
- case CK_Scroll_Up:
- case CK_Scroll_Up_Highlight:
- edit_move_up (edit, 1, 1);
- break;
- case CK_Scroll_Down:
- case CK_Scroll_Down_Highlight:
- edit_move_down (edit, 1, 1);
- break;
- case CK_Home:
- case CK_Home_Highlight:
- edit_cursor_to_bol (edit);
- break;
- case CK_End:
- case CK_End_Highlight:
- edit_cursor_to_eol (edit);
- break;
-
- case CK_Tab:
- edit_tab_cmd (edit);
- if (option_auto_para_formatting) {
- format_paragraph (edit, 0);
- edit->force |= REDRAW_PAGE;
- } else
- check_and_wrap_line (edit);
- break;
-
- case CK_Toggle_Insert:
- edit->overwrite = (edit->overwrite == 0);
-#ifndef MIDNIGHT
- CSetCursorColor (edit->overwrite ? color_palette (24) : color_palette (19));
-#endif
- break;
-
- case CK_Mark:
- edit_mark_cmd (edit, 0);
- break;
- case CK_Unmark:
- edit_mark_cmd (edit, 1);
- break;
-
- case CK_Beginning_Of_Text:
- case CK_Beginning_Of_Text_Highlight:
- edit_move_to_top (edit);
- break;
- case CK_End_Of_Text:
- case CK_End_Of_Text_Highlight:
- edit_move_to_bottom (edit);
- break;
-
- case CK_Copy:
- edit_block_copy_cmd (edit);
- break;
- case CK_Remove:
- edit_block_delete_cmd (edit);
- break;
- case CK_Move:
- edit_block_move_cmd (edit);
- break;
-
- case CK_XStore:
- edit_copy_to_X_buf_cmd (edit);
- break;
- case CK_XCut:
- edit_cut_to_X_buf_cmd (edit);
- break;
- case CK_XPaste:
- edit_paste_from_X_buf_cmd (edit);
- break;
- case CK_Selection_History:
- edit_paste_from_history (edit);
- break;
-
- case CK_Save_As:
-#ifndef MIDNIGHT
- if (edit->widget->options & EDITOR_NO_FILE)
- break;
-#endif
- edit_save_as_cmd (edit);
- break;
- case CK_Save:
-#ifndef MIDNIGHT
- if (edit->widget->options & EDITOR_NO_FILE)
- break;
-#endif
- edit_save_confirm_cmd (edit);
- break;
- case CK_Load:
-#ifndef MIDNIGHT
- if (edit->widget->options & EDITOR_NO_FILE)
- break;
-#endif
- edit_load_cmd (edit);
- break;
- case CK_Save_Block:
- edit_save_block_cmd (edit);
- break;
- case CK_Insert_File:
- edit_insert_file_cmd (edit);
- break;
-
- case CK_Find:
- edit_search_cmd (edit, 0);
- break;
- case CK_Find_Again:
- edit_search_cmd (edit, 1);
- break;
- case CK_Replace:
- edit_replace_cmd (edit, 0);
- break;
- case CK_Replace_Again:
- edit_replace_cmd (edit, 1);
- break;
-
- case CK_Exit:
- edit_quit_cmd (edit);
- break;
- case CK_New:
- edit_new_cmd (edit);
- break;
-
- case CK_Help:
- edit_help_cmd (edit);
- break;
-
- case CK_Refresh:
- edit_refresh_cmd (edit);
- break;
-
- case CK_Date:{
- time_t t;
- time (&t);
- edit_printf (edit, ctime (&t));
- edit->force |= REDRAW_PAGE;
- break;
- }
- case CK_Goto:
- edit_goto_cmd (edit);
- break;
- case CK_Paragraph_Format:
- format_paragraph (edit, 1);
- edit->force |= REDRAW_PAGE;
- break;
- case CK_Delete_Macro:
- edit_delete_macro_cmd (edit);
- break;
-#ifdef MIDNIGHT
- case CK_Sort:
- edit_sort_cmd (edit);
- break;
- case CK_Mail:
- edit_mail_dialog (edit);
- break;
-#endif
-
-/* These commands are not handled and must be handled by the user application */
-#ifndef MIDNIGHT
- case CK_Sort:
- case CK_Mail:
-#endif
- case CK_Complete:
- case CK_Cancel:
- case CK_Save_Desktop:
- case CK_New_Window:
- case CK_Cycle:
- case CK_Menu:
- case CK_Save_And_Quit:
- case CK_Check_Save_And_Quit:
- case CK_Run_Another:
- result = 0;
- break;
- }
-
-#ifdef MIDNIGHT
-/* CK_Pipe_Block */
- if ((command / 1000) == 1) /* a shell command */
- edit_block_process_cmd (edit, shell_cmd[command - 1000], 1);
-#else
- if ((command / 1000) == 1) /* a user defined command */
- if (user_commamd)
- (*user_commamd) (edit, command - 1000);
-#endif
-
- if (command > CK_Macro (0) && command <= CK_Last_Macro) { /* a macro command */
- struct macro m[MAX_MACRO_LENGTH];
- int nm;
- if ((result = edit_load_macro_cmd (edit, m, &nm, command - 2000)))
- edit_execute_macro (edit, m, nm);
- }
-/* keys which must set the col position, and the search vars */
- switch (command) {
- case CK_Find:
- case CK_Find_Again:
- case CK_Replace:
- case CK_Replace_Again:
- edit->prev_col = edit_get_col (edit);
- return 1;
- break;
- case CK_Up:
- case CK_Up_Highlight:
- case CK_Down:
- case CK_Down_Highlight:
- case CK_Page_Up:
- case CK_Page_Up_Highlight:
- case CK_Page_Down:
- case CK_Page_Down_Highlight:
- case CK_Beginning_Of_Text:
- case CK_Beginning_Of_Text_Highlight:
- case CK_End_Of_Text:
- case CK_End_Of_Text_Highlight:
- case CK_Paragraph_Up:
- case CK_Paragraph_Up_Highlight:
- case CK_Paragraph_Down:
- case CK_Paragraph_Down_Highlight:
- case CK_Scroll_Up:
- case CK_Scroll_Up_Highlight:
- case CK_Scroll_Down:
- case CK_Scroll_Down_Highlight:
- edit->search_start = edit->curs1;
- edit->found_len = 0;
- edit_find_bracket (edit);
- return 1;
- break;
- default:
- edit->found_len = 0;
- edit->prev_col = edit_get_col (edit);
- edit->search_start = edit->curs1;
- }
- edit_find_bracket (edit);
-
- if (option_auto_para_formatting) {
- switch (command) {
- case CK_BackSpace:
- case CK_Delete:
- case CK_Delete_Word_Left:
- case CK_Delete_Word_Right:
- case CK_Delete_To_Line_End:
- case CK_Delete_To_Line_Begin:
- format_paragraph (edit, 0);
- edit->force |= REDRAW_PAGE;
- }
- }
- return result;
-}
-
-
-/* either command or char_for_insertion must be passed as -1 */
-/* returns 0 if command is a macro that was not found, 1 otherwise */
-int edit_execute_command (WEdit * edit, int command, int char_for_insertion)
-{
- int r;
- r = edit_execute_cmd (edit, command, char_for_insertion);
- edit_update_screen (edit);
- return r;
-}
-
-void edit_execute_macro (WEdit * edit, struct macro macro[], int n)
-{
- int i = 0;
- edit->force |= REDRAW_PAGE;
- for (; i < n; i++) {
- edit_execute_cmd (edit, macro[i].command, macro[i].ch);
- }
- edit_update_screen (edit);
-}
-
diff --git a/rosapps/applications/mc/edit/edit.h b/rosapps/applications/mc/edit/edit.h
deleted file mode 100644
index 6428dd91b36..00000000000
--- a/rosapps/applications/mc/edit/edit.h
+++ /dev/null
@@ -1,633 +0,0 @@
-#ifndef __EDIT_H
-#define __EDIT_H
-
-#ifdef MIDNIGHT
-
-#ifdef HAVE_SLANG
-#define HAVE_SYNTAXH 1
-#endif
-
-# include
-# include
-# include
-# ifdef HAVE_UNISTD_H
-# include
-# endif
-# include
-# include "../src/tty.h"
-# include
-# include
-
-# ifdef HAVE_FCNTL_H
-# include
-# endif
-
-# include
-# include
-
-#else /* ! MIDNIGHT */
-
-# include "global.h"
-# include
-# include
-# include
-
-# ifdef HAVE_UNISTD_H
-# include
-# endif
-
-# include
-# include
-
-# ifdef HAVE_FCNTL_H
-# include
-# endif
-
-# include
-# include
-
-# if TIME_WITH_SYS_TIME
-# include
-# include
-# else
-# if HAVE_SYS_TIME_H
-# include
-# else
-# include
-# endif
-# endif
-
-# include "regex.h"
-
-#endif
-
-#ifndef MIDNIGHT
-
-# include
-# include
-# include
-# include
-# include "lkeysym.h"
-# include "coolwidget.h"
-# include "app_glob.c"
-# include "coollocal.h"
-# include "stringtools.h"
-
-#else
-
-# include "../src/main.h" /* for char *shell */
-# include "../src/mad.h"
-# include "../src/dlg.h"
-# include "../src/widget.h"
-# include "../src/color.h"
-# include "../src/dialog.h"
-# include "../src/mouse.h"
-# include "../src/global.h"
-# include "../src/help.h"
-# include "../src/key.h"
-# include "../src/wtools.h" /* for QuickWidgets */
-# include "../src/win.h"
-# include "../vfs/vfs.h"
-# include "../src/menu.h"
-# include "../src/regex.h"
-# define WANT_WIDGETS
-
-# define WIDGET_COMMAND (WIDGET_USER + 10)
-# define N_menus 5
-
-#endif
-
-#define SEARCH_DIALOG_OPTION_NO_SCANF 1
-#define SEARCH_DIALOG_OPTION_NO_REGEX 2
-#define SEARCH_DIALOG_OPTION_NO_CASE 4
-#define SEARCH_DIALOG_OPTION_BACKWARDS 8
-
-#define SYNTAX_FILE "/.cedit/syntax"
-#define CLIP_FILE "/.cedit/cooledit.clip"
-#define MACRO_FILE "/.cedit/cooledit.macros"
-#define BLOCK_FILE "/.cedit/cooledit.block"
-#define ERROR_FILE "/.cedit/cooledit.error"
-#define TEMP_FILE "/.cedit/cooledit.temp"
-#define SCRIPT_FILE "/.cedit/cooledit.script"
-#define EDIT_DIR "/.cedit"
-
-#define EDIT_KEY_EMULATION_NORMAL 0
-#define EDIT_KEY_EMULATION_EMACS 1
-
-#define REDRAW_LINE (1 << 0)
-#define REDRAW_LINE_ABOVE (1 << 1)
-#define REDRAW_LINE_BELOW (1 << 2)
-#define REDRAW_AFTER_CURSOR (1 << 3)
-#define REDRAW_BEFORE_CURSOR (1 << 4)
-#define REDRAW_PAGE (1 << 5)
-#define REDRAW_IN_BOUNDS (1 << 6)
-#define REDRAW_CHAR_ONLY (1 << 7)
-#define REDRAW_COMPLETELY (1 << 8)
-
-#define MOD_ABNORMAL (1 << 0)
-#define MOD_UNDERLINED (1 << 1)
-#define MOD_BOLD (1 << 2)
-#define MOD_HIGHLIGHTED (1 << 3)
-#define MOD_MARKED (1 << 4)
-#define MOD_ITALIC (1 << 5)
-#define MOD_CURSOR (1 << 6)
-#define MOD_INVERSE (1 << 7)
-
-#ifndef MIDNIGHT
-# define EDIT_TEXT_HORIZONTAL_OFFSET 4
-# define EDIT_TEXT_VERTICAL_OFFSET 3
-#else
-# define EDIT_TEXT_HORIZONTAL_OFFSET 0
-# define EDIT_TEXT_VERTICAL_OFFSET 1
-# define FONT_OFFSET_X 0
-# define FONT_OFFSET_Y 0
-#endif
-
-#define EDIT_RIGHT_EXTREME option_edit_right_extreme
-#define EDIT_LEFT_EXTREME option_edit_left_extreme
-#define EDIT_TOP_EXTREME option_edit_top_extreme
-#define EDIT_BOTTOM_EXTREME option_edit_bottom_extreme
-
-#define MAX_MACRO_LENGTH 1024
-
-/*there are a maximum of ... */
-#define MAXBUFF 1024
-/*... edit buffers, each of which is ... */
-#define EDIT_BUF_SIZE 16384
-/* ...bytes in size. */
-
-/*x / EDIT_BUF_SIZE equals x >> ... */
-#define S_EDIT_BUF_SIZE 14
-
-/* x % EDIT_BUF_SIZE is equal to x && ... */
-#define M_EDIT_BUF_SIZE 16383
-
-#define SIZE_LIMIT (EDIT_BUF_SIZE * (MAXBUFF - 2))
-/* Note a 16k stack is 64k of data and enough to hold (usually) around 10
- pages of undo info. */
-
-/* undo stack */
-#define START_STACK_SIZE 32
-
-
-/*some codes that may be pushed onto or returned from the undo stack: */
-#define CURS_LEFT 601
-#define CURS_RIGHT 602
-#define DELETE 603
-#define BACKSPACE 604
-#define STACK_BOTTOM 605
-#define CURS_LEFT_LOTS 606
-#define CURS_RIGHT_LOTS 607
-#define MARK_1 1000
-#define MARK_2 700000000
-#define KEY_PRESS 1400000000
-
-/*Tabs spaces: (sofar only HALF_TAB_SIZE is used: */
-#define TAB_SIZE option_tab_spacing
-#define HALF_TAB_SIZE ((int) option_tab_spacing / 2)
-
-struct macro {
- short command;
- short ch;
-};
-
-struct selection {
- unsigned char * text;
- int len;
-};
-
-
-#define RULE_CONTEXT 0x00FFF000UL
-#define RULE_CONTEXT_SHIFT 12
-#define RULE_WORD 0x00000FFFUL
-#define RULE_WORD_SHIFT 0
-#define RULE_ON_LEFT_BORDER 0x02000000UL
-#define RULE_ON_RIGHT_BORDER 0x01000000UL
-
-struct key_word {
- char *keyword;
- char first;
- char last;
- char *whole_word_chars_left;
- char *whole_word_chars_right;
-#define NO_COLOR ((unsigned long) -1);
- int line_start;
- int bg;
- int fg;
-};
-
-struct context_rule {
- int rule_number;
- char *left;
- char first_left;
- char last_left;
- char line_start_left;
- char *right;
- char first_right;
- char last_right;
- char line_start_right;
- int single_char;
- int between_delimiters;
- char *whole_word_chars_left;
- char *whole_word_chars_right;
- unsigned char *conflicts;
- char *keyword_first_chars;
- char *keyword_last_chars;
-/* first word is word[1] */
- struct key_word **keyword;
-};
-
-
-
-struct editor_widget {
-#ifdef MIDNIGHT
- Widget widget;
-#else
- struct cool_widget *widget;
-#endif
-#define from_here num_widget_lines
- int num_widget_lines;
- int num_widget_columns;
-
-#ifdef MIDNIGHT
- int have_frame;
-#else
- int stopped;
-#endif
-
- char *filename; /* Name of the file */
- char *dir; /* current directory */
-
-/* dynamic buffers and curser position for editor: */
- long curs1; /*position of the cursor from the beginning of the file. */
- long curs2; /*position from the end of the file */
- unsigned char *buffers1[MAXBUFF + 1]; /*all data up to curs1 */
- unsigned char *buffers2[MAXBUFF + 1]; /*all data from end of file down to curs2 */
-
-/* search variables */
- long search_start; /* First character to start searching from */
- int found_len; /* Length of found string or 0 if none was found */
- long found_start; /* the found word from a search - start position */
-
-/* display information */
- long last_byte; /* Last byte of file */
- long start_display; /* First char displayed */
- long start_col; /* First displayed column, negative */
- long max_column; /* The maximum cursor position ever reached used to calc hori scroll bar */
- long curs_row; /*row position of curser on the screen */
- long curs_col; /*column position on screen */
- int force; /* how much of the screen do we redraw? */
- unsigned char overwrite;
- unsigned char modified; /*has the file been changed?: 1 if char inserted or
- deleted at all since last load or save */
-#ifdef MIDNIGHT
- int delete_file; /* has the file been created in edit_load_file? Delete
- it at end of editing when it hasn't been modified
- or saved */
-#endif
- unsigned char highlight;
- long prev_col; /*recent column position of the curser - used when moving
- up or down past lines that are shorter than the current line */
- long curs_line; /*line number of the cursor. */
- long start_line; /*line nummber of the top of the page */
-
-/* file info */
- long total_lines; /*total lines in the file */
- long mark1; /*position of highlight start */
- long mark2; /*position of highlight end */
- int column1; /*position of column highlight start */
- int column2; /*position of column highlight end */
- long bracket; /*position of a matching bracket */
-
-/* undo stack and pointers */
- unsigned long stack_pointer;
- long *undo_stack;
- unsigned long stack_size;
- unsigned long stack_size_mask;
- unsigned long stack_bottom;
- struct stat stat;
-
-/* syntax higlighting */
- struct context_rule **rules;
- long last_get_rule;
- unsigned long rule;
- char *syntax_type; /* description of syntax highlighting type being used */
- int explicit_syntax; /* have we forced the syntax hi. type in spite of the filename? */
-
- int to_here; /* dummy marker */
-
-
-/* macro stuff */
- int macro_i; /* -1 if not recording index to macro[] otherwise */
- struct macro macro[MAX_MACRO_LENGTH];
-};
-
-typedef struct editor_widget WEdit;
-
-#ifndef MIDNIGHT
-
-void edit_render_expose (WEdit * edit, XExposeEvent * xexpose);
-void edit_render_tidbits (struct cool_widget *w);
-int eh_editor (CWidget * w, XEvent * xevent, CEvent * cwevent);
-void edit_draw_menus (Window parent, int x, int y);
-void edit_run_make (void);
-void edit_change_directory (void);
-int edit_man_page_cmd (WEdit * edit);
-void edit_search_replace_dialog (Window parent, int x, int y, char **search_text, char **replace_text, char **arg_order, char *heading, int option);
-void edit_search_dialog (WEdit * edit, char **search_text);
-long edit_find (long search_start, unsigned char *exp, int *len, long last_byte, int (*get_byte) (void *, long), void *data);
-void edit_set_foreground_colors (unsigned long normal, unsigned long bold, unsigned long italic);
-void edit_set_background_colors (unsigned long normal, unsigned long abnormal, unsigned long marked, unsigned long marked_abnormal, unsigned long highlighted);
-void edit_set_cursor_color (unsigned long c);
-void draw_options_dialog (Window parent, int x, int y);
-void CRefreshEditor (WEdit * edit);
-void edit_set_user_command (void (*func) (WEdit *, int));
-void edit_draw_this_line_proportional (WEdit * edit, long b, int curs_row, int start_column, int end_column);
-unsigned char get_international_character (unsigned char key_press);
-void edit_set_user_key_function (int (*user_def_key_func) (unsigned int, unsigned int, KeySym keysym));
-
-#else
-
-int edit_drop_hotkey_menu (WEdit * e, int key);
-void edit_menu_cmd (WEdit * e);
-void edit_init_menu_emacs (void);
-void edit_init_menu_normal (void);
-void edit_done_menu (void);
-int edit_raw_key_query (char *heading, char *query, int cancel);
-char *strcasechr (const char *s, int c);
-int edit (const char *_file, int line);
-int edit_translate_key (WEdit * edit, unsigned int x_keycode, long x_key, int x_state, int *cmd, int *ch);
-
-#endif
-
-int edit_get_byte (WEdit * edit, long byte_index);
-char *edit_get_buffer_as_text (WEdit * edit);
-int edit_load_file (WEdit * edit, const char *filename, const char *text, unsigned long text_size);
-int edit_count_lines (WEdit * edit, long current, int upto);
-long edit_move_forward (WEdit * edit, long current, int lines, long upto);
-long edit_move_forward3 (WEdit * edit, long current, int cols, long upto);
-long edit_move_backward (WEdit * edit, long current, int lines);
-void edit_scroll_screen_over_cursor (WEdit * edit);
-void edit_render_keypress (WEdit * edit);
-void edit_scroll_upward (WEdit * edit, unsigned long i);
-void edit_scroll_downward (WEdit * edit, int i);
-void edit_scroll_right (WEdit * edit, int i);
-void edit_scroll_left (WEdit * edit, int i);
-int edit_get_col (WEdit * edit);
-long edit_bol (WEdit * edit, long current);
-long edit_eol (WEdit * edit, long current);
-void edit_update_curs_row (WEdit * edit);
-void edit_update_curs_col (WEdit * edit);
-
-void edit_block_copy_cmd (WEdit * edit);
-void edit_block_move_cmd (WEdit * edit);
-int edit_block_delete_cmd (WEdit * edit);
-
-int edit_delete (WEdit * edit);
-void edit_insert (WEdit * edit, int c);
-int edit_cursor_move (WEdit * edit, long increment);
-void edit_push_action (WEdit * edit, long c,...);
-void edit_push_key_press (WEdit * edit);
-void edit_insert_ahead (WEdit * edit, int c);
-int edit_save_file (WEdit * edit, const char *filename);
-int edit_save_cmd (WEdit * edit);
-int edit_save_confirm_cmd (WEdit * edit);
-int edit_save_as_cmd (WEdit * edit);
-WEdit *edit_init (WEdit * edit, int lines, int columns, const char *filename, const char *text, const char *dir, unsigned long text_size);
-int edit_clean (WEdit * edit);
-int edit_renew (WEdit * edit);
-int edit_new_cmd (WEdit * edit);
-int edit_reload (WEdit * edit, const char *filename, const char *text, const char *dir, unsigned long text_size);
-int edit_load_cmd (WEdit * edit);
-void edit_mark_cmd (WEdit * edit, int unmark);
-void edit_set_markers (WEdit * edit, long m1, long m2, int c1, int c2);
-void edit_push_markers (WEdit * edit);
-void edit_quit_cmd (WEdit * edit);
-void edit_replace_cmd (WEdit * edit, int again);
-void edit_search_cmd (WEdit * edit, int again);
-int edit_save_block_cmd (WEdit * edit);
-int edit_insert_file_cmd (WEdit * edit);
-int edit_insert_file (WEdit * edit, const char *filename);
-void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block);
-char *catstrs (const char *first,...);
-void edit_refresh_cmd (WEdit * edit);
-void edit_date_cmd (WEdit * edit);
-void edit_goto_cmd (WEdit * edit);
-int eval_marks (WEdit * edit, long *start_mark, long *end_mark);
-void edit_status (WEdit * edit);
-int edit_execute_command (WEdit * edit, int command, int char_for_insertion);
-int edit_execute_key_command (WEdit * edit, int command, int char_for_insertion);
-void edit_update_screen (WEdit * edit);
-int edit_printf (WEdit * e, const char *fmt,...);
-int edit_print_string (WEdit * e, const char *s);
-void edit_move_to_line (WEdit * e, long line);
-void edit_move_display (WEdit * e, long line);
-void edit_word_wrap (WEdit * edit);
-unsigned char *edit_get_block (WEdit * edit, long start, long finish, int *l);
-int edit_sort_cmd (WEdit * edit);
-void edit_help_cmd (WEdit * edit);
-void edit_left_word_move (WEdit * edit);
-void edit_right_word_move (WEdit * edit);
-void edit_get_selection (WEdit * edit);
-
-int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n);
-int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k);
-void edit_delete_macro_cmd (WEdit * edit);
-
-int edit_copy_to_X_buf_cmd (WEdit * edit);
-int edit_cut_to_X_buf_cmd (WEdit * edit);
-void edit_paste_from_X_buf_cmd (WEdit * edit);
-
-void edit_paste_from_history (WEdit *edit);
-
-void edit_split_filename (WEdit * edit, char *name);
-
-#ifdef MIDNIGHT
-#define CWidget Widget
-#endif
-void edit_set_syntax_change_callback (void (*callback) (CWidget *));
-void edit_load_syntax (WEdit * edit, char **names, char *type);
-void edit_free_syntax_rules (WEdit * edit);
-void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
-
-
-#ifdef MIDNIGHT
-
-/* put OS2/NT/WIN95 defines here */
-
-# ifdef OS2_NT
-# define MY_O_TEXT O_TEXT
-# else
-# define MY_O_TEXT 0
-# endif
-
-# define FONT_PIX_PER_LINE 1
-# define FONT_MEAN_WIDTH 1
-
-# define get_sys_error(s) (s)
-# define open mc_open
-# define close(f) mc_close(f)
-# define read(f,b,c) mc_read(f,b,c)
-# define write(f,b,c) mc_write(f,b,c)
-# define stat(f,s) mc_stat(f,s)
-# define mkdir(s,m) mc_mkdir(s,m)
-# define itoa MY_itoa
-
-# define edit_get_load_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
-# define edit_get_save_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
-# define CMalloc(x) malloc(x)
-
-# define set_error_msg(s) edit_init_error_msg = strdup(s)
-
-# ifdef _EDIT_C
-
-# define edit_error_dialog(h,s) set_error_msg(s)
-char *edit_init_error_msg = NULL;
-
-# else /* ! _EDIT_C */
-
-# define edit_error_dialog(h,s) query_dialog (h, s, 0, 1, _("&Dismiss"))
-# define edit_message_dialog(h,s) query_dialog (h, s, 0, 1, _("&Ok"))
-extern char *edit_init_error_msg;
-
-# endif /* ! _EDIT_C */
-
-
-# define get_error_msg(s) edit_init_error_msg
-# define edit_query_dialog2(h,t,a,b) query_dialog(h,t,0,2,a,b)
-# define edit_query_dialog3(h,t,a,b,c) query_dialog(h,t,0,3,a,b,c)
-# define edit_query_dialog4(h,t,a,b,c,d) query_dialog(h,t,0,4,a,b,c,d)
-
-#else /* ! MIDNIGHT */
-
-# define MY_O_TEXT 0
-# define WIN_MESSAGES edit->widget->mainid, 20, 20
-
-# define edit_get_load_file(d,f,h) CGetLoadFile(WIN_MESSAGES,d,f,h)
-# define edit_get_save_file(d,f,h) CGetSaveFile(WIN_MESSAGES,d,f,h)
-# define edit_error_dialog(h,t) CErrorDialog(WIN_MESSAGES,h,"%s",t)
-# define edit_message_dialog(h,t) CMessageDialog(WIN_MESSAGES,0,h,"%s",t)
-# define edit_query_dialog2(h,t,a,b) CQueryDialog(WIN_MESSAGES,h,t,a,b,0)
-# define edit_query_dialog3(h,t,a,b,c) CQueryDialog(WIN_MESSAGES,h,t,a,b,c,0)
-# define edit_query_dialog4(h,t,a,b,c,d) CQueryDialog(WIN_MESSAGES,h,t,a,b,c,d,0)
-
-#endif /* ! MIDNIGHT */
-
-extern char *home_dir;
-
-#define NUM_SELECTION_HISTORY 32
-
-#ifdef _EDIT_C
-
-struct selection selection =
-{0, 0};
-int current_selection = 0;
-/* Note: selection.text = selection_history[current_selection].text */
-struct selection selection_history[NUM_SELECTION_HISTORY] =
-{
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
-};
-
-#ifdef MIDNIGHT
-/*
- what editor are we going to emulate? one of EDIT_KEY_EMULATION_NORMAL
- or EDIT_KEY_EMULATION_EMACS
- */
-int edit_key_emulation = EDIT_KEY_EMULATION_NORMAL;
-#endif /* ! MIDNIGHT */
-
-int option_word_wrap_line_length = 72;
-int option_typewriter_wrap = 0;
-int option_auto_para_formatting = 0;
-int option_international_characters = 0;
-int option_tab_spacing = 8;
-int option_fill_tabs_with_spaces = 0;
-int option_return_does_auto_indent = 1;
-int option_backspace_through_tabs = 0;
-int option_fake_half_tabs = 1;
-int option_save_mode = 0;
-int option_backup_ext_int = -1;
-int option_find_bracket = 1;
-int option_max_undo = 8192;
-
-int option_editor_fg_normal = 26;
-int option_editor_fg_bold = 8;
-int option_editor_fg_italic = 10;
-
-int option_edit_right_extreme = 0;
-int option_edit_left_extreme = 0;
-int option_edit_top_extreme = 0;
-int option_edit_bottom_extreme = 0;
-
-int option_editor_bg_normal = 1;
-int option_editor_bg_abnormal = 0;
-int option_editor_bg_marked = 2;
-int option_editor_bg_marked_abnormal = 9;
-int option_editor_bg_highlighted = 12;
-int option_editor_fg_cursor = 18;
-
-char *option_whole_chars_search = "0123456789abcdefghijklmnopqrstuvwxyz_";
-char *option_whole_chars_move = "0123456789abcdefghijklmnopqrstuvwxyz_; ,[](){}";
-char *option_backup_ext = "~";
-
-#else /* ! _EDIT_C */
-
-extern struct selection selection;
-extern struct selection selection_history[];
-extern int current_selection;
-
-#ifdef MIDNIGHT
-/*
- what editor are we going to emulate? one of EDIT_KEY_EMULATION_NORMAL
- or EDIT_KEY_EMULATION_EMACS
- */
-extern int edit_key_emulation;
-#endif /* ! MIDNIGHT */
-
-extern int option_word_wrap_line_length;
-extern int option_typewriter_wrap;
-extern int option_auto_para_formatting;
-extern int option_international_characters;
-extern int option_tab_spacing;
-extern int option_fill_tabs_with_spaces;
-extern int option_return_does_auto_indent;
-extern int option_backspace_through_tabs;
-extern int option_fake_half_tabs;
-extern int option_save_mode;
-extern int option_backup_ext_int;
-extern int option_find_bracket;
-extern int option_max_undo;
-
-extern int option_editor_fg_normal;
-extern int option_editor_fg_bold;
-extern int option_editor_fg_italic;
-
-extern int option_edit_right_extreme;
-extern int option_edit_left_extreme;
-extern int option_edit_top_extreme;
-extern int option_edit_bottom_extreme;
-
-extern int option_editor_bg_normal;
-extern int option_editor_bg_abnormal;
-extern int option_editor_bg_marked;
-extern int option_editor_bg_marked_abnormal;
-extern int option_editor_bg_highlighted;
-extern int option_editor_fg_cursor;
-
-extern char *option_whole_chars_search;
-extern char *option_whole_chars_move;
-extern char *option_backup_ext;
-
-extern int edit_confirm_save;
-
-#endif /* ! _EDIT_C */
-#endif /* __EDIT_H */
diff --git a/rosapps/applications/mc/edit/edit_key_translator.c b/rosapps/applications/mc/edit/edit_key_translator.c
deleted file mode 100644
index 4fffa306100..00000000000
--- a/rosapps/applications/mc/edit/edit_key_translator.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- these #defines are probably the ones most people will be interested in.
- You can use these two #defines to hard code the key mappings --- just
- uncomment the one you want. But only if you have trouble with learn
- keys (which is unlikely).
-*/
-
- /* KEY_BACKSPACE is the key learned in the learn keys menu : */
-#define OUR_BACKSPACE_KEY KEY_BACKSPACE
- /* ...otherwise ctrl-h : */
-/* #define OUR_BACKSPACE_KEY XCTRL ('h') */
- /* ...otherwise 127 or DEL in ascii : */
-/* #define OUR_BACKSPACE_KEY 0177 */
-
- /* KEY_DC is the key learned in the learn keys menu */
-#define OUR_DELETE_KEY KEY_DC
- /* ...otherwise ctrl-d : */
-/* #define OUR_DELETE_KEY XCTRL ('d') */
- /* ...otherwise 127 or DEL in ascii : */
-/* #define OUR_DELETE_KEY 0177 */
-
-
-/*
- This is #include'd into the function edit_translate_key in edit.c.
- This sequence of code takes 'x_state' and 'x_key' and translates them
- into either 'command' or 'char_for_insertion'. 'x_key' holds one of
- KEY_NPAGE, KEY_HOME etc., and 'x_state' holds a bitwise inclusive OR of
- CONTROL_PRESSED, ALT_PRESSED or SHIFT_PRESSED, although none may
- be supported.
- 'command' is one of the editor commands editcmddef.h.
-
- Almost any C code can go into this file. The code below is an example
- that may by appended or modified by the user.
- */
-
-/* look in this file for the list of commands : */
-#include "editcmddef.h"
-
-#define KEY_NUMLOCK ???
-
-/* ordinary translations. (Some of this may be redundant.) Note that keys listed
- first take priority when a key is assigned to more than one command */
- static long *key_map;
- static long cooledit_key_map[] =
- {OUR_BACKSPACE_KEY, CK_BackSpace, OUR_DELETE_KEY, CK_Delete,
- XCTRL ('d'), CK_Delete, '\n', CK_Enter,
- KEY_PPAGE, CK_Page_Up, KEY_NPAGE, CK_Page_Down, KEY_LEFT, CK_Left,
- KEY_RIGHT, CK_Right, KEY_UP, CK_Up, KEY_DOWN, CK_Down, ALT ('\t'), CK_Return, ALT ('\n'), CK_Return,
- KEY_HOME, CK_Home, KEY_END, CK_End, '\t', CK_Tab, XCTRL ('u'), CK_Undo, KEY_IC, CK_Toggle_Insert,
- XCTRL ('o'), CK_Load, KEY_F (3), CK_Mark, KEY_F (5), CK_Copy,
- KEY_F (6), CK_Move, KEY_F (8), CK_Remove, KEY_F (12), CK_Save_As,
- KEY_F (2), CK_Save, XCTRL ('n'), CK_New,
- XCTRL ('l'), CK_Refresh, ESC_CHAR, CK_Exit, KEY_F (10), CK_Exit,
- KEY_F (19), /*C formatter */ CK_Pipe_Block (0),
- XCTRL ('p'), /*spell check */ CK_Pipe_Block (1),
- KEY_F (15), CK_Insert_File,
- XCTRL ('f'), CK_Save_Block, KEY_F (1), CK_Help,
- ALT ('t'), CK_Sort, ALT ('m'), CK_Mail,
- XCTRL ('z'), CK_Word_Left, XCTRL ('x'), CK_Word_Right,
- KEY_F (4), CK_Replace, KEY_F (7), CK_Find, KEY_F (14), CK_Replace_Again,
- XCTRL ('h'), CK_BackSpace, ALT ('l'), CK_Goto, ALT ('L'), CK_Goto, XCTRL ('y'), CK_Delete_Line,
- KEY_F (17), CK_Find_Again, ALT ('p'), CK_Paragraph_Format, 0};
-
- static long emacs_key_map[] =
- {OUR_BACKSPACE_KEY, CK_BackSpace, OUR_DELETE_KEY, CK_Delete, '\n', CK_Enter,
- KEY_PPAGE, CK_Page_Up, KEY_NPAGE, CK_Page_Down, KEY_LEFT, CK_Left,
- KEY_RIGHT, CK_Right, KEY_UP, CK_Up, KEY_DOWN, CK_Down, ALT ('\t'), CK_Return, ALT ('\n'), CK_Return,
- KEY_HOME, CK_Home, KEY_END, CK_End, '\t', CK_Tab, XCTRL ('u'), CK_Undo, KEY_IC, CK_Toggle_Insert,
- XCTRL ('o'), CK_Load, KEY_F (3), CK_Mark, KEY_F (5), CK_Copy,
- KEY_F (6), CK_Move, KEY_F (8), CK_Remove, KEY_F (12), CK_Save_As,
- KEY_F (2), CK_Save, ALT ('p'), CK_Paragraph_Format,
-
- ALT ('t'), CK_Sort,
-
- XCTRL ('a'), CK_Home, XCTRL ('e'), CK_End,
- XCTRL ('b'), CK_Left, XCTRL ('f'), CK_Right,
- XCTRL ('n'), CK_Down, XCTRL ('p'), CK_Up,
- XCTRL ('d'), CK_Delete,
- XCTRL ('v'), CK_Page_Down, ALT ('v'), CK_Page_Up,
- XCTRL ('@'), CK_Mark,
- XCTRL ('k'), CK_Delete_To_Line_End,
- XCTRL ('s'), CK_Find,
-
- ALT ('b'), CK_Word_Left, ALT ('f'), CK_Word_Right,
- XCTRL ('w'), CK_XCut,
- XCTRL ('y'), CK_XPaste,
- ALT ('w'), CK_XStore,
-
- XCTRL ('l'), CK_Refresh, ESC_CHAR, CK_Exit, KEY_F (10), CK_Exit,
- KEY_F (19), /*C formatter */ CK_Pipe_Block (0),
- ALT ('$'), /*spell check */ CK_Pipe_Block (1),
- KEY_F (15), CK_Insert_File,
- KEY_F (1), CK_Help,
-
- KEY_F (4), CK_Replace, KEY_F (7), CK_Find, KEY_F (14), CK_Replace_Again,
- XCTRL ('h'), CK_BackSpace, ALT ('l'), CK_Goto, ALT ('L'), CK_Goto,
- KEY_F (17), CK_Find_Again,
- ALT ('<'), CK_Beginning_Of_Text,
- ALT ('>'), CK_End_Of_Text,
-
- 0, 0};
-
- static long key_pad_map[10] =
- {XCTRL ('o'), KEY_END, KEY_DOWN, KEY_NPAGE, KEY_LEFT,
- KEY_DOWN, KEY_RIGHT, KEY_HOME, KEY_UP, KEY_PPAGE};
-
-
-#define DEFAULT_NUM_LOCK 0
-
- static int num_lock = DEFAULT_NUM_LOCK;
- int i = 0;
-
- switch (edit_key_emulation) {
- case EDIT_KEY_EMULATION_NORMAL:
- key_map = cooledit_key_map;
- break;
- case EDIT_KEY_EMULATION_EMACS:
- key_map = emacs_key_map;
- if (x_key == XCTRL ('x')) {
- int ext_key;
- ext_key = edit_raw_key_query (" Ctrl-X ", _(" Emacs key: "), 0);
- switch (ext_key) {
- case 's':
- command = CK_Save;
- goto fin;
- case 'x':
- command = CK_Exit;
- goto fin;
- case 'k':
- command = CK_New;
- goto fin;
- case 'e':
- command = CK_Macro (edit_raw_key_query (_(" Execute Macro "), _(" Press macro hotkey: "), 1));
- if (command == CK_Macro (0))
- command = -1;
- goto fin;
- }
- goto fin;
- }
- break;
- }
-
- if (x_key == XCTRL ('q')) {
- char_for_insertion = edit_raw_key_query (_(" Insert Literal "), _(" Press any key: "), 0);
- goto fin;
- }
- if (x_key == XCTRL ('a') && edit_key_emulation != EDIT_KEY_EMULATION_EMACS) {
- command = CK_Macro (edit_raw_key_query (" Execute Macro ", " Press macro hotkey: ", 1));
- if (command == CK_Macro (0))
- command = -1;
- goto fin;
- }
-/* edit is a pointer to the widget */
- if (edit)
- if (x_key == XCTRL ('r')) {
- command = edit->macro_i < 0 ? CK_Begin_Record_Macro : CK_End_Record_Macro;
- goto fin;
- }
-/* if (x_key == KEY_NUMLOCK) {
- num_lock = 1 - num_lock;
- return 1;
- }
- */
-
-/* first translate the key-pad */
- if (num_lock) {
- if (x_key >= '0' && x_key <= '9') {
- x_key = key_pad_map[x_key - '0'];
- }
- if (x_key == '.') {
- x_key = KEY_DC;
- }
- }
- if ((x_state & SHIFT_PRESSED) && (x_state & CONTROL_PRESSED)) {
- switch (x_key) {
- case KEY_PPAGE:
- command = CK_Beginning_Of_Text_Highlight;
- goto fin;
- case KEY_NPAGE:
- command = CK_End_Of_Text_Highlight;
- goto fin;
- case KEY_LEFT:
- command = CK_Word_Left_Highlight;
- goto fin;
- case KEY_RIGHT:
- command = CK_Word_Right_Highlight;
- goto fin;
- }
- }
- if ((x_state & SHIFT_PRESSED) && !(x_state & CONTROL_PRESSED)) {
- switch (x_key) {
- case KEY_PPAGE:
- command = CK_Page_Up_Highlight;
- goto fin;
- case KEY_NPAGE:
- command = CK_Page_Down_Highlight;
- goto fin;
- case KEY_LEFT:
- command = CK_Left_Highlight;
- goto fin;
- case KEY_RIGHT:
- command = CK_Right_Highlight;
- goto fin;
- case KEY_UP:
- command = CK_Up_Highlight;
- goto fin;
- case KEY_DOWN:
- command = CK_Down_Highlight;
- goto fin;
- case KEY_HOME:
- command = CK_Home_Highlight;
- goto fin;
- case KEY_END:
- command = CK_End_Highlight;
- goto fin;
- case KEY_IC:
- command = CK_XPaste;
- goto fin;
- case KEY_DC:
- command = CK_XCut;
- goto fin;
- }
- }
-/* things that need a control key */
- if (x_state & CONTROL_PRESSED) {
- switch (x_key) {
- case KEY_F (2):
- command = CK_Save_As;
- goto fin;
- case KEY_F (4):
- command = CK_Replace_Again;
- goto fin;
- case KEY_F (7):
- command = CK_Find_Again;
- goto fin;
- case KEY_BACKSPACE:
- command = CK_Undo;
- goto fin;
- case KEY_PPAGE:
- command = CK_Beginning_Of_Text;
- goto fin;
- case KEY_NPAGE:
- command = CK_End_Of_Text;
- goto fin;
- case KEY_UP:
- command = CK_Scroll_Up;
- goto fin;
- case KEY_DOWN:
- command = CK_Scroll_Down;
- goto fin;
- case KEY_LEFT:
- command = CK_Word_Left;
- goto fin;
- case KEY_RIGHT:
- command = CK_Word_Right;
- goto fin;
- case KEY_IC:
- command = CK_XStore;
- goto fin;
- case KEY_DC:
- command = CK_Remove;
- goto fin;
- }
- }
-/* an ordinary insertable character */
- if (x_key < 256 && is_printable (x_key)) {
- char_for_insertion = x_key;
- goto fin;
- }
-/* other commands */
- i = 0;
- while (key_map[i] != x_key && (key_map[i] || key_map[i + 1]))
- i += 2;
- command = key_map[i + 1];
- if (command)
- goto fin;
-
-/* Function still not found for this key, so try macro's */
-/* This allows the same macro to be
- enabled by either eg "ALT('f')" or "XCTRL('f')" or "XCTRL('a'), 'f'" */
-
-/* key.h: #define ALT(x) (0x200 | (x)) */
- if (x_key & ALT (0)) { /* is an alt key ? */
- command = CK_Macro (x_key - ALT (0));
- goto fin;
- }
-/* key.h: #define XCTRL(x) ((x) & 31) */
- if (x_key < ' ') { /* is a ctrl key ? */
- command = CK_Macro (x_key);
- goto fin;
- }
- fin:
-
-
diff --git a/rosapps/applications/mc/edit/editcmd.c b/rosapps/applications/mc/edit/editcmd.c
deleted file mode 100644
index c883a6c9a37..00000000000
--- a/rosapps/applications/mc/edit/editcmd.c
+++ /dev/null
@@ -1,2541 +0,0 @@
-/* editor high level editing commands.
-
- Copyright (C) 1996, 1997 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-/* #define PIPE_BLOCKS_SO_READ_BYTE_BY_BYTE */
-
-#include
-#ifdef OS2_NT
-#include
-#include
-#endif
-#include
-#include "edit.h"
-#include "editcmddef.h"
-
-#ifndef MIDNIGHT
-#include
-#include "loadfile.h"
-#endif
-
-/* globals: */
-
-/* search and replace: */
-int replace_scanf = 0;
-int replace_regexp = 0;
-int replace_all = 0;
-int replace_prompt = 1;
-int replace_whole = 0;
-int replace_case = 0;
-int replace_backwards = 0;
-
-/* queries on a save */
-#ifdef MIDNIGHT
-int edit_confirm_save = 1;
-#else
-int edit_confirm_save = 0;
-#endif
-
-#define NUM_REPL_ARGS 16
-#define MAX_REPL_LEN 1024
-
-#ifdef MIDNIGHT
-
-static inline int my_lower_case (int c)
-{
- return tolower(c);
-}
-
-char *strcasechr (const char *s, int c)
-{
- for (; my_lower_case ((int) *s) != my_lower_case (c); ++s)
- if (*s == '\0')
- return 0;
- return (char *)s;
-}
-
-
-#include "../src/mad.h"
-
-#ifndef HAVE_MEMMOVE
-/* for Christophe */
-static void *memmove (void *dest, const void *src, size_t n)
-{
- char *t, *s;
-
- if (dest <= src) {
- t = (char *) dest;
- s = (char *) src;
- while (n--)
- *t++ = *s++;
- } else {
- t = (char *) dest + n;
- s = (char *) src + n;
- while (n--)
- *--t = *--s;
- }
- return dest;
-}
-#endif
-
-/* #define itoa MY_itoa <---- this line is now in edit.h */
-char *itoa (int i)
-{
- static char t[14];
- char *s = t + 13;
- int j = i;
- *s-- = 0;
- do {
- *s-- = i % 10 + '0';
- } while ((i = i / 10));
- if (j < 0)
- *s-- = '-';
- return ++s;
-}
-
-/*
- This joins strings end on end and allocates memory for the result.
- The result is later automatically free'd and must not be free'd
- by the caller.
- */
-char *catstrs (const char *first,...)
-{
- static char *stacked[16] =
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- static int i = 0;
- va_list ap;
- int len;
- char *data;
-
- if (!first)
- return 0;
-
- len = strlen (first);
- va_start (ap, first);
-
- while ((data = va_arg (ap, char *)) != 0)
- len += strlen (data);
-
- len++;
-
- i = (i + 1) % 16;
- if (stacked[i])
- free (stacked[i]);
-
- stacked[i] = malloc (len);
- va_end (ap);
- va_start (ap, first);
- strcpy (stacked[i], first);
- while ((data = va_arg (ap, char *)) != 0)
- strcat (stacked[i], data);
- va_end (ap);
-
- return stacked[i];
-}
-#endif
-
-#ifdef MIDNIGHT
-
-void edit_help_cmd (WEdit * edit)
-{
- char *hlpdir = concat_dir_and_file (mc_home, "mc.hlp");
- interactive_display (hlpdir, "[Internal File Editor]");
- free (hlpdir);
- edit->force |= REDRAW_COMPLETELY;
-}
-
-void edit_refresh_cmd (WEdit * edit)
-{
-#ifndef HAVE_SLANG
- clr_scr();
- do_refresh();
-#else
- {
- int fg, bg;
- edit_get_syntax_color (edit, -1, &fg, &bg);
- }
- touchwin(stdscr);
-#endif
- mc_refresh();
- doupdate();
-}
-
-#else
-
-void edit_help_cmd (WEdit * edit)
-{
-}
-
-void edit_refresh_cmd (WEdit * edit)
-{
-}
-
-void CRefreshEditor (WEdit * edit)
-{
- edit_refresh_cmd (edit);
-}
-
-#endif
-
-#ifndef MIDNIGHT
-
-/* three argument open */
-int my_open (const char *pathname, int flags,...)
-{
- int file;
- va_list ap;
-
- file = open ((char *) pathname, O_RDONLY);
- if (file < 0 && (flags & O_CREAT)) { /* must it be created ? */
- mode_t mode;
- va_start(ap, flags);
- mode = va_arg(ap, mode_t);
- va_end(ap);
- return creat ((char *) pathname, mode);
- }
- close (file);
- return open ((char *) pathname, flags);
-}
-
-#define open my_open
-
-#endif
-
-/* "Oleg Yu. Repin" added backup filenames
- ...thanks -paul */
-
-/* If 0 (quick save) then a) create/truncate file,
- b) save to ;
- if 1 (safe save) then a) save to ,
- b) rename to ;
- if 2 (do backups) then a) save to ,
- b) rename to ,
- c) rename to . */
-
-/* returns 0 on error */
-int edit_save_file (WEdit * edit, const char *filename)
-{
- long buf;
- long filelen = 0;
- int file;
- char *savename = (char *) filename;
- int this_save_mode;
-
- if ((file = open (savename, O_WRONLY)) == -1) {
- this_save_mode = 0; /* the file does not exists yet, so no safe save or backup necessary */
- } else {
- close (file);
- this_save_mode = option_save_mode;
- }
-
- if (this_save_mode > 0) {
- char *savedir = ".", *slashpos = strrchr (filename, '/');
- if (slashpos != 0) {
- savedir = strdup (filename);
- if (savedir == 0)
- return 0;
- savedir[slashpos - filename + 1] = '\0';
- }
-#ifdef HAVE_MAD
- savename = strdup (tempnam (savedir, "cooledit"));
-#else
- savename = tempnam (savedir, "cooledit");
-#endif
- if (slashpos)
- free (savedir);
- if (!savename)
- return 0;
- }
- if ((file = open (savename, O_CREAT | O_WRONLY | O_TRUNC | MY_O_TEXT, edit->stat.st_mode)) == -1) {
- if (this_save_mode > 0)
- free (savename);
- return 0;
- }
- chown (savename, edit->stat.st_uid, edit->stat.st_gid);
- buf = 0;
- while (buf <= (edit->curs1 >> S_EDIT_BUF_SIZE) - 1) {
- filelen += write (file, (char *) edit->buffers1[buf], EDIT_BUF_SIZE);
- buf++;
- }
- filelen += write (file, (char *) edit->buffers1[buf], edit->curs1 & M_EDIT_BUF_SIZE);
-
- if (edit->curs2) {
- edit->curs2--;
- buf = (edit->curs2 >> S_EDIT_BUF_SIZE);
- filelen += write (file, (char *) edit->buffers2[buf] + EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1, 1 + (edit->curs2 & M_EDIT_BUF_SIZE));
- buf--;
- while (buf >= 0) {
- filelen += write (file, (char *) edit->buffers2[buf], EDIT_BUF_SIZE);
- buf--;
- }
- edit->curs2++;
- }
- close (file);
-
- if (filelen == edit->last_byte) {
- if (this_save_mode == 2) {
- if (rename (filename, catstrs (filename, option_backup_ext, 0)) == -1) { /* catstrs free's automatically */
- free (savename);
- return 0;
- }
- }
- if (this_save_mode > 0) {
- if (rename (savename, filename) == -1) {
- free (savename);
- return 0;
- }
- free (savename);
- }
- return 1;
- } else {
- if (this_save_mode > 0)
- free (savename);
- return 0;
- }
-}
-
-#ifdef MIDNIGHT
-/*
- I changed this from Oleg's original routine so
- that option_backup_ext works with coolwidgets as well. This
- does mean there is a memory leak - paul.
- */
-void menu_save_mode_cmd (void)
-{
-#define DLG_X 36
-#define DLG_Y 10
- static char *str_result;
- static int save_mode_new;
- static char *str[] =
- {
- "Quick save ",
- "Safe save ",
- "Do backups -->"};
- static QuickWidget widgets[] =
- {
- {quick_button, 18, DLG_X, 7, DLG_Y, "&Cancel", 0,
- B_CANCEL, 0, 0, XV_WLAY_DONTCARE, "c"},
- {quick_button, 6, DLG_X, 7, DLG_Y, "&Ok", 0,
- B_ENTER, 0, 0, XV_WLAY_DONTCARE, "o"},
- {quick_input, 23, DLG_X, 5, DLG_Y, 0, 9,
- 0, 0, &str_result, XV_WLAY_DONTCARE, "i"},
- {quick_label, 22, DLG_X, 4, DLG_Y, "Extension:", 0,
- 0, 0, 0, XV_WLAY_DONTCARE, "savemext"},
- {quick_radio, 4, DLG_X, 3, DLG_Y, "", 3,
- 0, &save_mode_new, str, XV_WLAY_DONTCARE, "t"},
- {0}};
- static QuickDialog dialog =
-/* NLS ? */
- {DLG_X, DLG_Y, -1, -1, " Edit Save Mode ", "[Edit Save Mode]",
- "esm", widgets};
-
- widgets[2].text = option_backup_ext;
- widgets[4].value = option_save_mode;
- if (quick_dialog (&dialog) != B_ENTER)
- return;
- option_save_mode = save_mode_new;
- option_backup_ext = str_result; /* this is a memory leak */
- option_backup_ext_int = 0;
- str_result[min (strlen (str_result), sizeof (int))] = '\0';
- memcpy ((char *) &option_backup_ext_int, str_result, strlen (option_backup_ext));
-}
-
-#endif
-
-#ifdef MIDNIGHT
-
-void edit_split_filename (WEdit * edit, char *f)
-{
- if (edit->filename)
- free (edit->filename);
- edit->filename = strdup (f);
- if (edit->dir)
- free (edit->dir);
- edit->dir = strdup ("");
-}
-
-#else
-
-void edit_split_filename (WEdit * edit, char *longname)
-{
- char *exp, *p;
- exp = canonicalize_pathname (longname); /* this ensures a full path */
- if (edit->filename)
- free (edit->filename);
- if (edit->dir)
- free (edit->dir);
- p = strrchr (exp, '/');
- edit->filename = strdup (++p);
- *p = 0;
- edit->dir = strdup (exp);
- free (exp);
-}
-
-#endif
-
-/* here we want to warn the user of overwriting an existing file, but only if they
- have made a change to the filename */
-/* returns 1 on success */
-int edit_save_as_cmd (WEdit * edit)
-{
-/* This heads the 'Save As' dialog box */
- char *exp = edit_get_save_file (edit->dir, edit->filename, _(" Save As "));
- int different_filename = 0;
- edit_push_action (edit, KEY_PRESS + edit->start_display);
- edit->force |= REDRAW_COMPLETELY;
-
- if (exp) {
- if (!*exp) {
- free (exp);
- return 0;
- } else {
- if (strcmp(catstrs (edit->dir, edit->filename, 0), exp)) {
- int file;
- different_filename = 1;
- if ((file = open ((char *) exp, O_RDONLY)) != -1) { /* the file exists */
- close (file);
- if (edit_query_dialog2 (_(" Warning "),
- _(" A file already exists with this name. "),
-/* Push buttons to over-write the current file, or cancel the operation */
- _("Overwrite"), _("Cancel")))
- return 0;
- }
- }
- if (edit_save_file (edit, exp)) {
- edit_split_filename (edit, exp);
- free (exp);
- edit->modified = 0;
-#ifdef MIDNIGHT
- edit->delete_file = 0;
-#endif
- if (different_filename && !edit->explicit_syntax)
- edit_load_syntax (edit, 0, 0);
- return 1;
- } else {
- free (exp);
- edit_error_dialog (_(" Save as "), get_sys_error (_(" Error trying to save file. ")));
- return 0;
- }
- }
- } else
- return 0;
-}
-
-/* {{{ Macro stuff starts here */
-
-#ifdef MIDNIGHT
-int raw_callback (struct Dlg_head *h, int key, int Msg)
-{
- switch (Msg) {
- case DLG_DRAW:
- attrset (REVERSE_COLOR);
- dlg_erase (h);
- draw_box (h, 1, 1, h->lines - 2, h->cols - 2);
-
- attrset (COLOR_HOT_NORMAL);
- dlg_move (h, 1, 2);
- printw (h->title);
- break;
-
- case DLG_KEY:
- h->running = 0;
- h->ret_value = key;
- return 1;
- }
- return 0;
-}
-
-/* gets a raw key from the keyboard. Passing cancel = 1 draws
- a cancel button thus allowing c-c etc.. Alternatively, cancel = 0
- will return the next key pressed */
-int edit_raw_key_query (char *heading, char *query, int cancel)
-{
- int w = strlen (query) + 7;
- struct Dlg_head *raw_dlg = create_dlg (0, 0, 7, w, dialog_colors,
-/* NLS ? */
- raw_callback, "[Raw Key Query]",
- "raw_key_input",
- DLG_CENTER | DLG_TRYUP);
- x_set_dialog_title (raw_dlg, heading);
- raw_dlg->raw = 1; /* to return even a tab key */
- if (cancel)
- add_widget (raw_dlg, button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON, "Cancel", 0, 0, 0));
- add_widget (raw_dlg, label_new (3 - cancel, 2, query, 0));
- add_widget (raw_dlg, input_new (3 - cancel, w - 5, INPUT_COLOR, 2, "", 0));
- run_dlg (raw_dlg);
- w = raw_dlg->ret_value;
- destroy_dlg (raw_dlg);
- if (cancel)
- if (w == XCTRL ('g') || w == XCTRL ('c') || w == ESC_CHAR || w == B_CANCEL)
- return 0;
-/* hence ctrl-a (=B_CANCEL), ctrl-g, ctrl-c, and Esc are cannot returned */
- return w;
-}
-
-#else
-
-int edit_raw_key_query (char *heading, char *query, int cancel)
-{
- return CKeySymMod (CRawkeyQuery (0, 0, 0, heading, query));
-}
-
-#endif
-
-/* creates a macro file if it doesn't exist */
-static FILE *edit_open_macro_file (const char *r)
-{
- char *filename;
- int file;
- filename = catstrs (home_dir, MACRO_FILE, 0);
- if ((file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
- return 0;
- close (file);
- return fopen (filename, r);
-}
-
-#define MAX_MACROS 1024
-static int saved_macro[MAX_MACROS + 1] =
-{0, 0};
-static int saved_macros_loaded = 0;
-
-/*
- This is just to stop the macro file be loaded over and over for keys
- that aren't defined to anything. On slow systems this could be annoying.
- */
-int macro_exists (int k)
-{
- int i;
- for (i = 0; i < MAX_MACROS && saved_macro[i]; i++)
- if (saved_macro[i] == k)
- return i;
- return -1;
-}
-
-/* returns 1 on error */
-int edit_delete_macro (WEdit * edit, int k)
-{
- struct macro macro[MAX_MACRO_LENGTH];
- FILE *f, *g;
- int s, i, n, j = 0;
-
- if (saved_macros_loaded)
- if ((j = macro_exists (k)) < 0)
- return 0;
- g = fopen (catstrs (home_dir, TEMP_FILE, 0), "w");
- if (!g) {
-/* This heads the delete macro error dialog box */
- edit_error_dialog (_(" Delete macro "),
-/* 'Open' = load temp file */
- get_sys_error (_(" Error trying to open temp file ")));
- return 1;
- }
- f = edit_open_macro_file ("r");
- if (!f) {
-/* This heads the delete macro error dialog box */
- edit_error_dialog (_(" Delete macro "),
-/* 'Open' = load temp file */
- get_sys_error (_(" Error trying to open macro file ")));
- fclose (g);
- return 1;
- }
- for (;;) {
- n = fscanf (f, _("key '%d 0': "), &s);
- if (!n || n == EOF)
- break;
- n = 0;
- while (fscanf (f, "%hd %hd, ", ¯o[n].command, ¯o[n].ch))
- n++;
- fscanf (f, ";\n");
- if (s != k) {
- fprintf (g, _("key '%d 0': "), s);
- for (i = 0; i < n; i++)
- fprintf (g, "%hd %hd, ", macro[i].command, macro[i].ch);
- fprintf (g, ";\n");
- }
- };
- fclose (f);
- fclose (g);
- if (rename (catstrs (home_dir, TEMP_FILE, 0), catstrs (home_dir, MACRO_FILE, 0)) == -1) {
-/* This heads the delete macro error dialog box */
- edit_error_dialog (_(" Delete macro "),
- get_sys_error (_(" Error trying to overwrite macro file ")));
- return 1;
- }
- if (saved_macros_loaded)
- memmove (saved_macro + j, saved_macro + j + 1, sizeof (int) * (MAX_MACROS - j - 1));
- return 0;
-}
-
-/* returns 0 on error */
-int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n)
-{
- FILE *f;
- int s, i;
-
- edit->force |= REDRAW_COMPLETELY;
- edit_push_action (edit, KEY_PRESS + edit->start_display);
-/* This heads the 'Macro' dialog box */
- s = edit_raw_key_query (_(" Macro "),
-/* Input line for a single key press follows the ':' */
- _(" Press the macro's new hotkey: "), 1);
- if (s) {
- if (edit_delete_macro (edit, s))
- return 0;
- f = edit_open_macro_file ("a+");
- if (f) {
- fprintf (f, _("key '%d 0': "), s);
- for (i = 0; i < n; i++)
- fprintf (f, "%hd %hd, ", macro[i].command, macro[i].ch);
- fprintf (f, ";\n");
- fclose (f);
- if (saved_macros_loaded) {
- for (i = 0; i < MAX_MACROS && saved_macro[i]; i++);
- saved_macro[i] = s;
- }
- return 1;
- } else
-/* This heads the 'Save Macro' dialog box */
- edit_error_dialog (_(" Save macro "), get_sys_error (_(" Error trying to open macro file ")));
- }
- return 0;
-}
-
-void edit_delete_macro_cmd (WEdit * edit)
-{
- int command;
-
-#ifdef MIDNIGHT
- command = CK_Macro (edit_raw_key_query (_(" Delete Macro "), _(" Press macro hotkey: "), 1));
-#else
-/* This heads the 'Delete Macro' dialog box */
- command = CK_Macro (CKeySymMod (CRawkeyQuery (0, 0, 0, _(" Delete Macro "),
-/* Input line for a single key press follows the ':' */
- _(" Press macro hotkey: "))));
-#endif
-
- if (command == CK_Macro (0))
- return;
-
- edit_delete_macro (edit, command - 2000);
-}
-
-/* return 0 on error */
-int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k)
-{
- FILE *f;
- int s, i = 0, found = 0;
-
- if (saved_macros_loaded)
- if (macro_exists (k) < 0)
- return 0;
-
- if ((f = edit_open_macro_file ("r"))) {
- struct macro dummy;
- do {
- int u;
- u = fscanf (f, _("key '%d 0': "), &s);
- if (!u || u == EOF)
- break;
- if (!saved_macros_loaded)
- saved_macro[i++] = s;
- if (!found) {
- *n = 0;
- while (*n < MAX_MACRO_LENGTH && 2 == fscanf (f, "%hd %hd, ", ¯o[*n].command, ¯o[*n].ch))
- (*n)++;
- } else {
- while (2 == fscanf (f, "%hd %hd, ", &dummy.command, &dummy.ch));
- }
- fscanf (f, ";\n");
- if (s == k)
- found = 1;
- } while (!found || !saved_macros_loaded);
- if (!saved_macros_loaded) {
- saved_macro[i] = 0;
- saved_macros_loaded = 1;
- }
- fclose (f);
- return found;
- } else
-/* This heads the 'Load Macro' dialog box */
- edit_error_dialog (_(" Load macro "),
- get_sys_error (_(" Error trying to open macro file ")));
- return 0;
-}
-
-/* }}} Macro stuff starts here */
-
-/* returns 1 on success */
-int edit_save_confirm_cmd (WEdit * edit)
-{
- char *f;
-
- if (edit_confirm_save) {
-#ifdef MIDNIGHT
- f = catstrs (_(" Confirm save file? : "), edit->filename, " ", 0);
-#else
- f = catstrs (_(" Confirm save file? : "), edit->dir, edit->filename, " ", 0);
-#endif
-/* Buttons to 'Confirm save file' query */
- if (edit_query_dialog2 (_(" Save file "), f, _("Save"), _("Cancel")))
- return 0;
- }
- return edit_save_cmd (edit);
-}
-
-
-/* returns 1 on success */
-int edit_save_cmd (WEdit * edit)
-{
- edit->force |= REDRAW_COMPLETELY;
- if (!edit_save_file (edit, catstrs (edit->dir, edit->filename, 0)))
- return edit_save_as_cmd (edit);
- edit->modified = 0;
-#ifdef MIDNIGHT
- edit->delete_file = 0;
-#endif
-
- return 1;
-}
-
-
-/* returns 1 on success */
-int edit_new_cmd (WEdit * edit)
-{
- edit->force |= REDRAW_COMPLETELY;
- if (edit->modified)
- if (edit_query_dialog2 (_(" Warning "), _(" Current text was modified without a file save. \n Continue discards these changes. "), _("Continue"), _("Cancel")))
- return 0;
- edit->modified = 0;
- return edit_renew (edit); /* if this gives an error, something has really screwed up */
-}
-
-int edit_load_cmd (WEdit * edit)
-{
- char *exp;
- edit->force |= REDRAW_COMPLETELY;
-
- if (edit->modified)
- if (edit_query_dialog2 (_(" Warning "), _(" Current text was modified without a file save. \n Continue discards these changes. "), _("Continue"), _("Cancel")))
- return 0;
-
- exp = edit_get_load_file (edit->dir, edit->filename, _(" Load "));
-
- if (exp) {
- if (!*exp) {
- free (exp);
- } else {
- int file;
- if ((file = open ((char *) exp, O_RDONLY, MY_O_TEXT)) != -1) {
- close (file);
- edit_reload (edit, exp, 0, "", 0);
- edit_split_filename (edit, exp);
- free (exp);
- edit->modified = 0;
- return 1;
- } else {
- free (exp);
-/* Heads the 'Load' file dialog box */
- edit_error_dialog (_(" Load "), get_sys_error (_(" Error trying to open file for reading ")));
- }
- }
- }
- return 0;
-}
-
-/*
- if mark2 is -1 then marking is from mark1 to the cursor.
- Otherwise its between the markers. This handles this.
- Returns 1 if no text is marked.
- */
-int eval_marks (WEdit * edit, long *start_mark, long *end_mark)
-{
- if (edit->mark1 != edit->mark2) {
- if (edit->mark2 >= 0) {
- *start_mark = min (edit->mark1, edit->mark2);
- *end_mark = max (edit->mark1, edit->mark2);
- } else {
- *start_mark = min (edit->mark1, edit->curs1);
- *end_mark = max (edit->mark1, edit->curs1);
- edit->column2 = edit->curs_col;
- }
- return 0;
- } else {
- *start_mark = *end_mark = 0;
- edit->column2 = edit->column1 = 0;
- return 1;
- }
-}
-
-/*Block copy, move and delete commands */
-
-void edit_block_copy_cmd (WEdit * edit)
-{
- long start_mark, end_mark, current = edit->curs1;
- long count;
- char *copy_buf;
-
- if (eval_marks (edit, &start_mark, &end_mark))
- return;
-
-
- copy_buf = malloc (end_mark - start_mark);
-
-/* all that gets pushed are deletes hence little space is used on the stack */
-
- edit_push_markers (edit);
-
- count = start_mark;
- while (count < end_mark) {
- copy_buf[end_mark - count - 1] = edit_get_byte (edit, count);
- count++;
- }
- while (count-- > start_mark) {
- edit_insert_ahead (edit, copy_buf[end_mark - count - 1]);
- }
- free (copy_buf);
- edit_scroll_screen_over_cursor (edit);
-
- if (start_mark < current && end_mark > current)
- edit_set_markers (edit, start_mark, end_mark + end_mark - start_mark, 0, 0);
-
- edit->force |= REDRAW_PAGE;
-}
-
-
-void edit_block_move_cmd (WEdit * edit)
-{
- long count;
- long current;
- char *copy_buf;
- long start_mark, end_mark;
-
- if (eval_marks (edit, &start_mark, &end_mark))
- return;
-
- if (start_mark <= edit->curs1 && end_mark >= edit->curs1)
- return;
-
- if ((end_mark - start_mark) > option_max_undo / 2)
- if (edit_query_dialog2 (_(" Warning "), _(" Block is large, you may not be able to undo this action. "), _("Continue"), _("Cancel")))
- return;
-
- copy_buf = malloc (end_mark - start_mark);
-
- edit_push_markers (edit);
-
- current = edit->curs1;
- edit_cursor_move (edit, start_mark - edit->curs1);
- edit_scroll_screen_over_cursor (edit);
-
- count = start_mark;
- while (count < end_mark) {
- copy_buf[end_mark - count - 1] = edit_delete (edit);
- count++;
- }
- edit_scroll_screen_over_cursor (edit);
-
- edit_cursor_move (edit, current - edit->curs1
- - (((current - edit->curs1) > 0) ? end_mark - start_mark : 0));
- edit_scroll_screen_over_cursor (edit);
-
- while (count-- > start_mark) {
- edit_insert_ahead (edit, copy_buf[end_mark - count - 1]);
- edit_set_markers (edit, edit->curs1, edit->curs1 + end_mark - start_mark, 0, 0);
- }
- edit_scroll_screen_over_cursor (edit);
-
- free (copy_buf);
- edit->force |= REDRAW_PAGE;
-}
-
-void edit_cursor_to_bol (WEdit * edit);
-
-extern int column_highlighting;
-
-void edit_delete_column_of_text (WEdit * edit)
-{
- long p, q, r, m1, m2;
- int b, c, d, fin;
-
- eval_marks (edit, &m1, &m2);
- c = edit_move_forward3 (edit, edit_bol (edit, m1), 0, m1);
- d = edit_move_forward3 (edit, edit_bol (edit, m2), 0, m2);
-
- b = min (c, d);
- c = max (c, d);
-
- fin = 0;
- while (!fin) {
- eval_marks (edit, &m1, &m2);
- r = edit_bol (edit, edit->curs1);
- p = edit_move_forward3 (edit, r, b, 0);
- q = edit_move_forward3 (edit, r, c, 0);
- if (p < m1)
- p = m1;
- if (q >= m2) {
- q = m2;
- fin = 1;
- }
- edit_cursor_move (edit, p - edit->curs1);
- while (p != q) { /* delete line between margins */
- if (edit_get_byte (edit, edit->curs1) != '\n')
- edit_delete (edit);
- q--;
- }
- if (!fin) /* next line */
- edit_cursor_move (edit, edit_move_forward (edit, edit->curs1, 1, 0) - edit->curs1);
- }
-}
-
-/* returns 1 if canceelled by user */
-int edit_block_delete_cmd (WEdit * edit)
-{
- long count;
- long start_mark, end_mark;
-
- if (eval_marks (edit, &start_mark, &end_mark)) {
- start_mark = edit_bol (edit, edit->curs1);
- end_mark = edit_eol (edit, edit->curs1) + 1;
- }
- if ((end_mark - start_mark) > option_max_undo / 2)
-/* Warning message with a query to continue or cancel the operation */
- if (edit_query_dialog2 (_(" Warning "), _(" Block is large, you may not be able to undo this action. "), _(" Continue "), _(" Cancel ")))
- return 1;
-
- edit_push_markers (edit);
-
- edit_cursor_move (edit, start_mark - edit->curs1);
- edit_scroll_screen_over_cursor (edit);
-
- count = start_mark;
- if (start_mark < end_mark) {
- if (column_highlighting) {
- edit_delete_column_of_text (edit);
- } else {
- while (count < end_mark) {
- edit_delete (edit);
- count++;
- }
- }
- }
- edit_set_markers (edit, 0, 0, 0, 0);
- edit->force |= REDRAW_PAGE;
-
- return 0;
-}
-
-
-#ifdef MIDNIGHT
-
-#define INPUT_INDEX 9
-#define SEARCH_DLG_HEIGHT 10
-#define REPLACE_DLG_HEIGHT 15
-#define B_REPLACE_ALL B_USER+1
-#define B_SKIP_REPLACE B_USER+2
-
-int edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
-{
- if (replace_prompt) {
- QuickWidget quick_widgets[] =
- {
-/* NLS for hotkeys? */
- {quick_button, 14, 18, 3, 6, "&Cancel", 0, B_CANCEL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 9, 18, 3, 6, "Replace &all", 0, B_REPLACE_ALL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 6, 18, 3, 6, "&Skip", 0, B_SKIP_REPLACE, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 2, 18, 3, 6, "&Replace", 0, B_ENTER, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_label, 2, 50, 2, 6, 0,
- 0, 0, 0, XV_WLAY_DONTCARE, 0},
- {0}};
-
- quick_widgets[4].text = catstrs (_(" Replace with: "), replace_text, 0);
-
- {
- QuickDialog Quick_input =
- {66, 6, 0, 0, N_(" Replace "),
- "[Input Line Keys]", "quick_input", 0 /*quick_widgets */ };
-
- Quick_input.widgets = quick_widgets;
-
- Quick_input.xpos = xpos;
- Quick_input.ypos = ypos;
- return quick_dialog (&Quick_input);
- }
- } else
- return 0;
-}
-
-
-
-void edit_replace_dialog (WEdit * edit, char **search_text, char **replace_text, char **arg_order)
-{
- int treplace_scanf = replace_scanf;
- int treplace_regexp = replace_regexp;
- int treplace_all = replace_all;
- int treplace_prompt = replace_prompt;
- int treplace_backwards = replace_backwards;
- int treplace_whole = replace_whole;
- int treplace_case = replace_case;
-
- char *tsearch_text;
- char *treplace_text;
- char *targ_order;
- QuickWidget quick_widgets[] =
- {
- {quick_button, 6, 10, 12, REPLACE_DLG_HEIGHT, "&Cancel", 0, B_CANCEL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 2, 10, 12, REPLACE_DLG_HEIGHT, "&Ok", 0, B_ENTER, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 25, 50, 11, REPLACE_DLG_HEIGHT, "Scanf &expression", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 25, 50, 10, REPLACE_DLG_HEIGHT, "Replace &all", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 25, 50, 9, REPLACE_DLG_HEIGHT, "Pr&ompt on replace", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 11, REPLACE_DLG_HEIGHT, "&Backwards", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 10, REPLACE_DLG_HEIGHT, "&Regular exprssn", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 9, REPLACE_DLG_HEIGHT, "&Whole words only", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 8, REPLACE_DLG_HEIGHT, "Case &sensitive", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_input, 3, 50, 7, REPLACE_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "edit-argord"},
- {quick_label, 2, 50, 6, REPLACE_DLG_HEIGHT, " Enter replacement argument order eg. 3,2,1,4 ", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, 0},
- {quick_input, 3, 50, 5, REPLACE_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "edit-replace"},
- {quick_label, 2, 50, 4, REPLACE_DLG_HEIGHT, " Enter replacement string", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {quick_input, 3, 50, 3, REPLACE_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "edit-search"},
- {quick_label, 2, 50, 2, REPLACE_DLG_HEIGHT, " Enter search string", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {0}};
-
- quick_widgets[2].result = &treplace_scanf;
- quick_widgets[3].result = &treplace_all;
- quick_widgets[4].result = &treplace_prompt;
- quick_widgets[5].result = &treplace_backwards;
- quick_widgets[6].result = &treplace_regexp;
- quick_widgets[7].result = &treplace_whole;
- quick_widgets[8].result = &treplace_case;
- quick_widgets[9].str_result = &targ_order;
- quick_widgets[9].text = *arg_order;
- quick_widgets[11].str_result = &treplace_text;
- quick_widgets[11].text = *replace_text;
- quick_widgets[13].str_result = &tsearch_text;
- quick_widgets[13].text = *search_text;
- {
- QuickDialog Quick_input =
- {50, REPLACE_DLG_HEIGHT, -1, 0, N_(" Replace "),
- "[Input Line Keys]", "quick_input", 0 /*quick_widgets */ };
-
- Quick_input.widgets = quick_widgets;
-
- if (quick_dialog (&Quick_input) != B_CANCEL) {
- *arg_order = *(quick_widgets[INPUT_INDEX].str_result);
- *replace_text = *(quick_widgets[INPUT_INDEX + 2].str_result);
- *search_text = *(quick_widgets[INPUT_INDEX + 4].str_result);
- replace_scanf = treplace_scanf;
- replace_backwards = treplace_backwards;
- replace_regexp = treplace_regexp;
- replace_all = treplace_all;
- replace_prompt = treplace_prompt;
- replace_whole = treplace_whole;
- replace_case = treplace_case;
- return;
- } else {
- *arg_order = NULL;
- *replace_text = NULL;
- *search_text = NULL;
- return;
- }
- }
-}
-
-
-void edit_search_dialog (WEdit * edit, char **search_text)
-{
- int treplace_scanf = replace_scanf;
- int treplace_regexp = replace_regexp;
- int treplace_whole = replace_whole;
- int treplace_case = replace_case;
- int treplace_backwards = replace_backwards;
-
- char *tsearch_text;
- QuickWidget quick_widgets[] =
- {
- {quick_button, 6, 10, 7, SEARCH_DLG_HEIGHT, "&Cancel", 0, B_CANCEL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 2, 10, 7, SEARCH_DLG_HEIGHT, "&Ok", 0, B_ENTER, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 25, 50, 6, SEARCH_DLG_HEIGHT, "Scanf &expression", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL },
- {quick_checkbox, 25, 50, 5, SEARCH_DLG_HEIGHT, "&Backwards", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 6, SEARCH_DLG_HEIGHT, "&Regular exprssn", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 5, SEARCH_DLG_HEIGHT, "&Whole words only", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_checkbox, 4, 50, 4, SEARCH_DLG_HEIGHT, "Case &sensitive", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {quick_input, 3, 50, 3, SEARCH_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "edit-search"},
- {quick_label, 2, 50, 2, SEARCH_DLG_HEIGHT, " Enter search string", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {0}};
-
- quick_widgets[2].result = &treplace_scanf;
- quick_widgets[3].result = &treplace_backwards;
- quick_widgets[4].result = &treplace_regexp;
- quick_widgets[5].result = &treplace_whole;
- quick_widgets[6].result = &treplace_case;
- quick_widgets[7].str_result = &tsearch_text;
- quick_widgets[7].text = *search_text;
-
- {
- QuickDialog Quick_input =
- {50, SEARCH_DLG_HEIGHT, -1, 0, N_(" Search "),
- "[Input Line Keys]", "quick_input", 0 /*quick_widgets */ };
-
- Quick_input.widgets = quick_widgets;
-
- if (quick_dialog (&Quick_input) != B_CANCEL) {
- *search_text = *(quick_widgets[7].str_result);
- replace_scanf = treplace_scanf;
- replace_backwards = treplace_backwards;
- replace_regexp = treplace_regexp;
- replace_whole = treplace_whole;
- replace_case = treplace_case;
- return;
- } else {
- *search_text = NULL;
- return;
- }
- }
-}
-
-
-#else
-
-#define B_ENTER 0
-#define B_SKIP_REPLACE 1
-#define B_REPLACE_ALL 2
-#define B_CANCEL 3
-
-extern CWidget *wedit;
-
-void edit_search_replace_dialog (Window parent, int x, int y, char **search_text, char **replace_text, char **arg_order, char *heading, int option)
-{
- Window win;
- XEvent xev;
- CEvent cev;
- CState s;
- int xh, yh, h, xb, ys, yc, yb, yr;
- CWidget *m;
-
- CBackupState (&s);
- CDisable ("*");
-
- win = CDrawHeadedDialog ("replace", parent, x, y, heading);
- CGetHintPos (&xh, &h);
-
-/* NLS hotkey ? */
- CIdent ("replace")->position = WINDOW_ALWAYS_RAISED;
-/* An input line comes after the ':' */
- (CDrawText ("replace.t1", win, xh, h, _(" Enter search text : ")))->hotkey = 'E';
-
- CGetHintPos (0, &yh);
- (m = CDrawTextInput ("replace.sinp", win, xh, yh, 10, AUTO_HEIGHT, 256, *search_text))->hotkey = 'E';
-
- if (replace_text) {
- CGetHintPos (0, &yh);
- (CDrawText ("replace.t2", win, xh, yh, _(" Enter replace text : ")))->hotkey = 'n';
- CGetHintPos (0, &yh);
- (CDrawTextInput ("replace.rinp", win, xh, yh, 10, AUTO_HEIGHT, 256, *replace_text))->hotkey = 'n';
- CGetHintPos (0, &yh);
- (CDrawText ("replace.t3", win, xh, yh, _(" Enter argument order : ")))->hotkey = 'o';
- CGetHintPos (0, &yh);
- (CDrawTextInput ("replace.ainp", win, xh, yh, 10, AUTO_HEIGHT, 256, *arg_order))->hotkey = 'o';
-/* Tool hint */
- CSetToolHint ("replace.ainp", _("Enter the order of replacement of your scanf format specifiers"));
- CSetToolHint ("replace.t3", _("Enter the order of replacement of your scanf format specifiers"));
- }
- CGetHintPos (0, &yh);
- ys = yh;
-/* The following are check boxes */
- CDrawSwitch ("replace.ww", win, xh, yh, replace_whole, _(" Whole words only "), 0);
- CGetHintPos (0, &yh);
- CDrawSwitch ("replace.case", win, xh, yh, replace_case, _(" Case sensitive "), 0);
- yc = yh;
- CGetHintPos (0, &yh);
- CDrawSwitch ("replace.reg", win, xh, yh, replace_regexp, _(" Regular expression "), 1);
- CSetToolHint ("replace.reg", _("See the regex man page for how to compose a regular expression"));
- CSetToolHint ("replace.reg.label", _("See the regex man page for how to compose a regular expression"));
- yb = yh;
- CGetHintPos (0, &yh);
- CGetHintPos (&xb, 0);
-
- if (option & SEARCH_DIALOG_OPTION_BACKWARDS) {
- CDrawSwitch ("replace.bkwd", win, xh, yh, replace_backwards, _(" Backwards "), 0);
-/* Tool hint */
- CSetToolHint ("replace.bkwd", _("Warning: Searching backward can be slow"));
- CSetToolHint ("replace.bkwd.label", _("Warning: Searching backward can be slow"));
- yb = yh;
- }
- if (replace_text) {
- if (option & SEARCH_DIALOG_OPTION_BACKWARDS)
- yr = yc;
- else
- yr = ys;
- } else {
- yr = yb;
- }
-
- if (replace_text) {
- CDrawSwitch ("replace.pr", win, xb, yr, replace_prompt, _(" Prompt on replace "), 0);
-/* Tool hint */
- CSetToolHint ("replace.pr", _("Ask before making each replacement"));
- CGetHintPos (0, &yr);
- CDrawSwitch ("replace.all", win, xb, yr, replace_all, _(" Replace all "), 0);
- CGetHintPos (0, &yr);
- }
- CDrawSwitch ("replace.scanf", win, xb, yr, replace_scanf, _(" Scanf expression "), 1);
-/* Tool hint */
- CSetToolHint ("replace.scanf", _("Allows entering of a C format string, see the scanf man page"));
-
- get_hint_limits (&x, &y);
- CDrawPixmapButton ("replace.ok", win, x - WIDGET_SPACING - TICK_BUTTON_WIDTH, h, PIXMAP_BUTTON_TICK);
-/* Tool hint */
- CSetToolHint ("replace.ok", _("Begin search, Enter"));
- CDrawPixmapButton ("replace.cancel", win, x - WIDGET_SPACING - TICK_BUTTON_WIDTH, h + WIDGET_SPACING + TICK_BUTTON_WIDTH, PIXMAP_BUTTON_CROSS);
-/* Tool hint */
- CSetToolHint ("replace.cancel", _("Abort this dialog, Esc"));
- CSetSizeHintPos ("replace");
- CMapDialog ("replace");
-
- m = CIdent ("replace");
- CSetWidgetSize ("replace.sinp", m->width - WIDGET_SPACING * 3 - 4 - TICK_BUTTON_WIDTH, (CIdent ("replace.sinp"))->height);
- if (replace_text) {
- CSetWidgetSize ("replace.rinp", m->width - WIDGET_SPACING * 3 - 4 - TICK_BUTTON_WIDTH, (CIdent ("replace.rinp"))->height);
- CSetWidgetSize ("replace.ainp", m->width - WIDGET_SPACING * 3 - 4 - TICK_BUTTON_WIDTH, (CIdent ("replace.ainp"))->height);
- }
- CFocus (CIdent ("replace.sinp"));
-
- for (;;) {
- CNextEvent (&xev, &cev);
- if (!CIdent ("replace")) {
- *search_text = 0;
- break;
- }
- if (!strcmp (cev.ident, "replace.cancel") || cev.command == CK_Cancel) {
- *search_text = 0;
- break;
- }
- if (!strcmp (cev.ident, "replace.reg") || !strcmp (cev.ident, "replace.scanf")) {
- if (CIdent ("replace.reg")->keypressed || CIdent ("replace.scanf")->keypressed) {
- if (!(CIdent ("replace.case")->keypressed)) {
- CIdent ("replace.case")->keypressed = 1;
- CExpose ("replace.case");
- }
- }
- }
- if (!strcmp (cev.ident, "replace.ok") || cev.command == CK_Enter) {
- if (replace_text) {
- replace_all = CIdent ("replace.all")->keypressed;
- replace_prompt = CIdent ("replace.pr")->keypressed;
- *replace_text = strdup (CIdent ("replace.rinp")->text);
- *arg_order = strdup (CIdent ("replace.ainp")->text);
- }
- *search_text = strdup (CIdent ("replace.sinp")->text);
- replace_whole = CIdent ("replace.ww")->keypressed;
- replace_case = CIdent ("replace.case")->keypressed;
- replace_scanf = CIdent ("replace.scanf")->keypressed;
- replace_regexp = CIdent ("replace.reg")->keypressed;
-
- if (option & SEARCH_DIALOG_OPTION_BACKWARDS) {
- replace_backwards = CIdent ("replace.bkwd")->keypressed;
- } else {
- replace_backwards = 0;
- }
-
- break;
- }
- }
- CDestroyWidget ("replace");
- CRestoreState (&s);
-}
-
-
-
-void edit_search_dialog (WEdit * edit, char **search_text)
-{
-/* Heads the 'Search' dialog box */
- edit_search_replace_dialog (WIN_MESSAGES, search_text, 0, 0, _(" Search "), SEARCH_DIALOG_OPTION_BACKWARDS);
-}
-
-void edit_replace_dialog (WEdit * edit, char **search_text, char **replace_text, char **arg_order)
-{
-/* Heads the 'Replace' dialog box */
- edit_search_replace_dialog (WIN_MESSAGES, search_text, replace_text, arg_order, _(" Replace "), SEARCH_DIALOG_OPTION_BACKWARDS);
-}
-
-int edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
-{
- if (replace_prompt) {
- int q;
- char *p, *r = 0;
- r = p = malloc (strlen (replace_text) + NUM_REPL_ARGS * 2);
- strcpy (p, replace_text);
- while ((p = strchr (p, '%'))) { /* convert "%" to "%%" so no convertion is attempted */
- memmove (p + 2, p + 1, strlen (p) + 1);
- *(++p) = '%';
- p++;
- }
- edit->force |= REDRAW_COMPLETELY;
- q = edit_query_dialog4 (_(" Replace "),
-/* This is for the confirm replace dialog box. The replaced string comes after the ':' */
- catstrs (_(" Replace with: "), r, 0),
-/* Buttons for the confirm replace dialog box. */
- _("Replace"), _("Skip"), _("Replace all"), _("Cancel"));
- if (r)
- free (r);
- switch (q) {
- case 0:
- return B_ENTER;
- case 1:
- return B_SKIP_REPLACE;
- case 2:
- return B_REPLACE_ALL;
- case -1:
- case 3:
- return B_CANCEL;
- }
- }
- return 0;
-}
-
-
-#endif
-
-long sargs[NUM_REPL_ARGS][256 / sizeof (long)];
-
-#define SCANF_ARGS sargs[0], sargs[1], sargs[2], sargs[3], \
- sargs[4], sargs[5], sargs[6], sargs[7], \
- sargs[8], sargs[9], sargs[10], sargs[11], \
- sargs[12], sargs[13], sargs[14], sargs[15]
-
-#define PRINTF_ARGS sargs[argord[0]], sargs[argord[1]], sargs[argord[2]], sargs[argord[3]], \
- sargs[argord[4]], sargs[argord[5]], sargs[argord[6]], sargs[argord[7]], \
- sargs[argord[8]], sargs[argord[9]], sargs[argord[10]], sargs[argord[11]], \
- sargs[argord[12]], sargs[argord[13]], sargs[argord[14]], sargs[argord[15]]
-
-/* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */
-/* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */
-int string_regexp_search (char *pattern, char *string, int len, int match_type, int match_bol, int icase, int *found_len)
-{
- static regex_t r;
- regmatch_t pmatch[1];
- static char *old_pattern = NULL;
- static int old_type, old_icase;
-
- if (!old_pattern || strcmp (old_pattern, pattern) || old_type != match_type || old_icase != icase) {
- if (old_pattern) {
- regfree (&r);
- free (old_pattern);
- old_pattern = 0;
- }
- if (regcomp (&r, pattern, REG_EXTENDED | (icase ? REG_ICASE : 0))) {
- *found_len = 0;
- return -3;
- }
- old_pattern = strdup (pattern);
- old_type = match_type;
- old_icase = icase;
- }
- if (regexec (&r, string, 1, pmatch, ((match_bol || match_type != match_normal) ? 0 : REG_NOTBOL)) != 0) {
- *found_len = 0;
- return -1;
- }
- *found_len = pmatch[0].rm_eo - pmatch[0].rm_so;
- return (pmatch[0].rm_so);
-}
-
-/* thanks to Liviu Daia for getting this
- (and the above) routines to work properly - paul */
-
-long edit_find_string (long start, unsigned char *exp, int *len, long last_byte, int (*get_byte) (void *, long), void *data, int once_only)
-{
- long p, q = 0;
- long l = strlen ((char *) exp), f = 0;
- int n = 0;
-
- for (p = 0; p < l; p++) /* count conversions... */
- if (exp[p] == '%')
- if (exp[++p] != '%') /* ...except for "%%" */
- n++;
-
- if (replace_scanf || replace_regexp) {
- int c;
- unsigned char *buf;
- unsigned char mbuf[MAX_REPL_LEN * 2 + 3];
-
- replace_scanf = (!replace_regexp); /* can't have both */
-
- buf = mbuf;
-
- if (replace_scanf) {
- unsigned char e[MAX_REPL_LEN];
- if (n >= NUM_REPL_ARGS)
- return -3;
-
- if (replace_case) {
- for (p = start; p < last_byte && p < start + MAX_REPL_LEN; p++)
- buf[p - start] = (*get_byte) (data, p);
- } else {
- for (p = 0; exp[p] != 0; p++)
- exp[p] = my_lower_case (exp[p]);
- for (p = start; p < last_byte && p < start + MAX_REPL_LEN; p++) {
- c = (*get_byte) (data, p);
- buf[p - start] = my_lower_case (c);
- }
- }
-
- buf[(q = p - start)] = 0;
- strcpy ((char *) e, (char *) exp);
- strcat ((char *) e, "%n");
- exp = e;
-
- while (q) {
- *((int *) sargs[n]) = 0; /* --> here was the problem - now fixed: good */
- if (n == sscanf ((char *) buf, (char *) exp, SCANF_ARGS)) {
- if (*((int *) sargs[n])) {
- *len = *((int *) sargs[n]);
- return start;
- }
- }
- if (once_only)
- return -2;
- if (q + start < last_byte) {
- if (replace_case) {
- buf[q] = (*get_byte) (data, q + start);
- } else {
- c = (*get_byte) (data, q + start);
- buf[q] = my_lower_case (c);
- }
- q++;
- }
- buf[q] = 0;
- start++;
- buf++; /* move the window along */
- if (buf == mbuf + MAX_REPL_LEN) { /* the window is about to go past the end of array, so... */
- memmove (mbuf, buf, strlen ((char *) buf) + 1); /* reset it */
- buf = mbuf;
- }
- q--;
- }
- } else { /* regexp matching */
- long offset = 0;
- int found_start, match_bol, move_win = 0;
-
- while (start + offset < last_byte) {
- match_bol = (offset == 0 || (*get_byte) (data, start + offset - 1) == '\n');
- if (!move_win) {
- p = start + offset;
- q = 0;
- }
- for (; p < last_byte && q < MAX_REPL_LEN; p++, q++) {
- mbuf[q] = (*get_byte) (data, p);
- if (mbuf[q] == '\n')
- break;
- }
- q++;
- offset += q;
- mbuf[q] = 0;
-
- buf = mbuf;
- while (q) {
- found_start = string_regexp_search ((char *) exp, (char *) buf, q, match_normal, match_bol, !replace_case, len);
-
- if (found_start <= -2) { /* regcomp/regexec error */
- *len = 0;
- return -3;
- }
- else if (found_start == -1) /* not found: try next line */
- break;
- else if (*len == 0) { /* null pattern: try again at next character */
- q--;
- buf++;
- match_bol = 0;
- continue;
- }
- else /* found */
- return (start + offset - q + found_start);
- }
- if (once_only)
- return -2;
-
- if (buf[q - 1] != '\n') { /* incomplete line: try to recover */
- buf = mbuf + MAX_REPL_LEN / 2;
- q = strlen ((char *) buf);
- memmove (mbuf, buf, q);
- p = start + q;
- move_win = 1;
- }
- else
- move_win = 0;
- }
- }
- } else {
- *len = strlen ((char *) exp);
- if (replace_case) {
- for (p = start; p <= last_byte - l; p++) {
- if ((*get_byte) (data, p) == (unsigned char)exp[0]) { /* check if first char matches */
- for (f = 0, q = 0; q < l && f < 1; q++)
- if ((*get_byte) (data, q + p) != (unsigned char)exp[q])
- f = 1;
- if (f == 0)
- return p;
- }
- if (once_only)
- return -2;
- }
- } else {
- for (p = 0; exp[p] != 0; p++)
- exp[p] = my_lower_case (exp[p]);
-
- for (p = start; p <= last_byte - l; p++) {
- if (my_lower_case ((*get_byte) (data, p)) == (unsigned char)exp[0]) {
- for (f = 0, q = 0; q < l && f < 1; q++)
- if (my_lower_case ((*get_byte) (data, q + p)) != (unsigned char)exp[q])
- f = 1;
- if (f == 0)
- return p;
- }
- if (once_only)
- return -2;
- }
- }
- }
- return -2;
-}
-
-
-long edit_find_forwards (long search_start, unsigned char *exp, int *len, long last_byte, int (*get_byte) (void *, long), void *data, int once_only)
-{ /*front end to find_string to check for
- whole words */
- long p;
- p = search_start;
-
- while ((p = edit_find_string (p, exp, len, last_byte, get_byte, data, once_only)) >= 0) {
- if (replace_whole) {
-/*If the bordering chars are not in option_whole_chars_search then word is whole */
- if (!strcasechr (option_whole_chars_search, (*get_byte) (data, p - 1))
- && !strcasechr (option_whole_chars_search, (*get_byte) (data, p + *len)))
- return p;
- if (once_only)
- return -2;
- } else
- return p;
- if (once_only)
- break;
- p++; /*not a whole word so continue search. */
- }
- return p;
-}
-
-long edit_find (long search_start, unsigned char *exp, int *len, long last_byte, int (*get_byte) (void *, long), void *data)
-{
- long p;
- if (replace_backwards) {
- while (search_start >= 0) {
- p = edit_find_forwards (search_start, exp, len, last_byte, get_byte, data, 1);
- if (p == search_start)
- return p;
- search_start--;
- }
- } else {
- return edit_find_forwards (search_start, exp, len, last_byte, get_byte, data, 0);
- }
- return -2;
-}
-
-#define is_digit(x) ((x) >= '0' && (x) <= '9')
-
-#define snprintf(v) { \
- *p1++ = *p++; \
- *p1++ = '%'; \
- *p1++ = 'n'; \
- *p1 = '\0'; \
- sprintf(s,q1,v,&n); \
- s += n; \
- }
-
-/* this function uses the sprintf command to do a vprintf */
-/* it takes pointers to arguments instead of the arguments themselves */
-int sprintf_p (char *str, const char *fmt,...)
-{
- va_list ap;
- int n;
- char *q, *p, *s = str;
- char q1[32];
- char *p1;
-
- va_start (ap, fmt);
- p = q = (char *) fmt;
-
- while ((p = strchr (p, '%'))) {
- n = (int) ((unsigned long) p - (unsigned long) q);
- strncpy (s, q, n); /* copy stuff between format specifiers */
- s += n;
- *s = 0;
- q = p;
- p1 = q1;
- *p1++ = *p++;
- if (*p == '%') {
- p++;
- *s++ = '%';
- q = p;
- continue;
- }
- if (*p == 'n') {
- p++;
-/* do nothing */
- q = p;
- continue;
- }
- if (*p == '#')
- *p1++ = *p++;
- if (*p == '0')
- *p1++ = *p++;
- if (*p == '-')
- *p1++ = *p++;
- if (*p == '+')
- *p1++ = *p++;
- if (*p == '*') {
- p++;
- strcpy (p1, itoa (*va_arg (ap, int *))); /* replace field width with a number */
- p1 += strlen (p1);
- } else {
- while (is_digit (*p))
- *p1++ = *p++;
- }
- if (*p == '.')
- *p1++ = *p++;
- if (*p == '*') {
- p++;
- strcpy (p1, itoa (*va_arg (ap, int *))); /* replace precision with a number */
- p1 += strlen (p1);
- } else {
- while (is_digit (*p))
- *p1++ = *p++;
- }
-/* flags done, now get argument */
- if (*p == 's') {
- snprintf (va_arg (ap, char *));
- } else if (*p == 'h') {
- if (strchr ("diouxX", *p))
- snprintf (*va_arg (ap, short *));
- } else if (*p == 'l') {
- *p1++ = *p++;
- if (strchr ("diouxX", *p))
- snprintf (*va_arg (ap, long *));
- } else if (strchr ("cdiouxX", *p)) {
- snprintf (*va_arg (ap, int *));
- } else if (*p == 'L') {
- *p1++ = *p++;
- if (strchr ("EefgG", *p))
- snprintf (*va_arg (ap, double *)); /* should be long double */
- } else if (strchr ("EefgG", *p)) {
- snprintf (*va_arg (ap, double *));
- } else if (strchr ("DOU", *p)) {
- snprintf (*va_arg (ap, long *));
- } else if (*p == 'p') {
- snprintf (*va_arg (ap, void **));
- }
- q = p;
- }
- va_end (ap);
- sprintf (s, q); /* print trailing leftover */
- return (unsigned long) s - (unsigned long) str + strlen (s);
-}
-
-static void regexp_error (WEdit *edit)
-{
-/* "Error: Syntax error in regular expression, or scanf expression contained too many %'s */
- edit_error_dialog (_(" Error "), _(" Invalid regular expression, or scanf expression with to many conversions "));
-}
-
-/* call with edit = 0 before shutdown to close memory leaks */
-void edit_replace_cmd (WEdit * edit, int again)
-{
- static char *old1 = NULL;
- static char *old2 = NULL;
- static char *old3 = NULL;
- char *exp1 = "";
- char *exp2 = "";
- char *exp3 = "";
- int replace_yes;
- int replace_continue;
- int i = 0;
- long times_replaced = 0, last_search;
- char fin_string[32];
- int argord[NUM_REPL_ARGS];
-
- if (!edit) {
- if (old1) {
- free (old1);
- old1 = 0;
- }
- if (old2) {
- free (old2);
- old2 = 0;
- }
- if (old3) {
- free (old3);
- old3 = 0;
- }
- return;
- }
-
- last_search = edit->last_byte;
-
- edit->force |= REDRAW_COMPLETELY;
-
- exp1 = old1 ? old1 : exp1;
- exp2 = old2 ? old2 : exp2;
- exp3 = old3 ? old3 : exp3;
-
- if (again) {
- if (!old1 || !old2)
- return;
- exp1 = strdup (old1);
- exp2 = strdup (old2);
- exp3 = strdup (old3);
- } else {
- edit_push_action (edit, KEY_PRESS + edit->start_display);
- edit_replace_dialog (edit, &exp1, &exp2, &exp3);
- }
-
- if (!exp1 || !*exp1) {
- edit->force = REDRAW_COMPLETELY;
- if (exp1) {
- free (exp1);
- free (exp2);
- free (exp3);
- }
- return;
- }
- if (old1)
- free (old1);
- if (old2)
- free (old2);
- if (old3)
- free (old3);
- old1 = strdup (exp1);
- old2 = strdup (exp2);
- old3 = strdup (exp3);
-
- {
- char *s;
- int ord;
- while ((s = strchr (exp3, ' ')))
- memmove (s, s + 1, strlen (s));
- s = exp3;
- for (i = 0; i < NUM_REPL_ARGS; i++) {
- if ((unsigned long) s != 1 && s < exp3 + strlen (exp3)) {
- if ((ord = atoi (s)))
- argord[i] = ord - 1;
- else
- argord[i] = i;
- s = strchr (s, ',') + 1;
- } else
- argord[i] = i;
- }
- }
-
- replace_continue = replace_all;
-
- if (edit->found_len && edit->search_start == edit->found_start + 1 && replace_backwards)
- edit->search_start--;
-
- if (edit->found_len && edit->search_start == edit->found_start - 1 && !replace_backwards)
- edit->search_start++;
-
- do {
- int len = 0;
- long new_start;
- new_start = edit_find (edit->search_start, (unsigned char *) exp1, &len, last_search,
- (int (*) (void *, long)) edit_get_byte, (void *) edit);
- if (new_start == -3) {
- regexp_error (edit);
- break;
- }
- edit->search_start = new_start;
- /*returns negative on not found or error in pattern */
-
- if (edit->search_start >= 0) {
- edit->found_start = edit->search_start;
- i = edit->found_len = len;
-
- edit_cursor_move (edit, edit->search_start - edit->curs1);
- edit_scroll_screen_over_cursor (edit);
-
- replace_yes = 1;
-
- if (replace_prompt) {
- int l;
- l = edit->curs_row - edit->num_widget_lines / 3;
- if (l > 0)
- edit_scroll_downward (edit, l);
- if (l < 0)
- edit_scroll_upward (edit, -l);
-
- edit_scroll_screen_over_cursor (edit);
- edit->force |= REDRAW_PAGE;
- edit_render_keypress (edit);
-
- /*so that undo stops at each query */
- edit_push_key_press (edit);
-
- switch (edit_replace_prompt (edit, exp2, /*and prompt 2/3 down */
- edit->num_widget_columns / 2 - 33, edit->num_widget_lines * 2 / 3)) {
- case B_ENTER:
- break;
- case B_SKIP_REPLACE:
- replace_yes = 0;
- break;
- case B_REPLACE_ALL:
- replace_prompt = 0;
- replace_continue = 1;
- break;
- case B_CANCEL:
- replace_yes = 0;
- replace_continue = 0;
- break;
- }
- }
- if (replace_yes) { /* delete then insert new */
- if (replace_scanf) {
- char repl_str[MAX_REPL_LEN + 2];
- if (sprintf_p (repl_str, exp2, PRINTF_ARGS) >= 0) {
- times_replaced++;
- while (i--)
- edit_delete (edit);
- while (repl_str[++i])
- edit_insert (edit, repl_str[i]);
- } else {
- edit_error_dialog (_(" Replace "),
-/* "Invalid regexp string or scanf string" */
- _(" Error in replacement format string. "));
- replace_continue = 0;
- }
- } else {
- times_replaced++;
- while (i--)
- edit_delete (edit);
- while (exp2[++i])
- edit_insert (edit, exp2[i]);
- }
- edit->found_len = i;
- }
-/* so that we don't find the same string again */
- if (replace_backwards) {
- last_search = edit->search_start;
- edit->search_start--;
- } else {
- edit->search_start += i;
- last_search = edit->last_byte;
- }
- edit_scroll_screen_over_cursor (edit);
- } else {
- edit->search_start = edit->curs1; /* try and find from right here for next search */
- edit_update_curs_col (edit);
-
- edit->force |= REDRAW_PAGE;
- edit_render_keypress (edit);
- if (times_replaced) {
- sprintf (fin_string, _(" %ld replacements made. "), times_replaced);
- edit_message_dialog (_(" Replace "), fin_string);
- } else
- edit_message_dialog (_(" Replace "), _(" Search string not found. "));
- replace_continue = 0;
- }
- } while (replace_continue);
-
- free (exp1);
- free (exp2);
- free (exp3);
- edit->force = REDRAW_COMPLETELY;
- edit_scroll_screen_over_cursor (edit);
-}
-
-
-
-
-void edit_search_cmd (WEdit * edit, int again)
-{
- static char *old = NULL;
- char *exp = "";
-
- if (!edit) {
- if (old) {
- free (old);
- old = 0;
- }
- return;
- }
-
- exp = old ? old : exp;
- if (again) { /*ctrl-hotkey for search again. */
- if (!old)
- return;
- exp = strdup (old);
- } else {
- edit_search_dialog (edit, &exp);
- edit_push_action (edit, KEY_PRESS + edit->start_display);
- }
-
- if (exp) {
- if (*exp) {
- int len = 0;
- if (old)
- free (old);
- old = strdup (exp);
-
- if (edit->found_len && edit->search_start == edit->found_start + 1 && replace_backwards)
- edit->search_start--;
-
- if (edit->found_len && edit->search_start == edit->found_start - 1 && !replace_backwards)
- edit->search_start++;
-
- edit->search_start = edit_find (edit->search_start, (unsigned char *) exp, &len, edit->last_byte,
- (int (*)(void *, long)) edit_get_byte, (void *) edit);
-
- if (edit->search_start >= 0) {
- edit->found_start = edit->search_start;
- edit->found_len = len;
-
- edit_cursor_move (edit, edit->search_start - edit->curs1);
- edit_scroll_screen_over_cursor (edit);
- if (replace_backwards)
- edit->search_start--;
- else
- edit->search_start++;
- } else if (edit->search_start == -3) {
- edit->search_start = edit->curs1;
- regexp_error (edit);
- } else {
- edit->search_start = edit->curs1;
- edit_error_dialog (_(" Search "), _(" Search string not found. "));
- }
- }
- free (exp);
- }
- edit->force |= REDRAW_COMPLETELY;
- edit_scroll_screen_over_cursor (edit);
-}
-
-
-/* Real edit only */
-void edit_quit_cmd (WEdit * edit)
-{
- edit_push_action (edit, KEY_PRESS + edit->start_display);
-
- edit->force |= REDRAW_COMPLETELY;
- if (edit->modified) {
-#ifdef MIDNIGHT
- switch (edit_query_dialog3 (_(" Quit "), _(" File was modified, Save with exit? "), _("Cancel quit"), _("&Yes"), _("&No"))) {
-#else
-/* Confirm 'Quit' dialog box */
- switch (edit_query_dialog3 (_(" Quit "),
- _(" Current text was modified without a file save. \n Save with exit? "), _(" &Cancel quit "), _(" &Yes "), _(" &No "))) {
-#endif
- case 1:
- edit_push_markers (edit);
- edit_set_markers (edit, 0, 0, 0, 0);
- if (!edit_save_cmd (edit))
- return;
- break;
- case 2:
-#ifdef MIDNIGHT
- if (edit->delete_file)
- unlink (catstrs (edit->dir, edit->filename, 0));
-#endif
- break;
- case 0:
- case -1:
- return;
- }
- }
-#ifdef MIDNIGHT
- else if (edit->delete_file)
- unlink (catstrs (edit->dir, edit->filename, 0));
-
- edit->widget.parent->running = 0;
-#else
- edit->stopped = 1;
-#endif
-}
-
-#define TEMP_BUF_LEN 1024
-
-extern int column_highlighting;
-
-/* returns a null terminated length of text. Result must be free'd */
-unsigned char *edit_get_block (WEdit * edit, long start, long finish, int *l)
-{
- unsigned char *s, *r;
- r = s = malloc (finish - start + 1);
- if (column_highlighting) {
- *l = 0;
- while (start < finish) { /* copy from buffer, excluding chars that are out of the column 'margins' */
- int c, x;
- x = edit_move_forward3 (edit, edit_bol (edit, start), 0, start);
- c = edit_get_byte (edit, start);
- if ((x >= edit->column1 && x < edit->column2)
- || (x >= edit->column2 && x < edit->column1) || c == '\n') {
- *s++ = c;
- (*l)++;
- }
- start++;
- }
- } else {
- *l = finish - start;
- while (start < finish)
- *s++ = edit_get_byte (edit, start++);
- }
- *s = 0;
- return r;
-}
-
-/* save block, returns 1 on success */
-int edit_save_block (WEdit * edit, const char *filename, long start, long finish)
-{
- long i = start, end, filelen = finish - start;
- int file;
- unsigned char *buf;
-
- if ((file = open ((char *) filename, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
- return 0;
-
- buf = malloc (TEMP_BUF_LEN);
- while (start != finish) {
- end = min (finish, start + TEMP_BUF_LEN);
- for (; i < end; i++)
- buf[i - start] = edit_get_byte (edit, i);
- filelen -= write (file, (char *) buf, end - start);
- start = end;
- }
- free (buf);
- close (file);
- if (filelen)
- return 0;
- return 1;
-}
-
-/* copies a block to clipboard file */
-static int edit_save_block_to_clip_file (WEdit * edit, long start, long finish)
-{
- return edit_save_block (edit, catstrs (home_dir, CLIP_FILE, 0), start, finish);
-}
-
-#ifndef MIDNIGHT
-
-void paste_text (WEdit * edit, unsigned char *data, unsigned int nitems)
-{
- if (data) {
- data += nitems - 1;
- while (nitems--)
- edit_insert_ahead (edit, *data--);
- }
- edit->force |= REDRAW_COMPLETELY;
-}
-
-char *selection_get_line (void *data, int line)
-{
- static unsigned char t[1024];
- struct selection *s;
- int i = 0;
- s = (struct selection *) data;
- line = (current_selection + line + 1) % NUM_SELECTION_HISTORY;
- if (s[line].text) {
- unsigned char *p = s[line].text;
- int c, j;
- for (j = 0; j < s[line].len; j++) {
- c = *p++;
- if ((c < ' ' || (c > '~' && c < 160)) && c != '\t') {
- t[i++] = '.';
- t[i++] = '\b';
- t[i++] = '.';
- } else
- t[i++] = c;
- if (i > 1020)
- break;
- }
- }
- t[i] = 0;
- return (char *) t;
-}
-
-void edit_paste_from_history (WEdit * edit)
-{
- int i, c;
-
- edit_update_curs_col (edit);
- edit_update_curs_row (edit);
-
- c = max (20, edit->num_widget_columns - 5);
-
- i = CListboxDialog (WIN_MESSAGES, c, 10,
- 0, NUM_SELECTION_HISTORY - 10, NUM_SELECTION_HISTORY - 1, NUM_SELECTION_HISTORY,
- selection_get_line, (void *) selection_history);
-
- if (i < 0)
- return;
-
- i = (current_selection + i + 1) % NUM_SELECTION_HISTORY;
-
- paste_text (edit, selection_history[i].text, selection_history[i].len);
- edit->force |= REDRAW_COMPLETELY;
-}
-
-/* copies a block to the XWindows buffer */
-static int edit_XStore_block (WEdit * edit, long start, long finish)
-{
- edit_get_selection (edit);
- if (selection.len <= 512 * 1024) { /* we don't want to fill up the server */
- XStoreBytes (CDisplay, (char *) selection.text, (int) selection.len);
- return 0;
- } else
- return 1;
-}
-
-int edit_copy_to_X_buf_cmd (WEdit * edit)
-{
- long start_mark, end_mark;
- if (eval_marks (edit, &start_mark, &end_mark))
- return 0;
- edit_XStore_block (edit, start_mark, end_mark);
- if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) {
- edit_error_dialog (_(" Copy to clipboard "), get_sys_error (_(" Unable to save to file. ")));
- return 1;
- }
- XSetSelectionOwner (CDisplay, XA_PRIMARY, edit->widget->winid, CurrentTime);
- edit_mark_cmd (edit, 1);
- return 0;
-}
-
-int edit_cut_to_X_buf_cmd (WEdit * edit)
-{
- long start_mark, end_mark;
- if (eval_marks (edit, &start_mark, &end_mark))
- return 0;
- edit_XStore_block (edit, start_mark, end_mark);
- if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) {
- edit_error_dialog (_(" Cut to clipboard "), _(" Unable to save to file. "));
- return 1;
- }
- edit_block_delete_cmd (edit);
- XSetSelectionOwner (CDisplay, XA_PRIMARY, edit->widget->winid, CurrentTime);
- edit_mark_cmd (edit, 1);
- return 0;
-}
-
-void selection_paste (WEdit * edit, Window win, unsigned prop, int delete);
-
-void edit_paste_from_X_buf_cmd (WEdit * edit)
-{
- if (selection.text)
- paste_text (edit, selection.text, selection.len);
- else if (!XGetSelectionOwner (CDisplay, XA_PRIMARY))
- selection_paste (edit, CRoot, XA_CUT_BUFFER0, False);
- else
- XConvertSelection (CDisplay, XA_PRIMARY, XA_STRING,
- XInternAtom (CDisplay, "VT_SELECTION", False),
- edit->widget->winid, CurrentTime);
- edit->force |= REDRAW_PAGE;
-}
-
-#else /* MIDNIGHT */
-
-void edit_paste_from_history (WEdit *edit)
-{
-}
-
-int edit_copy_to_X_buf_cmd (WEdit * edit)
-{
- long start_mark, end_mark;
- if (eval_marks (edit, &start_mark, &end_mark))
- return 0;
- if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) {
- edit_error_dialog (_(" Copy to clipboard "), get_sys_error (_(" Unable to save to file. ")));
- return 1;
- }
- edit_mark_cmd (edit, 1);
- return 0;
-}
-
-int edit_cut_to_X_buf_cmd (WEdit * edit)
-{
- long start_mark, end_mark;
- if (eval_marks (edit, &start_mark, &end_mark))
- return 0;
- if (!edit_save_block_to_clip_file (edit, start_mark, end_mark)) {
- edit_error_dialog (_(" Cut to clipboard "), _(" Unable to save to file. "));
- return 1;
- }
- edit_block_delete_cmd (edit);
- edit_mark_cmd (edit, 1);
- return 0;
-}
-
-void edit_paste_from_X_buf_cmd (WEdit * edit)
-{
- edit_insert_file (edit, catstrs (home_dir, CLIP_FILE, 0));
-}
-
-#endif /* MIDMIGHT */
-
-void edit_goto_cmd (WEdit *edit)
-{
- char *f;
- static int l = 0;
-#ifdef MIDNIGHT
- char s[12];
- sprintf (s, "%d", l);
- f = input_dialog (_(" Goto line "), _(" Enter line: "), l ? s : "");
-#else
- f = CInputDialog ("goto", WIN_MESSAGES, 150, l ? itoa (l) : "", _(" Goto line "), _(" Enter line: "));
-#endif
- if (f) {
- if (*f) {
- l = atoi (f);
- edit_move_display (edit, l - edit->num_widget_lines / 2 - 1);
- edit_move_to_line (edit, l - 1);
- edit->force |= REDRAW_COMPLETELY;
- free (f);
- }
- }
-}
-
-/*returns 1 on success */
-int edit_save_block_cmd (WEdit * edit) {
- long start_mark, end_mark;
- char *exp;
- if (eval_marks (edit, &start_mark, &end_mark))
- return 1;
-
- exp = edit_get_save_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _(" Save Block "));
-
- edit->force |= REDRAW_COMPLETELY;
- edit_push_action (edit, KEY_PRESS + edit->start_display);
-
- if (exp) {
- if (!*exp) {
- free (exp);
- return 0;
- } else {
- if (edit_save_block (edit, exp, start_mark, end_mark)) {
- free (exp);
- edit->force |= REDRAW_COMPLETELY;
- return 1;
- } else {
- free (exp);
- edit->force |= REDRAW_COMPLETELY;
- edit_error_dialog (_(" Save Block "), get_sys_error (_(" Error trying to save file. ")));
- return 0;
- }
- }
- } else
- return 0;
-}
-
-
-/* inserts a file at the cursor, returns 1 on success */
-int edit_insert_file (WEdit * edit, const char *filename)
-{
- int i, file, blocklen;
- long current = edit->curs1;
- unsigned char *buf;
-
- if ((file = open ((char *) filename, O_RDONLY)) == -1)
- return 0;
- buf = malloc (TEMP_BUF_LEN);
- while ((blocklen = read (file, (char *) buf, TEMP_BUF_LEN)) > 0) {
- for (i = 0; i < blocklen; i++)
- edit_insert (edit, buf[i]);
- }
- edit_cursor_move (edit, current - edit->curs1);
- free (buf);
- close (file);
- if (blocklen)
- return 0;
- return 1;
-}
-
-
-/* returns 1 on success */
-int edit_insert_file_cmd (WEdit * edit) {
- char *exp = edit_get_load_file (edit->dir, catstrs (home_dir, CLIP_FILE, 0), _(" Insert File "));
- edit->force |= REDRAW_COMPLETELY;
-
- edit_push_action (edit, KEY_PRESS + edit->start_display);
-
- if (exp) {
- if (!*exp) {
- free (exp);
- return 0;
- } else {
- if (edit_insert_file (edit, exp)) {
- free (exp);
- return 1;
- } else {
- free (exp);
- edit_error_dialog (_(" Insert file "), get_sys_error (_(" Error trying to insert file. ")));
- return 0;
- }
- }
- } else
- return 0;
-}
-
-#ifdef MIDNIGHT
-
-/* sorts a block, returns -1 on system fail, 1 on cancel and 0 on success */
-int edit_sort_cmd (WEdit * edit)
-{
- static char *old = 0;
- char *exp;
- long start_mark, end_mark;
- int e;
-
- if (eval_marks (edit, &start_mark, &end_mark)) {
-/* Not essential to translate */
- edit_error_dialog (_(" Sort block "), _(" You must first highlight a block of text. "));
- return 0;
- }
- edit_save_block (edit, catstrs (home_dir, BLOCK_FILE, 0), start_mark, end_mark);
-
- exp = old ? old : "";
-
- exp = input_dialog (_(" Run Sort "),
-/* Not essential to translate */
- _(" Enter sort options (see manpage) separated by whitespace: "), "");
-
- if (!exp)
- return 1;
- if (old)
- free (old);
- old = exp;
-
- e = system (catstrs (" sort ", exp, " ", home_dir, BLOCK_FILE, " > ", home_dir, TEMP_FILE, 0));
- if (e) {
- if (e == -1 || e == 127) {
- edit_error_dialog (_(" Sort "),
-/* Not essential to translate */
- get_sys_error (_(" Error trying to execute sort command ")));
- } else {
- char q[8];
- sprintf (q, "%d ", e);
- edit_error_dialog (_(" Sort "),
-/* Not essential to translate */
- catstrs (_(" Sort returned non-zero: "), q, 0));
- }
- return -1;
- }
-
- edit->force |= REDRAW_COMPLETELY;
-
- if (edit_block_delete_cmd (edit))
- return 1;
- edit_insert_file (edit, catstrs (home_dir, TEMP_FILE, 0));
- return 0;
-}
-
-/* if block is 1, a block must be highlighted and the shell command
- processes it. If block is 0 the shell command is a straight system
- command, that just produces some output which is to be inserted */
-void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
-{
- long start_mark, end_mark;
- struct stat s;
- char *f = NULL, *b = NULL;
-
- if (block) {
- if (eval_marks (edit, &start_mark, &end_mark)) {
- edit_error_dialog (_(" Process block "),
-/* Not essential to translate */
- _(" You must first highlight a block of text. "));
- return;
- }
- edit_save_block (edit, b = catstrs (home_dir, BLOCK_FILE, 0), start_mark, end_mark);
- my_system (0, shell, catstrs (home_dir, shell_cmd, 0));
- edit_refresh_cmd (edit);
- } else {
- my_system (0, shell, shell_cmd);
- edit_refresh_cmd (edit);
- }
-
- edit->force |= REDRAW_COMPLETELY;
-
- f = catstrs (home_dir, ERROR_FILE, 0);
-
- if (block) {
- if (stat (f, &s) == 0) {
- if (!s.st_size) { /* no error messages */
- if (edit_block_delete_cmd (edit))
- return;
- edit_insert_file (edit, b);
- return;
- } else {
- edit_insert_file (edit, f);
- return;
- }
- } else {
-/* Not essential to translate */
- edit_error_dialog (_(" Process block "),
-/* Not essential to translate */
- get_sys_error (_(" Error trying to stat file ")));
- return;
- }
- }
-}
-
-#endif
-
-int edit_execute_cmd (WEdit * edit, int command, int char_for_insertion);
-
-/* prints at the cursor */
-/* returns the number of chars printed */
-int edit_print_string (WEdit * e, const char *s)
-{
- int i = 0;
- while (s[i])
- edit_execute_cmd (e, -1, s[i++]);
- e->force |= REDRAW_COMPLETELY;
- edit_update_screen (e);
- return i;
-}
-
-int edit_printf (WEdit * e, const char *fmt,...)
-{
- int i;
- va_list pa;
- char s[1024];
- va_start (pa, fmt);
- sprintf (s, fmt, pa);
- i = edit_print_string (e, s);
- va_end (pa);
- return i;
-}
-
-#ifdef MIDNIGHT
-
-/* FIXME: does this function break NT_OS2 ? */
-
-static void pipe_mail (WEdit *edit, char *to, char *subject, char *cc)
-{
- FILE *p;
- char *s;
- s = malloc (4096);
- sprintf (s, "mail -s \"%s\" -c \"%s\" \"%s\"", subject, cc, to);
- p = popen (s, "w");
- if (!p) {
- free (s);
- return;
- } else {
- long i;
- for (i = 0; i < edit->last_byte; i++)
- fputc (edit_get_byte (edit, i), p);
- pclose (p);
- }
- free (s);
-}
-
-#define MAIL_DLG_HEIGHT 12
-
-void edit_mail_dialog (WEdit * edit)
-{
- char *tmail_to;
- char *tmail_subject;
- char *tmail_cc;
-
- static char *mail_cc_last = 0;
- static char *mail_subject_last = 0;
- static char *mail_to_last = 0;
-
- QuickDialog Quick_input =
- {50, MAIL_DLG_HEIGHT, -1, 0, N_(" Mail "),
-/* NLS ? */
- "[Input Line Keys]", "quick_input", 0};
-
- QuickWidget quick_widgets[] =
- {
-/* NLS ? */
- {quick_button, 6, 10, 9, MAIL_DLG_HEIGHT, "&Cancel", 0, B_CANCEL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_button, 2, 10, 9, MAIL_DLG_HEIGHT, "&Ok", 0, B_ENTER, 0,
- 0, XV_WLAY_DONTCARE, NULL},
- {quick_input, 3, 50, 8, MAIL_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "mail-dlg-input"},
- {quick_label, 2, 50, 7, MAIL_DLG_HEIGHT, " Copies to", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {quick_input, 3, 50, 6, MAIL_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "mail-dlg-input-2"},
- {quick_label, 2, 50, 5, MAIL_DLG_HEIGHT, " Subject", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {quick_input, 3, 50, 4, MAIL_DLG_HEIGHT, "", 44, 0, 0,
- 0, XV_WLAY_BELOWCLOSE, "mail-dlg-input-3"},
- {quick_label, 2, 50, 3, MAIL_DLG_HEIGHT, " To", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {quick_label, 2, 50, 2, MAIL_DLG_HEIGHT, " mail -s -c ", 0, 0, 0,
- 0, XV_WLAY_DONTCARE, 0},
- {0}};
-
- quick_widgets[2].str_result = &tmail_cc;
- quick_widgets[2].text = mail_cc_last ? mail_cc_last : "";
- quick_widgets[4].str_result = &tmail_subject;
- quick_widgets[4].text = mail_subject_last ? mail_subject_last : "";
- quick_widgets[6].str_result = &tmail_to;
- quick_widgets[6].text = mail_to_last ? mail_to_last : "";
-
- Quick_input.widgets = quick_widgets;
-
- if (quick_dialog (&Quick_input) != B_CANCEL) {
- if (mail_cc_last)
- free (mail_cc_last);
- if (mail_subject_last)
- free (mail_subject_last);
- if (mail_to_last)
- free (mail_to_last);
- mail_cc_last = *(quick_widgets[2].str_result);
- mail_subject_last = *(quick_widgets[4].str_result);
- mail_to_last = *(quick_widgets[6].str_result);
- pipe_mail (edit, mail_to_last, mail_subject_last, mail_cc_last);
- }
-}
-
-#endif
-
diff --git a/rosapps/applications/mc/edit/editcmddef.h b/rosapps/applications/mc/edit/editcmddef.h
deleted file mode 100644
index 891c4c3c055..00000000000
--- a/rosapps/applications/mc/edit/editcmddef.h
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifndef __EDIT_CMD_DEF_H
-#define __EDIT_CMD_DEF_H
-
-/* in the distant future, keyboards will be invented with a
- seperate key for each one of these commands *sigh* */
-
-/* cursor movements */
-#define CK_No_Command -1
-#define CK_BackSpace 1
-#define CK_Delete 2
-#define CK_Enter 3
-#define CK_Page_Up 4
-#define CK_Page_Down 5
-#define CK_Left 6
-#define CK_Right 7
-#define CK_Word_Left 8
-#define CK_Word_Right 9
-#define CK_Up 10
-#define CK_Down 11
-#define CK_Home 12
-#define CK_End 13
-#define CK_Tab 14
-#define CK_Undo 15
-#define CK_Beginning_Of_Text 16
-#define CK_End_Of_Text 17
-#define CK_Scroll_Up 18
-#define CK_Scroll_Down 19
-#define CK_Return 20
-#define CK_Begin_Page 21
-#define CK_End_Page 22
-#define CK_Delete_Word_Left 23
-#define CK_Delete_Word_Right 24
-#define CK_Paragraph_Up 25
-#define CK_Paragraph_Down 26
-
-
-/* file commands */
-#define CK_Save 101
-#define CK_Load 102
-#define CK_New 103
-#define CK_Save_As 104
-
-/* block commands */
-#define CK_Mark 201
-#define CK_Copy 202
-#define CK_Move 203
-#define CK_Remove 204
-#define CK_Unmark 206
-#define CK_Save_Block 207
-
-/* search and replace */
-#define CK_Find 301
-#define CK_Find_Again 302
-#define CK_Replace 303
-#define CK_Replace_Again 304
-
-/* misc */
-#define CK_Insert_File 401
-#define CK_Exit 402
-#define CK_Toggle_Insert 403
-#define CK_Help 404
-#define CK_Date 405
-#define CK_Refresh 406
-#define CK_Goto 407
-#define CK_Delete_Line 408
-#define CK_Delete_To_Line_End 409
-#define CK_Delete_To_Line_Begin 410
-#define CK_Man_Page 411
-#define CK_Sort 412
-#define CK_Mail 413
-#define CK_Cancel 414
-#define CK_Complete 415
-#define CK_Paragraph_Format 416
-
-/* application control */
-#define CK_Save_Desktop 451
-#define CK_New_Window 452
-#define CK_Cycle 453
-#define CK_Menu 454
-#define CK_Save_And_Quit 455
-#define CK_Run_Another 456
-#define CK_Check_Save_And_Quit 457
-
-/* macro */
-#define CK_Begin_Record_Macro 501
-#define CK_End_Record_Macro 502
-#define CK_Delete_Macro 503
-
-/* highlight commands */
-#define CK_Page_Up_Highlight 604
-#define CK_Page_Down_Highlight 605
-#define CK_Left_Highlight 606
-#define CK_Right_Highlight 607
-#define CK_Word_Left_Highlight 608
-#define CK_Word_Right_Highlight 609
-#define CK_Up_Highlight 610
-#define CK_Down_Highlight 611
-#define CK_Home_Highlight 612
-#define CK_End_Highlight 613
-#define CK_Beginning_Of_Text_Highlight 614
-#define CK_End_Of_Text_Highlight 615
-#define CK_Begin_Page_Highlight 616
-#define CK_End_Page_Highlight 617
-#define CK_Scroll_Up_Highlight 618
-#define CK_Scroll_Down_Highlight 619
-#define CK_Paragraph_Up_Highlight 620
-#define CK_Paragraph_Down_Highlight 621
-
-/* X clipboard operations */
-
-#define CK_XStore 701
-#define CK_XCut 702
-#define CK_XPaste 703
-#define CK_Selection_History 704
-
-#ifdef MIDNIGHT /* cooledit now has its own full-featured script editor and executor */
-/*
- Process a block through a shell command: CK_Pipe_Block(i) executes shell_cmd[i].
- shell_cmd[i] must process the file ~/cooledit.block and output ~/cooledit.block
- which is then inserted into the text in place of the original block. shell_cmd[i] must
- also produce a file homedir/cooledit.error . If this file is not empty an error will
- have been assumed to have occured, and the block will not be replaced.
- TODO: bring up a viewer to display the error message instead of inserting
- it into the text, which is annoying.
- */
-#define CK_Pipe_Block(i) (1000+(i))
-#define SHELL_COMMANDS_i {"/.cedit/edit.indent.rc", "/.cedit/edit.spell.rc", /* and so on */ 0};
-#else
-#define CK_User_Command(i) (1000+(i))
-#endif
-
-/* execute a macro */
-#define CK_Macro(i) (2000+(i))
-#define CK_Last_Macro CK_Macro(0x7FFF)
-
-
-#endif
-
diff --git a/rosapps/applications/mc/edit/editdraw.c b/rosapps/applications/mc/edit/editdraw.c
deleted file mode 100644
index c563912d2b1..00000000000
--- a/rosapps/applications/mc/edit/editdraw.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/* editor text drawing.
-
- Copyright (C) 1996, 1997 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#include "edit.h"
-
-#define MAX_LINE_LEN 1024
-
-#ifndef MIDNIGHT
-#include "app_glob.c"
-#include "coollocal.h"
-#else
-#include "../src/mad.h"
-#endif
-
-
-static void status_string (WEdit * edit, char *s, int w, int fill, int font_width)
-{
- int i;
- char t[160]; /* 160 just to be sure */
-/* The field lengths just prevents the status line from shortening to much */
- sprintf (t, "[%c%c%c%c] %2ld:%3ld+%2ld=%3ld/%3ld - *%-4ld/%4ldb=%3d",
- edit->mark1 != edit->mark2 ? 'B' : '-',
- edit->modified ? 'M' : '-', edit->macro_i < 0 ? '-' : 'R',
- edit->overwrite == 0 ? '-' : 'O',
- edit->curs_col / font_width, edit->start_line + 1, edit->curs_row,
- edit->curs_line + 1, edit->total_lines + 1, edit->curs1,
- edit->last_byte, edit->curs1 < edit->last_byte
- ? edit_get_byte (edit, edit->curs1) : -1);
- sprintf (s, "%.*s", w + 1, t);
- i = strlen (s);
- s[i] = ' ';
- i = w;
- do {
- if (strchr (" +-*=/:b", s[i])) /* chop off the last word/number */
- break;
- s[i] = fill;
- } while (i--);
- s[i] = fill;
- s[w] = 0;
-}
-
-
-#ifdef MIDNIGHT
-
-/* how to get as much onto the status line as is numerically possible :) */
-void edit_status (WEdit * edit)
-{
- int w, i, t;
- char *s;
- w = edit->widget.cols - (edit->have_frame * 2);
- s = malloc (w + 15);
- if (w < 4)
- w = 4;
- memset (s, ' ', w);
- attrset (SELECTED_COLOR);
- if (w > 4) {
- widget_move (edit, edit->have_frame, edit->have_frame);
- i = w > 24 ? 18 : w - 6;
- i = i < 13 ? 13 : i;
- sprintf (s, "%s", name_trunc (edit->filename ? edit->filename : "", i));
- i += strlen (s);
- s[strlen (s)] = ' ';
- t = w - 20;
- if (t < 0)
- t = 0;
- status_string (edit, s + 20, t, ' ', 1);
- } else {
- s[w] = 0;
- }
- printw ("%.*s", w, s);
-
- attrset (NORMAL_COLOR);
- free (s);
-}
-
-#else
-
-extern int fixed_font;
-
-void rerender_text (CWidget * wdt);
-
-void edit_status (WEdit * edit)
-{
- if ((edit->widget->options & EDITOR_NO_TEXT)) {
- return;
- } else {
- int w, i, t;
- CWidget *wdt;
- char id[33];
- char s[160];
- w = edit->num_widget_columns - 1;
- if (w > 150)
- w = 150;
- if (w < 0)
- w = 0;
- memset (s, 0, w);
- if (w > 1) {
- i = w > 24 ? 18 : w - 6;
- i = i < 13 ? 13 : i;
- sprintf (s, "%s", name_trunc (edit->filename ? edit->filename : "", i));
- i = strlen (s);
- s[i] = ' ';
- s[i+1] = ' ';
- t = w - i - 2;
- if (t < 0)
- t = 0;
- status_string (edit, s + i + 2, t, 0, FONT_MEAN_WIDTH);
- }
- s[w] = 0;
- strcpy (id, edit->widget->ident);
- strcat (id, ".text");
- wdt = CIdent (id);
- free (wdt->text);
- wdt->text = strdup (s);
- CSetWidgetSize (id, edit->widget->width, wdt->height);
- rerender_text (wdt);
- }
-}
-
-
-#endif
-
-
-/* boolean */
-int cursor_in_screen (WEdit * edit, long row)
-{
- if (row < 0 || row >= edit->num_widget_lines)
- return 0;
- else
- return 1;
-}
-
-/* returns rows from the first displayed line to the cursor */
-int cursor_from_display_top (WEdit * edit)
-{
- if (edit->curs1 < edit->start_display)
- return -edit_move_forward (edit, edit->curs1, 0, edit->start_display);
- else
- return edit_move_forward (edit, edit->start_display, 0, edit->curs1);
-}
-
-/* returns how far the cursor is out of the screen */
-int cursor_out_of_screen (WEdit * edit)
-{
- int row = cursor_from_display_top (edit);
- if (row >= edit->num_widget_lines)
- return row - edit->num_widget_lines + 1;
- if (row < 0)
- return row;
- return 0;
-}
-
-#ifndef MIDNIGHT
-extern unsigned char per_char[256];
-int edit_width_of_long_printable (int c);
-#endif
-
-/* this scrolls the text so that cursor is on the screen */
-void edit_scroll_screen_over_cursor (WEdit * edit)
-{
- int p, l;
- int outby;
- p = edit_get_col (edit);
- edit_update_curs_row (edit);
-#ifdef MIDNIGHT
- outby = p + edit->start_col - edit->num_widget_columns + 1 + (EDIT_RIGHT_EXTREME + edit->found_len);
-#else
- outby = p + edit->start_col - edit->widget->width + 7 + (EDIT_RIGHT_EXTREME + edit->found_len) * FONT_MEAN_WIDTH + edit_width_of_long_printable (edit_get_byte (edit, edit->curs1));
-#endif
- if (outby > 0)
- edit_scroll_right (edit, outby);
-#ifdef MIDNIGHT
- outby = EDIT_LEFT_EXTREME - p - edit->start_col;
-#else
- outby = EDIT_LEFT_EXTREME * FONT_MEAN_WIDTH - p - edit->start_col;
-#endif
- if (outby > 0)
- edit_scroll_left (edit, outby);
- p = edit->curs_row;
- l = 0;
- if (edit->found_len != 0)
- l = edit->num_widget_lines / 5;
- outby = p - edit->num_widget_lines + 1 + EDIT_BOTTOM_EXTREME + l;
- if (outby > 0)
- edit_scroll_downward (edit, outby);
- outby = EDIT_TOP_EXTREME - p + l;
- if (outby > 0)
- edit_scroll_upward (edit, outby);
- edit_update_curs_row (edit);
-}
-
-
-#ifndef MIDNIGHT
-
-#define CACHE_WIDTH 256
-#define CACHE_HEIGHT 128
-
-int EditExposeRedraw = 0;
-int EditClear = 0;
-
-/* background colors: marked is refers to mouse highlighting, highlighted refers to a found string. */
-unsigned long edit_abnormal_color, edit_marked_abnormal_color;
-unsigned long edit_highlighted_color, edit_marked_color;
-unsigned long edit_normal_background_color;
-
-/* foreground colors */
-unsigned long edit_normal_foreground_color, edit_bold_color;
-unsigned long edit_italic_color;
-
-/* cursor color */
-unsigned long edit_cursor_color;
-
-void edit_set_foreground_colors (unsigned long normal, unsigned long bold, unsigned long italic)
-{
- edit_normal_foreground_color = normal;
- edit_bold_color = bold;
- edit_italic_color = italic;
-}
-
-void edit_set_background_colors (unsigned long normal, unsigned long abnormal, unsigned long marked, unsigned long marked_abnormal, unsigned long highlighted)
-{
- edit_abnormal_color = abnormal;
- edit_marked_abnormal_color = marked_abnormal;
- edit_marked_color = marked;
- edit_highlighted_color = highlighted;
- edit_normal_background_color = normal;
-}
-
-void edit_set_cursor_color (unsigned long c)
-{
- edit_cursor_color = c;
-}
-
-#else
-
-#define BOLD_COLOR MARKED_COLOR
-#define UNDERLINE_COLOR VIEW_UNDERLINED_COLOR
-#define MARK_COLOR SELECTED_COLOR
-#define DEF_COLOR NORMAL_COLOR
-
-static void set_color (int font)
-{
- attrset (font);
-}
-
-#define edit_move(x,y) widget_move(edit, y, x);
-
-static void print_to_widget (WEdit * edit, long row, int start_col, float start_col_real, long end_col, unsigned int line[])
-{
- int x = (float) start_col_real + EDIT_TEXT_HORIZONTAL_OFFSET;
- int x1 = start_col + EDIT_TEXT_HORIZONTAL_OFFSET;
- int y = row + EDIT_TEXT_VERTICAL_OFFSET;
-
- set_color (DEF_COLOR);
- edit_move (x1, y);
- hline (' ', end_col + 1 - EDIT_TEXT_HORIZONTAL_OFFSET - x1);
-
- edit_move (x + FONT_OFFSET_X, y + FONT_OFFSET_Y);
- {
- unsigned int *p = line;
- int textchar = ' ';
- long style;
-
- while (*p) {
- style = *p >> 8;
- textchar = *p & 0xFF;
-#ifdef HAVE_SYNTAXH
- if (!(style & (0xFF - MOD_ABNORMAL - MOD_CURSOR)))
- SLsmg_set_color ((*p & 0x007F0000) >> 16);
-#endif
- if (style & MOD_ABNORMAL)
- textchar = '.';
- if (style & MOD_HIGHLIGHTED) {
- set_color (BOLD_COLOR);
- } else if (style & MOD_MARKED) {
- set_color (MARK_COLOR);
- }
- if (style & MOD_UNDERLINED) {
- set_color (UNDERLINE_COLOR);
- }
- if (style & MOD_BOLD) {
- set_color (BOLD_COLOR);
- }
- addch (textchar);
- p++;
- }
- }
-}
-
-/* b pointer to begining of line */
-static void edit_draw_this_line (WEdit * edit, long b, long row, long start_col, long end_col)
-{
- static unsigned int line[MAX_LINE_LEN];
- unsigned int *p = line;
- long m1 = 0, m2 = 0, q;
- int col, start_col_real;
- unsigned int c;
- int fg, bg;
- int i;
-
- edit_get_syntax_color (edit, b - 1, &fg, &bg);
- q = edit_move_forward3 (edit, b, start_col - edit->start_col, 0);
- start_col_real = (col = (int) edit_move_forward3 (edit, b, 0, q)) + edit->start_col;
-
- if (col + 16 > -edit->start_col) {
- eval_marks (edit, &m1, &m2);
-
- if (row <= edit->total_lines - edit->start_line) {
- while (col <= end_col - edit->start_col) {
- *p = 0;
- if (q == edit->curs1)
- *p |= MOD_CURSOR * 256;
- if (q >= m1 && q < m2)
- *p |= MOD_MARKED * 256;
- if (q == edit->bracket)
- *p |= MOD_BOLD * 256;
- if (q >= edit->found_start && q < edit->found_start + edit->found_len)
- *p |= MOD_HIGHLIGHTED * 256;
- c = edit_get_byte (edit, q);
- edit_get_syntax_color (edit, q, &fg, &bg);
-/* we don't use bg for mc - fg contains both */
- *p |= fg << 16;
- q++;
- switch (c) {
- case '\n':
- col = end_col - edit->start_col + 1; /* quit */
- *(p++) |= ' ';
- break;
- case '\t':
- i = TAB_SIZE - ((int) col % TAB_SIZE);
- *p |= ' ';
- c = *(p++) & (0xFFFFFFFF - MOD_CURSOR * 256);
- col += i;
- while (--i)
- *(p++) = c;
- break;
- case '\r':
- break;
- default:
- if (is_printable (c)) {
- *(p++) |= c;
- } else {
- *(p++) = '.';
- *p |= (256 * MOD_ABNORMAL);
- }
- col++;
- break;
- }
- }
- }
- } else {
- start_col_real = start_col = 0;
- }
- *p = 0;
-
- print_to_widget (edit, row, start_col, start_col_real, end_col, line);
-}
-
-#endif
-
-#ifdef MIDNIGHT
-
-#define key_pending(x) (!is_idle())
-
-#else
-
-int edit_mouse_pending (Window win);
-#define edit_draw_this_line edit_draw_this_line_proportional
-
-static int key_pending (WEdit * edit)
-{
- if (!(edit->force & REDRAW_COMPLETELY) && !EditExposeRedraw)
- return CKeyPending ();
- return 0;
-}
-
-#endif
-
-
-/* b for pointer to begining of line */
-static void edit_draw_this_char (WEdit * edit, long curs, long row)
-{
- int b = edit_bol (edit, curs);
-#ifdef MIDNIGHT
- edit_draw_this_line (edit, b, row, 0, edit->num_widget_columns - 1);
-#else
- edit_draw_this_line (edit, b, row, 0, edit->widget->width);
-#endif
-}
-
-/* cursor must be in screen for other than REDRAW_PAGE passed in force */
-void render_edit_text (WEdit * edit, long start_row, long start_column, long end_row, long end_column)
-{
- long row = 0, curs_row;
- static int prev_curs_row = 0;
- static long prev_start_display = 0;
- static int prev_start_col = 0;
- static long prev_curs = 0;
-
-#ifndef MIDNIGHT
- static Window prev_win = 0;
-#endif
- int fg, bg;
-
- int force = edit->force;
- long b;
-
-/*
- if the position of the page has not moved then we can draw the cursor character only.
- This will prevent line flicker when using arrow keys.
- */
- if ((!(force & REDRAW_CHAR_ONLY)) || (force & REDRAW_PAGE)
-#ifndef MIDNIGHT
- || prev_win != edit->widget->winid
-#endif
- ) {
- if (!(force & REDRAW_IN_BOUNDS)) { /* !REDRAW_IN_BOUNDS means to ignore bounds and redraw whole rows */
- start_row = 0;
- end_row = edit->num_widget_lines - 1;
- start_column = 0;
-#ifdef MIDNIGHT
- end_column = edit->num_widget_columns - 1;
-#else
- end_column = edit->widget->width;
-#endif
- }
- if (force & REDRAW_PAGE) {
- row = start_row;
- b = edit_move_forward (edit, edit->start_display, start_row, 0);
- while (row <= end_row) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, row, start_column, end_column);
- b = edit_move_forward (edit, b, 1, 0);
- row++;
- }
- } else {
- curs_row = edit->curs_row;
-
- if (force & REDRAW_BEFORE_CURSOR) {
- if (start_row < curs_row) {
- long upto = curs_row - 1 <= end_row ? curs_row - 1 : end_row;
- row = start_row;
- b = edit->start_display;
- while (row <= upto) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, row, start_column, end_column);
- b = edit_move_forward (edit, b, 1, 0);
- }
- }
- }
-/* if (force & REDRAW_LINE) { ---> default */
- b = edit_bol (edit, edit->curs1);
- if (curs_row >= start_row && curs_row <= end_row) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, curs_row, start_column, end_column);
- }
- if (force & REDRAW_AFTER_CURSOR) {
- if (end_row > curs_row) {
- row = curs_row + 1 < start_row ? start_row : curs_row + 1;
- b = edit_move_forward (edit, b, 1, 0);
- while (row <= end_row) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, row, start_column, end_column);
- b = edit_move_forward (edit, b, 1, 0);
- row++;
- }
- }
- }
- if (force & REDRAW_LINE_ABOVE && curs_row >= 1) {
- row = curs_row - 1;
- b = edit_move_backward (edit, edit_bol (edit, edit->curs1), 1);
- if (row >= start_row && row <= end_row) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, row, start_column, end_column);
- }
- }
- if (force & REDRAW_LINE_BELOW && row < edit->num_widget_lines - 1) {
- row = curs_row + 1;
- b = edit_bol (edit, edit->curs1);
- b = edit_move_forward (edit, b, 1, 0);
- if (row >= start_row && row <= end_row) {
- if (key_pending (edit))
- goto exit_render;
- edit_draw_this_line (edit, b, row, start_column, end_column);
- }
- }
- }
- } else {
- if (prev_curs_row < edit->curs_row) { /* with the new text highlighting, we must draw from the top down */
- edit_draw_this_char (edit, prev_curs, prev_curs_row);
- edit_draw_this_char (edit, edit->curs1, edit->curs_row);
- } else {
- edit_draw_this_char (edit, edit->curs1, edit->curs_row);
- edit_draw_this_char (edit, prev_curs, prev_curs_row);
- }
- }
-
- edit->force = 0;
-
- prev_curs_row = edit->curs_row;
- prev_curs = edit->curs1;
- prev_start_display = edit->start_display;
- prev_start_col = edit->start_col;
-#ifndef MIDNIGHT
- prev_win = edit->widget->winid;
-#endif
- exit_render:
- edit_get_syntax_color (edit, edit->start_display - 1, &fg, &bg);
-}
-
-
-
-#ifndef MIDNIGHT
-
-void edit_convert_expose_to_area (XExposeEvent * xexpose, int *row1, int *col1, int *row2, int *col2)
-{
- *col1 = xexpose->x - EDIT_TEXT_HORIZONTAL_OFFSET;
- *row1 = (xexpose->y - EDIT_TEXT_VERTICAL_OFFSET) / FONT_PIX_PER_LINE;
- *col2 = xexpose->x + xexpose->width + EDIT_TEXT_HORIZONTAL_OFFSET + 3;
- *row2 = (xexpose->y + xexpose->height - EDIT_TEXT_VERTICAL_OFFSET) / FONT_PIX_PER_LINE;
-}
-
-void edit_render_tidbits (CWidget * wdt)
-{
- int isfocussed;
- int w = wdt->width, h = wdt->height;
- Window win;
-
- win = wdt->winid;
- isfocussed = (win == CGetFocus ());
-
- CSetColor (COLOR_FLAT);
-
- if (isfocussed) {
- render_bevel (win, 0, 0, w - 1, h - 1, 3, 1); /*most outer border bevel */
- } else {
- render_bevel (win, 2, 2, w - 3, h - 3, 1, 1); /*border bevel */
- render_bevel (win, 0, 0, w - 1, h - 1, 2, 0); /*most outer border bevel */
- }
-}
-
-void edit_set_space_width (int s);
-extern int option_long_whitespace;
-
-#endif
-
-void edit_render (WEdit * edit, int page, int row_start, int col_start, int row_end, int col_end)
-{
- int f = 0;
- if (page) /* if it was an expose event, 'page' would be set */
- edit->force |= REDRAW_PAGE | REDRAW_IN_BOUNDS;
- f = edit->force & (REDRAW_PAGE | REDRAW_COMPLETELY);
-
-#ifdef MIDNIGHT
- if (edit->force & REDRAW_COMPLETELY)
- redraw_labels (edit->widget.parent, (Widget *) edit);
-#else
- if (option_long_whitespace)
- edit_set_space_width (per_char[' '] * 2);
- else
- edit_set_space_width (per_char[' ']);
- edit_set_foreground_colors (
- color_palette (option_editor_fg_normal),
- color_palette (option_editor_fg_bold),
- color_palette (option_editor_fg_italic)
- );
- edit_set_background_colors (
- color_palette (option_editor_bg_normal),
- color_palette (option_editor_bg_abnormal),
- color_palette (option_editor_bg_marked),
- color_palette (option_editor_bg_marked_abnormal),
- color_palette (option_editor_bg_highlighted)
- );
- edit_set_cursor_color (
- color_palette (option_editor_fg_cursor)
- );
-
- if (!EditExposeRedraw)
- set_cursor_position (0, 0, 0, 0, 0, 0, 0, 0, 0);
-#endif
-
- render_edit_text (edit, row_start, col_start, row_end, col_end);
- if (edit->force) /* edit->force != 0 means a key was pending and the redraw
- was halted, so next time we must redraw everything in case stuff
- was left undrawn from a previous key press */
- edit->force |= REDRAW_PAGE;
-#ifndef MIDNIGHT
- if (f) {
- edit_render_tidbits (edit->widget);
- CSetColor (edit_normal_background_color);
- CLine (edit->widget->winid, 3, 3, 3, edit->widget->height - 4);
- }
-#endif
-}
-
-#ifndef MIDNIGHT
-void edit_render_expose (WEdit * edit, XExposeEvent * xexpose)
-{
- int row_start, col_start, row_end, col_end;
- EditExposeRedraw = 1;
- edit->num_widget_lines = (edit->widget->height - 6) / FONT_PIX_PER_LINE;
- edit->num_widget_columns = (edit->widget->width - 7) / FONT_MEAN_WIDTH;
- if (edit->force & (REDRAW_PAGE | REDRAW_COMPLETELY)) {
- edit->force |= REDRAW_PAGE | REDRAW_COMPLETELY;
- edit_render_keypress (edit);
- } else {
- edit_convert_expose_to_area (xexpose, &row_start, &col_start, &row_end, &col_end);
- edit_render (edit, 1, row_start, col_start, row_end, col_end);
- }
- EditExposeRedraw = 0;
-}
-
-void edit_render_keypress (WEdit * edit)
-{
- edit_render (edit, 0, 0, 0, 0, 0);
-}
-
-#else
-
-void edit_render_keypress (WEdit * edit)
-{
- edit_render (edit, 0, 0, 0, 0, 0);
-}
-
-#endif
diff --git a/rosapps/applications/mc/edit/editmenu.c b/rosapps/applications/mc/edit/editmenu.c
deleted file mode 100644
index 9605507045d..00000000000
--- a/rosapps/applications/mc/edit/editmenu.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/* editor menu definitions and initialisation
-
- Copyright (C) 1996 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-#include
-#include "edit.h"
-
-#include "editcmddef.h"
-
-#ifdef MIDNIGHT
-
-#include "../src/mad.h"
-
-extern int edit_key_emulation;
-extern WEdit *wedit;
-extern WButtonBar *edit_bar;
-extern Dlg_head *edit_dlg;
-extern WMenu *edit_menubar;
-
-#undef edit_message_dialog
-#define edit_message_dialog(w,x,y,h,s) query_dialog (h, s, 0, 1, "&Ok")
-#define CFocus(x)
-
-static void menu_cmd (int i)
-{
- send_message (wedit->widget.parent, (Widget *) wedit, WIDGET_COMMAND, i);
-}
-
-static void menu_key (int i)
-{
- send_message (wedit->widget.parent, (Widget *) wedit, WIDGET_KEY, i);
-}
-
-void edit_wrap_cmd ()
-{
- char *f;
- char s[12];
- sprintf (s, "%d", option_word_wrap_line_length);
- f = input_dialog (_(" Word wrap "),
-/* Not essential to translate */
- _(" Enter line length, 0 for off: "), s);
- if (f) {
- if (*f) {
- option_word_wrap_line_length = atoi (f);
- free (f);
- }
- }
-}
-
-void edit_about_cmd ()
-{
- edit_message_dialog (wedit->mainid, 20, 20, " About ",
- "\n"
- " Cooledit v2.1\n"
- "\n"
- " Copyright (C) 1996 the Free Software Foundation\n"
- "\n"
- " A user friendly text editor written\n"
- " for the Midnight Commander.\n"
- );
-}
-
-void menu_mail_cmd (void) { menu_cmd (CK_Mail); }
-void menu_load_cmd (void) { menu_cmd (CK_Load); }
-void menu_new_cmd (void) { menu_cmd (CK_New); }
-void menu_save_cmd (void) { menu_cmd (CK_Save); }
-void menu_save_as_cmd (void) { menu_cmd (CK_Save_As); }
-void menu_insert_file_cmd (void) { menu_cmd (CK_Insert_File); }
-void menu_quit_cmd (void) { menu_cmd (CK_Exit); }
-void menu_mark_cmd (void) { menu_cmd (CK_Mark); }
-void menu_ins_cmd (void) { menu_cmd (CK_Toggle_Insert); }
-void menu_copy_cmd (void) { menu_cmd (CK_Copy); }
-void menu_move_cmd (void) { menu_cmd (CK_Move); }
-void menu_delete_cmd (void) { menu_cmd (CK_Remove); }
-void menu_cut_cmd (void) { menu_cmd (CK_Save_Block); }
-void menu_search_cmd (void) { menu_cmd (CK_Find); }
-void menu_search_again_cmd (void) { menu_cmd (CK_Find_Again); }
-void menu_replace_cmd (void) { menu_cmd (CK_Replace); }
-void menu_begin_record_cmd (void) { menu_cmd (CK_Begin_Record_Macro); }
-void menu_end_record_cmd (void) { menu_cmd (CK_End_Record_Macro); }
-void menu_wrap_cmd (void) { edit_wrap_cmd (); }
-void menu_exec_macro_cmd (void) { menu_key (XCTRL ('a')); }
-void menu_exec_macro_delete_cmd (void) { menu_cmd (CK_Delete_Macro); }
-void menu_c_form_cmd (void) { menu_key (KEY_F (19)); }
-void menu_ispell_cmd (void) { menu_cmd (CK_Pipe_Block (1)); }
-void menu_sort_cmd (void) { menu_cmd (CK_Sort); }
-void menu_date_cmd (void) { menu_cmd (CK_Date); }
-void menu_undo_cmd (void) { menu_cmd (CK_Undo); }
-void menu_beginning_cmd (void) { menu_cmd (CK_Beginning_Of_Text); }
-void menu_end_cmd (void) { menu_cmd (CK_End_Of_Text); }
-void menu_refresh_cmd (void) { menu_cmd (CK_Refresh); }
-void menu_goto_line (void) { menu_cmd (CK_Goto); }
-void menu_lit_cmd (void) { menu_key (XCTRL ('q')); }
-void menu_format_paragraph (void) { menu_cmd (CK_Paragraph_Format); }
-void edit_options_dialog (void);
-void menu_options (void) { edit_options_dialog (); }
-
-static menu_entry FileMenu[] =
-{
- {' ', N_("&Open/load... C-o"), 'O', menu_load_cmd},
- {' ', N_("&New C-n"), 'N', menu_new_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Save F2"), 'S', menu_save_cmd},
- {' ', N_("save &As... F12"), 'A', menu_save_as_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd},
- {' ', N_("copy to &File... C-f"), 'F', menu_cut_cmd},
- {' ', "", ' ', 0},
- {' ', N_("a&Bout... "), 'B', edit_about_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Quit F10"), 'Q', menu_quit_cmd}
- };
-
-static menu_entry FileMenuEmacs[] =
-{
- {' ', N_("&Open/load... C-o"), 'O', menu_load_cmd},
- {' ', N_("&New C-x k"), 'N', menu_new_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Save F2"), 'S', menu_save_cmd},
- {' ', N_("save &As... F12"), 'A', menu_save_as_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Insert file... F15"), 'I', menu_insert_file_cmd},
- {' ', N_("copy to &File... "), 'F', menu_cut_cmd},
- {' ', "", ' ', 0},
- {' ', N_("a&Bout... "), 'B', edit_about_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Quit F10"), 'Q', menu_quit_cmd}
-};
-
-static menu_entry EditMenu[] =
-{
- {' ', N_("&Toggle Mark F3"), 'T', menu_mark_cmd},
- {' ', "", ' ', 0},
- {' ', N_("toggle &Ins/overw Ins"), 'I', menu_ins_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Copy F5"), 'C', menu_copy_cmd},
- {' ', N_("&Move F6"), 'M', menu_move_cmd},
- {' ', N_("&Delete F8"), 'D', menu_delete_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Undo C-u"), 'U', menu_undo_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Beginning C-PgUp"), 'B', menu_beginning_cmd},
- {' ', N_("&End C-PgDn"), 'E', menu_end_cmd}
-};
-
-static menu_entry EditMenuEmacs[] =
-{
- {' ', N_("&Toggle Mark F3"), 'T', menu_mark_cmd},
- {' ', "", ' ', 0},
- {' ', N_("toggle &Ins/overw Ins"), 'I', menu_ins_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Copy F5"), 'C', menu_copy_cmd},
- {' ', N_("&Move F6"), 'M', menu_move_cmd},
- {' ', N_("&Delete F8"), 'D', menu_delete_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Undo C-u"), 'U', menu_undo_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Beginning C-PgUp"), 'B', menu_beginning_cmd},
- {' ', N_("&End C-PgDn"), 'E', menu_end_cmd}
-};
-
-static menu_entry SearReplMenu[] =
-{
- {' ', N_("&Search... F7"), 'S', menu_search_cmd},
- {' ', N_("search &Again F17"), 'A', menu_search_again_cmd},
- {' ', N_("&Replace... F4"), 'R', menu_replace_cmd}
-};
-
-static menu_entry SearReplMenuEmacs[] =
-{
- {' ', N_("&Search... F7"), 'S', menu_search_cmd},
- {' ', N_("search &Again F17"), 'A', menu_search_again_cmd},
- {' ', N_("&Replace... F4"), 'R', menu_replace_cmd}
-};
-
-static menu_entry CmdMenu[] =
-{
- {' ', N_("&Goto line... M-l"), 'G', menu_goto_line},
- {' ', "", ' ', 0},
- {' ', N_("insert &Literal... C-q"), 'L', menu_lit_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Refresh screen C-l"), 'R', menu_refresh_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Start record macro C-r"), 'S', menu_begin_record_cmd},
- {' ', N_("&Finish record macro... C-r"), 'F', menu_end_record_cmd},
- {' ', N_("&Execute macro... C-a, KEY"), 'E', menu_exec_macro_cmd},
- {' ', N_("delete macr&O... "), 'O', menu_exec_macro_delete_cmd},
- {' ', "", ' ', 0},
- {' ', N_("insert &Date/time "), 'D', menu_date_cmd},
- {' ', "", ' ', 0},
- {' ', N_("format p&Aragraph M-p"), 'A', menu_format_paragraph},
- {' ', N_("'ispell' s&Pell check C-p"), 'P', menu_ispell_cmd},
- {' ', N_("sor&T... M-t"), 'T', menu_sort_cmd},
- {' ', N_("'indent' &C Formatter F19"), 'C', menu_c_form_cmd},
- {' ', N_("&Mail... "), 'M', menu_mail_cmd}
-};
-
-static menu_entry CmdMenuEmacs[] =
-{
- {' ', N_("&Goto line... M-l"), 'G', menu_goto_line},
- {' ', "", ' ', 0},
- {' ', N_("insert &Literal... C-q"), 'L', menu_lit_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Refresh screen C-l"), 'R', menu_refresh_cmd},
- {' ', "", ' ', 0},
- {' ', N_("&Start record macro C-r"), 'S', menu_begin_record_cmd},
- {' ', N_("&Finish record macro... C-r"), 'F', menu_end_record_cmd},
- {' ', N_("&Execute macro... C-x e, KEY"), 'E', menu_exec_macro_cmd},
- {' ', N_("delete macr&O... "), 'o', menu_exec_macro_delete_cmd},
- {' ', "", ' ', 0},
- {' ', N_("insert &Date/time "), 'D', menu_date_cmd},
- {' ', "", ' ', 0},
- {' ', N_("format p&Aragraph M-p"), 'a', menu_format_paragraph},
- {' ', N_("'ispell' s&Pell check M-$"), 'P', menu_ispell_cmd},
- {' ', N_("sor&T... M-t"), 'T', menu_sort_cmd},
- {' ', N_("'indent' &C Formatter F19"), 'C', menu_c_form_cmd}
-};
-
-extern void menu_save_mode_cmd (void);
-
-static menu_entry OptMenu[] =
-{
- {' ', N_("&General... "), 'G', menu_options},
- {' ', N_("&Save mode..."), 'S', menu_save_mode_cmd}
-#if 0
- {' ', N_("&Layout..."), 'L', menu_layout_cmd}
-#endif
-};
-
-static menu_entry OptMenuEmacs[] =
-{
- {' ', N_("&General... "), 'G', menu_options},
- {' ', N_("&Save mode..."), 'S', menu_save_mode_cmd}
-#if 0
- {' ', N_("&Layout..."), 'L', menu_layout_cmd}
-#endif
-};
-
-#define menu_entries(x) sizeof(x)/sizeof(menu_entry)
-
-Menu EditMenuBar[N_menus];
-
-void edit_init_menu_normal (void)
-{
- EditMenuBar[0] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu));
- EditMenuBar[1] = create_menu (_(" Edit "), EditMenu, menu_entries (EditMenu));
- EditMenuBar[2] = create_menu (_(" Sear/Repl "), SearReplMenu, menu_entries (SearReplMenu));
- EditMenuBar[3] = create_menu (_(" Command "), CmdMenu, menu_entries (CmdMenu));
- EditMenuBar[4] = create_menu (_(" Options "), OptMenu, menu_entries (OptMenu));
-}
-
-void edit_init_menu_emacs (void)
-{
- EditMenuBar[0] = create_menu (_(" File "), FileMenuEmacs, menu_entries (FileMenuEmacs));
- EditMenuBar[1] = create_menu (_(" Edit "), EditMenuEmacs, menu_entries (EditMenuEmacs));
- EditMenuBar[2] = create_menu (_(" Sear/Repl "), SearReplMenuEmacs, menu_entries (SearReplMenuEmacs));
- EditMenuBar[3] = create_menu (_(" Command "), CmdMenuEmacs, menu_entries (CmdMenuEmacs));
- EditMenuBar[4] = create_menu (_(" Options "), OptMenuEmacs, menu_entries (OptMenuEmacs));
-}
-
-void edit_done_menu (void)
-{
- int i;
- for (i = 0; i < N_menus; i++)
- destroy_menu (EditMenuBar[i]);
-}
-
-
-void edit_drop_menu_cmd (WEdit * e, int which)
-{
- if (edit_menubar->active)
- return;
- edit_menubar->active = 1;
- edit_menubar->dropped = drop_menus;
- edit_menubar->previous_selection = which >= 0 ? which : dlg_item_number (edit_dlg);
- if (which >= 0)
- edit_menubar->selected = which;
- dlg_select_widget (edit_dlg, edit_menubar);
-}
-
-
-void edit_menu_cmd (WEdit * e)
-{
- edit_drop_menu_cmd (e, -1);
-}
-
-
-int edit_drop_hotkey_menu (WEdit * e, int key)
-{
- int m = 0;
- switch (key) {
- case ALT ('f'):
- if (edit_key_emulation == EDIT_KEY_EMULATION_EMACS)
- return 0;
- m = 0;
- break;
- case ALT ('e'):
- m = 1;
- break;
- case ALT ('s'):
- m = 2;
- break;
- case ALT ('c'):
- m = 3;
- break;
- case ALT ('o'):
- m = 4;
- break;
- default:
- return 0;
- }
-
- edit_drop_menu_cmd (e, m);
- return 1;
-}
-
-
-#else /* !MIDNIGHT */
-
-
-extern CWidget *wedit;
-
-void CSetEditMenu (const char *ident)
-{
- wedit = CIdent (ident);
-}
-
-CWidget *CGetEditMenu (void)
-{
- return wedit;
-}
-
-static void menu_cmd (unsigned long i)
-{
- XEvent e;
- if (wedit) {
- memset (&e, 0, sizeof (XEvent));
- e.type = EditorCommand;
- e.xkey.keycode = i;
- e.xkey.window = wedit->winid;
- CFocus (wedit);
- CSendEvent (&e);
- }
-}
-
-void CEditMenuCommand (int i)
-{
- menu_cmd ((unsigned long) i);
-}
-
-static void menu_key (KeySym i, int state)
-{
- int cmd, ch;
- if (edit_translate_key (0, i, state, &cmd, &ch)) {
- if (cmd > 0)
- menu_cmd (cmd);
- }
-}
-
-static void menu_ctrl_key (unsigned long i)
-{
- menu_key ((KeySym) i, ControlMask);
-}
-
-void CDrawEditMenuButtons (const char *ident, Window parent, Window focus_return, int x, int y)
-{
- int d;
-
- CDrawMenuButton (catstrs (ident, ".filemenu", 0), parent, focus_return, x, y, AUTO_WIDTH, AUTO_HEIGHT, 8,
-/* The following are menu options. Do not change the key bindings (eg. C-o) and preserve '\t' */
- _(" File "),
- _("Open...\tC-o"), '~', menu_cmd, CK_Load,
- _("New\tC-n"), '~', menu_cmd, CK_New,
- "", ' ', 0, 0,
- _("Save\tF2"), '~', menu_cmd, CK_Save,
- _("Save as...\tF12"), '~', menu_cmd, CK_Save_As,
- "", ' ', 0, 0,
- _("Insert file...\tF15"), '~', menu_cmd, CK_Insert_File,
- _("Copy to file...\tC-f"), '~', menu_cmd, CK_Save_Block
- );
-/* Tool hint */
- CSetToolHint (catstrs (ident, ".filemenu", 0), _("Disk operations"));
-
- CGetHintPos (&x, &d);
-
- CDrawMenuButton (catstrs (ident, ".editmenu", 0), parent, focus_return, x, y, AUTO_WIDTH, AUTO_HEIGHT, 14,
- _(" Edit "),
- _("Toggle mark\tF3"), '~', menu_cmd, CK_Mark,
- "", ' ', 0, 0,
- _("Toggle insert/overwrite\tIns"), '~', menu_cmd, CK_Toggle_Insert,
- "", ' ', 0, 0,
- _("Copy block to cursor\tF5"), '~', menu_cmd, CK_Copy,
- _("Move block to cursor\tF6"), '~', menu_cmd, CK_Move,
- _("Delete block\tF8/C-Del"), '~', menu_cmd, CK_Remove,
- "", ' ', 0, 0,
- _("Copy block to clipbrd\tC-Ins"), '~', menu_cmd, CK_XStore,
- _("Cut block to clipbrd\tS-Del"), '~', menu_cmd, CK_XCut,
- _("Paste block from clipbrd\tS-Ins"), '~', menu_cmd, CK_XPaste,
- _("Selection history\tM-Ins"), '~', menu_cmd, CK_Selection_History,
- "", ' ', 0, 0,
- _("Undo\tC-BackSpace"), '~', menu_cmd, CK_Undo
- );
-/* Tool hint */
- CSetToolHint (catstrs (ident, ".editmenu", 0), _("Manipulating blocks of text"));
-
- CGetHintPos (&x, &d);
-
- CDrawMenuButton (catstrs (ident, ".searchmenu", 0), parent, focus_return, x, y, AUTO_WIDTH, AUTO_HEIGHT, 4,
- _(" Srch/Replce "),
- _("Search...\tF7"), '~', menu_cmd, CK_Find,
- _("Search again\tF17"), '~', menu_cmd, CK_Find_Again,
- _("Replace...\tF4"), '~', menu_cmd, CK_Replace,
- _("Replace again\tF14"), '~', menu_cmd, CK_Replace_Again
- );
-/* Tool hint */
- CSetToolHint (catstrs (ident, ".searchmenu", 0), _("Search for and replace text"));
-
- CGetHintPos (&x, &d);
-
- CDrawMenuButton (catstrs (ident, ".commandmenu", 0), parent, focus_return, x, y, AUTO_WIDTH, AUTO_HEIGHT, 9,
- _(" Command "),
- _("Goto line...\tM-l"), '~', menu_cmd, CK_Goto,
- "", ' ', 0, 0,
- _("Start record macro\tC-r"), '~', menu_cmd, CK_Begin_Record_Macro,
- _("Finish record macro...\tC-r"), '~', menu_cmd, CK_End_Record_Macro,
- _("Execute macro...\tC-a, KEY"), '~', menu_ctrl_key, XK_a,
- _("Delete macro...\t"), '~', menu_cmd, CK_Delete_Macro,
- "", ' ', 0, 0,
- _("Insert date/time\tC-d"), '~', menu_cmd, CK_Date,
- _("Format paragraph\tM-p"), '~', menu_cmd, CK_Paragraph_Format
- );
-/* Tool hint */
- CSetToolHint (catstrs (ident, ".commandmenu", 0), _("Macros and internal commands"));
-}
-
-
-#endif /* !MIDNIGHT */
-
diff --git a/rosapps/applications/mc/edit/editoptions.c b/rosapps/applications/mc/edit/editoptions.c
deleted file mode 100644
index aea58843488..00000000000
--- a/rosapps/applications/mc/edit/editoptions.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* editor options dialog box
-
- Copyright (C) 1996, 1997 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#include "edit.h"
-
-#define OPT_DLG_H 15
-#define OPT_DLG_W 72
-
-#ifndef USE_INTERNAL_EDIT
-#define USE_INTERNAL_EDIT 1
-#endif
-
-#include "../src/main.h" /* extern int option_this_and_that ... */
-
-char *key_emu_str[] =
-{"Intuitive", "Emacs"};
-
-char *wrap_str[] =
-{N_("None"), N_("Dynamic paragraphing"), N_("Type writer wrap")};
-
-extern int option_syntax_highlighting;
-
-void edit_options_dialog (void)
-{
- char wrap_length[32], tab_spacing[32], *p, *q;
- int wrap_mode = 0;
- int tedit_key_emulation = edit_key_emulation;
- int toption_fill_tabs_with_spaces = option_fill_tabs_with_spaces;
- int tedit_confirm_save = edit_confirm_save;
- int tedit_syntax_highlighting = option_syntax_highlighting;
- int toption_return_does_auto_indent = option_return_does_auto_indent;
- int toption_backspace_through_tabs = option_backspace_through_tabs;
- int toption_fake_half_tabs = option_fake_half_tabs;
-
- QuickWidget quick_widgets[] =
- {
-/*0 */
- {quick_button, 6, 10, OPT_DLG_H - 3, OPT_DLG_H, "&Cancel", 0, B_CANCEL, 0,
- 0, XV_WLAY_DONTCARE, NULL},
-/*1 */
- {quick_button, 2, 10, OPT_DLG_H - 3, OPT_DLG_H, "&Ok", 0, B_ENTER, 0,
- 0, XV_WLAY_DONTCARE, NULL},
-/*2 */
- {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 4, OPT_DLG_H, "Word wrap line length : ", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*3 */
- {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 4, OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0,
- 0, 0, XV_WLAY_DONTCARE, "i"},
-/*4 */
- {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 5, OPT_DLG_H, "Tab spacing : ", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*5 */
- {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 5, OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0,
- 0, 0, XV_WLAY_DONTCARE, "i"},
-/*6 */
-#if !defined(MIDNIGHT) || defined(HAVE_SYNTAXH)
-#define OA 1
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H, "syntax h&Ighlighting", 8, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-#else
-#define OA 0
-#endif
-/*7 */
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 8, OPT_DLG_H, "confir&M before saving", 6, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*8 */
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 9, OPT_DLG_H, "&Fill tabs with spaces", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*9 */
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 10, OPT_DLG_H, "&Return does auto indent", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*10 */
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 11, OPT_DLG_H, "&Backspace through tabs", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*11 */
- {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 12, OPT_DLG_H, "&Fake half tabs", 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*12 */
- {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 6, OPT_DLG_H, "", 3, 0,
- 0, wrap_str, XV_WLAY_DONTCARE, "wrapm"},
-/*13 */
- {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H, N_("Wrap mode"), 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
-/*14 */
- {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 11, OPT_DLG_H, "", 2, 0,
- 0, key_emu_str, XV_WLAY_DONTCARE, "keyemu"},
-/*15 */
- {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 12, OPT_DLG_H, N_("Key emulation"), 0, 0,
- 0, 0, XV_WLAY_DONTCARE, NULL},
- {0}};
-
- sprintf (wrap_length, "%d", option_word_wrap_line_length);
- sprintf (tab_spacing, "%d", option_tab_spacing);
-
- quick_widgets[3].text = wrap_length;
- quick_widgets[3].str_result = &p;
- quick_widgets[5].text = tab_spacing;
- quick_widgets[5].str_result = &q;
- quick_widgets[5 + OA].result = &tedit_syntax_highlighting;
- quick_widgets[6 + OA].result = &tedit_confirm_save;
- quick_widgets[7 + OA].result = &toption_fill_tabs_with_spaces;
- quick_widgets[8 + OA].result = &toption_return_does_auto_indent;
- quick_widgets[9 + OA].result = &toption_backspace_through_tabs;
- quick_widgets[10 + OA].result = &toption_fake_half_tabs;
-
- if (option_auto_para_formatting)
- wrap_mode = 1;
- else if (option_typewriter_wrap)
- wrap_mode = 2;
- else
- wrap_mode = 0;
-
- quick_widgets[11 + OA].result = &wrap_mode;
- quick_widgets[11 + OA].value = wrap_mode;
-
- quick_widgets[13 + OA].result = &tedit_key_emulation;
- quick_widgets[13 + OA].value = tedit_key_emulation;
-
- {
- QuickDialog Quick_options =
- {OPT_DLG_W, OPT_DLG_H, -1, 0, " Editor Options ",
- "", "quick_input", 0};
-
- Quick_options.widgets = quick_widgets;
-
- if (quick_dialog (&Quick_options) != B_CANCEL) {
- if (p) {
- option_word_wrap_line_length = atoi (p);
- free (p);
- }
- if (q) {
- option_tab_spacing = atoi (q);
- if (option_tab_spacing < 0)
- option_tab_spacing = 2;
- option_tab_spacing += option_tab_spacing & 1;
- free (q);
- }
- option_syntax_highlighting = *quick_widgets[5 + OA].result;
- edit_confirm_save = *quick_widgets[6 + OA].result;
- option_fill_tabs_with_spaces = *quick_widgets[7 + OA].result;
- option_return_does_auto_indent = *quick_widgets[8 + OA].result;
- option_backspace_through_tabs = *quick_widgets[9 + OA].result;
- option_fake_half_tabs = *quick_widgets[10 + OA].result;
-
- if (*quick_widgets[11 + OA].result == 1) {
- option_auto_para_formatting = 1;
- option_typewriter_wrap = 0;
- } else if (*quick_widgets[11 + OA].result == 2) {
- option_auto_para_formatting = 0;
- option_typewriter_wrap = 1;
- } else {
- option_auto_para_formatting = 0;
- option_typewriter_wrap = 0;
- }
-
- edit_key_emulation = *quick_widgets[13 + OA].result;
-
- return;
- } else {
- return;
- }
- }
-}
-
diff --git a/rosapps/applications/mc/edit/editwidget.c b/rosapps/applications/mc/edit/editwidget.c
deleted file mode 100644
index f959796f312..00000000000
--- a/rosapps/applications/mc/edit/editwidget.c
+++ /dev/null
@@ -1,1082 +0,0 @@
-/* editor initialisation and callback handler.
-
- Copyright (C) 1996, 1997 the Free Software Foundation
-
- Authors: 1996, 1997 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-
-#include
-#include "edit.h"
-
-#ifndef MIDNIGHT
-#include /* CARD32 */
-#include
-#include "app_glob.c"
-#include "coollocal.h"
-#include "editcmddef.h"
-#include "mousemark.h"
-#endif
-
-
-#ifndef MIDNIGHT
-
-extern int EditExposeRedraw;
-CWidget *wedit = 0;
-
-void edit_destroy_callback (CWidget * w)
-{
- if (w) {
- edit_clean (w->editor);
- if (w->editor)
- free (w->editor);
- w->editor = NULL;
- } else
-/* NLS ? */
- CError ("Trying to destroy non-existing editor widget.\n");
-}
-
-void link_hscrollbar_to_editor (CWidget * scrollbar, CWidget * editor, XEvent * xevent, CEvent * cwevent, int whichscrbutton);
-
-extern int option_editor_bg_normal;
-void edit_tri_cursor (Window win);
-/* starting_directory is for the filebrowser */
-CWidget *CDrawEditor (const char *identifier, Window parent, int x, int y,
- int width, int height, const char *text, const char *filename,
- const char *starting_directory, unsigned int options, unsigned long text_size)
-{
- static made_directory = 0;
- int extra_space_for_hscroll = 0;
- CWidget *w;
- WEdit *e;
-
- if (options & EDITOR_HORIZ_SCROLL)
- extra_space_for_hscroll = 8;
-
- wedit = w = CSetupWidget (identifier, parent, x, y,
- width + 7, height + 6, C_EDITOR_WIDGET,
- ExposureMask | ButtonPressMask | ButtonReleaseMask | \
- KeyPressMask | KeyReleaseMask | ButtonMotionMask | \
- PropertyChangeMask | StructureNotifyMask | \
- EnterWindowMask | LeaveWindowMask, color_palette (option_editor_bg_normal), 1);
- edit_tri_cursor (w->winid);
- w->options = options | WIDGET_TAKES_SELECTION;
-
- w->destroy = edit_destroy_callback;
- if (filename)
- w->label = strdup (filename);
- else
- w->label = strdup ("");
-
- if (!made_directory) {
- mkdir (catstrs (home_dir, EDIT_DIR, 0), 0700);
- made_directory = 1;
- }
- e = w->editor = CMalloc (sizeof (WEdit));
- if (!w->editor) {
-/* Not essential to translate */
- CError (_ ("Error initialising editor.\n"));
- return 0;
- }
- w->editor->widget = w;
- e = w->editor = edit_init (e, height / FONT_PIX_PER_LINE, width / FONT_MEAN_WIDTH, filename, text, starting_directory, text_size);
- if (!e) {
- CDestroyWidget (w->ident);
- return 0;
- }
- e->macro_i = -1;
- e->widget = w;
-
- set_hint_pos (x + width + 7 + WIDGET_SPACING, y + height + 6 + WIDGET_SPACING + extra_space_for_hscroll);
- if (extra_space_for_hscroll) {
- w->hori_scrollbar = CDrawHorizontalScrollbar (catstrs (identifier, ".hsc", 0), parent,
- x, y + height + 6, width + 6, 12, 0, 0);
- CSetScrollbarCallback (w->hori_scrollbar->ident, w->ident, link_hscrollbar_to_editor);
- }
- if (!(options & EDITOR_NO_TEXT))
- CDrawText (catstrs (identifier, ".text", 0), parent, x, y + height + 6 + WIDGET_SPACING + extra_space_for_hscroll, "%s", e->filename);
- if (!(options & EDITOR_NO_SCROLL)) {
- w->vert_scrollbar = CDrawVerticalScrollbar (catstrs (identifier, ".vsc", 0), parent,
- x + width + 7 + WIDGET_SPACING, y, height + 6, 20, 0, 0);
- CSetScrollbarCallback (w->vert_scrollbar->ident, w->ident, link_scrollbar_to_editor);
- }
- return w;
-}
-
-void update_scroll_bars (WEdit * e)
-{
- int i, x1, x2;
- CWidget *scroll;
- scroll = e->widget->vert_scrollbar;
- if (scroll) {
- i = e->total_lines - e->start_line + 1;
- if (i > e->num_widget_lines)
- i = e->num_widget_lines;
- if (e->total_lines) {
- x1 = (double) 65535.0 *e->start_line / (e->total_lines + 1);
- x2 = (double) 65535.0 *i / (e->total_lines + 1);
- } else {
- x1 = 0;
- x2 = 65535;
- }
- if (x1 != scroll->firstline || x2 != scroll->numlines) {
- scroll->firstline = x1;
- scroll->numlines = x2;
- EditExposeRedraw = 1;
- render_scrollbar (scroll);
- EditExposeRedraw = 0;
- }
- }
- scroll = e->widget->hori_scrollbar;
- if (scroll) {
- i = e->max_column - (-e->start_col) + 1;
- if (i > e->num_widget_columns * FONT_MEAN_WIDTH)
- i = e->num_widget_columns * FONT_MEAN_WIDTH;
- x1 = (double) 65535.0 *(-e->start_col) / (e->max_column + 1);
- x2 = (double) 65535.0 *i / (e->max_column + 1);
- if (x1 != scroll->firstline || x2 != scroll->numlines) {
- scroll->firstline = x1;
- scroll->numlines = x2;
- EditExposeRedraw = 1;
- render_scrollbar (scroll);
- EditExposeRedraw = 0;
- }
- }
-}
-
-/* returns the position in the edit buffer of a window click */
-long edit_get_click_pos (WEdit * edit, int x, int y)
-{
- long click;
-/* (1) goto to left margin */
- click = edit_bol (edit, edit->curs1);
-
-/* (1) move up or down */
- if (y > (edit->curs_row + 1))
- click = edit_move_forward (edit, click, y - (edit->curs_row + 1), 0);
- if (y < (edit->curs_row + 1))
- click = edit_move_backward (edit, click, (edit->curs_row + 1) - y);
-
-/* (3) move right to x pos */
- click = edit_move_forward3 (edit, click, x - edit->start_col - 1, 0);
- return click;
-}
-
-void edit_translate_xy (int xs, int ys, int *x, int *y)
-{
- *x = xs - EDIT_TEXT_HORIZONTAL_OFFSET;
- *y = (ys - EDIT_TEXT_VERTICAL_OFFSET - option_text_line_spacing / 2 - 1) / FONT_PIX_PER_LINE + 1;
-}
-
-extern int just_dropped_something;
-
-static void mouse_redraw (WEdit * edit, long click)
-{
- edit->force |= REDRAW_PAGE | REDRAW_LINE;
- edit_update_curs_row (edit);
- edit_update_curs_col (edit);
- edit->prev_col = edit_get_col (edit);
- edit_update_screen (edit);
- edit->search_start = click;
-}
-
-static void xy (int x, int y, int *x_return, int *y_return)
-{
- edit_translate_xy (x, y, x_return, y_return);
-}
-
-static long cp (WEdit *edit, int x, int y)
-{
- return edit_get_click_pos (edit, x, y);
-}
-
-/* return 1 if not marked */
-static int marks (WEdit * edit, long *start, long *end)
-{
- return eval_marks (edit, start, end);
-}
-
-int column_highlighting = 0;
-
-static int erange (WEdit * edit, long start, long end, int click)
-{
- if (column_highlighting) {
- int x;
- x = edit_move_forward3 (edit, edit_bol (edit, click), 0, click);
- if ((x >= edit->column1 && x < edit->column2)
- || (x > edit->column2 && x <= edit->column1))
- return (start <= click && click < end);
- else
- return 0;
- }
- return (start <= click && click < end);
-}
-
-static void fin_mark (WEdit *edit)
-{
- if (edit->mark2 < 0)
- edit_mark_cmd (edit, 0);
-}
-
-static void move_mark (WEdit *edit)
-{
- edit_mark_cmd (edit, 1);
- edit_mark_cmd (edit, 0);
-}
-
-static void release_mark (WEdit *edit, XEvent *event)
-{
- if (edit->mark2 < 0)
- edit_mark_cmd (edit, 0);
- else
- edit_mark_cmd (edit, 1);
- if (edit->mark1 != edit->mark2) {
- edit_get_selection (edit);
- XSetSelectionOwner (CDisplay, XA_PRIMARY, edit->widget->winid, event->xbutton.time);
- }
-}
-
-static char *get_block (WEdit * edit, long start_mark, long end_mark, int *type, int *l)
-{
- char *t;
- t = (char *) edit_get_block (edit, start_mark, end_mark, l);
- if (strlen (t) < *l)
- *type = DndRawData; /* if there are nulls in the data, send as raw */
- else
- *type = DndText; /* else send as text */
- return t;
-}
-
-static void move (WEdit *edit, long click, int y)
-{
- edit_cursor_move (edit, click - edit->curs1);
-}
-
-static void dclick (WEdit *edit, XEvent *event)
-{
- edit_mark_cmd (edit, 1);
- edit_right_word_move (edit);
- edit_mark_cmd (edit, 0);
- edit_left_word_move (edit);
- release_mark (edit, event);
-}
-
-static void redraw (WEdit *edit, long click)
-{
- mouse_redraw (edit, click);
-}
-
-static void edit_mouse_mark (WEdit * edit, XEvent * event, CEvent * ce)
-{
- edit_update_curs_row (edit);
- edit_update_curs_col (edit);
- if (event->type != MotionNotify) {
- edit_push_action (edit, KEY_PRESS + edit->start_display);
- if (edit->mark2 == -1)
- edit_push_action (edit, MARK_1 + edit->mark1); /* mark1 must be following the cursor */
- }
- if (event->type == ButtonPress) {
- edit->highlight = 0;
- edit->found_len = 0;
- }
- mouse_mark (
- (void *) edit,
- event,
- ce,
- (void (*) (int, int, int *, int *)) xy,
- (long (*) (void *, int, int)) cp,
- (int (*) (void *, long *, long *)) marks,
- (int (*) (void *, long, long, long)) erange,
- (void (*) (void *)) fin_mark,
- (void (*) (void *)) move_mark,
- (void (*) (void *, XEvent *)) release_mark,
- (char * (*) (void *, long, long, int *, int *)) get_block,
- (void (*) (void *, long, int)) move,
- 0,
- (void (*) (void *, XEvent *)) dclick,
- (void (*) (void *, long)) redraw
- );
-}
-
-void link_scrollbar_to_editor (CWidget * scrollbar, CWidget * editor, XEvent * xevent, CEvent * cwevent, int whichscrbutton)
-{
- int i, start_line;
- WEdit *e;
- e = editor->editor;
- if (!e)
- return;
- if (!e->widget->vert_scrollbar)
- return;
- start_line = e->start_line;
- if ((xevent->type == ButtonRelease || xevent->type == MotionNotify) && whichscrbutton == 3) {
- edit_move_display (e, (double) scrollbar->firstline * e->total_lines / 65535.0 + 1);
- } else if (xevent->type == ButtonPress && (cwevent->button == Button1 || cwevent->button == Button2)) {
- switch (whichscrbutton) {
- case 1:
- edit_move_display (e, e->start_line - e->num_widget_lines + 1);
- break;
- case 2:
- edit_move_display (e, e->start_line - 1);
- break;
- case 5:
- edit_move_display (e, e->start_line + 1);
- break;
- case 4:
- edit_move_display (e, e->start_line + e->num_widget_lines - 1);
- break;
- }
- }
- if (e->total_lines)
- scrollbar->firstline = (double) 65535.0 *e->start_line / (e->total_lines + 1);
- else
- scrollbar->firstline = 0;
- i = e->total_lines - e->start_line + 1;
- if (i > e->num_widget_lines)
- i = e->num_widget_lines;
- if (e->total_lines)
- scrollbar->numlines = (double) 65535.0 *i / (e->total_lines + 1);
- else
- scrollbar->numlines = 65535;
- if (start_line != e->start_line) {
- e->force |= REDRAW_PAGE | REDRAW_LINE;
- set_cursor_position (0, 0, 0, 0, 0, 0, 0, 0, 0);
- if (CCheckWindowEvent (xevent->xany.window, ButtonReleaseMask | ButtonMotionMask, 0))
- return;
- }
- if (e->force) {
- edit_render_keypress (e);
- edit_status (e);
- }
-}
-
-void link_hscrollbar_to_editor (CWidget * scrollbar, CWidget * editor, XEvent * xevent, CEvent * cwevent, int whichscrbutton)
-{
- int i, start_col;
- WEdit *e;
- e = editor->editor;
- if (!e)
- return;
- if (!e->widget->hori_scrollbar)
- return;
- start_col = (-e->start_col);
- if ((xevent->type == ButtonRelease || xevent->type == MotionNotify) && whichscrbutton == 3) {
- e->start_col = (double) scrollbar->firstline * e->max_column / 65535.0 + 1;
- e->start_col -= e->start_col % FONT_MEAN_WIDTH;
- if (e->start_col < 0)
- e->start_col = 0;
- e->start_col = (-e->start_col);
- } else if (xevent->type == ButtonPress && (cwevent->button == Button1 || cwevent->button == Button2)) {
- switch (whichscrbutton) {
- case 1:
- edit_scroll_left (e, (e->num_widget_columns - 1) * FONT_MEAN_WIDTH);
- break;
- case 2:
- edit_scroll_left (e, FONT_MEAN_WIDTH);
- break;
- case 5:
- edit_scroll_right (e, FONT_MEAN_WIDTH);
- break;
- case 4:
- edit_scroll_right (e, (e->num_widget_columns - 1) * FONT_MEAN_WIDTH);
- break;
- }
- }
- scrollbar->firstline = (double) 65535.0 *(-e->start_col) / (e->max_column + 1);
- i = e->max_column - (-e->start_col) + 1;
- if (i > e->num_widget_columns * FONT_MEAN_WIDTH)
- i = e->num_widget_columns * FONT_MEAN_WIDTH;
- scrollbar->numlines = (double) 65535.0 *i / (e->max_column + 1);
- if (start_col != (-e->start_col)) {
- e->force |= REDRAW_PAGE | REDRAW_LINE;
- set_cursor_position (0, 0, 0, 0, 0, 0, 0, 0, 0);
- if (CCheckWindowEvent (xevent->xany.window, ButtonReleaseMask | ButtonMotionMask, 0))
- return;
- }
- if (e->force) {
- edit_render_keypress (e);
- edit_status (e);
- }
-}
-
-/*
- This section comes from rxvt-2.21b1/src/screen.c by
- Robert Nation &
- mods by mj olesen
-
- Changes made for cooledit
- */
-void selection_send (XSelectionRequestEvent * rq)
-{
- XEvent ev;
- static Atom xa_targets = None;
- if (xa_targets == None)
- xa_targets = XInternAtom (CDisplay, "TARGETS", False);
-
- ev.xselection.type = SelectionNotify;
- ev.xselection.property = None;
- ev.xselection.display = rq->display;
- ev.xselection.requestor = rq->requestor;
- ev.xselection.selection = rq->selection;
- ev.xselection.target = rq->target;
- ev.xselection.time = rq->time;
-
- if (rq->target == xa_targets) {
- /*
- * On some systems, the Atom typedef is 64 bits wide.
- * We need to have a typedef that is exactly 32 bits wide,
- * because a format of 64 is not allowed by the X11 protocol.
- */
- typedef CARD32 Atom32;
-
- Atom32 target_list[2];
-
- target_list[0] = (Atom32) xa_targets;
- target_list[1] = (Atom32) XA_STRING;
-
- XChangeProperty (CDisplay, rq->requestor, rq->property,
- xa_targets, 8 * sizeof (target_list[0]), PropModeReplace,
- (unsigned char *) target_list,
- sizeof (target_list) / sizeof (target_list[0]));
- ev.xselection.property = rq->property;
- } else if (rq->target == XA_STRING) {
- XChangeProperty (CDisplay, rq->requestor, rq->property,
- XA_STRING, 8, PropModeReplace,
- selection.text, selection.len);
- ev.xselection.property = rq->property;
- }
- XSendEvent (CDisplay, rq->requestor, False, 0, &ev);
-}
-
-/*{{{ paste selection */
-
-/*
- * Respond to a notification that a primary selection has been sent
- */
-void paste_prop (void *data, void (*insert) (void *, int), Window win, unsigned prop, int delete)
-{
- long nread;
- unsigned long bytes_after;
-
- if (prop == None)
- return;
-
- nread = 0;
- do {
- unsigned char *s;
- Atom actual_type;
- int actual_fmt, i;
- unsigned long nitems;
-
- if (XGetWindowProperty (CDisplay, win, prop,
- nread / 4, 65536, delete,
- AnyPropertyType, &actual_type, &actual_fmt,
- &nitems, &bytes_after,
- &s) != Success) {
- XFree (s);
- return;
- }
- nread += nitems;
- for (i = 0; i < nitems; i++)
- (*insert) (data, s[i]);
- XFree (s);
- } while (bytes_after);
-}
-
-void selection_paste (WEdit * edit, Window win, unsigned prop, int delete)
-{
- long c;
- c = edit->curs1;
- paste_prop ((void *) edit,
- (void (*)(void *, int)) edit_insert,
- win, prop, delete);
- edit_cursor_move (edit, c - edit->curs1);
- edit->force |= REDRAW_COMPLETELY | REDRAW_LINE;
-}
-
-/*}}} */
-
-void selection_clear (void)
-{
- selection.text = 0;
- selection.len = 0;
-}
-
-void edit_update_screen (WEdit * e)
-{
- if (!e)
- return;
- if (!e->force)
- return;
-
- edit_scroll_screen_over_cursor (e);
- edit_update_curs_row (e);
- edit_update_curs_col (e);
- update_scroll_bars (e);
- edit_status (e);
-
- if (e->force & REDRAW_COMPLETELY)
- e->force |= REDRAW_PAGE;
-
-/* pop all events for this window for internal handling */
- if (e->force & (REDRAW_CHAR_ONLY | REDRAW_COMPLETELY)) {
- edit_render_keypress (e);
- } else if (CCheckWindowEvent (e->widget->winid, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask, 0)
- || CKeyPending ()) {
- e->force |= REDRAW_PAGE;
- return;
- } else {
- edit_render_keypress (e);
- }
-}
-
-extern int space_width;
-
-static void edit_insert_column_of_text (WEdit * edit, unsigned char *data, int size, int width)
-{
- long cursor;
- int i, col;
- cursor = edit->curs1;
- col = edit_get_col (edit);
- for (i = 0; i < size; i++) {
- if (data[i] == '\n') { /* fill in and move to next line */
- int l;
- long p;
- if (edit_get_byte (edit, edit->curs1) != '\n') {
- l = width - (edit_get_col (edit) - col);
- while (l > 0) {
- edit_insert (edit, ' ');
- l -= space_width;
- }
- }
- for (p = edit->curs1;; p++) {
- if (p == edit->last_byte)
- edit_insert_ahead (edit, '\n');
- if (edit_get_byte (edit, p) == '\n') {
- p++;
- break;
- }
- }
- edit_cursor_move (edit, edit_move_forward3 (edit, p, col, 0) - edit->curs1);
- l = col - edit_get_col (edit);
- while (l >= space_width) {
- edit_insert (edit, ' ');
- l -= space_width;
- }
- continue;
- }
- edit_insert (edit, data[i]);
- }
- edit_cursor_move (edit, cursor - edit->curs1);
-}
-
-#define free_data if (data) {free(data);data=0;}
-
-/* handles drag and drop */
-void handle_client_message (CWidget * w, XEvent * xevent, CEvent * cwevent)
-{
- int data_type;
- unsigned char *data;
- unsigned long size;
- int xs, ys;
- long start_line;
- int x, y, r, deleted = 0;
- long click;
- unsigned int state;
- long start_mark = 0, end_mark = 0;
- WEdit *e = w->editor;
-
-/* see just below for a comment on what this is for: */
- if (CIsDropAcknowledge (xevent, &state) != DndNotDnd) {
- if (!(state & Button1Mask) && just_dropped_something) {
- edit_push_action (e, KEY_PRESS + e->start_display);
- edit_block_delete_cmd (e);
- }
- return;
- }
- data_type = CGetDrop (xevent, &data, &size, &xs, &ys);
-
- if (data_type == DndNotDnd || xs < 0 || ys < 0 || xs >= w->width || ys >= w->height) {
- free_data;
- return;
- }
- edit_translate_xy (xs, ys, &x, &y);
- click = edit_get_click_pos (e, x, y);
-
- r = eval_marks (e, &start_mark, &end_mark);
-/* musn't be able to drop into a block, otherwise a single click will copy a block: */
- if (r)
- goto fine;
- if (start_mark > click || click >= end_mark)
- goto fine;
- if (column_highlighting) {
- if (!((x >= e->column1 && x < e->column2)
- || (x > e->column2 && x <= e->column1)))
- goto fine;
- }
- free_data;
- return;
- fine:
- edit_push_action (e, KEY_PRESS + e->start_display);
-
-/* drops to the same window moving to the left: */
- start_line = e->start_line;
- if (xevent->xclient.data.l[2] == xevent->xclient.window && !(xevent->xclient.data.l[1] & Button1Mask))
- if ((column_highlighting && x < max (e->column1, e->column2)) || !column_highlighting) {
- edit_block_delete_cmd (e);
- deleted = 1;
- }
- edit_update_curs_row (e);
- edit_move_display (e, start_line);
- click = edit_get_click_pos (e, x, y); /* click pos changes with edit_block_delete_cmd() */
- edit_cursor_move (e, click - e->curs1);
- if (data_type == DndFile) {
- edit_insert_file (e, (char *) data);
- } else if (data_type != DndFiles) {
- if (dnd_null_term_type (data_type)) {
- int len;
- len = strlen ((char *) data);
- size = min (len, size);
- }
- if (column_highlighting) {
- edit_insert_column_of_text (e, data, size, abs (e->column2 - e->column1));
- } else {
- while (size--)
- edit_insert_ahead (e, data[size]);
- }
- } else {
- while (size--)
- edit_insert_ahead (e, data[size] ? data[size] : '\n');
- }
-
-/* drops to the same window moving to the right: */
- if (xevent->xclient.data.l[2] == xevent->xclient.window && !(xevent->xclient.data.l[1] & Button1Mask))
- if (column_highlighting && !deleted)
- edit_block_delete_cmd (e);
-
-/* The drop has now been successfully recieved. We can now send an acknowledge
- event back to the window that send the data. When this window recieves
- the acknowledge event, the app can decide whether or not to delete the data.
- This allows text to be safely moved betweem text windows without the
- risk of data being lost. In our case, drag with button1 is a copy
- drag, while drag with any other button is a move drag (i.e. the sending
- application must delete its selection after recieving an acknowledge
- event). We must not, however, send an acknowledge signal if a filelist
- (for example) was passed to us, since the sender might take this to
- mean that all those files can be deleted! The two types we can acknowledge
- are: */
- if (xevent->xclient.data.l[2] != xevent->xclient.window) /* drops to the same window */
- if (data_type == DndText || data_type == DndRawData)
- CDropAcknowledge (xevent);
- e->force |= REDRAW_COMPLETELY | REDRAW_LINE;
- free_data;
-}
-
-int eh_editor (CWidget * w, XEvent * xevent, CEvent * cwevent)
-{
- WEdit *e = w->editor;
- int r = 0;
- static int old_tab_spacing = -1;
-
- if (!e)
- return 0;
-
- if (old_tab_spacing != option_tab_spacing)
- e->force |= REDRAW_COMPLETELY + REDRAW_LINE;
- old_tab_spacing = option_tab_spacing;
-
- if (xevent->type == KeyPress) {
- if (xevent->xkey.keycode == 0x31 && xevent->xkey.state == 0xD) {
- CSetColor (color_palette (18));
- CRectangle (w->winid, 0, 0, w->width, w->height);
- }
- }
- switch (xevent->type) {
- case SelectionNotify:
- selection_paste (e, xevent->xselection.requestor, xevent->xselection.property, True);
- r = 1;
- break;
- case SelectionRequest:
- selection_send (&(xevent->xselectionrequest));
- return 1;
-/* case SelectionClear: ---> This is handled by coolnext.c: CNextEvent() */
- case ClientMessage:
- handle_client_message (w, xevent, cwevent);
- r = 1;
- break;
- case ButtonPress:
- CFocus (w);
- edit_render_tidbits (w);
- case ButtonRelease:
- if (xevent->xbutton.state & ControlMask)
- column_highlighting = 1;
- else
- column_highlighting = 0;
- case MotionNotify:
- if (!xevent->xmotion.state && xevent->type == MotionNotify)
- return 0;
- resolve_button (xevent, cwevent);
- edit_mouse_mark (e, xevent, cwevent);
- break;
- case Expose:
- edit_render_expose (e, &(xevent->xexpose));
- return 1;
- case FocusIn:
- CSetCursorColor (e->overwrite ? color_palette (24) : color_palette (19));
- case FocusOut:
- edit_render_tidbits (w);
- e->force |= REDRAW_CHAR_ONLY | REDRAW_LINE;
- edit_render_keypress (e);
- return 1;
- break;
- case KeyRelease:
- if (column_highlighting) {
- column_highlighting = 0;
- e->force = REDRAW_COMPLETELY | REDRAW_LINE;
- edit_mark_cmd (e, 1);
- }
- break;
- case KeyPress:
- cwevent->ident = w->ident;
- if (!cwevent->command && cwevent->insert < 0) { /* no translation */
- if ((cwevent->key == XK_r || cwevent->key == XK_R) && (cwevent->state & ControlMask)) {
- cwevent->command = e->macro_i < 0 ? CK_Begin_Record_Macro : CK_End_Record_Macro;
- } else {
- cwevent->command = CKeySymMod (xevent);
- if (cwevent->command > 0)
- cwevent->command = CK_Macro (cwevent->command);
- else
- break;
- }
- }
- r = edit_execute_key_command (e, cwevent->command, cwevent->insert);
- if (r)
- edit_update_screen (e);
- return r;
- break;
- case EditorCommand:
- cwevent->ident = w->ident;
- cwevent->command = xevent->xkey.keycode;
- r = cwevent->handled = edit_execute_key_command (e, xevent->xkey.keycode, -1);
- break;
- default:
- return 0;
- }
- edit_update_screen (e);
- return r;
-}
-
-#else
-
-WEdit *wedit;
-WButtonBar *edit_bar;
-Dlg_head *edit_dlg;
-WMenu *edit_menubar;
-
-int column_highlighting = 0;
-
-static int edit_callback (Dlg_head * h, WEdit * edit, int msg, int par);
-
-static int edit_mode_callback (struct Dlg_head *h, int id, int msg)
-{
- return 0;
-}
-
-int edit_event (WEdit * edit, Gpm_Event * event, int *result)
-{
- *result = MOU_NORMAL;
- edit_update_curs_row (edit);
- edit_update_curs_col (edit);
- if (event->type & (GPM_DOWN | GPM_DRAG | GPM_UP)) {
- if (event->y > 1 && event->x > 0
- && event->x <= edit->num_widget_columns
- && event->y <= edit->num_widget_lines + 1) {
- if (edit->mark2 != -1 && event->type & (GPM_UP | GPM_DRAG))
- return 1; /* a lone up mustn't do anything */
- if (event->type & (GPM_DOWN | GPM_UP))
- edit_push_key_press (edit);
- edit_cursor_move (edit, edit_bol (edit, edit->curs1) - edit->curs1);
- if (--event->y > (edit->curs_row + 1))
- edit_cursor_move (edit,
- edit_move_forward (edit, edit->curs1, event->y - (edit->curs_row + 1), 0)
- - edit->curs1);
- if (event->y < (edit->curs_row + 1))
- edit_cursor_move (edit,
- +edit_move_backward (edit, edit->curs1, (edit->curs_row + 1) - event->y)
- - edit->curs1);
- edit_cursor_move (edit, (int) edit_move_forward3 (edit, edit->curs1,
- event->x - edit->start_col - 1, 0) - edit->curs1);
- edit->prev_col = edit_get_col (edit);
- if (event->type & GPM_DOWN) {
- edit_mark_cmd (edit, 1); /* reset */
- edit->highlight = 0;
- }
- if (!(event->type & GPM_DRAG))
- edit_mark_cmd (edit, 0);
- edit->force |= REDRAW_COMPLETELY;
- edit_update_curs_row (edit);
- edit_update_curs_col (edit);
- edit_update_screen (edit);
- return 1;
- }
- }
- return 0;
-}
-
-
-
-int menubar_event (Gpm_Event * event, WMenu * menubar); /* menu.c */
-
-int edit_mouse_event (Gpm_Event * event, void *x)
-{
- int result;
- if (edit_event ((WEdit *) x, event, &result))
- return result;
- else
- return menubar_event (event, edit_menubar);
-}
-
-extern Menu EditMenuBar[5];
-
-int edit (const char *_file, int line)
-{
- static int made_directory = 0;
- int framed = 0;
- int midnight_colors[4];
- char *text = 0;
-
- if (option_backup_ext_int != -1) {
- option_backup_ext = malloc (sizeof(int) + 1);
- option_backup_ext[sizeof(int)] = '\0';
- memcpy (option_backup_ext, (char *) &option_backup_ext_int, sizeof (int));
- }
-
- if (!made_directory) {
- mkdir (catstrs (home_dir, EDIT_DIR, 0), 0700);
- made_directory = 1;
- }
- if (_file) {
- if (!(*_file)) {
- _file = 0;
- text = "";
- }
- } else
- text = "";
-
- if (!(wedit = edit_init (NULL, LINES - 2, COLS, _file, text, "", 0))) {
- message (1, _(" Error "), get_error_msg (""));
- return 0;
- }
- wedit->macro_i = -1;
-
- /* Create a new dialog and add it widgets to it */
- edit_dlg = create_dlg (0, 0, LINES, COLS, midnight_colors,
- edit_mode_callback, "[Internal File Editor]",
- "edit",
- DLG_NONE);
-
- edit_dlg->raw = 1; /*so that tab = '\t' key works */
-
- init_widget (&(wedit->widget), 0, 0, LINES - 1, COLS,
- (callback_fn) edit_callback,
- (destroy_fn) edit_clean,
- (mouse_h) edit_mouse_event, 0);
-
- widget_want_cursor (wedit->widget, 1);
-
- edit_bar = buttonbar_new (1);
-
- if (!framed) {
- switch (edit_key_emulation) {
- case EDIT_KEY_EMULATION_NORMAL:
- edit_init_menu_normal (); /* editmenu.c */
- break;
- case EDIT_KEY_EMULATION_EMACS:
- edit_init_menu_emacs (); /* editmenu.c */
- break;
- }
- edit_menubar = menubar_new (0, 0, COLS, EditMenuBar, N_menus);
- }
- add_widget (edit_dlg, wedit);
-
- if (!framed)
- add_widget (edit_dlg, edit_menubar);
-
- add_widget (edit_dlg, edit_bar);
- edit_move_display (wedit, line - 1);
- edit_move_to_line (wedit, line - 1);
-
- run_dlg (edit_dlg);
-
- if (!framed)
- edit_done_menu (); /* editmenu.c */
-
- destroy_dlg (edit_dlg);
-
- return 1;
-}
-
-static void edit_my_define (Dlg_head * h, int idx, char *text,
- void (*fn) (WEdit *), WEdit * edit)
-{
- define_label_data (h, (Widget *) edit, idx, text, (buttonbarfn) fn, edit);
-}
-
-
-void cmd_F1 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (1));
-}
-
-void cmd_F2 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (2));
-}
-
-void cmd_F3 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (3));
-}
-
-void cmd_F4 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (4));
-}
-
-void cmd_F5 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (5));
-}
-
-void cmd_F6 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (6));
-}
-
-void cmd_F7 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (7));
-}
-
-void cmd_F8 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (8));
-}
-
-void cmd_F9 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (9));
-}
-
-void cmd_F10 (WEdit * edit)
-{
- send_message (edit->widget.parent, (Widget *) edit, WIDGET_KEY, KEY_F (10));
-}
-
-void edit_labels (WEdit * edit)
-{
- Dlg_head *h = edit->widget.parent;
-
- edit_my_define (h, 1, _("Help"), cmd_F1, edit);
- edit_my_define (h, 2, _("Save"), cmd_F2, edit);
- edit_my_define (h, 3, _("Mark"), cmd_F3, edit);
- edit_my_define (h, 4, _("Replac"), cmd_F4, edit);
- edit_my_define (h, 5, _("Copy"), cmd_F5, edit);
- edit_my_define (h, 6, _("Move"), cmd_F6, edit);
- edit_my_define (h, 7, _("Search"), cmd_F7, edit);
- edit_my_define (h, 8, _("Delete"), cmd_F8, edit);
- if (!edit->have_frame)
- edit_my_define (h, 9, _("PullDn"), edit_menu_cmd, edit);
- edit_my_define (h, 10, _("Quit"), cmd_F10, edit);
-
- redraw_labels (h, (Widget *) edit);
-}
-
-
-long get_key_state ()
-{
- return (long) get_modifier ();
-}
-
-void edit_adjust_size (Dlg_head * h)
-{
- WEdit *edit;
- WButtonBar *edit_bar;
-
- edit = (WEdit *) find_widget_type (h, (callback_fn) edit_callback);
- edit_bar = (WButtonBar *) edit->widget.parent->current->next->widget;
- widget_set_size (&edit->widget, 0, 0, LINES - 1, COLS);
- widget_set_size (&edit_bar->widget, LINES - 1, 0, 1, COLS);
- widget_set_size (&edit_menubar->widget, 0, 0, 1, COLS);
-
-#ifdef RESIZABLE_MENUBAR
- menubar_arrange(edit_menubar);
-#endif
-}
-
-void edit_update_screen (WEdit * e)
-{
- edit_scroll_screen_over_cursor (e);
-
- edit_update_curs_col (e);
- edit_status (e);
-
-/* pop all events for this window for internal handling */
-
- if (!is_idle ()) {
- e->force |= REDRAW_PAGE;
- return;
- }
- if (e->force & REDRAW_COMPLETELY)
- e->force |= REDRAW_PAGE;
- edit_render_keypress (e);
-}
-
-static int edit_callback (Dlg_head * h, WEdit * e, int msg, int par)
-{
- switch (msg) {
- case WIDGET_INIT:
- e->force |= REDRAW_COMPLETELY;
- edit_labels (e);
- break;
- case WIDGET_DRAW:
- e->force |= REDRAW_COMPLETELY;
- e->num_widget_lines = LINES - 2;
- e->num_widget_columns = COLS;
- case WIDGET_FOCUS:
- edit_update_screen (e);
- return 1;
- case WIDGET_KEY:{
- int cmd, ch;
- if (edit_drop_hotkey_menu (e, par)) /* first check alt-f, alt-e, alt-s, etc for drop menus */
- return 1;
- if (!edit_translate_key (e, 0, par, get_key_state (), &cmd, &ch))
- return 0;
- edit_execute_key_command (e, cmd, ch);
- edit_update_screen (e);
- }
- return 1;
- case WIDGET_COMMAND:
- edit_execute_key_command (e, par, -1);
- edit_update_screen (e);
- return 1;
- case WIDGET_CURSOR:
- widget_move (&e->widget, e->curs_row + EDIT_TEXT_VERTICAL_OFFSET, e->curs_col + e->start_col);
- return 1;
- }
- return default_proc (h, msg, par);
-}
-
-#endif
diff --git a/rosapps/applications/mc/edit/makefile.in b/rosapps/applications/mc/edit/makefile.in
deleted file mode 100644
index ccff9f174ee..00000000000
--- a/rosapps/applications/mc/edit/makefile.in
+++ /dev/null
@@ -1,84 +0,0 @@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-rootdir = $(srcdir)/..
-@MCFG@@MCF@
-
-CFLAGS = $(XCFLAGS)
-CPPFLAGS = $(XCPPFLAGS)
-LDFLAGS = $(XLDFLAGS)
-DEFS = $(XDEFS)
-LIBS = @SHADOWLIB@ $(XLIBS) @TERMNET@ @PAMLIBS@ $(XLIB)
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-AR = @AR@
-
-#
-# Distribution variables
-#
-
-EDITSRC = edit.c editcmd.c editwidget.c edit_key_translator.c editdraw.c \
- edit.h editmenu.c editcmddef.h wordproc.c syntax.c editoptions.c
-
-EDITOBJS = edit.o editcmd.o editwidget.o editdraw.o editmenu.o wordproc.o \
- syntax.o editoptions.o
-
-DIST = Makefile.in README.edit $(EDITSRC)
-
-all: @LIBEDIT_A@
-
-.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DMIDNIGHT $<
-
-check:
- @echo no tests are supplied.
-
-libedit.a: $(EDITOBJS)
- $(RMF) $@
- $(AR) cr $@ $(EDITOBJS)
- -$(RANLIB) $@
-
-mcedit:
- -$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
- $(LN_S) mc $(DESTDIR)$(bindir)/$(binprefix)mcedit
-
-showlibdep:
- @echo 'OBJS="$(EDITOBJS)"'
-
-cross:
- $(MAKE) CC=gcc-linux CPP="gcc-linux -E" \
- CPPFLAGS="$(CPPFLAGS) -I/usr/local/lib/gcc-lib/i386-linux-linux/include/ncurses "
-
-TAGS: $(EDITSRC)
- etags $(EDITSRC)
-
-clean:
- $(RMF) *.o core a.out libedit.a
-
-realclean: clean
- $(RMF) .depend
- $(RMF) TAGS
- $(RMF) *~
-
-distclean:
- -$(RMF) $(srcdir)/*~ $(srcdir)/*.o $(srcdir)/a.out
- -$(RMF) $(srcdir)/core $(srcdir)/libedit.a
- -if test $(srcdir) = .; then $(MAKE) realclean; fi
- -$(RMF) $(srcdir)/Makefile
-
-install: @MCEDIT@
-
-uninstall:
- -$(RMF) $(DESTDIR)$(bindir)/$(binprefix)mcedit
-
-distcopy:
- $(CP) $(DIST) ../../mc-$(VERSION)/edit
-
-depend dep: mcdep
-
-fastdeploc:
-
-# ***Dependencies***Do not edit***
-@DOTDEPEND@
-# ***End of dependencies***
diff --git a/rosapps/applications/mc/edit/readme.edit b/rosapps/applications/mc/edit/readme.edit
deleted file mode 100644
index 8b137891791..00000000000
--- a/rosapps/applications/mc/edit/readme.edit
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/rosapps/applications/mc/edit/syntax.c b/rosapps/applications/mc/edit/syntax.c
deleted file mode 100644
index 3b0fda3c845..00000000000
--- a/rosapps/applications/mc/edit/syntax.c
+++ /dev/null
@@ -1,1712 +0,0 @@
-/* editor syntax highlighting.
-
- Copyright (C) 1996, 1997, 1998 the Free Software Foundation
-
- Authors: 1998 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#ifdef MIDNIGHT
-#include "edit.h"
-#else
-#include "coolwidget.h"
-#endif
-
-#if !defined(MIDNIGHT) || defined(HAVE_SYNTAXH)
-
-int option_syntax_highlighting = 1;
-
-/* these three functions are called from the outside */
-void edit_load_syntax (WEdit * edit, char **names, char *type);
-void edit_free_syntax_rules (WEdit * edit);
-void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
-
-static void *syntax_malloc (size_t x)
-{
- void *p;
- p = malloc (x);
- memset (p, 0, x);
- return p;
-}
-
-#define syntax_free(x) {if(x){free(x);(x)=0;}}
-
-static int compare_word_to_right (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start)
-{
- char *p;
- int c, j;
- if (!*text)
- return 0;
- c = edit_get_byte (edit, i - 1);
- if (line_start)
- if (c != '\n')
- return 0;
- if (whole_left)
- if (strchr (whole_left, c))
- return 0;
- for (p = text; *p; p++, i++) {
- switch (*p) {
- case '\001':
- p++;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n')
- return 0;
- i++;
- }
- break;
- case '\002':
- p++;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n' || c == '\t' || c == ' ')
- return 0;
- i++;
- }
- break;
- case '\003':
- p++;
-#if 0
- c = edit_get_byte (edit, i++);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char1;
- return 0;
- found_char1:
-#endif
- for (;;i++) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char2;
- break;
- found_char2:;
- }
- i--;
- while (*p != '\003')
- p++;
- break;
-#if 0
- case '\004':
- p++;
- c = edit_get_byte (edit, i++);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- return 0;
- for (;;i++) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- goto found_char4;
- continue;
- found_char4:
- break;
- }
- i--;
- while (*p != '\004')
- p++;
- break;
-#endif
- default:
- if (*p != edit_get_byte (edit, i))
- return 0;
- }
- }
- if (whole_right)
- if (strchr (whole_right, edit_get_byte (edit, i)))
- return 0;
- return 1;
-}
-
-static int compare_word_to_left (WEdit * edit, long i, char *text, char *whole_left, char *whole_right, int line_start)
-{
- char *p;
- int c, j;
-#if 0
- int d;
-#endif
- if (!*text)
- return 0;
- if (whole_right)
- if (strchr (whole_right, edit_get_byte (edit, i + 1)))
- return 0;
- for (p = text + strlen (text) - 1; (unsigned long) p >= (unsigned long) text; p--, i--) {
- switch (*p) {
- case '\001':
- p--;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n')
- return 0;
- i--;
- }
- break;
- case '\002':
- p--;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == *p)
- break;
- if (c == '\n' || c == '\t' || c == ' ')
- return 0;
- i--;
- }
- break;
- case '\003':
- while (*(--p) != '\003');
- p++;
-#if 0
- c = edit_get_byte (edit, i--);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char1;
- return 0;
- found_char1:
-#endif
- for (;; i--) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\003'; j++)
- if (c == p[j])
- goto found_char2;
- break;
- found_char2:;
- }
- i++;
- p--;
- break;
-#if 0
- case '\004':
- while (*(--p) != '\004');
- d = *p;
- p++;
- c = edit_get_byte (edit, i--);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j])
- return 0;
- for (;; i--) {
- c = edit_get_byte (edit, i);
- for (j = 0; p[j] != '\004'; j++)
- if (c == p[j] || c == '\n' || c == d)
- goto found_char4;
- continue;
- found_char4:
- break;
- }
- i++;
- p--;
- break;
-#endif
- default:
- if (*p != edit_get_byte (edit, i))
- return 0;
- }
- }
- c = edit_get_byte (edit, i);
- if (line_start)
- if (c != '\n')
- return 0;
- if (whole_left)
- if (strchr (whole_left, c))
- return 0;
- return 1;
-}
-
-
-#if 0
-#define debug_printf(x,y) fprintf(stderr,x,y)
-#else
-#define debug_printf(x,y)
-#endif
-
-static inline unsigned long apply_rules_going_right (WEdit * edit, long i, unsigned long rule)
-{
- struct context_rule *r;
- int context, contextchanged = 0, keyword, c1, c2;
- int found_right = 0, found_left = 0, keyword_foundleft = 0;
- int done = 0;
- unsigned long border;
- context = (rule & RULE_CONTEXT) >> RULE_CONTEXT_SHIFT;
- keyword = (rule & RULE_WORD) >> RULE_WORD_SHIFT;
- border = rule & (RULE_ON_LEFT_BORDER | RULE_ON_RIGHT_BORDER);
- c1 = edit_get_byte (edit, i - 1);
- c2 = edit_get_byte (edit, i);
- if (!c2 || !c1)
- return rule;
-
- debug_printf ("%c->", c1);
- debug_printf ("%c ", c2);
-
-/* check to turn off a keyword */
- if (keyword) {
- struct key_word *k;
- k = edit->rules[context]->keyword[keyword];
- if (c1 == '\n')
- keyword = 0;
- if (k->last == c1 && compare_word_to_left (edit, i - 1, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = 0;
- keyword_foundleft = 1;
- debug_printf ("keyword=%d ", keyword);
- }
- }
- debug_printf ("border=%s ", border ? ((border & RULE_ON_LEFT_BORDER) ? "left" : "right") : "off");
-
-/* check to turn off a context */
- if (context && !keyword) {
- r = edit->rules[context];
- if (r->first_right == c2 && compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&!(rule & RULE_ON_RIGHT_BORDER)) {
- debug_printf ("A:3 ", 0);
- found_right = 1;
- border = RULE_ON_RIGHT_BORDER;
- if (r->between_delimiters)
- context = 0;
- } else if (!found_left) {
- if (r->last_right == c1 && compare_word_to_left (edit, i - 1, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
-/* always turn off a context at 4 */
- debug_printf ("A:4 ", 0);
- found_left = 1;
- border = 0;
- if (!keyword_foundleft)
- context = 0;
- } else if (r->last_left == c1 && compare_word_to_left (edit, i - 1, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
-/* never turn off a context at 2 */
- debug_printf ("A:2 ", 0);
- found_left = 1;
- border = 0;
- }
- }
- }
- debug_printf ("\n", 0);
-
-/* check to turn on a keyword */
- if (!keyword) {
- char *p;
- p = (r = edit->rules[context])->keyword_first_chars;
- while ((p = strchr (p + 1, c2))) {
- struct key_word *k;
- int count;
- count = (unsigned long) p - (unsigned long) r->keyword_first_chars;
- k = r->keyword[count];
- if (compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = count;
- debug_printf ("keyword=%d ", keyword);
- break;
- }
- }
- }
-/* check to turn on a context */
- if (!context) {
- int count;
- for (count = 1; edit->rules[count] && !done; count++) {
- r = edit->rules[count];
- if (!found_left) {
- if (r->last_right == c1 && compare_word_to_left (edit, i - 1, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
- debug_printf ("B:4 count=%d", count);
- found_left = 1;
- border = 0;
- context = 0;
- contextchanged = 1;
- keyword = 0;
- } else if (r->last_left == c1 && compare_word_to_left (edit, i - 1, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
- debug_printf ("B:2 ", 0);
- found_left = 1;
- border = 0;
- if (r->between_delimiters) {
- context = count;
- contextchanged = 1;
- keyword = 0;
- debug_printf ("context=%d ", context);
- if (r->first_right == c2 && compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) {
- debug_printf ("B:3 ", 0);
- found_right = 1;
- border = RULE_ON_RIGHT_BORDER;
- context = 0;
- }
- }
- break;
- }
- }
- if (!found_right) {
- if (r->first_left == c2 && compare_word_to_right (edit, i, r->left, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_left)) {
- debug_printf ("B:1 ", 0);
- found_right = 1;
- border = RULE_ON_LEFT_BORDER;
- if (!r->between_delimiters) {
- debug_printf ("context=%d ", context);
- if (!keyword)
- context = count;
- }
- break;
- }
- }
- }
- }
- if (!keyword && contextchanged) {
- char *p;
- p = (r = edit->rules[context])->keyword_first_chars;
- while ((p = strchr (p + 1, c2))) {
- struct key_word *k;
- int coutner;
- coutner = (unsigned long) p - (unsigned long) r->keyword_first_chars;
- k = r->keyword[coutner];
- if (compare_word_to_right (edit, i, k->keyword, k->whole_word_chars_left, k->whole_word_chars_right, k->line_start)) {
- keyword = coutner;
- debug_printf ("keyword=%d ", keyword);
- break;
- }
- }
- }
- debug_printf ("border=%s ", border ? ((border & RULE_ON_LEFT_BORDER) ? "left" : "right") : "off");
- debug_printf ("keyword=%d ", keyword);
-
- debug_printf (" %d#\n\n", context);
-
- return (context << RULE_CONTEXT_SHIFT) | (keyword << RULE_WORD_SHIFT) | border;
-}
-
-static inline int resolve_left_delim (WEdit * edit, long i, struct context_rule *r, int s)
-{
- int c, count;
- if (!r->conflicts)
- return s;
- for (;;) {
- c = edit_get_byte (edit, i);
- if (c == '\n')
- break;
- for (count = 1; r->conflicts[count]; count++) {
- struct context_rule *p;
- p = edit->rules[r->conflicts[count]];
- if (!p)
- break;
- if (p->first_left == c && r->between_delimiters == p->between_delimiters && compare_word_to_right (edit, i, p->left, p->whole_word_chars_left, r->whole_word_chars_right, p->line_start_left))
- return r->conflicts[count];
- }
- i--;
- }
- return 0;
-}
-
-static inline unsigned long apply_rules_going_left (WEdit * edit, long i, unsigned long rule)
-{
- struct context_rule *r;
- int context, contextchanged = 0, keyword, c2, c1;
- int found_left = 0, found_right = 0, keyword_foundright = 0;
- int done = 0;
- unsigned long border;
- context = (rule & RULE_CONTEXT) >> RULE_CONTEXT_SHIFT;
- keyword = (rule & RULE_WORD) >> RULE_WORD_SHIFT;
- border = rule & (RULE_ON_RIGHT_BORDER | RULE_ON_LEFT_BORDER);
- c1 = edit_get_byte (edit, i);
- c2 = edit_get_byte (edit, i + 1);
- if (!c2 || !c1)
- return rule;
-
- debug_printf ("%c->", c2);
- debug_printf ("%c ", c1);
-
-/* check to turn off a keyword */
- if (keyword) {
- struct key_word *k;
- k = edit->rules[context]->keyword[keyword];
- if (c2 == '\n')
- keyword = 0;
- if ((k->first == c2 && compare_word_to_right (edit, i + 1, k->keyword, k->whole_word_chars_right, k->whole_word_chars_left, k->line_start)) || (c2 == '\n')) {
- keyword = 0;
- keyword_foundright = 1;
- debug_printf ("keyword=%d ", keyword);
- }
- }
- debug_printf ("border=%s ", border ? ((border & RULE_ON_RIGHT_BORDER) ? "right" : "left") : "off");
-
-/* check to turn off a context */
- if (context && !keyword) {
- r = edit->rules[context];
- if (r->last_left == c1 && compare_word_to_left (edit, i, r->left, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_left) \
- &&!(rule & RULE_ON_LEFT_BORDER)) {
- debug_printf ("A:2 ", 0);
- found_left = 1;
- border = RULE_ON_LEFT_BORDER;
- if (r->between_delimiters)
- context = 0;
- } else if (!found_right) {
- if (r->first_left == c2 && compare_word_to_right (edit, i + 1, r->left, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
-/* always turn off a context at 4 */
- debug_printf ("A:1 ", 0);
- found_right = 1;
- border = 0;
- if (!keyword_foundright)
- context = 0;
- } else if (r->first_right == c2 && compare_word_to_right (edit, i + 1, r->right, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
-/* never turn off a context at 2 */
- debug_printf ("A:3 ", 0);
- found_right = 1;
- border = 0;
- }
- }
- }
- debug_printf ("\n", 0);
-
-/* check to turn on a keyword */
- if (!keyword) {
- char *p;
- p = (r = edit->rules[context])->keyword_last_chars;
- while ((p = strchr (p + 1, c1))) {
- struct key_word *k;
- int count;
- count = (unsigned long) p - (unsigned long) r->keyword_last_chars;
- k = r->keyword[count];
- if (compare_word_to_left (edit, i, k->keyword, k->whole_word_chars_right, k->whole_word_chars_left, k->line_start)) {
- keyword = count;
- debug_printf ("keyword=%d ", keyword);
- break;
- }
- }
- }
-/* check to turn on a context */
- if (!context) {
- int count;
- for (count = 1; edit->rules[count] && !done; count++) {
- r = edit->rules[count];
- if (!found_right) {
- if (r->first_left == c2 && compare_word_to_right (edit, i + 1, r->left, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_left) \
- &&(rule & RULE_ON_LEFT_BORDER)) {
- debug_printf ("B:1 count=%d", count);
- found_right = 1;
- border = 0;
- context = 0;
- contextchanged = 1;
- keyword = 0;
- } else if (r->first_right == c2 && compare_word_to_right (edit, i + 1, r->right, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_right) \
- &&(rule & RULE_ON_RIGHT_BORDER)) {
- if (!(c2 == '\n' && r->single_char)) {
- debug_printf ("B:3 ", 0);
- found_right = 1;
- border = 0;
- if (r->between_delimiters) {
- debug_printf ("context=%d ", context);
- context = resolve_left_delim (edit, i, r, count);
- contextchanged = 1;
- keyword = 0;
- if (r->last_left == c1 && compare_word_to_left (edit, i, r->left, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_left)) {
- debug_printf ("B:2 ", 0);
- found_left = 1;
- border = RULE_ON_LEFT_BORDER;
- context = 0;
- }
- }
- break;
- }
- }
- }
- if (!found_left) {
- if (r->last_right == c1 && compare_word_to_left (edit, i, r->right, r->whole_word_chars_right, r->whole_word_chars_left, r->line_start_right)) {
- if (!(c1 == '\n' && r->single_char)) {
- debug_printf ("B:4 ", 0);
- found_left = 1;
- border = RULE_ON_RIGHT_BORDER;
- if (!keyword)
- if (!r->between_delimiters)
- context = resolve_left_delim (edit, i - 1, r, count);
- break;
- }
- }
- }
- }
- }
- if (!keyword && contextchanged) {
- char *p;
- p = (r = edit->rules[context])->keyword_last_chars;
- while ((p = strchr (p + 1, c1))) {
- struct key_word *k;
- int coutner;
- coutner = (unsigned long) p - (unsigned long) r->keyword_last_chars;
- k = r->keyword[coutner];
- if (compare_word_to_left (edit, i, k->keyword, k->whole_word_chars_right, k->whole_word_chars_left, k->line_start)) {
- keyword = coutner;
- debug_printf ("keyword=%d ", keyword);
- break;
- }
- }
- }
- debug_printf ("border=%s ", border ? ((border & RULE_ON_RIGHT_BORDER) ? "right" : "left") : "off");
- debug_printf ("keyword=%d ", keyword);
-
- debug_printf (" %d#\n\n", context);
-
- return (context << RULE_CONTEXT_SHIFT) | (keyword << RULE_WORD_SHIFT) | border;
-}
-
-
-static unsigned long edit_get_rule (WEdit * edit, long byte_index)
-{
- long i;
- if (byte_index < 0) {
- edit->last_get_rule = -1;
- edit->rule = 0;
- return 0;
- }
-#if 0
- if (byte_index < edit->last_get_rule_start_display) {
-/* this is for optimisation */
- for (i = edit->last_get_rule_start_display - 1; i >= byte_index; i--)
- edit->rule_start_display = apply_rules_going_left (edit, i, edit->rule_start_display);
- edit->last_get_rule_start_display = byte_index;
- edit->rule = edit->rule_start_display;
- } else
-#endif
- if (byte_index > edit->last_get_rule) {
- for (i = edit->last_get_rule + 1; i <= byte_index; i++)
- edit->rule = apply_rules_going_right (edit, i, edit->rule);
- } else if (byte_index < edit->last_get_rule) {
- for (i = edit->last_get_rule - 1; i >= byte_index; i--)
- edit->rule = apply_rules_going_left (edit, i, edit->rule);
- }
- edit->last_get_rule = byte_index;
- return edit->rule;
-}
-
-static void translate_rule_to_color (WEdit * edit, unsigned long rule, int *fg, int *bg)
-{
- struct key_word *k;
- k = edit->rules[(rule & RULE_CONTEXT) >> RULE_CONTEXT_SHIFT]->keyword[(rule & RULE_WORD) >> RULE_WORD_SHIFT];
- *bg = k->bg;
- *fg = k->fg;
-}
-
-void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg)
-{
- unsigned long rule;
- if (!edit->rules || byte_index >= edit->last_byte || !option_syntax_highlighting) {
-#ifdef MIDNIGHT
- *fg = NORMAL_COLOR;
-#else
- *fg = NO_COLOR;
- *bg = NO_COLOR;
-#endif
- } else {
- rule = edit_get_rule (edit, byte_index);
- translate_rule_to_color (edit, rule, fg, bg);
- }
-}
-
-
-/*
- Returns 0 on error/eof or a count of the number of bytes read
- including the newline. Result must be free'd.
- */
-static int read_one_line (char **line, FILE * f)
-{
- char *p;
- int len = 256, c, r = 0, i = 0;
- p = syntax_malloc (len);
- for (;;) {
- c = fgetc (f);
- if (c == -1) {
- r = 0;
- break;
- } else if (c == '\n') {
- r = i + 1; /* extra 1 for the newline just read */
- break;
- } else {
- if (i >= len - 1) {
- char *q;
- q = syntax_malloc (len * 2);
- memcpy (q, p, len);
- syntax_free (p);
- p = q;
- len *= 2;
- }
- p[i++] = c;
- }
- }
- p[i] = 0;
- *line = p;
- return r;
-}
-
-static char *strdup_convert (char *s)
-{
-#if 0
- int e = 0;
-#endif
- char *r, *p;
- p = r = strdup (s);
- while (*s) {
- switch (*s) {
- case '\\':
- s++;
- switch (*s) {
- case 'n':
- *p = '\n';
- break;
- case 'r':
- *p = '\r';
- break;
- case 't':
- *p = '\t';
- break;
- case 's':
- *p = ' ';
- break;
- case '*':
- *p = '*';
- break;
- case '\\':
- *p = '\\';
- break;
- case '[':
- case ']':
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = *s;
- else {
-#if 0
- if (!strncmp (s, "[^", 2)) {
- *p = '\004';
- e = 1;
- s++;
- } else {
- if (e)
- *p = '\004';
- else
-#endif
- *p = '\003';
-#if 0
- e = 0;
- }
-#endif
- }
- break;
- default:
- *p = *s;
- break;
- }
- break;
- case '*':
-/* a * or + at the beginning or end of the line must be interpreted literally */
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = '*';
- else
- *p = '\001';
- break;
- case '+':
- if ((unsigned long) p == (unsigned long) r || strlen (s) == 1)
- *p = '+';
- else
- *p = '\002';
- break;
- default:
- *p = *s;
- break;
- }
- s++;
- p++;
- }
- *p = 0;
- return r;
-}
-
-#define whiteness(x) ((x) == '\t' || (x) == '\n' || (x) == ' ')
-
-static void get_args (char *l, char **args, int *argc)
-{
- *argc = 0;
- l--;
- for (;;) {
- char *p;
- for (p = l + 1; *p && whiteness (*p); p++);
- if (!*p)
- break;
- for (l = p + 1; *l && !whiteness (*l); l++);
- *l = '\0';
- *args = strdup_convert (p);
- (*argc)++;
- args++;
- }
- *args = 0;
-}
-
-static void free_args (char **args)
-{
- while (*args) {
- syntax_free (*args);
- *args = 0;
- args++;
- }
-}
-
-#define check_a {if(!*a){result=line;break;}}
-#define check_not_a {if(*a){result=line;break;}}
-
-#ifdef MIDNIGHT
-
-int try_alloc_color_pair (char *fg, char *bg);
-
-int this_try_alloc_color_pair (char *fg, char *bg)
-{
- char f[80], b[80], *p;
- if (fg) {
- strcpy (f, fg);
- p = strchr (f, '/');
- if (p)
- *p = '\0';
- fg = f;
- }
- if (bg) {
- strcpy (b, bg);
- p = strchr (b, '/');
- if (p)
- *p = '\0';
- bg = b;
- }
- return try_alloc_color_pair (fg, bg);
-}
-#else
-int this_allocate_color (char *fg)
-{
- char *p;
- if (!fg)
- return allocate_color (0);
- p = strchr (fg, '/');
- if (!p)
- return allocate_color (fg);
- return allocate_color (p + 1);
-}
-#endif
-
-/* returns line number on error */
-static int edit_read_syntax_rules (WEdit * edit, FILE * f)
-{
- char *fg, *bg;
- char whole_right[256];
- char whole_left[256];
- char *args[1024], *l = 0;
- int line = 0;
- struct context_rule **r, *c;
- int num_words = -1, num_contexts = -1;
- int argc, result = 0;
- int i, j;
-
- args[0] = 0;
-
- strcpy (whole_left, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
- strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
-
- r = edit->rules = syntax_malloc (256 * sizeof (struct context_rule *));
-
- for (;;) {
- char **a;
- line++;
- if (!read_one_line (&l, f))
- break;
- get_args (l, args, &argc);
- a = args + 1;
- if (!args[0]) {
- /* do nothing */
- } else if (!strcmp (args[0], "wholechars")) {
- check_a;
- if (!strcmp (*a, "left")) {
- a++;
- strcpy (whole_left, *a);
- } else if (!strcmp (*a, "right")) {
- a++;
- strcpy (whole_right, *a);
- } else {
- strcpy (whole_left, *a);
- strcpy (whole_right, *a);
- }
- a++;
- check_not_a;
- } else if (!strcmp (args[0], "context")) {
- check_a;
- if (num_contexts == -1) {
- if (strcmp (*a, "default")) { /* first context is the default */
- *a = 0;
- check_a;
- }
- a++;
- c = r[0] = syntax_malloc (sizeof (struct context_rule));
- c->left = strdup (" ");
- c->right = strdup (" ");
- num_contexts = 0;
- } else {
- c = r[num_contexts] = syntax_malloc (sizeof (struct context_rule));
- if (!strcmp (*a, "exclusive")) {
- a++;
- c->between_delimiters = 1;
- }
- check_a;
- if (!strcmp (*a, "whole")) {
- a++;
- c->whole_word_chars_left = strdup (whole_left);
- c->whole_word_chars_right = strdup (whole_right);
- } else if (!strcmp (*a, "wholeleft")) {
- a++;
- c->whole_word_chars_left = strdup (whole_left);
- } else if (!strcmp (*a, "wholeright")) {
- a++;
- c->whole_word_chars_right = strdup (whole_right);
- }
- check_a;
- if (!strcmp (*a, "linestart")) {
- a++;
- c->line_start_left = 1;
- }
- check_a;
- c->left = strdup (*a++);
- check_a;
- if (!strcmp (*a, "linestart")) {
- a++;
- c->line_start_right = 1;
- }
- check_a;
- c->right = strdup (*a++);
- c->last_left = c->left[strlen (c->left) - 1];
- c->last_right = c->right[strlen (c->right) - 1];
- c->first_left = *c->left;
- c->first_right = *c->right;
- c->single_char = (strlen (c->right) == 1);
- }
- c->keyword = syntax_malloc (1024 * sizeof (struct key_word *));
- num_words = 1;
- c->keyword[0] = syntax_malloc (sizeof (struct key_word));
- fg = *a;
- if (*a)
- a++;
- bg = *a;
- if (*a)
- a++;
-#ifdef MIDNIGHT
- c->keyword[0]->fg = this_try_alloc_color_pair (fg, bg);
-#else
- c->keyword[0]->fg = this_allocate_color (fg);
- c->keyword[0]->bg = this_allocate_color (bg);
-#endif
- c->keyword[0]->keyword = strdup (" ");
- check_not_a;
- num_contexts++;
- } else if (!strcmp (args[0], "keyword")) {
- struct key_word *k;
- if (num_words == -1)
- *a = 0;
- check_a;
- k = r[num_contexts - 1]->keyword[num_words] = syntax_malloc (sizeof (struct key_word));
- if (!strcmp (*a, "whole")) {
- a++;
- k->whole_word_chars_left = strdup (whole_left);
- k->whole_word_chars_right = strdup (whole_right);
- } else if (!strcmp (*a, "wholeleft")) {
- a++;
- k->whole_word_chars_left = strdup (whole_left);
- } else if (!strcmp (*a, "wholeright")) {
- a++;
- k->whole_word_chars_right = strdup (whole_right);
- }
- check_a;
- if (!strcmp (*a, "linestart")) {
- a++;
- k->line_start = 1;
- }
- check_a;
- if (!strcmp (*a, "whole")) {
- *a = 0;
- check_a;
- }
- k->keyword = strdup (*a++);
- k->last = k->keyword[strlen (k->keyword) - 1];
- k->first = *k->keyword;
- fg = *a;
- if (*a)
- a++;
- bg = *a;
- if (*a)
- a++;
-#ifdef MIDNIGHT
- k->fg = this_try_alloc_color_pair (fg, bg);
-#else
- k->fg = this_allocate_color (fg);
- k->bg = this_allocate_color (bg);
-#endif
- check_not_a;
- num_words++;
- } else if (!strncmp (args[0], "#", 1)) {
- /* do nothing for comment */
- } else if (!strcmp (args[0], "file")) {
- break;
- } else { /* anything else is an error */
- *a = 0;
- check_a;
- }
- free_args (args);
- syntax_free (l);
- }
- free_args (args);
- syntax_free (l);
-
- if (result)
- return result;
-
- if (num_contexts == -1) {
- result = line;
- return result;
- }
- for (i = 1; edit->rules[i]; i++) {
- for (j = i + 1; edit->rules[j]; j++) {
- if (strstr (edit->rules[j]->right, edit->rules[i]->right) && strcmp (edit->rules[i]->right, "\n")) {
- unsigned char *s;
- if (!edit->rules[i]->conflicts)
- edit->rules[i]->conflicts = syntax_malloc (sizeof (unsigned char) * 260);
- s = edit->rules[i]->conflicts;
- s[strlen ((char *) s)] = (unsigned char) j;
- }
- }
- }
-
- {
- char first_chars[1024], *p;
- char last_chars[1024], *q;
- for (i = 0; edit->rules[i]; i++) {
- c = edit->rules[i];
- p = first_chars;
- q = last_chars;
- *p++ = (char) 1;
- *q++ = (char) 1;
- for (j = 1; c->keyword[j]; j++) {
- *p++ = c->keyword[j]->first;
- *q++ = c->keyword[j]->last;
- }
- *p = '\0';
- *q = '\0';
- c->keyword_first_chars = strdup (first_chars);
- c->keyword_last_chars = strdup (last_chars);
- }
- }
-
- return result;
-}
-
-void (*syntax_change_callback) (CWidget *) = 0;
-
-void edit_set_syntax_change_callback (void (*callback) (CWidget *))
-{
- syntax_change_callback = callback;
-}
-
-void edit_free_syntax_rules (WEdit * edit)
-{
- int i, j;
- if (!edit)
- return;
- if (!edit->rules)
- return;
- syntax_free (edit->syntax_type);
- if (syntax_change_callback)
-#ifdef MIDNIGHT
- (*syntax_change_callback) (&edit->widget);
-#else
- (*syntax_change_callback) (edit->widget);
-#endif
- for (i = 0; edit->rules[i]; i++) {
- if (edit->rules[i]->keyword) {
- for (j = 0; edit->rules[i]->keyword[j]; j++) {
- syntax_free (edit->rules[i]->keyword[j]->keyword);
- syntax_free (edit->rules[i]->keyword[j]->whole_word_chars_left);
- syntax_free (edit->rules[i]->keyword[j]->whole_word_chars_right);
- syntax_free (edit->rules[i]->keyword[j]);
- }
- }
- syntax_free (edit->rules[i]->conflicts);
- syntax_free (edit->rules[i]->left);
- syntax_free (edit->rules[i]->right);
- syntax_free (edit->rules[i]->whole_word_chars_left);
- syntax_free (edit->rules[i]->whole_word_chars_right);
- syntax_free (edit->rules[i]->keyword);
- syntax_free (edit->rules[i]->keyword_first_chars);
- syntax_free (edit->rules[i]->keyword_last_chars);
- syntax_free (edit->rules[i]);
- }
- syntax_free (edit->rules);
-}
-
-#define CURRENT_SYNTAX_RULES_VERSION "22"
-
-char *syntax_text =
-"# syntax rules version " CURRENT_SYNTAX_RULES_VERSION "\n"
-"# Allowable colors for mc are\n"
-"# (after the slash is a Cooledit color, 0-26 or any of the X colors in rgb.txt)\n"
-"# black\n"
-"# red\n"
-"# green\n"
-"# brown\n"
-"# blue\n"
-"# magenta\n"
-"# cyan\n"
-"# lightgray\n"
-"# gray\n"
-"# brightred\n"
-"# brightgreen\n"
-"# yellow\n"
-"# brightblue\n"
-"# brightmagenta\n"
-"# brightcyan\n"
-"# white\n"
-"\n"
-"###############################################################################\n"
-"file ..\\*\\\\.tex$ LaTeX\\s2.09\\sDocument\n"
-"context default\n"
-"wholechars left \\\\\n"
-"wholechars right abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n"
-"\n"
-"# type style\n"
-" keyword whole \\\\tiny yellow/24\n"
-" keyword whole \\\\scriptsize yellow/24\n"
-" keyword whole \\\\footnotesize yellow/24\n"
-" keyword whole \\\\small yellow/24\n"
-" keyword whole \\\\normalsize yellow/24\n"
-" keyword whole \\\\large yellow/24\n"
-" keyword whole \\\\Large yellow/24\n"
-" keyword whole \\\\LARGE yellow/24\n"
-" keyword whole \\\\huge yellow/24\n"
-" keyword whole \\\\Huge yellow/24\n"
-"\n"
-"# accents and symbols\n"
-" keyword whole \\\\`{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\'{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\^{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\\"{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\~{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\={\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\.{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\u{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\v{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\H{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\t{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\c{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\d{\\[aeiouAEIOU\\]} yellow/24\n"
-" keyword whole \\\\b{\\[aeiouAEIOU\\]} yellow/24\n"
-"\n"
-" keyword whole \\\\dag yellow/24\n"
-" keyword whole \\\\ddag yellow/24\n"
-" keyword whole \\\\S yellow/24\n"
-" keyword whole \\\\P yellow/24\n"
-" keyword whole \\\\copyright yellow/24\n"
-" keyword whole \\\\pounds yellow/24\n"
-"\n"
-"# sectioning and table of contents\n"
-" keyword whole \\\\part[*]{*} brightred/19\n"
-" keyword whole \\\\part{*} brightred/19\n"
-" keyword whole \\\\part\\*{*} brightred/19\n"
-" keyword whole \\\\chapter[*]{*} brightred/19\n"
-" keyword whole \\\\chapter{*} brightred/19\n"
-" keyword whole \\\\chapter\\*{*} brightred/19\n"
-" keyword whole \\\\section[*]{*} brightred/19\n"
-" keyword whole \\\\section{*} brightred/19\n"
-" keyword whole \\\\section\\*{*} brightred/19\n"
-" keyword whole \\\\subsection[*]{*} brightred/19\n"
-" keyword whole \\\\subsection{*} brightred/19\n"
-" keyword whole \\\\subsection\\*{*} brightred/19\n"
-" keyword whole \\\\subsubsection[*]{*} brightred/19\n"
-" keyword whole \\\\subsubsection{*} brightred/19\n"
-" keyword whole \\\\subsubsection\\*{*} brightred/19\n"
-" keyword whole \\\\paragraph[*]{*} brightred/19\n"
-" keyword whole \\\\paragraph{*} brightred/19\n"
-" keyword whole \\\\paragraph\\*{*} brightred/19\n"
-" keyword whole \\\\subparagraph[*]{*} brightred/19\n"
-" keyword whole \\\\subparagraph{*} brightred/19\n"
-" keyword whole \\\\subparagraph\\*{*} brightred/19\n"
-"\n"
-" keyword whole \\\\appendix brightred/19\n"
-" keyword whole \\\\tableofcontents brightred/19\n"
-"\n"
-"# misc\n"
-" keyword whole \\\\item[*] yellow/24\n"
-" keyword whole \\\\item yellow/24\n"
-" keyword whole \\\\\\\\ yellow/24\n"
-" keyword \\\\\\s yellow/24 black/0\n"
-" keyword %% yellow/24\n"
-"\n"
-"# docuement and page styles \n"
-" keyword whole \\\\documentstyle[*]{*} yellow/20\n"
-" keyword whole \\\\documentstyle{*} yellow/20\n"
-" keyword whole \\\\pagestyle{*} yellow/20\n"
-"\n"
-"# cross references\n"
-" keyword whole \\\\label{*} yellow/24\n"
-" keyword whole \\\\ref{*} yellow/24\n"
-"\n"
-"# bibliography and citations\n"
-" keyword whole \\\\bibliography{*} yellow/24\n"
-" keyword whole \\\\bibitem[*]{*} yellow/24\n"
-" keyword whole \\\\bibitem{*} yellow/24\n"
-" keyword whole \\\\cite[*]{*} yellow/24\n"
-" keyword whole \\\\cite{*} yellow/24\n"
-"\n"
-"# splitting the input\n"
-" keyword whole \\\\input{*} yellow/20\n"
-" keyword whole \\\\include{*} yellow/20\n"
-" keyword whole \\\\includeonly{*} yellow/20\n"
-"\n"
-"# line breaking\n"
-" keyword whole \\\\linebreak[\\[01234\\]] yellow/24\n"
-" keyword whole \\\\nolinebreak[\\[01234\\]] yellow/24\n"
-" keyword whole \\\\linebreak yellow/24\n"
-" keyword whole \\\\nolinebreak yellow/24\n"
-" keyword whole \\\\[+] yellow/24\n"
-" keyword whole \\\\- yellow/24\n"
-" keyword whole \\\\sloppy yellow/24\n"
-"\n"
-"# page breaking\n"
-" keyword whole \\\\pagebreak[\\[01234\\]] yellow/24\n"
-" keyword whole \\\\nopagebreak[\\[01234\\]] yellow/24\n"
-" keyword whole \\\\pagebreak yellow/24\n"
-" keyword whole \\\\nopagebreak yellow/24\n"
-" keyword whole \\\\samepage yellow/24\n"
-" keyword whole \\\\newpage yellow/24\n"
-" keyword whole \\\\clearpage yellow/24\n"
-"\n"
-"# defintiions\n"
-" keyword \\\\newcommand{*}[*] cyan/5\n"
-" keyword \\\\newcommand{*} cyan/5\n"
-" keyword \\\\newenvironment{*}[*]{*} cyan/5\n"
-" keyword \\\\newenvironment{*}{*} cyan/5\n"
-"\n"
-"# boxes\n"
-"\n"
-"# begins and ends\n"
-" keyword \\\\begin{document} brightred/14\n"
-" keyword \\\\begin{equation} brightred/14\n"
-" keyword \\\\begin{eqnarray} brightred/14\n"
-" keyword \\\\begin{quote} brightred/14\n"
-" keyword \\\\begin{quotation} brightred/14\n"
-" keyword \\\\begin{center} brightred/14\n"
-" keyword \\\\begin{verse} brightred/14\n"
-" keyword \\\\begin{verbatim} brightred/14\n"
-" keyword \\\\begin{itemize} brightred/14\n"
-" keyword \\\\begin{enumerate} brightred/14\n"
-" keyword \\\\begin{description} brightred/14\n"
-" keyword \\\\begin{array} brightred/14\n"
-" keyword \\\\begin{tabular} brightred/14\n"
-" keyword \\\\begin{thebibliography}{*} brightred/14\n"
-" keyword \\\\begin{sloppypar} brightred/14\n"
-"\n"
-" keyword \\\\end{document} brightred/14\n"
-" keyword \\\\end{equation} brightred/14\n"
-" keyword \\\\end{eqnarray} brightred/14\n"
-" keyword \\\\end{quote} brightred/14\n"
-" keyword \\\\end{quotation} brightred/14\n"
-" keyword \\\\end{center} brightred/14\n"
-" keyword \\\\end{verse} brightred/14\n"
-" keyword \\\\end{verbatim} brightred/14\n"
-" keyword \\\\end{itemize} brightred/14\n"
-" keyword \\\\end{enumerate} brightred/14\n"
-" keyword \\\\end{description} brightred/14\n"
-" keyword \\\\end{array} brightred/14\n"
-" keyword \\\\end{tabular} brightred/14\n"
-" keyword \\\\end{thebibliography}{*} brightred/14\n"
-" keyword \\\\end{sloppypar} brightred/14\n"
-"\n"
-" keyword \\\\begin{*} brightcyan/16\n"
-" keyword \\\\end{*} brightcyan/16\n"
-"\n"
-" keyword \\\\theorem{*}{*} yellow/24\n"
-"\n"
-"# if all else fails\n"
-" keyword whole \\\\+[*]{*}{*}{*} brightcyan/17\n"
-" keyword whole \\\\+[*]{*}{*} brightcyan/17\n"
-" keyword whole \\\\+{*}{*}{*}{*} brightcyan/17\n"
-" keyword whole \\\\+{*}{*}{*} brightcyan/17\n"
-" keyword whole \\\\+{*}{*} brightcyan/17\n"
-" keyword whole \\\\+{*} brightcyan/17\n"
-" keyword \\\\\\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\]\\n brightcyan/17\n"
-" keyword \\\\\\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\]\\s brightcyan/17\n"
-" keyword \\\\\\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\\]\\t brightcyan/17\n"
-"\n"
-"context \\\\pagenumbering{ } yellow/20\n"
-" keyword arabic brightcyan/17\n"
-" keyword roman brightcyan/17\n"
-" keyword alph brightcyan/17\n"
-" keyword Roman brightcyan/17\n"
-" keyword Alph brightcyan/17\n"
-"\n"
-"context % \\n brown/22\n"
-"\n"
-"# mathematical formulas\n"
-"context $ $ brightgreen/6\n"
-"context exclusive \\\\begin{equation} \\\\end{equation} brightgreen/6\n"
-"context exclusive \\\\begin{eqnarray} \\\\end{eqnarray} brightgreen/6\n"
-"\n"
-"\n"
-"###############################################################################\n"
-"file ..\\*\\\\.([chC]|CC|cxx|cc|cpp|CPP|CXX)$ C/C\\+\\+\\sProgram\n"
-"context default\n"
-" keyword whole auto yellow/24\n"
-" keyword whole break yellow/24\n"
-" keyword whole case yellow/24\n"
-" keyword whole char yellow/24\n"
-" keyword whole const yellow/24\n"
-" keyword whole continue yellow/24\n"
-" keyword whole default yellow/24\n"
-" keyword whole do yellow/24\n"
-" keyword whole double yellow/24\n"
-" keyword whole else yellow/24\n"
-" keyword whole enum yellow/24\n"
-" keyword whole extern yellow/24\n"
-" keyword whole float yellow/24\n"
-" keyword whole for yellow/24\n"
-" keyword whole goto yellow/24\n"
-" keyword whole if yellow/24\n"
-" keyword whole int yellow/24\n"
-" keyword whole long yellow/24\n"
-" keyword whole register yellow/24\n"
-" keyword whole return yellow/24\n"
-" keyword whole short yellow/24\n"
-" keyword whole signed yellow/24\n"
-" keyword whole sizeof yellow/24\n"
-" keyword whole static yellow/24\n"
-" keyword whole struct yellow/24\n"
-" keyword whole switch yellow/24\n"
-" keyword whole typedef yellow/24\n"
-" keyword whole union yellow/24\n"
-" keyword whole unsigned yellow/24\n"
-" keyword whole void yellow/24\n"
-" keyword whole volatile yellow/24\n"
-" keyword whole while yellow/24\n"
-" keyword whole asm yellow/24\n"
-" keyword whole catch yellow/24\n"
-" keyword whole class yellow/24\n"
-" keyword whole friend yellow/24\n"
-" keyword whole delete yellow/24\n"
-" keyword whole inline yellow/24\n"
-" keyword whole new yellow/24\n"
-" keyword whole operator yellow/24\n"
-" keyword whole private yellow/24\n"
-" keyword whole protected yellow/24\n"
-" keyword whole public yellow/24\n"
-" keyword whole this yellow/24\n"
-" keyword whole throw yellow/24\n"
-" keyword whole template yellow/24\n"
-" keyword whole try yellow/24\n"
-" keyword whole virtual yellow/24\n"
-" keyword whole bool yellow/24\n"
-" keyword whole const_cast yellow/24\n"
-" keyword whole dynamic_cast yellow/24\n"
-" keyword whole explicit yellow/24\n"
-" keyword whole false yellow/24\n"
-" keyword whole mutable yellow/24\n"
-" keyword whole namespace yellow/24\n"
-" keyword whole reinterpret_cast yellow/24\n"
-" keyword whole static_cast yellow/24\n"
-" keyword whole true yellow/24\n"
-" keyword whole typeid yellow/24\n"
-" keyword whole typename yellow/24\n"
-" keyword whole using yellow/24\n"
-" keyword whole wchar_t yellow/24\n"
-" keyword whole ... yellow/24\n"
-"\n"
-" keyword /\\* brown/22\n"
-" keyword \\*/ brown/22\n"
-"\n"
-" keyword '\\s' brightgreen/16\n"
-" keyword '+' brightgreen/16\n"
-" keyword > yellow/24\n"
-" keyword < yellow/24\n"
-" keyword \\+ yellow/24\n"
-" keyword - yellow/24\n"
-" keyword \\* yellow/24\n"
-" keyword / yellow/24\n"
-" keyword % yellow/24\n"
-" keyword = yellow/24\n"
-" keyword != yellow/24\n"
-" keyword == yellow/24\n"
-" keyword { brightcyan/14\n"
-" keyword } brightcyan/14\n"
-" keyword ( brightcyan/15\n"
-" keyword ) brightcyan/15\n"
-" keyword [ brightcyan/14\n"
-" keyword ] brightcyan/14\n"
-" keyword , brightcyan/14\n"
-" keyword : brightcyan/14\n"
-" keyword ; brightmagenta/19\n"
-"context exclusive /\\* \\*/ brown/22\n"
-"context linestart # \\n brightred/18\n"
-" keyword \\\\\\n yellow/24\n"
-" keyword /\\**\\*/ brown/22\n"
-" keyword \"+\" red/19\n"
-" keyword <+> red/19\n"
-"context \" \" green/6\n"
-" keyword \\\\\" brightgreen/16\n"
-" keyword %% brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[L\\]e brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[L\\]E brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[L\\]f brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[L\\]g brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[L\\]G brightgreen/16\n"
-" keyword %\\[0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]d brightgreen/16\n"
-" keyword %\\[0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]i brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]o brightgreen/16\n"
-" keyword %\\[0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]u brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]x brightgreen/16\n"
-" keyword %\\[#0\\s-\\+,\\]\\[0123456789\\]\\[.\\]\\[0123456789\\]\\[hl\\]X brightgreen/16\n"
-" keyword %\\[hl\\]n brightgreen/16\n"
-" keyword %\\[.\\]\\[0123456789\\]s brightgreen/16\n"
-" keyword %[*] brightgreen/16\n"
-" keyword %c brightgreen/16\n"
-" keyword \\\\\\\\ brightgreen/16\n"
-"\n"
-"###############################################################################\n"
-"file .\\*ChangeLog$ GNU\\sDistribution\\sChangeLog\\sFile\n"
-"\n"
-"context default\n"
-" keyword \\s+() brightmagenta/23\n"
-" keyword \\t+() brightmagenta/23\n"
-"\n"
-"context linestart \\t\\* : brightcyan/17\n"
-"context linestart \\s\\s\\s\\s\\s\\s\\s\\s\\* : brightcyan/17\n"
-"\n"
-"context linestart 19+-+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart 20+-+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Mon\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Tue\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Wed\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Thu\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Fri\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Sat\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"context linestart Sun\\s+\\s+\\s+\\s \\n yellow/24\n"
-" keyword <+@+> brightred/19\n"
-"\n"
-"\n"
-"###############################################################################\n"
-"file .\\*Makefile[\\\\\\.a-z]\\*$ Makefile\n"
-"\n"
-"context default\n"
-" keyword $(*) yellow/24\n"
-" keyword ${*} brightgreen/16\n"
-" keyword whole linestart include magenta\n"
-" keyword whole linestart endif magenta\n"
-" keyword whole linestart ifeq magenta\n"
-" keyword whole linestart ifneq magenta\n"
-" keyword whole linestart else magenta\n"
-" keyword linestart \\t lightgray/13 red\n"
-" keyword whole .PHONY white/25\n"
-" keyword whole .NOEXPORT white/25\n"
-" keyword = white/25\n"
-" keyword : yellow/24\n"
-" keyword \\\\\\n yellow/24\n"
-"# this handles strange cases like @something@@somethingelse@ properly\n"
-" keyword whole @+@ brightmagenta/23 black/0\n"
-" keyword @+@ brightmagenta/23 black/0\n"
-"\n"
-"context linestart # \\n brown/22\n"
-" keyword whole @+@ brightmagenta/23 black/0\n"
-" keyword @+@ brightmagenta/23 black/0\n"
-"\n"
-"context exclusive = \\n brightcyan/17\n"
-" keyword \\\\\\n yellow/24\n"
-" keyword $(*) yellow/24\n"
-" keyword ${*} brightgreen/16\n"
-" keyword linestart \\t lightgray/13 red\n"
-" keyword whole @+@ brightmagenta/23 black/0\n"
-" keyword @+@ brightmagenta/23 black/0\n"
-"\n"
-"context exclusive linestart \\t \\n\n"
-" keyword \\\\\\n yellow/24\n"
-" keyword $(*) yellow/24\n"
-" keyword ${*} brightgreen/16\n"
-" keyword linestart \\t lightgray/13 red\n"
-" keyword whole @+@ brightmagenta/23 black/0\n"
-" keyword @+@ brightmagenta/23 black/0\n"
-"\n"
-"###############################################################################\n"
-"\n"
-"file .\\*syntax$ Syntax\\sHighlighting\\sdefinitions\n"
-"\n"
-"context default\n"
-" keyword whole keyw\\ord yellow/24\n"
-" keyword whole whole\\[\\t\\s\\]l\\inestart brightcyan/17\n"
-" keyword whole whole\\[\\t\\s\\]l\\inestart brightcyan/17\n"
-" keyword whole wh\\oleleft\\[\\t\\s\\]l\\inestart brightcyan/17\n"
-" keyword whole wh\\oleright\\[\\t\\s\\]l\\inestart brightcyan/17\n"
-" keyword whole l\\inestart\\[\\t\\s\\]wh\\ole\n"
-" keyword whole l\\inestart\\[\\t\\s\\]wh\\ole\n"
-" keyword whole l\\inestart\\[\\t\\s\\]wh\\oleleft\n"
-" keyword whole l\\inestart\\[\\t\\s\\]wh\\oleright\n"
-" keyword wholeleft whole\\s brightcyan/17\n"
-" keyword wholeleft whole\\t brightcyan/17\n"
-" keyword whole wh\\oleleft brightcyan/17\n"
-" keyword whole wh\\oleright brightcyan/17\n"
-" keyword whole lin\\[e\\]start brightcyan/17\n"
-" keyword whole c\\ontext\\[\\t\\s\\]exclusive brightred/18\n"
-" keyword whole c\\ontext\\[\\t\\s\\]default brightred/18\n"
-" keyword whole c\\ontext brightred/18\n"
-" keyword whole wh\\olechars\\[\\t\\s\\]left brightcyan/17\n"
-" keyword whole wh\\olechars\\[\\t\\s\\]right brightcyan/17\n"
-" keyword whole wh\\olechars brightcyan/17\n"
-" keyword whole f\\ile brightgreen/6\n"
-"\n"
-" keyword whole 0 lightgray/0 blue/26\n"
-" keyword whole 1 lightgray/1 blue/26\n"
-" keyword whole 2 lightgray/2 blue/26\n"
-" keyword whole 3 lightgray/3 blue/26\n"
-" keyword whole 4 lightgray/4 blue/26\n"
-" keyword whole 5 lightgray/5 blue/26\n"
-" keyword whole 6 lightgray/6\n"
-" keyword whole 7 lightgray/7\n"
-" keyword whole 8 lightgray/8\n"
-" keyword whole 9 lightgray/9\n"
-" keyword whole 10 lightgray/10\n"
-" keyword whole 11 lightgray/11\n"
-" keyword whole 12 lightgray/12\n"
-" keyword whole 13 lightgray/13\n"
-" keyword whole 14 lightgray/14\n"
-" keyword whole 15 lightgray/15\n"
-" keyword whole 16 lightgray/16\n"
-" keyword whole 17 lightgray/17\n"
-" keyword whole 18 lightgray/18\n"
-" keyword whole 19 lightgray/19\n"
-" keyword whole 20 lightgray/20\n"
-" keyword whole 21 lightgray/21\n"
-" keyword whole 22 lightgray/22\n"
-" keyword whole 23 lightgray/23\n"
-" keyword whole 24 lightgray/24\n"
-" keyword whole 25 lightgray/25\n"
-" keyword whole 26 lightgray/26\n"
-"\n"
-" keyword wholeleft black\\/ black/0\n"
-" keyword wholeleft red\\/ red/DarkRed\n"
-" keyword wholeleft green\\/ green/green3\n"
-" keyword wholeleft brown\\/ brown/saddlebrown\n"
-" keyword wholeleft blue\\/ blue/blue3\n"
-" keyword wholeleft magenta\\/ magenta/magenta3\n"
-" keyword wholeleft cyan\\/ cyan/cyan3\n"
-" keyword wholeleft lightgray\\/ lightgray/lightgray\n"
-" keyword wholeleft gray\\/ gray/gray\n"
-" keyword wholeleft brightred\\/ brightred/red\n"
-" keyword wholeleft brightgreen\\/ brightgreen/green1\n"
-" keyword wholeleft yellow\\/ yellow/yellow\n"
-" keyword wholeleft brightblue\\/ brightblue/blue1\n"
-" keyword wholeleft brightmagenta\\/ brightmagenta/magenta\n"
-" keyword wholeleft brightcyan\\/ brightcyan/cyan1\n"
-" keyword wholeleft white\\/ white/26\n"
-"\n"
-"context linestart # \\n brown/22\n"
-"\n"
-"file \\.\\* Help\\ssupport\\sother\\sfile\\stypes\n"
-"context default\n"
-"file \\.\\* by\\scoding\\srules\\sin\\s~/.cedit/syntax.\n"
-"context default\n"
-"file \\.\\* See\\sman/syntax\\sin\\sthe\\ssource\\sdistribution\n"
-"context default\n"
-"file \\.\\* and\\sconsult\\sthe\\sman\\spage.\n"
-"context default\n";
-
-
-
-FILE *upgrade_syntax_file (char *syntax_file)
-{
- FILE *f;
- char line[80];
- f = fopen (syntax_file, "r");
- if (!f) {
- f = fopen (syntax_file, "w");
- if (!f)
- return 0;
- fprintf (f, "%s", syntax_text);
- fclose (f);
- return fopen (syntax_file, "r");
- }
- memset (line, 0, 79);
- fread (line, 80, 1, f);
- if (!strstr (line, "syntax rules version")) {
- goto rename_rule_file;
- } else {
- char *p;
- p = strstr (line, "version") + strlen ("version") + 1;
- if (atoi (p) < atoi (CURRENT_SYNTAX_RULES_VERSION)) {
- char s[1024];
- rename_rule_file:
- strcpy (s, syntax_file);
- strcat (s, ".OLD");
- unlink (s);
- rename (syntax_file, s);
- unlink (syntax_file); /* might rename() fail ? */
-#ifdef MIDNIGHT
- edit_message_dialog (" Load Syntax Rules ", " Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. ");
-#else
- CMessageDialog (0, 20, 20, 0, " Load Syntax Rules ", " Your syntax rule file is outdated \n A new rule file is being installed. \n Your old rule file has been saved with a .OLD extension. ");
-#endif
- return upgrade_syntax_file (syntax_file);
- } else {
- rewind (f);
- return (f);
- }
- }
- return 0; /* not reached */
-}
-
-/* returns -1 on file error, line number on error in file syntax */
-static int edit_read_syntax_file (WEdit * edit, char **names, char *syntax_file, char *editor_file, char *type)
-{
- FILE *f;
- regex_t r;
- regmatch_t pmatch[1];
- char *args[1024], *l;
- int line = 0;
- int argc;
- int result = 0;
- int count = 0;
-
- f = upgrade_syntax_file (syntax_file);
- if (!f)
- return -1;
- args[0] = 0;
-
- for (;;) {
- line++;
- if (!read_one_line (&l, f))
- break;
- get_args (l, args, &argc);
- if (!args[0]) {
- } else if (!strcmp (args[0], "file")) {
- if (!args[1] || !args[2]) {
- result = line;
- break;
- }
- if (regcomp (&r, args[1], REG_EXTENDED)) {
- result = line;
- break;
- }
- if (names) {
- names[count++] = strdup (args[2]);
- names[count] = 0;
- } else if (type) {
- if (!strcmp (type, args[2]))
- goto found_type;
- } else if (editor_file && edit) {
- if (!regexec (&r, editor_file, 1, pmatch, 0)) {
- int line_error;
- found_type:
- line_error = edit_read_syntax_rules (edit, f);
- if (line_error)
- result = line + line_error;
- else {
- syntax_free (edit->syntax_type);
- edit->syntax_type = strdup (args[2]);
- if (syntax_change_callback)
-#ifdef MIDNIGHT
- (*syntax_change_callback) (&edit->widget);
-#else
- (*syntax_change_callback) (edit->widget);
-#endif
-/* if there are no rules then turn off syntax highlighting for speed */
- if (!edit->rules[1])
- if (!edit->rules[0]->keyword[1])
- edit_free_syntax_rules (edit);
- }
- break;
- }
- }
- }
- free_args (args);
- syntax_free (l);
- }
- free_args (args);
- syntax_free (l);
-
- fclose (f);
-
- return result;
-}
-
-/* loads rules into edit struct. one of edit or names must be zero. if
- edit is zero, a list of types will be stored into name. type may be zero
- in which case the type will be selected according to the filename. */
-void edit_load_syntax (WEdit * edit, char **names, char *type)
-{
- int r;
- char *f;
-
- edit_free_syntax_rules (edit);
-
-#ifdef MIDNIGHT
- if (!SLtt_Use_Ansi_Colors)
- return;
-#endif
-
- if (edit) {
- if (!edit->filename)
- return;
- if (!*edit->filename && !type)
- return;
- }
- f = catstrs (home_dir, SYNTAX_FILE, 0);
- r = edit_read_syntax_file (edit, names, f, edit ? edit->filename : 0, type);
- if (r == -1) {
- edit_free_syntax_rules (edit);
- edit_error_dialog (_ (" Load syntax file "), _ (" File access error "));
- return;
- }
- if (r) {
- char s[80];
- edit_free_syntax_rules (edit);
- sprintf (s, _ (" Syntax error in file %s on line %d "), f, r);
- edit_error_dialog (_ (" Load syntax file "), s);
- return;
- }
-}
-
-#else
-
-int option_syntax_highlighting = 0;
-
-void edit_load_syntax (WEdit * edit, char **names, char *type)
-{
- return;
-}
-
-void edit_free_syntax_rules (WEdit * edit)
-{
- return;
-}
-
-void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg)
-{
- *fg = NORMAL_COLOR;
-}
-
-#endif /* !defined(MIDNIGHT) || defined(HAVE_SYNTAXH) */
-
-
-
-
diff --git a/rosapps/applications/mc/edit/wordproc.c b/rosapps/applications/mc/edit/wordproc.c
deleted file mode 100644
index d3ce53f42f1..00000000000
--- a/rosapps/applications/mc/edit/wordproc.c
+++ /dev/null
@@ -1,350 +0,0 @@
-/* wordproc.c - word-processor mode for the editor: does dynamic
- paragraph formatting.
- Copyright (C) 1996 Paul Sheer
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include
-#include "edit.h"
-
-#ifdef MIDNIGHT
-#define tab_width option_tab_spacing
-#endif
-
-int line_is_blank (WEdit * edit, long line);
-
-#define NO_FORMAT_CHARS_START "-+*\\,.;:&>"
-
-static long line_start (WEdit * edit, long line)
-{
- static long p = -1, l = 0;
- int c;
- if (p == -1 || abs (l - line) > abs (edit->curs_line - line)) {
- l = edit->curs_line;
- p = edit->curs1;
- }
- if (line < l)
- p = edit_move_backward (edit, p, l - line);
- else if (line > l)
- p = edit_move_forward (edit, p, line - l, 0);
- l = line;
- p = edit_bol (edit, p);
- while (strchr ("\t ", c = edit_get_byte (edit, p)))
- p++;
- return p;
-}
-
-static int bad_line_start (WEdit * edit, long p)
-{
- int c;
- c = edit_get_byte (edit, p);
- if (c == '.') { /* `...' is acceptable */
- if (edit_get_byte (edit, p + 1) == '.')
- if (edit_get_byte (edit, p + 2) == '.')
- return 0;
- return 1;
- }
- if (c == '-') {
- if (edit_get_byte (edit, p + 1) == '-')
- if (edit_get_byte (edit, p + 2) == '-')
- return 0; /* `---' is acceptable */
- return 1;
- }
- if (strchr (NO_FORMAT_CHARS_START, c))
- return 1;
- return 0;
-}
-
-static long begin_paragraph (WEdit * edit, long p, int force)
-{
- int i;
- for (i = edit->curs_line - 1; i > 0; i--) {
- if (line_is_blank (edit, i)) {
- i++;
- break;
- }
- if (force) {
- if (bad_line_start (edit, line_start (edit, i))) {
- i++;
- break;
- }
- }
- }
- return edit_move_backward (edit, edit_bol (edit, edit->curs1), edit->curs_line - i);
-}
-
-static long end_paragraph (WEdit * edit, long p, int force)
-{
- int i;
- for (i = edit->curs_line + 1; i < edit->total_lines; i++) {
- if (line_is_blank (edit, i)) {
- i--;
- break;
- }
- if (force)
- if (bad_line_start (edit, line_start (edit, i))) {
- i--;
- break;
- }
- }
- return edit_eol (edit, edit_move_forward (edit, edit_bol (edit, edit->curs1), i - edit->curs_line, 0));
-}
-
-static char *get_paragraph (WEdit * edit, long p, long q, int indent, int *size)
-{
- char *s, *t;
- t = malloc ((q - p) + 2 * (q - p) / option_word_wrap_line_length + 10);
- if (!t)
- return 0;
- for (s = t; p < q; p++, s++) {
- if (indent)
- if (edit_get_byte (edit, p - 1) == '\n')
- while (strchr ("\t ", edit_get_byte (edit, p)))
- p++;
- *s = edit_get_byte (edit, p);
- }
- *size = (unsigned long) s - (unsigned long) t;
- t[*size] = '\n';
- return t;
-}
-
-static void strip_newlines (char *t, int size)
-{
- char *p = t;
- while (size--) {
- *p = *p == '\n' ? ' ' : *p;
- p++;
- }
-}
-
-#ifndef MIDNIGHT
-int edit_width_of_long_printable (int c);
-#endif
-/*
- This is a copy of the function
- int calc_text_pos (WEdit * edit, long b, long *q, int l)
- in propfont.c :(
- It calculates the number of chars in a line specified to length l in pixels
- */
-extern int tab_width;
-static inline int next_tab_pos (int x)
-{
- return x += tab_width - x % tab_width;
-}
-static int line_pixel_length (char *t, long b, int l)
-{
- int x = 0, c, xn = 0;
- for (;;) {
- c = t[b];
- switch (c) {
- case '\n':
- return b;
- case '\t':
- xn = next_tab_pos (x);
- break;
- default:
-#ifdef MIDNIGHT
- xn = x + 1;
-#else
- xn = x + edit_width_of_long_printable (c);
-#endif
- break;
- }
- if (xn > l)
- break;
- x = xn;
- b++;
- }
- return b;
-}
-
-/* find the start of a word */
-static int next_word_start (char *t, int q, int size)
-{
- int i;
- for (i = q;; i++) {
- switch (t[i]) {
- case '\n':
- return -1;
- case '\t':
- case ' ':
- for (;; i++) {
- if (t[i] == '\n')
- return -1;
- if (t[i] != ' ' && t[i] != '\t')
- return i;
- }
- break;
- }
- }
-}
-
-/* find the start of a word */
-static int word_start (char *t, int q, int size)
-{
- int i = q;
- if (t[q] == ' ' || t[q] == '\t')
- return next_word_start (t, q, size);
- for (;;) {
- int c;
- if (!i)
- return -1;
- c = t[i - 1];
- if (c == '\n')
- return -1;
- if (c == ' ' || c == '\t')
- return i;
- i--;
- }
-}
-
-/* replaces ' ' with '\n' to properly format a paragraph */
-static void format_this (char *t, int size, int indent)
-{
- int q = 0, ww;
- strip_newlines (t, size);
- ww = option_word_wrap_line_length * FONT_MEAN_WIDTH - indent;
- if (ww < FONT_MEAN_WIDTH * 2)
- ww = FONT_MEAN_WIDTH * 2;
- for (;;) {
- int p;
- q = line_pixel_length (t, q, ww);
- if (q > size)
- break;
- if (t[q] == '\n')
- break;
- p = word_start (t, q, size);
- if (p == -1)
- q = next_word_start (t, q, size); /* Return the end of the word if the beginning
- of the word is at the beginning of a line
- (i.e. a very long word) */
- else
- q = p;
- if (q == -1) /* end of paragraph */
- break;
- if (q)
- t[q - 1] = '\n';
- }
-}
-
-static void replace_at (WEdit * edit, long q, int c)
-{
- edit_cursor_move (edit, q - edit->curs1);
- edit_delete (edit);
- edit_insert_ahead (edit, c);
-}
-
-void edit_insert_indent (WEdit * edit, int indent);
-
-/* replaces a block of text */
-static void put_paragraph (WEdit * edit, char *t, long p, long q, int indent, int size)
-{
- long cursor;
- int i, c = 0;
- cursor = edit->curs1;
- if (indent)
- while (strchr ("\t ", edit_get_byte (edit, p)))
- p++;
- for (i = 0; i < size; i++, p++) {
- if (i && indent) {
- if (t[i - 1] == '\n' && c == '\n') {
- while (strchr ("\t ", edit_get_byte (edit, p)))
- p++;
- } else if (t[i - 1] == '\n') {
- long curs;
- edit_cursor_move (edit, p - edit->curs1);
- curs = edit->curs1;
- edit_insert_indent (edit, indent);
- if (cursor >= curs)
- cursor += edit->curs1 - p;
- p = edit->curs1;
- } else if (c == '\n') {
- edit_cursor_move (edit, p - edit->curs1);
- while (strchr ("\t ", edit_get_byte (edit, p))) {
- edit_delete (edit);
- if (cursor > edit->curs1)
- cursor--;
- }
- p = edit->curs1;
- }
- }
- c = edit_get_byte (edit, p);
- if (c != t[i])
- replace_at (edit, p, t[i]);
- }
- edit_cursor_move (edit, cursor - edit->curs1); /* restore cursor position */
-}
-
-int edit_indent_width (WEdit * edit, long p);
-
-static int test_indent (WEdit * edit, long p, long q)
-{
- int indent;
- indent = edit_indent_width (edit, p++);
- if (!indent)
- return 0;
- for (; p < q; p++)
- if (edit_get_byte (edit, p - 1) == '\n')
- if (indent != edit_indent_width (edit, p))
- return 0;
- return indent;
-}
-
-void format_paragraph (WEdit * edit, int force)
-{
- long p, q;
- int size;
- char *t;
- int indent = 0;
- if (option_word_wrap_line_length < 2)
- return;
- if (line_is_blank (edit, edit->curs_line))
- return;
- p = begin_paragraph (edit, edit->curs1, force);
- q = end_paragraph (edit, edit->curs1, force);
- indent = test_indent (edit, p, q);
- t = get_paragraph (edit, p, q, indent, &size);
- if (!t)
- return;
- if (!force) {
- int i;
- if (strchr (NO_FORMAT_CHARS_START, *t)) {
- free (t);
- return;
- }
- for (i = 0; i < size - 1; i++) {
- if (t[i] == '\n') {
- if (strchr (NO_FORMAT_CHARS_START "\t ", t[i + 1])) {
- free (t);
- return;
- }
- }
- }
- }
- format_this (t, q - p, indent);
- put_paragraph (edit, t, p, q, indent, size);
- free (t);
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/rosapps/applications/mc/install-sh b/rosapps/applications/mc/install-sh
deleted file mode 100644
index 0ff4b6a08e8..00000000000
--- a/rosapps/applications/mc/install-sh
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/bin/sh
-
-#
-# install - install a program, script, or datafile
-# This comes from X11R5; it is not part of GNU.
-#
-# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-
-instcmd="$mvprog"
-chmodcmd=""
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-
-while [ x"$1" != x ]; do
- case $1 in
- -c) instcmd="$cpprog"
- shift
- continue;;
-
- -m) chmodcmd="$chmodprog $2"
- shift
- shift
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd="$stripprog"
- shift
- continue;;
-
- *) if [ x"$src" = x ]
- then
- src=$1
- else
- dst=$1
- fi
- shift
- continue;;
- esac
-done
-
-if [ x"$src" = x ]
-then
- echo "install: no input file specified"
- exit 1
-fi
-
-if [ x"$dst" = x ]
-then
- echo "install: no destination specified"
- exit 1
-fi
-
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-if [ -d $dst ]
-then
- dst="$dst"/`basename $src`
-fi
-
-# Make a temp file name in the proper directory.
-
-dstdir=`dirname $dst`
-dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-$doit $instcmd $src $dsttmp
-
-# and set any options; do chmod last to preserve setuid bits
-
-if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
-if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
-if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
-if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
-
-# Now rename the file to the real destination.
-
-$doit $rmcmd $dst
-$doit $mvcmd $dsttmp $dst
-
-
-exit 0
diff --git a/rosapps/applications/mc/make.common.in b/rosapps/applications/mc/make.common.in
deleted file mode 100644
index 63d2bde175d..00000000000
--- a/rosapps/applications/mc/make.common.in
+++ /dev/null
@@ -1,105 +0,0 @@
-VERSION=4.1.36
-
-SHELL = /bin/sh
-
-# This variable makes it possible to move the installation root to another
-# directory. This is useful when you're creating a binary distribution of mc.
-# If empty, normal root will be used.
-# You can run e.g. 'make install DESTDIR=/packages/mc/3.0' to accomplish
-# that.
-# DESTDIR = /opt/apps/mc/$(VERSION)
-
-# Installation target directories & other installation stuff
-prefix = @prefix@
-exec_prefix = $(prefix)
-binprefix =
-manprefix =
-
-builddir = @builddir@
-bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib/mc
-suppbindir = $(libdir)/bin
-tidir = $(libdir)/term
-extfsdir = $(libdir)/extfs
-icondir = $(prefix)/share/icons/mc
-mandir = $(prefix)/man/man1
-datadir = $(prefix)/share
-localedir = $(datadir)/locale
-manext = 1
-man8dir = $(prefix)/man/man8
-man8ext = 8
-xv_bindir = @xv_bindir@
-
-# Tools & program stuff
-SEDCMD = @SEDCMD@
-SEDCMD2 = @SEDCMD2@
-STRIP = @STRIP@
-@SET_MAKE@
-CC = @CC@
-CPP = @CPP@
-AR = @AR@
-RANLIB = @RANLIB@
-RM = @RM@
-RMF = @RM@ -f
-MV = @MV@
-CP = @CP@
-LN_S = @LN_S@
-AWK = @AWK@
-AWK_VAR_OPTION = @AWK_VAR_OPTION@
-
-# Flags & libs
-# No way, to make make happy (except GNU), we cannot use := to append
-# something to these, so that's why there is a leading _
-XCFLAGS = @CFLAGS@
-XCPPFLAGS = @CPPFLAGS@ -I.. -DBINDIR=\""$(bindir)/"\" -DLIBDIR=\""$(libdir)/"\" -DICONDIR=\""$(icondir)/"\" $(XINC) -DLOCALEDIR=\""$(localedir)/"\"
-XLDFLAGS = @LDFLAGS@
-XDEFS = @DEFS@
-XLIBS = @LIBS@
-
-# Where do we have the sources?
-# You shouldn't have to edit this :)
-mcsrcdir = $(rootdir)/src
-docdir = $(rootdir)/doc
-mclibdir = $(rootdir)/lib
-slangdir = $(rootdir)/slang
-vfsdir = $(rootdir)/vfs
-xvdir = $(rootdir)/xv
-tkdir = $(rootdir)/tk
-gnomedir = $(rootdir)/gnome
-icodir = $(rootdir)/icons
-
-hpath = -I$(mcsrcdir) -I$(slangdir) -I$(vfsdir) -I$(xvdir) -I$(xvdir)/support/xview_private -I$(tkdir)
-
-# Rules
-first_rule: all
-
-@PHONY@ all check cross TAGS clean install uninstall distcopy depend dep
-@PHONY@ fastdep fastdepslang fastdepvfs fastdeploc slowdep
-
-@PCENTRULE@../slang/%.o : ../slang/%.c
-@PCENTRULE@ cd ../slang; $(MAKE) libmcslang.a
-
-@PCENTRULE@../vfs/%.o : ../vfs/%.c
-@PCENTRULE@ cd ../vfs; $(MAKE) libvfs.a
-
-fastdep: dummy
- if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then { cd $(srcdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(srcdir)" *.[ch];} > .depend; fi
- -$(MAKE) fastdeploc
- @WRITEDEP@
-
-fastdepslang:
-@PCENTRULE@ { { { cd ../slang; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(slangdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../slang libmcslang.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(slangdir)";};} >> .depend
-
-fastdepvfs:
-@PCENTRULE@ { { { cd ../vfs; $(MAKE) showlibdep;} | grep OBJS; cat .depend;} | { cd $(vfsdir); $(AWK) -f $(mcsrcdir)/depend.awk $(AWK_VAR_OPTION) dolib="../vfs libvfs.a" $(AWK_VAR_OPTION) hpath="$(hpath)" $(AWK_VAR_OPTION) srcdir="$(vfsdir)";};} >> .depend
-
-slowdep: dummy
- if test x"`echo $(srcdir)/*.[ch]`" != x'$(srcdir)/*.[ch]'; then \
- $(CPP) -M $(CPPFLAGS) $(DEFS) $(CFLAGS) $(srcdir)/*.c > .depend; fi
- @WRITEDEP@
-
-mcdep: @dep@
-
-dummy:
-
-# End of Make.common
diff --git a/rosapps/applications/mc/mc.rbuild b/rosapps/applications/mc/mc.rbuild
deleted file mode 100644
index 873c8316ede..00000000000
--- a/rosapps/applications/mc/mc.rbuild
+++ /dev/null
@@ -1,84 +0,0 @@
-
- src
- pc
- slang
- edit
-
-
-
-
- kernel32
- user32
- advapi32
-
-
- terms.c
- user.c
- file.c
- listmode.c
- cmd.c
- command.c
- help.c
- menu.c
- view.c
- dir.c
- info.c
- widget.c
- option.c
- dlg.c
- panelize.c
- profile.c
- util.c
- dialog.c
- ext.c
- color.c
- layout.c
- setup.c
- regex.c
- hotlist.c
- tree.c
- win.c
- complete.c
- find.c
- wtools.c
- boxes.c
- background.c
- main.c
- popt.c
- text.c
- screen.c
-
-
-
- slint_pc.c
- chmod.c
- drive.c
- cons_nt.c
- dirent_nt.c
- key_nt.c
- util_win32.c
- util_winnt.c
- util_nt.c
-
-
-
- slerr.c
- slgetkey.c
- slsmg.c
- slvideo.c
- slw32tty.c
-
-
-
- edit.c
- editcmd.c
- editdraw.c
- editmenu.c
- editoptions.c
- editwidget.c
- syntax.c
- wordproc.c
-
-
- mc.rc
-
diff --git a/rosapps/applications/mc/mc.rc b/rosapps/applications/mc/mc.rc
deleted file mode 100644
index 8340ee46a4c..00000000000
--- a/rosapps/applications/mc/mc.rc
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "VERSION"
-#ifndef WINDRES
-# include "windows.h"
-// # include "winver.h"
-#endif
-
-/* English (U.S.) resources */
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-
-#ifdef _WIN32
-#ifndef WINDRES
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#endif
-#pragma code_page(1252)
-#endif /* _WIN32 */
-
-/* Version */
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 3,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40000L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904E4"
- BEGIN
- VALUE "CompanyName", "Free Software Foundation"
- VALUE "FileDescription", "GNU Midnight Commander"
- VALUE "FileVersion", VERSION
- VALUE "InternalName", "MC"
- VALUE "LegalCopyright", "(c) Free Software Foundation"
- VALUE "LegalTrademarks", "see GNU General Public License"
- VALUE "OriginalFilename", "MC.EXE"
- VALUE "ProductName", "GNU Midnight Commander"
- VALUE "ProductVersion", VERSION
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
-
-
-/* Icon */
-// 0 ICON DISCARDABLE "mc_nt.ico"
-// 1 ICON DISCARDABLE "bez03.ico"
-
-#endif /* English (U.S.) resources */
-
diff --git a/rosapps/applications/mc/mcfn_install b/rosapps/applications/mc/mcfn_install
deleted file mode 100644
index de6bc326afe..00000000000
--- a/rosapps/applications/mc/mcfn_install
+++ /dev/null
@@ -1,67 +0,0 @@
-#/bin/sh
-#
-prefix=/usr/local
-if test -n `echo $prefix | grep prefix`; then
- prefix=/usr/local
-fi
-if test x$BASH = x; then
- BASHRC=
-else
- BASHRC=~/.bashrc
-fi
-if test "x$EUID" = x0; then
- PROFILE=/etc/profile
-else
- PROFILE=~/.profile
-fi
-if test -f $PROFILE; then
- A=`grep "mc ()" $PROFILE`
- B=
- if test -n "$BASHRC"; then
- if test -f $BASHRC; then
- B=`grep "mc ()" $BASHRC`
- fi
- fi
- if test -n "$A"; then
- :
- else
- if test -n "$B"; then
- :
- else
- A=`typeset -f | grep "mc ()" 2>/dev/null`
- if test ! -n "$A"; then
- echo "mc () installation."
- if test -n "$BASHRC"; then
- echo "While examining your $PROFILE and $BASHRC,"
- else
- echo "While examining your $PROFILE,"
- fi
- echo "I've found that you have no mc () function defined there."
- echo "This function enables a feature of mc(1) that when you leave mc(1),"
- echo "you return to a directory where you were in mc just before exiting"
- echo "and not to the directory you've started mc from."
- echo "Would you like to append"
- echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };'
- if test -n "$BASHRC"; then
- echo "function to your (p) $PROFILE (mc function will be active in your login shells)"
- echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] "
- else
- echo -n "function to your $PROFILE? [y|n] "
- fi
- read rep
- if test -n "$BASHRC"; then
- INITFILE=$BASHRC
- else
- INITFILE=$PROFILE
- fi
- case $rep in
- [Nn]*) exit ;;
- [Pp]*) INITFILE=$PROFILE ;;
- esac
- echo >>$INITFILE
- echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };' >>$INITFILE
- echo "mc () function appended to your $INITFILE"
- fi
- fi
- fi
-fi
diff --git a/rosapps/applications/mc/mcfn_install.in b/rosapps/applications/mc/mcfn_install.in
deleted file mode 100644
index 9aed408052d..00000000000
--- a/rosapps/applications/mc/mcfn_install.in
+++ /dev/null
@@ -1,67 +0,0 @@
-#/bin/sh
-#
-prefix=@prefix@
-if test -n `echo $prefix | grep prefix`; then
- prefix=/usr/local
-fi
-if test x$BASH = x; then
- BASHRC=
-else
- BASHRC=~/.bashrc
-fi
-if test "x$EUID" = x0; then
- PROFILE=/etc/profile
-else
- PROFILE=~/.profile
-fi
-if test -f $PROFILE; then
- A=`grep "mc ()" $PROFILE`
- B=
- if test -n "$BASHRC"; then
- if test -f $BASHRC; then
- B=`grep "mc ()" $BASHRC`
- fi
- fi
- if test -n "$A"; then
- :
- else
- if test -n "$B"; then
- :
- else
- A=`typeset -f | grep "mc ()" 2>/dev/null`
- if test ! -n "$A"; then
- echo "mc () installation."
- if test -n "$BASHRC"; then
- echo "While examining your $PROFILE and $BASHRC,"
- else
- echo "While examining your $PROFILE,"
- fi
- echo "I've found that you have no mc () function defined there."
- echo "This function enables a feature of mc(1) that when you leave mc(1),"
- echo "you return to a directory where you were in mc just before exiting"
- echo "and not to the directory you've started mc from."
- echo "Would you like to append"
- echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };'
- if test -n "$BASHRC"; then
- echo "function to your (p) $PROFILE (mc function will be active in your login shells)"
- echo -n "or to your (b) $BASHRC (in every bash instance) or (n) no? [p|b|n] "
- else
- echo -n "function to your $PROFILE? [y|n] "
- fi
- read rep
- if test -n "$BASHRC"; then
- INITFILE=$BASHRC
- else
- INITFILE=$PROFILE
- fi
- case $rep in
- [Nn]*) exit ;;
- [Pp]*) INITFILE=$PROFILE ;;
- esac
- echo >>$INITFILE
- echo 'mc () { MC=`'$prefix'/bin/mc -P "$@"`; [ -n "$MC" ] && cd "$MC"; unset MC };' >>$INITFILE
- echo "mc () function appended to your $INITFILE"
- fi
- fi
- fi
-fi
diff --git a/rosapps/applications/mc/mkinstalldirs b/rosapps/applications/mc/mkinstalldirs
deleted file mode 100644
index d0fd194fd6c..00000000000
--- a/rosapps/applications/mc/mkinstalldirs
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh
-# mkinstalldirs --- make directory hierarchy
-# Author: Noah Friedman
-# Created: 1993-05-16
-# Public domain
-
-# $Id$
-
-errstatus=0
-
-for file
-do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
- shift
-
- pathcomp=
- for d
- do
- pathcomp="$pathcomp$d"
- case "$pathcomp" in
- -* ) pathcomp=./$pathcomp ;;
- esac
-
- if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp" 1>&2
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- fi
- fi
-
- pathcomp="$pathcomp/"
- done
-done
-
-exit $errstatus
-
-# mkinstalldirs ends here
diff --git a/rosapps/applications/mc/pc/Makefile.PC b/rosapps/applications/mc/pc/Makefile.PC
deleted file mode 100644
index 9220c16efe3..00000000000
--- a/rosapps/applications/mc/pc/Makefile.PC
+++ /dev/null
@@ -1,178 +0,0 @@
-# Makefile.PC
-#
-# This is the Makefile for Midnight Commander under OS/2 and Windows NT
-#
-# Written by Dan Nicolaescu
-# 970423 hacked by Juan f. Grigera
-# 970525 hacked again by jfg to add internal editor
-# 971127 hacked by Pavel Roskin to make it work with mc-4.1.11
-# 980206 hacked by Pavel Roskin to make it work with GNU make
-# 980329 changed by Pavel Roskin to make it common for OS/2 and NT
-#
-# Supported Compilers:
-#
-# For Windows NT:
-# Makefile.VC4: Microsoft Visual C++ 4.0 and above
-# Makefile.BC5: Borland C++ 5.x
-# Makefile.MIN: MinGW
-# Makefile.RSX: RSX
-# For OS/2:
-# Makefile.EMX: EMX/GCC
-# Makefile.BC2: Borland C++ 2.x
-# Makefile.IBM: IBM CSet or Visual Age C++
-# ...
-
-# ---- Directories
-MC_PC_DIR=.
-MC_SRC_DIR=../src
-VFS_DIR=../vfs
-MCEDIT_SRC_DIR=../edit
-MCEDIT_OBJS_DIR=$(OBJS_DIR)/edit
-SLANG_SRC_DIR=../slang
-SLANG_OBJS_DIR=$(OBJS_DIR)/slang
-MC_EXE=$(OBJS_DIR)/mc.exe
-
-# --- Midnight Defines
-COMMON_DEFINES=-DMC_$(TARGET_OS) $(SPECIFIC_DEFINES)
-MC_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MC_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-SLANG_DEFINES=$(COMMON_DEFINES)
-SLANG_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-MCEDIT_DEFINES=$(COMMON_DEFINES) -DHAVE_CONFIG_H
-MCEDIT_INCLUDES=-I$(MC_PC_DIR) -I$(SLANG_SRC_DIR)
-
-CFLAGS=$(SPECIFIC_MC_CFLAGS) $(MC_INCLUDES) $(MC_DEFINES) -c
-SLANG_CFLAGS=$(SPECIFIC_SLANG_CFLAGS) $(SLANG_INCLUDES) $(SLANG_DEFINES) -c
-MCEDIT_CFLAGS=$(SPECIFIC_MCEDIT_CFLAGS) $(MCEDIT_INCLUDES) $(MCEDIT_DEFINES) -c
-
-
-all: object-dirs mc
-object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR)
-
-mc: $(MC_EXE)
-
-clean:
- deltree -y "$(SLANG_OBJS_DIR)"
- deltree -y "$(MCEDIT_OBJS_DIR)"
- deltree -y "$(OBJS_DIR)"
-
-$(OBJS_DIR):
- mkdir "$@"
-
-$(SLANG_OBJS_DIR):
- mkdir "$@"
-
-$(MCEDIT_OBJS_DIR):
- mkdir "$@"
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_PC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(OBJS_DIR)/%.$(OBJ_SUFFIX): $(MC_SRC_DIR)/%.c
- $(CC) $(CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(SLANG_OBJS_DIR)/%.$(OBJ_SUFFIX): $(SLANG_SRC_DIR)/%.c
- $(CC) $(SLANG_CFLAGS) $(OBJ_PLACE)$@ $<
-
-$(MCEDIT_OBJS_DIR)/%.$(OBJ_SUFFIX): $(MCEDIT_SRC_DIR)/%.c
- $(CC) $(MCEDIT_CFLAGS) $(OBJ_PLACE)$@ $<
-
-MC_SRCS= \
- terms.c \
- user.c \
- file.c \
- listmode.c \
- cmd.c \
- command.c \
- help.c \
- menu.c \
- view.c \
- dir.c \
- info.c \
- widget.c \
- option.c \
- dlg.c \
- panelize.c \
- profile.c \
- util.c \
- dialog.c \
- ext.c \
- color.c \
- layout.c \
- setup.c \
- regex.c \
- hotlist.c \
- tree.c \
- win.c \
- complete.c \
- find.c \
- wtools.c \
- boxes.c \
- background.c \
- main.c \
- popt.c \
- text.c \
- screen.c
-
-PC_SRCS= \
- slint_pc.c \
- chmod.c \
- drive.c
-
-NT_SRCS= \
- cons_nt.c \
- dirent_nt.c \
- key_nt.c \
- util_win32.c \
- util_winnt.c \
- util_nt.c
-
-OS2_SRCS= \
- cons_os2.c \
- dirent_os2.c \
- key_os2.c \
- util_os2.c
-
-SLANG_NT=slw32tty.c
-SLANG_OS2=slos2tty.c
-
-SLANG_SRCS= \
- slerr.c \
- slgetkey.c \
- slsmg.c \
- slvideo.c \
- $(SLANG_$(TARGET_OS))
-
-MCEDIT_SRCS= \
- edit.c \
- editcmd.c \
- editdraw.c \
- editmenu.c \
- editoptions.c \
- editwidget.c \
- syntax.c \
- wordproc.c
-
-SRCS=$(MC_SRCS) $(PC_SRCS) $($(TARGET_OS)_SRCS) $(EXTRA_MC_SRCS)
-
-OBJS=$(addprefix $(OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SRCS)))
-SLANG_OBJS=$(addprefix $(SLANG_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(SLANG_SRCS)))
-MCEDIT_OBJS=$(addprefix $(MCEDIT_OBJS_DIR)/, \
- $(patsubst %.c,%.$(OBJ_SUFFIX),$(MCEDIT_SRCS)))
-
-ifdef RSC
-
-ifndef RES_SUFFIX
-RES_SUFFIX=res
-endif # RES_SUFFIX
-
-MC_RES=$(OBJS_DIR)/mc.$(RES_SUFFIX)
-
-$(MC_RES): $(MC_PC_DIR)/mc.rc $(MC_PC_DIR)/mc_nt.ico $(MC_PC_DIR)/config.h ../VERSION
- $(RSC) $(RES_PLACE)$(MC_RES) $(RC_DEFINES) $(MC_PC_DIR)/mc.rc
-
-else
-MC_RES=
-endif # !RSC
diff --git a/rosapps/applications/mc/pc/bugs b/rosapps/applications/mc/pc/bugs
deleted file mode 100644
index 940445e471e..00000000000
--- a/rosapps/applications/mc/pc/bugs
+++ /dev/null
@@ -1,15 +0,0 @@
-BUGS OF PC port
-
-- Troubles with keys (Ctrl-Tab, Gray +,-,*, Alt-Shift-A etc)
-- Filtered view hangs in close_pipe() because error is set, but nothing
-is available on stderr
-- Windows '95 will not delete directory if not empty. (as it does
- not return ENOTEMPTY but ENOACCESS)! Already fixed?
-- Windows '95 will not allow "''" in root drives
-- OS/2 port uses always screen size 80x25. Do we need newer SLang?
-- IBM C++ has some problems with O_TEXT -> troubles with editor
-- OS/2 port causes access violation while copying files.
-- getcwd from EMX returns a UNIX-like path -> drive change fails.
-
--please report!
-
diff --git a/rosapps/applications/mc/pc/changelog b/rosapps/applications/mc/pc/changelog
deleted file mode 100644
index 1068122ce6c..00000000000
--- a/rosapps/applications/mc/pc/changelog
+++ /dev/null
@@ -1,23 +0,0 @@
-Tue May 12 17:16:43 1998 Pavel Roskin
-
- * Makefile.RSX, mc.rc: Resources support for RSX
-
- * Makefile.PC, *.c: Some includes corrected for MinGW
- compatability (dir.h exists both in mc and MinGW)
-
-Fri May 8 10:49:21 1998 Pavel Roskin
-
- * Makefile.PC, Makefile.MIN: support for custom extension
- for compiled resourses
-
- * key_nt.c: Minor changes for MinGW
-
- * mc.rc: WindRes support
-
- * slint_pc.c: support for syntax highlighting
-
-Fri May 1 17:33:11 1998 Pavel Roskin
-
- * chmod.c: Updated call to update_panels()
-
- * config.h, Makefile.MIN: Support for MinGW added
diff --git a/rosapps/applications/mc/pc/chmod.c b/rosapps/applications/mc/pc/chmod.c
deleted file mode 100644
index 403b3b481fe..00000000000
--- a/rosapps/applications/mc/pc/chmod.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/* Chmod command for Windows NT and OS/2
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-
-#ifdef __os2__
-#define INCL_DOSFILEMGR
-#include
-#endif
-
-#ifdef _OS_NT
-#include
-#endif
-
-#include
-#include
-/* for chmod and stat */
-#include
-#include
-#include
-#include "../src/tty.h"
-#include "../src/mad.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/color.h"
-#include "../src/dlg.h"
-#include "../src/widget.h"
-#include "../src/dialog.h" /* For do_refresh() */
-
-#include "../src/dir.h"
-#include "../src/panel.h" /* Needed for the externs */
-#include "../src/file.h"
-#include "../src/main.h"
-#include "../src/chmod.h"
-#include "../src/achown.h"
-#include "../src/chown.h"
-
-#ifdef _OS_NT
-#define FILE_ARCHIVED FILE_ATTRIBUTE_ARCHIVE
-#define FILE_DIRECTORY FILE_ATTRIBUTE_DIRECTORY
-#define FILE_HIDDEN FILE_ATTRIBUTE_HIDDEN
-#define FILE_READONLY FILE_ATTRIBUTE_READONLY
-#define FILE_SYSTEM FILE_ATTRIBUTE_SYSTEM
-#define mk_chmod(fname,st) SetFileAttributes(fname,st)
-#endif
-
-static int single_set;
-struct Dlg_head *ch_dlg;
-
-#define PX 5
-#define PY 2
-
-#define FX 40
-#define FY 2
-
-#define BX 6
-#define BY 17
-
-#define TX 40
-#define TY 12
-
-#define PERMISSIONS 4
-#define BUTTONS 6
-
-#define B_MARKED B_USER
-#define B_ALL B_USER+1
-#define B_SETMRK B_USER+2
-#define B_CLRMRK B_USER+3
-
-
-int mode_change, need_update;
-int c_file, end_chmod;
-
-umode_t and_mask, or_mask, c_stat;
-char *c_fname, *c_fown, *c_fgrp, *c_fperm;
-int c_fsize;
-
-static WLabel *statl;
-static int normal_color;
-static int title_color;
-static int selection_color;
-
-/* bsedos.h */
-struct {
- mode_t mode;
- char *text;
- int selected;
- WCheck *check;
-} check_perm[PERMISSIONS] = {
-
- {
- FILE_ARCHIVED, N_("Archive"), 0, 0,
- },
- {
- FILE_READONLY, N_("Read Only"), 0, 0,
- },
- {
- FILE_HIDDEN, N_("Hidden"), 0, 0,
- },
- {
- FILE_SYSTEM, N_("System"), 0, 0,
- },
-};
-
-struct {
- int ret_cmd, flags, y, x;
- char *text;
-} chmod_but[BUTTONS] = {
-
- {
- B_CANCEL, NORMAL_BUTTON, 2, 33, N_("&Cancel"),
- },
- {
- B_ENTER, DEFPUSH_BUTTON, 2, 17, N_("&Set"),
- },
- {
- B_CLRMRK, NORMAL_BUTTON, 0, 42, N_("C&lear marked"),
- },
- {
- B_SETMRK, NORMAL_BUTTON, 0, 27, N_("S&et marked"),
- },
- {
- B_MARKED, NORMAL_BUTTON, 0, 12, N_("&Marked all"),
- },
- {
- B_ALL, NORMAL_BUTTON, 0, 0, N_("Set &all"),
- },
-};
-
-static void chmod_toggle_select (void)
-{
- int Id = ch_dlg->current->dlg_id - BUTTONS + single_set * 2;
-
- attrset (normal_color);
- check_perm[Id].selected ^= 1;
-
- dlg_move (ch_dlg, PY + PERMISSIONS - Id, PX + 1);
- addch ((check_perm[Id].selected) ? '*' : ' ');
- dlg_move (ch_dlg, PY + PERMISSIONS - Id, PX + 3);
-}
-
-static void chmod_refresh (void)
-{
- attrset (normal_color);
- dlg_erase (ch_dlg);
-
- draw_box (ch_dlg, 1, 2, 20 - single_set, 66);
- draw_box (ch_dlg, PY, PX, PERMISSIONS + 2, 33);
- draw_box (ch_dlg, FY, FX, 10, 25);
-
- dlg_move (ch_dlg, FY + 1, FX + 2);
- addstr (_("Name"));
- dlg_move (ch_dlg, FY + 3, FX + 2);
- addstr (_("Permissions (Octal)"));
- dlg_move (ch_dlg, FY + 5, FX + 2);
- addstr (_("Owner name"));
- dlg_move (ch_dlg, FY + 7, FX + 2);
- addstr (_("Group name"));
-
- attrset (title_color);
- dlg_move (ch_dlg, 1, 28);
- addstr (_(" Chmod command "));
- dlg_move (ch_dlg, PY, PX + 1);
- addstr (_(" Permission "));
- dlg_move (ch_dlg, FY, FX + 1);
- addstr (_(" File "));
-
- attrset (selection_color);
-
- dlg_move (ch_dlg, TY, TX);
- addstr (_("Use SPACE to change"));
- dlg_move (ch_dlg, TY + 1, TX);
- addstr (_("an option, ARROW KEYS"));
- dlg_move (ch_dlg, TY + 2, TX);
- addstr (_("to move between options"));
- dlg_move (ch_dlg, TY + 3, TX);
- addstr (_("and T or INS to mark"));
-}
-
-static int chmod_callback (Dlg_head *h, int Par, int Msg)
-{
- char buffer [10];
-
- switch (Msg) {
- case DLG_ACTION:
- if (Par >= BUTTONS - single_set * 2){
- c_stat ^= check_perm[Par - BUTTONS + single_set * 2].mode;
- sprintf (buffer, "%o", c_stat);
- label_set_text (statl, buffer);
- chmod_toggle_select ();
- mode_change = 1;
- }
- break;
-
- case DLG_KEY:
- if ((Par == 'T' || Par == 't' || Par == KEY_IC) &&
- ch_dlg->current->dlg_id >= BUTTONS - single_set * 2) {
- chmod_toggle_select ();
- if (Par == KEY_IC)
- dlg_one_down (ch_dlg);
- return 1;
- }
- break;
-#ifndef HAVE_X
- case DLG_DRAW:
- chmod_refresh ();
- break;
-#endif
- }
- return 0;
-}
-
-static void init_chmod (void)
-{
- int i;
-
- do_refresh ();
- end_chmod = c_file = need_update = 0;
- single_set = (cpanel->marked < 2) ? 2 : 0;
-
- if (use_colors){
- normal_color = COLOR_NORMAL;
- title_color = COLOR_HOT_NORMAL;
- selection_color = COLOR_NORMAL;
- } else {
- normal_color = NORMAL_COLOR;
- title_color = SELECTED_COLOR;
- selection_color = SELECTED_COLOR;
- }
-
- ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
- chmod_callback, _("[Chmod]"), _("chmod"), DLG_CENTER);
-
- x_set_dialog_title (ch_dlg, _("Chmod command"));
-
-#define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
- chmod_but[i].ret_cmd, chmod_but[i].flags, chmod_but[i].text, 0, 0, NULL
-
- tk_new_frame (ch_dlg, "b.");
- for (i = 0; i < BUTTONS; i++) {
- if (i == 2 && single_set)
- break;
- else
- add_widgetl (ch_dlg, button_new (XTRACT (i)), XV_WLAY_RIGHTOF);
- }
-
-
-#define XTRACT2(i) 0, check_perm [i].text, NULL
- tk_new_frame (ch_dlg, "c.");
- for (i = 0; i < PERMISSIONS; i++) {
- check_perm[i].check = check_new (PY + (PERMISSIONS - i), PX + 2,
- XTRACT2 (i));
- add_widget (ch_dlg, check_perm[i].check);
- }
-}
-
-int pc_stat_file (char *filename)
-{
- mode_t st;
-
-#ifdef _OS_NT
- st = GetFileAttributes (filename);
-#endif /* _OS_NT */
-
-#ifdef __os2__
- HFILE fHandle = 0L;
- ULONG fInfoLevel = 1; /* 1st Level Info: Standard attributs */
- FILESTATUS3 fInfoBuf;
- ULONG fInfoBufSize;
- ULONG fAction = 0;
- APIRET rc;
-
- fInfoBufSize = sizeof(FILESTATUS3);
- rc = DosOpen((PSZ) filename,
- &fHandle,
- &fAction,
- (ULONG) 0,
- FILE_NORMAL,
- OPEN_ACTION_OPEN_IF_EXISTS,
- (OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE),
- (PEAOP2) NULL);
- if (rc != 0) {
- return -1;
- }
-
- rc = DosQueryFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- DosClose(fHandle);
- if (rc != 0) {
- return -1; /* error ! */
- } else {
- st = fInfoBuf.attrFile;
- }
-#endif /* __os2__ */
-
- if (st & FILE_DIRECTORY)
- st = -1;
- return st;
-}
-
-static void chmod_done (void)
-{
- if (need_update)
- update_panels (UP_OPTIMIZE, UP_KEEPSEL);
- repaint_screen ();
-}
-
-char *next_file (void)
-{
- while (!cpanel->dir.list[c_file].f.marked)
- c_file++;
-
- return cpanel->dir.list[c_file].fname;
-}
-
-#ifdef __os2__
-static int mk_chmod (char *filename, ULONG st)
-{
- HFILE fHandle = 0L;
- ULONG fInfoLevel = 1; /* 1st Level Info: Standard attributs */
- FILESTATUS3 fInfoBuf;
- ULONG fInfoBufSize;
- ULONG fAction = 0L;
- APIRET rc;
-
- if (!(st & FILE_READONLY))
- chmod(filename, (S_IWRITE | S_IREAD));
- fInfoBufSize = sizeof(FILESTATUS3);
- rc = DosOpen((PSZ) filename,
- &fHandle,
- &fAction,
- (ULONG) 0,
- FILE_NORMAL,
- OPEN_ACTION_OPEN_IF_EXISTS,
- (OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYNONE),
- 0L);
- if (rc != 0) {
- return rc;
- }
-
- rc = DosQueryFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- if (rc!=0) {
- DosClose(fHandle);
- return rc;
- }
- fInfoBuf.attrFile = st;
- rc = DosSetFileInfo(fHandle, fInfoLevel, &fInfoBuf, fInfoBufSize);
- rc = DosClose(fHandle);
- return rc;
-}
-#endif /* __os2__ */
-
-static void do_chmod (mode_t sf)
-{
- sf &= and_mask;
- sf |= or_mask;
-
- mk_chmod(cpanel->dir.list[c_file].fname, sf);
-
- do_file_mark (cpanel, c_file, 0);
-}
-
-static void apply_mask (mode_t sf)
-{
- char *fname;
- int sf_stat;
-
- need_update = end_chmod = 1;
- do_chmod (sf);
-
- do {
- fname = next_file ();
- if ((sf_stat = pc_stat_file (fname)) < 0)
- break;
-
- c_stat = (mode_t) sf_stat;
- do_chmod (c_stat);
- } while (cpanel->marked);
-}
-
-void chmod_cmd (void)
-{
- char buffer [10];
- char *fname;
- int i;
- int sf_stat;
-
- do { /* do while any files remaining */
- init_chmod ();
- if (cpanel->marked)
- fname = next_file (); /* next marked file */
- else
- fname = selection (cpanel)->fname; /* single file */
-
- if ((sf_stat = pc_stat_file (fname)) < 0) /* get status of file */
- break;
-
- c_stat = (mode_t) sf_stat;
- mode_change = 0; /* clear changes flag */
-
- /* set check buttons */
- for (i = 0; i < PERMISSIONS; i++){
- check_perm[i].check->state = (c_stat & check_perm[i].mode) ? 1 : 0;
- check_perm[i].selected = 0;
- }
-
- tk_new_frame (ch_dlg, "l.");
- /* Set the labels */
- c_fname = name_trunc (fname, 21);
- add_widget (ch_dlg, label_new (FY+2, FX+2, c_fname, NULL));
- c_fown = _("unknown");
- add_widget (ch_dlg, label_new (FY+6, FX+2, c_fown, NULL));
- c_fgrp = _("unknown");
- add_widget (ch_dlg, label_new (FY+8, FX+2, c_fgrp, NULL));
- sprintf (buffer, "%o", c_stat);
- statl = label_new (FY+4, FX+2, buffer, NULL);
- add_widget (ch_dlg, statl);
- tk_end_frame ();
-
- run_dlg (ch_dlg); /* retrieve an action */
-
- /* do action */
- switch (ch_dlg->ret_value){
- case B_ENTER:
- if (mode_change)
- mk_chmod (fname, c_stat); /*.ado */
- need_update = 1;
- break;
-
- case B_CANCEL:
- end_chmod = 1;
- break;
-
- case B_ALL:
- case B_MARKED:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected || ch_dlg->ret_value == B_ALL)
- if (check_perm[i].check->state & C_BOOL)
- or_mask |= check_perm[i].mode;
- else
- and_mask &= ~check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
-
- case B_SETMRK:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected)
- or_mask |= check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
- case B_CLRMRK:
- and_mask = or_mask = 0;
- and_mask = ~and_mask;
-
- for (i = 0; i < PERMISSIONS; i++) {
- if (check_perm[i].selected)
- and_mask &= ~check_perm[i].mode;
- }
-
- apply_mask (sf_stat);
- break;
- }
-
- if (cpanel->marked && ch_dlg->ret_value!=B_CANCEL) {
- do_file_mark (cpanel, c_file, 0);
- need_update = 1;
- }
- destroy_dlg (ch_dlg);
- } while (cpanel->marked && !end_chmod);
- chmod_done ();
-}
diff --git a/rosapps/applications/mc/pc/config.h b/rosapps/applications/mc/pc/config.h
deleted file mode 100644
index d5129437281..00000000000
--- a/rosapps/applications/mc/pc/config.h
+++ /dev/null
@@ -1,248 +0,0 @@
-/****************************************************************************
- CONFIG.H - Midnight Commander Configuration for Win32 and OS/2
-
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- ----------------------------------------------------------------------------
- Changes:
- - Created 951204/jfg
- - Changed from Alexander Dong (ado) for OS/2
- - Changed 980329 by Pavel Roskin for both OS/2 and NT
-
- ----------------------------------------------------------------------------
- Contents:
- - Headers flags
- - Library flags
- - Typedefs
- - etc.
- ****************************************************************************/
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-#define OS2_NT
-
-#ifdef MC_NT
-# ifndef WIN32
-# define WIN32
-# endif
-# ifndef __WIN32__
-# define __WIN32__
-# endif
-# ifndef MSWINDOWS
-# define MSWINDOWS
-# endif
-# ifndef _OS_NT
-# define _OS_NT
-# endif
-#endif /* MC_NT */
-
-#ifdef MC_OS2
-# ifndef OS2
-# define OS2
-# endif
-# ifndef __os2__
-# define __os2__
-# endif
-#endif /* MC_OS2 */
-
-#include "../VERSION"
-
-#ifndef pc_system
-# define pc_system
-#endif
-
-#ifndef HAVE_SLANG
-# define HAVE_SLANG
-#endif
-
-#ifndef _CONSOLE
-# define _CONSOLE
-#endif
-
-#define FLOAT_TYPE
-#define MIDNIGHT
-#define USE_INTERNAL_EDIT
-
-#define STDC_HEADERS
-#define HAVE_STDLIB_H
-#define HAVE_STRING_H
-#define HAVE_DIRENT_H
-#define HAVE_LIMITS_H
-#define HAVE_FCNTL_H
-#define HAVE_UTIME_H
-
-#define HAVE_MEMSET
-#define HAVE_MEMCHR
-#define HAVE_MEMCPY
-#define HAVE_MEMCMP
-#define HAVE_MEMMOVE
-#define HAVE_STRDUP
-#define HAVE_STRERROR
-#define HAVE_TRUNCATE
-
-#define REGEX_MALLOC
-#define NO_INFOMOUNT
-
-typedef unsigned int umode_t;
-#define S_IFLNK 0
-#define S_ISLNK(x) 0
-
-#ifdef __EMX__
-
-#define S_IFBLK 0
-#define S_ISBLK(x) 0
-
-#endif /* __EMX__ */
-
-#ifdef __MINGW32__
-
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-#define ENABLE_NLS
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-
-/*typedef int mode_t;*/
-typedef unsigned int nlink_t;
-typedef int gid_t;
-typedef int uid_t;
-/*typedef int pid_t;*/
-
-#endif /* __MINGW32__ */
-
-#ifdef _MSC_VER
-
-#pragma include_alias(, )
-
-#define INLINE
-#define inline
-
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-
-#define S_ISFIFO(m) 0
-#define S_ISBLK(x) 0
-
-#define S_IRWXU 0000700
-#define S_IRUSR 0000400
-#define S_IWUSR 0000200
-#define S_IXUSR 0000100
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-#define popen _popen
-#define pclose _pclose
-
-typedef int mode_t;
-typedef unsigned int nlink_t;
-typedef int gid_t;
-typedef int uid_t;
-typedef int pid_t;
-
-#endif /* _MSC_VER */
-
-#ifdef __BORLANDC__
-
-#define INLINE
-#define inline
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#define pipe(p) _pipe(p, 4096, 0x8000 /* O_BINARY */)
-#define popen _popen
-#define pclose _pclose
-#define sleep _sleep
-
-typedef int pid_t;
-
-#endif /* __BORLANDC__ */
-
-#ifdef __IBMC__
-
-#define INLINE
-#define inline
-
-#define S_ISFIFO(m) 0
-#define S_ISBLK(x) 0
-
-#define S_ISCHR(m) (((m) & S_IFCHR) != 0)
-#define S_ISDIR(m) (((m) & S_IFDIR) != 0)
-#define S_ISREG(m) (((m) & S_IFREG) != 0)
-
-#define S_IRWXU 0000700
-#define S_IRUSR 0000400
-#define S_IWUSR 0000200
-#define S_IXUSR 0000100
-
-#define S_IRWXG 0000070
-#define S_IRGRP 0000040
-#define S_IWGRP 0000020
-#define S_IXGRP 0000010
-#define S_IRWXO 0000007
-#define S_IROTH 0000004
-#define S_IWOTH 0000002
-#define S_IXOTH 0000001
-
-#define ENOTDIR ENOENT
-
-/* FIXME: is this definition correct? */
-#define R_OK 4
-
-#pragma map( chdir , "_chdir" )
-#pragma map( getcwd, "_getcwd" )
-#pragma map( mkdir , "_mkdir" )
-#pragma map( rmdir , "_rmdir" )
-
-#define popen DosCreatePipe
-#define pclose DosClose
-#define sleep DosSleep
-
-typedef unsigned int nlink_t;
-typedef int mode_t;
-typedef int gid_t;
-typedef int uid_t;
-typedef int pid_t;
-
-#endif /* __IBMC__ */
-
-#endif /* __CONFIG_H */
diff --git a/rosapps/applications/mc/pc/cons_nt.c b/rosapps/applications/mc/pc/cons_nt.c
deleted file mode 100644
index e23e564104f..00000000000
--- a/rosapps/applications/mc/pc/cons_nt.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Client interface for General purpose Win32 console save/restore server
- Having the same interface as its Linux counterpart:
- Copyright (C) 1994 Janne Kukonlehto
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Note:
- show_console_contents doesn't know how to write to its window
- the rest works fine.
-*/
-#include
-
-#include
-#include "trace_nt.h"
-
-int cons_saver_pid = 1;
-
-#include "../src/tty.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/cons.saver.h"
-
-signed char console_flag = 1;
-static HANDLE hSaved, hNew;
-
-void show_console_contents (int starty, unsigned char begin_line,
- unsigned char end_line)
-{
- COORD c0 = { 0, 0 };
- COORD csize;
- SMALL_RECT rect;
- CHAR_INFO *pchar;
-
- csize.X = COLS;
- csize.Y = end_line-begin_line;
- rect.Left = 0;
- rect.Top = begin_line;
- rect.Right = COLS;
- rect.Bottom = end_line;
-
-/* -- This code reads characters and attributes */
- pchar = malloc (sizeof(CHAR_INFO) * (end_line-begin_line) * COLS);
- /* Copy from one console to the curses virtual screen */
- win32APICALL(ReadConsoleOutput (hSaved, pchar, csize, c0, &rect));
-
- /* FIXME: this should've work,
- but refresh() is called after this write :-( */
- win32APICALL(WriteConsoleOutput (hNew, pchar, csize, c0, &rect));
-
- free (pchar);
-}
-
-void handle_console (unsigned char action)
-{
- static SECURITY_ATTRIBUTES sa;
- CONSOLE_SCREEN_BUFFER_INFO csbi;
-
- switch (action){
- case CONSOLE_INIT:
- /* Save Standard handle */
- hSaved = GetStdHandle (STD_OUTPUT_HANDLE);
-
- sa.nLength = sizeof(SECURITY_ATTRIBUTES);
- sa.lpSecurityDescriptor = NULL;
- /* Create a new console buffer */
- sa.bInheritHandle = TRUE;
- win32APICALL_HANDLE(hNew,
- CreateConsoleScreenBuffer (GENERIC_WRITE | GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE, &sa,
- CONSOLE_TEXTMODE_BUFFER, NULL));
- win32APICALL(GetConsoleScreenBufferInfo(hSaved, &csbi));
- csbi.dwSize.X=csbi.srWindow.Right-csbi.srWindow.Left;
- csbi.dwSize.Y=csbi.srWindow.Bottom-csbi.srWindow.Right;
- win32APICALL(SetConsoleScreenBufferSize(hNew, csbi.dwSize));
-
- /* that becomes standard handle */
- win32APICALL(SetConsoleActiveScreenBuffer(hNew));
- win32APICALL(SetConsoleMode(hNew, ENABLE_PROCESSED_INPUT));
- win32APICALL(SetStdHandle(STD_OUTPUT_HANDLE, hNew));
- break;
-
- case CONSOLE_DONE:
- win32APICALL(CloseHandle (hNew));
- break;
-
- case CONSOLE_SAVE:
- /* Current = our standard handle */
- win32APICALL(SetConsoleActiveScreenBuffer (hNew));
- win32APICALL(SetStdHandle (STD_OUTPUT_HANDLE, hNew));
- break;
-
- case CONSOLE_RESTORE:
- /* Put saved (shell) screen buffer */
- win32APICALL(SetConsoleActiveScreenBuffer (hSaved));
- win32APICALL(SetStdHandle (STD_OUTPUT_HANDLE, hSaved));
- break;
- default:
- win32Trace(("Invalid action code %d sent to handle_console", action));
- }
-}
diff --git a/rosapps/applications/mc/pc/cons_os2.c b/rosapps/applications/mc/pc/cons_os2.c
deleted file mode 100644
index 46587439802..00000000000
--- a/rosapps/applications/mc/pc/cons_os2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Client interface for General purpose OS/2 console save/restore server.
- 1997 Alexander Dong
- Having the same interface as its Linux counterpart:
- Copyright (C) 1994 Janne Kukonlehto
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-
-#ifdef __os2__
-#define INCL_BASE
-#define INCL_NOPM
-#define INCL_VIO
-#define INCL_KBD
-#define INCL_DOS
-#define INCL_SUB
-#define INCL_DOSERRORS
-#include
-#endif
-
-#include "../src/tty.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/cons.saver.h"
-
-signed char console_flag = 1;
-static unsigned char *scr_buffer;
-static unsigned char *pointer;
-
-static int GetScrRows();
-static int GetScrCols();
-
-static int GetScrRows()
-{
- VIOMODEINFO pvMode = {80};
- unsigned int hVio = 0;
- VioGetMode(&pvMode, hVio);
- return (pvMode.row ? pvMode.row: 25);
-}
-
-static int GetScrCols()
-{
- VIOMODEINFO pvMode = {80};
- unsigned int hVio = 0;
- VioGetMode(&pvMode, hVio);
- return (pvMode.col ? pvMode.col: 80);
-}
-
-void show_console_contents (int starty, unsigned char begin_line, unsigned char end_line)
-{
- int col = GetScrCols();
- int row = GetScrRows();
- int n;
- register int z;
-
- pointer = scr_buffer;
- for (z=0; z<(begin_line * col); z++) {
- pointer++; pointer++;
- }
- n = (end_line - begin_line + 1) * col;
- VioWrtCellStr((PCH) pointer, (USHORT) n, begin_line, 0, 0);
- return;
-}
-
-void handle_console (unsigned char action)
-{
- static int col;
- static int row;
- int n;
-
- switch (action) {
- case CONSOLE_INIT: /* Initialize */
- col = GetScrCols();
- row = GetScrRows();
- scr_buffer = (unsigned char *) malloc(col * row * 2); /* short values */
- n = col * row * 2;
- VioReadCellStr((PCH) scr_buffer, (USHORT *) &n, 0, 0, 0); /* Just save it */
- break;
- case CONSOLE_DONE:
- free(scr_buffer);
- break;
- case CONSOLE_SAVE: /* Save the screen */
- n = col * row * 2;
- VioReadCellStr((PCH) scr_buffer, (USHORT *) &n, 0, 0, 0);
- break;
- case CONSOLE_RESTORE:
- n = col * row * 2;
- VioWrtCellStr ((PCH) scr_buffer, (USHORT) n, 0, 0, 0); /* Write it back */
- break;
- default:
- /* This is not possible, but if we are here, just save the screen */
- handle_console(CONSOLE_SAVE);
- break;
- }
- return;
-}
diff --git a/rosapps/applications/mc/pc/dirent.h b/rosapps/applications/mc/pc/dirent.h
deleted file mode 100644
index 0f153f53f28..00000000000
--- a/rosapps/applications/mc/pc/dirent.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * direct.h Defines the types and structures used by the directory routines
- *
- */
-#ifndef _DIRENT_H_incl
-#define _DIRENT_H_incl
-
-#ifdef __cplupplus
-extern "C" {
-#endif
-
-#include
-
-#define NAME_MAX 255 /* maximum filename for HPFS or NTFS */
-
-typedef struct dirent {
- unsigned long* d_handle;
- unsigned d_attr; /* file's attribute */
- unsigned short int d_time; /* file's time */
- unsigned short int d_date; /* file's date */
- long d_size; /* file's size */
- char d_name[ NAME_MAX + 1 ]; /* file's name */
- unsigned short d_ino; /* serial number (not used) */
- char d_first; /* flag for 1st time */
-} DIR;
-
-extern int closedir( DIR * );
-extern DIR *opendir( const char * );
-extern struct dirent *readdir( DIR * );
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* _DIRENT_H_incl */
diff --git a/rosapps/applications/mc/pc/dirent_nt.c b/rosapps/applications/mc/pc/dirent_nt.c
deleted file mode 100644
index 7cdd9293f6f..00000000000
--- a/rosapps/applications/mc/pc/dirent_nt.c
+++ /dev/null
@@ -1,92 +0,0 @@
-
-#include
-#include
-#include
-#include
-#include
-#include "dirent.h"
-
-DIR *opendir (const char * a_dir)
-{
- int err;
- WIN32_FIND_DATA wfd;
- DIR* dd_dir = (DIR*) malloc (sizeof(DIR));
-
- char *c_dir = malloc (strlen(a_dir) + 4);
- strcpy (c_dir, a_dir);
- strcat (c_dir, "\\*");
-
- dd_dir->d_handle = FindFirstFile (c_dir, &wfd);
- if (dd_dir->d_handle == INVALID_HANDLE_VALUE) {
- err = GetLastError();
- switch (err) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_NOT_ENOUGH_MEMORY:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- free(dd_dir);
- return NULL;
- }
- dd_dir->d_attr = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL)
- ? 0 : wfd.dwFileAttributes;
-
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = wfd.nFileSizeLow;
- strcpy (dd_dir->d_name, wfd.cFileName);
- dd_dir->d_first = 1;
-
- free (c_dir);
- return dd_dir;
-}
-
-DIR *readdir( DIR * dd_dir)
-{
- int err;
- WIN32_FIND_DATA wfd;
-
- if (dd_dir->d_first) {
- dd_dir->d_first = 0;
- return dd_dir;
- }
-
- if(!FindNextFile (dd_dir->d_handle, &wfd)) {
- err = GetLastError();
- switch (err) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_NOT_ENOUGH_MEMORY:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- return NULL;
- }
- dd_dir->d_attr = (wfd.dwFileAttributes == FILE_ATTRIBUTE_NORMAL)
- ? 0 : wfd.dwFileAttributes;
-
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = wfd.nFileSizeLow;
- strcpy (dd_dir->d_name, wfd.cFileName);
- return dd_dir;
-}
-
-int closedir (DIR *dd_dir)
-{
- FindClose(dd_dir->d_handle);
- free (dd_dir);
- return 1;
-}
-
diff --git a/rosapps/applications/mc/pc/dirent_os2.c b/rosapps/applications/mc/pc/dirent_os2.c
deleted file mode 100644
index 158027493aa..00000000000
--- a/rosapps/applications/mc/pc/dirent_os2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include
-#endif
-
-#define INCL_DOSFILEMGR
-#define INCL_DOSERRORS
-#include
-
-#include
-#include
-#include
-#include
-#include "dirent.h"
-
-DIR *opendir (const char * a_dir)
-{
- APIRET rc;
- FILEFINDBUF3 FindBuffer = {0};
- ULONG FileCount = 1;
- DIR *dd_dir = (DIR*) malloc (sizeof(DIR));
- char *c_dir = (char*) malloc (strlen(a_dir) + 5);
-
- strcpy (c_dir, a_dir);
- strcat (c_dir, "\\*.*");
- dd_dir->d_handle = (unsigned long*) HDIR_CREATE;
-
- rc = DosFindFirst(c_dir,
- (PHDIR) &dd_dir->d_handle,
- FILE_SYSTEM | FILE_HIDDEN | FILE_DIRECTORY,
- (PVOID) &FindBuffer,
- sizeof(FILEFINDBUF3),
- &FileCount,
- FIL_STANDARD);
-
- if (rc) {
- switch (rc) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_BUFFER_OVERFLOW:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- free(dd_dir);
- return NULL;
- }
- dd_dir->d_attr = FindBuffer.attrFile;
- dd_dir->d_time = dd_dir->d_date = 10;
- dd_dir->d_size = FindBuffer.cbFile;
- strcpy (dd_dir->d_name, FindBuffer.achName);
- dd_dir->d_first = 1;
-
- free (c_dir);
- return dd_dir;
-}
-
-DIR *readdir( DIR * dd_dir)
-{
- APIRET rc;
- FILEFINDBUF3 FindBuffer = {0};
- ULONG FileCount = 1;
- DIR *ret_dir = (DIR*) malloc (sizeof(DIR));
-
- if (dd_dir->d_first) {
- dd_dir->d_first = 0;
- return dd_dir;
- }
-
- rc = DosFindNext((HDIR) dd_dir->d_handle,
- (PVOID) &FindBuffer,
- sizeof(FILEFINDBUF3),
- &FileCount);
-
- if (rc) {
- switch (rc) {
- case ERROR_NO_MORE_FILES:
- case ERROR_FILE_NOT_FOUND:
- case ERROR_PATH_NOT_FOUND:
- errno = ENOENT;
- break;
- case ERROR_BUFFER_OVERFLOW:
- errno = ENOMEM;
- break;
- default:
- errno = EINVAL;
- break;
- }
- return NULL;
- }
-
- ret_dir->d_attr = FindBuffer.attrFile;
- ret_dir->d_time = ret_dir->d_date = 10;
- ret_dir->d_size = FindBuffer.cbFile;
- strcpy (ret_dir->d_name, FindBuffer.achName);
- return ret_dir;
-}
-
-int closedir (DIR *dd_dir)
-{
- if (dd_dir->d_handle != (unsigned long*) HDIR_CREATE) {
- DosFindClose((HDIR) dd_dir->d_handle);
- }
- free (dd_dir);
- return 1;
-}
diff --git a/rosapps/applications/mc/pc/drive.c b/rosapps/applications/mc/pc/drive.c
deleted file mode 100644
index eaf5f38ef86..00000000000
--- a/rosapps/applications/mc/pc/drive.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Ch-Drive command for Windows NT and OS/2
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Bug:
- the code will not work if you have more drives than those that
- can fit in a panel.
- */
-
-#include
-#ifdef _OS_NT
-#include
-#include "util_win32.h"
-#endif
-#include
-#include
-#include
-#include
-#include "../src/tty.h"
-#include "../src/mad.h"
-#include "../src/util.h"
-#include "../src/win.h"
-#include "../src/color.h"
-#include "../src/dlg.h"
-#include "../src/widget.h"
-#include "../src/dialog.h"
-#include "../src/dir.h"
-#include "../src/panel.h"
-#include "../src/main.h"
-#include "../src/cmd.h"
-
-struct Dlg_head *drive_dlg;
-WPanel *this_panel;
-
-static int drive_dlg_callback (Dlg_head *h, int Par, int Msg);
-static void drive_dlg_refresh (void);
-static void drive_cmd(void);
-
-#define B_DRIVE_BASE 100
-#define MAX_LGH 13 /* Length for drives */
-
-static void drive_cmd()
-{
- int i, nNewDrive, nDrivesAvail;
- char szTempBuf[7], szDrivesAvail[27*4], *p;
-
- /* Dialogbox position */
- int x_pos;
- int y_pos = (LINES-6)/2-3;
- int y_height;
- int x_width;
-
- int m_drv;
-
- /* Get drives name and count */
-#ifdef _OS_NT
- GetLogicalDriveStrings (255, szDrivesAvail);
- for (nDrivesAvail = 0, p = szDrivesAvail; *p; nDrivesAvail++)
- p+=4;
-#else
- unsigned long uDriveNum, uDriveMap;
- nDrivesAvail = 0;
- p = szDrivesAvail;
- DosQueryCurrentDisk(&uDriveNum, &uDriveMap);
- for (i = 0; i < 26; i++) {
- if ( uDriveMap & (1 << i) ) {
- *p = 'A' + i;
- p += 4;
- nDrivesAvail++;
- }
- }
- *p = 0;
-#endif
-
- /* Create Dialog */
- do_refresh ();
-
- m_drv = ((nDrivesAvail > MAX_LGH) ? MAX_LGH: nDrivesAvail);
- /* Center on x, relative to panel */
- x_pos = this_panel->widget.x + (this_panel->widget.cols - m_drv*3)/2 + 2;
-
- if (nDrivesAvail > MAX_LGH) {
- y_height = 8;
- x_width = 33;
- } else {
- y_height = 6;
- x_width = (nDrivesAvail - 1) * 2 + 9;
- }
-
- drive_dlg = create_dlg (y_pos, x_pos, y_height, x_width, dialog_colors,
- drive_dlg_callback, _("[ChDrive]"),_("drive"), DLG_NONE);
-
- x_set_dialog_title (drive_dlg, _("Change Drive") );
-
- if (nDrivesAvail>MAX_LGH) {
- for (i = 0; i < nDrivesAvail - MAX_LGH; i++) {
- p -= 4;
- sprintf(szTempBuf, "&%c", *p);
- add_widgetl(drive_dlg,
- button_new (5,
- (m_drv-i-1)*2+4 - (MAX_LGH*2 - nDrivesAvail) * 2,
- B_DRIVE_BASE + nDrivesAvail - i - 1,
- HIDDEN_BUTTON,
- szTempBuf, 0, NULL, NULL),
- XV_WLAY_RIGHTOF);
- }
- }
-
- /* Add a button for each drive */
- for (i = 0; i < m_drv; i++) {
- p -= 4;
- sprintf (szTempBuf, "&%c", *p);
- add_widgetl(drive_dlg,
- button_new (3, (m_drv-i-1)*2+4, B_DRIVE_BASE+m_drv-i-1,
- HIDDEN_BUTTON, szTempBuf, 0, NULL, NULL),
- XV_WLAY_RIGHTOF);
- }
-
- run_dlg(drive_dlg);
-
- /* do action */
- if (drive_dlg->ret_value != B_CANCEL) {
- int errocc = 0; /* no error */
- int rtn;
- char drvLetter;
-
- /* Set the Panel to Directory listing mode first */
- int is_right=(this_panel==right_panel);
-
- set_display_type (is_right?1:0, view_listing);
- this_panel=is_right?right_panel:left_panel;
- /* */
-
- nNewDrive = drive_dlg->ret_value - B_DRIVE_BASE;
- drvLetter = (char) *(szDrivesAvail + (nNewDrive*4));
-#ifdef _OS_NT
- if (win32_GetPlatform() == OS_WinNT) { /* Windows NT */
- rtn = _chdrive(drvLetter - 'A' + 1);
- } else { /* Windows 95 */
- rtn = 1;
- SetCurrentDirectory(szDrivesAvail+(nNewDrive*4));
- }
-#else
- rtn = DosSetDefaultDisk(nNewDrive + 1);
-#endif
- if (rtn == -1)
- errocc = 1;
- else {
- getcwd (this_panel->cwd, sizeof (this_panel->cwd)-2);
- if (toupper(drvLetter) == toupper(*(this_panel->cwd))) {
- clean_dir (&this_panel->dir, this_panel->count);
- this_panel->count = do_load_dir(&this_panel->dir,
- this_panel->sort_type,
- this_panel->reverse,
- this_panel->case_sensitive,
- this_panel->filter);
- this_panel->top_file = 0;
- this_panel->selected = 0;
- this_panel->marked = 0;
- this_panel->total = 0;
- show_dir(this_panel);
- reread_cmd();
- } else
- errocc = 1;
- }
- if (errocc)
- message (1, _(" Error "), _(" Can't access drive %c: "),
- *(szDrivesAvail+(nNewDrive*4)) );
- }
- destroy_dlg (drive_dlg);
- repaint_screen ();
-}
-
-
-void drive_cmd_a()
-{
- this_panel = left_panel;
- drive_cmd();
-}
-
-void drive_cmd_b()
-{
- this_panel = right_panel;
- drive_cmd();
-}
-
-void drive_chg(WPanel *panel)
-{
- this_panel = panel;
- drive_cmd();
-}
-
-static int drive_dlg_callback (Dlg_head *h, int Par, int Msg)
-{
- switch (Msg) {
-#ifndef HAVE_X
- case DLG_DRAW:
- drive_dlg_refresh ();
- break;
-#endif
- }
- return 0;
-}
-
-static void drive_dlg_refresh (void)
-{
- attrset (dialog_colors[0]);
- dlg_erase (drive_dlg);
- draw_box (drive_dlg, 1, 1, drive_dlg->lines-2, drive_dlg->cols-2);
-
- attrset (dialog_colors[2]);
- dlg_move (drive_dlg, 1, drive_dlg->cols/2 - 7);
- addstr (_(" Change Drive "));
-}
diff --git a/rosapps/applications/mc/pc/drive.h b/rosapps/applications/mc/pc/drive.h
deleted file mode 100644
index 7b7c01f2dcc..00000000000
--- a/rosapps/applications/mc/pc/drive.h
+++ /dev/null
@@ -1,4 +0,0 @@
-void drive_cmd_a(WPanel *);
-void drive_cmd_b(WPanel *);
-void drive_chg(WPanel *panel);
-
diff --git a/rosapps/applications/mc/pc/key_nt.c b/rosapps/applications/mc/pc/key_nt.c
deleted file mode 100644
index bd44d55cd08..00000000000
--- a/rosapps/applications/mc/pc/key_nt.c
+++ /dev/null
@@ -1,325 +0,0 @@
-/* Keyboard support routines.
- for Windows NT system.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- Bugs:
- Have trouble with non-US keyboards, "Alt-gr"+keys (API tells CTRL-ALT is pressed)
- */
-#include
-#ifndef _OS_NT
-#error This file is for Win32 systems.
-#else
-
-#include
-#include
-#include "../src/mouse.h"
-#include "../src/global.h"
-#include "../src/main.h"
-#include "../src/key.h"
-#include "../vfs/vfs.h"
-#include "../src/tty.h"
-#include "trace_nt.h"
-
-/* Global variables */
-int old_esc_mode = 0;
-HANDLE hConsoleInput;
-DWORD dwSaved_ControlState;
-Gpm_Event evSaved_Event;
-
-/* Unused variables */
-int double_click_speed; /* they are here to keep linker happy */
-int mou_auto_repeat;
-int use_8th_bit_as_meta = 0;
-
-/* Static Tables */
-struct {
- int key_code;
- int vkcode;
-} key_table [] = {
- { KEY_F(1), VK_F1 },
- { KEY_F(2), VK_F2 },
- { KEY_F(3), VK_F3 },
- { KEY_F(4), VK_F4 },
- { KEY_F(5), VK_F5 },
- { KEY_F(6), VK_F6 },
- { KEY_F(7), VK_F7 },
- { KEY_F(8), VK_F8 },
- { KEY_F(9), VK_F9 },
- { KEY_F(10), VK_F10 },
- { KEY_F(11), VK_F11 },
- { KEY_F(12), VK_F12 },
- { KEY_F(13), VK_F13 },
- { KEY_F(14), VK_F14 },
- { KEY_F(15), VK_F15 },
- { KEY_F(16), VK_F16 },
- { KEY_F(17), VK_F17 },
- { KEY_F(18), VK_F18 },
- { KEY_F(19), VK_F19 },
- { KEY_F(20), VK_F20 },
- { KEY_IC, VK_INSERT },
- { KEY_DC, VK_DELETE },
- { KEY_BACKSPACE, VK_BACK },
-
- { KEY_PPAGE, VK_PRIOR },
- { KEY_NPAGE, VK_NEXT },
- { KEY_LEFT, VK_LEFT },
- { KEY_RIGHT, VK_RIGHT },
- { KEY_UP, VK_UP },
- { KEY_DOWN, VK_DOWN },
- { KEY_HOME, VK_HOME },
- { KEY_END, VK_END },
-
- { ALT('*'), VK_MULTIPLY },
- { ALT('+'), VK_ADD },
- { ALT('-'), VK_SUBTRACT },
-
- { ALT('\t'), VK_PAUSE }, /* Added to make Complete work press Pause */
-
- { ESC_CHAR, VK_ESCAPE },
-
- { 0, 0}
-};
-
-/* init_key - Called in main.c to initialize ourselves
- Get handle to console input
-*/
-void init_key (void)
-{
- win32APICALL_HANDLE (hConsoleInput, GetStdHandle (STD_INPUT_HANDLE));
-}
-
-int ctrl_pressed ()
-{
- if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0;
- /* The line above fixes the BUG with the AltGr Keys*/
- return dwSaved_ControlState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED);
-}
-
-int shift_pressed ()
-{
- if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0;
- /* The line above fixes the BUG with the AltGr Keys*/
- return dwSaved_ControlState & SHIFT_PRESSED;
-}
-
-int alt_pressed ()
-{
- return dwSaved_ControlState & (/* RIGHT_ALT_PRESSED | */ LEFT_ALT_PRESSED);
-}
-
-static int VKtoCurses (int a_vkc)
-{
- int i;
-
- for (i = 0; key_table[i].vkcode != 0; i++)
- if (a_vkc == key_table[i].vkcode) {
- return key_table[i].key_code;
- }
- return 0;
-}
-
-static int translate_key_code(int asc, int scan)
-{
- int c;
- switch(scan){
- case 106: /* KP_MULT*/
- return ALT('*');
- case 107: /* KP_PLUS*/
- return ALT('+');
- case 109: /* KP_MINUS*/
- return ALT('-');
- }
- c = VKtoCurses (scan);
- if (!asc && !c)
- return 0;
- if (asc && c)
- return c;
- if (!asc || asc=='\t' )
- {
- if (shift_pressed() && (c >= KEY_F(1)) && (c <= KEY_F(10)))
- c += 10;
- if (alt_pressed() && (c >= KEY_F(1)) && (c <= KEY_F(2)))
- c += 10;
- if (alt_pressed() && (c == KEY_F(7)))
- c = ALT('?');
- if (asc == '\t'){
- if(ctrl_pressed())c = ALT('\t');
- else c=asc;
- }
- return c;
- }
- if (ctrl_pressed())
- return XCTRL(asc);
- if (alt_pressed())
- return ALT(asc);
- if (asc == 13)
- return 10;
- return asc;
-}
-
-int get_key_code (int no_delay)
-{
- INPUT_RECORD ir; /* Input record */
- DWORD dw; /* number of records actually read */
- int ch, vkcode, j;
-
- if (no_delay) {
- /* Check if any input pending, otherwise return */
- nodelay (stdscr, TRUE);
- win32APICALL(PeekConsoleInput(hConsoleInput, &ir, 1, &dw));
- if (!dw)
- return 0;
- }
-
- do {
- win32APICALL(ReadConsoleInput(hConsoleInput, &ir, 1, &dw));
- switch (ir.EventType) {
- case KEY_EVENT:
- if (!ir.Event.KeyEvent.bKeyDown) /* Process key just once: when pressed */
- break;
-
- vkcode = ir.Event.KeyEvent.wVirtualKeyCode;
-//#ifndef __MINGW32__
- ch = ir.Event.KeyEvent.uChar.AsciiChar;
-//#else
-// ch = ir.Event.KeyEvent.AsciiChar;
-//#endif
- dwSaved_ControlState = ir.Event.KeyEvent.dwControlKeyState;
- j = translate_key_code (ch, vkcode);
- if (j)
- return j;
- break;
-
- case MOUSE_EVENT:
- /* Save event as a GPM-like event */
- evSaved_Event.x = ir.Event.MouseEvent.dwMousePosition.X;
- evSaved_Event.y = ir.Event.MouseEvent.dwMousePosition.Y+1;
- evSaved_Event.buttons = ir.Event.MouseEvent.dwButtonState;
- switch (ir.Event.MouseEvent.dwEventFlags) {
- case 0:
- evSaved_Event.type = GPM_DOWN | GPM_SINGLE;
- break;
- case MOUSE_MOVED:
- evSaved_Event.type = GPM_MOVE;
- break;
- case DOUBLE_CLICK:
- evSaved_Event.type = GPM_DOWN | GPM_DOUBLE;
- break;
- };
- return 0;
- }
- } while (!no_delay);
- return 0;
-}
-
-static int getch_with_delay (void)
-{
- int c;
-
- while (1) {
- /* Try to get a character */
- c = get_key_code (0);
- if (c != ERR)
- break;
- }
- /* Success -> return the character */
- return c;
-}
-
-/* Returns a character read from stdin with appropriate interpretation */
-int get_event (Gpm_Event *event, int redo_event, int block)
-{
- int c;
- static int flag; /* Return value from select */
- static int dirty = 3;
-
- if ((dirty == 1) || is_idle ()){
- refresh ();
- doupdate ();
- dirty = 1;
- } else
- dirty++;
-
- vfs_timeout_handler ();
-
- c = block ? getch_with_delay () : get_key_code (1);
-
- if (!c) {
- /* Code is 0, so this is a Control key or mouse event */
- return EV_NONE; /* FIXME: mouse not supported */
- }
-
- return c;
-}
-
-/* Returns a key press, mouse events are discarded */
-int mi_getch ()
-{
- Gpm_Event ev;
- int key;
-
- while ((key = get_event (&ev, 0, 1)) == 0)
- ;
- return key;
-}
-
-/*
- is_idle - A function to check if we're idle.
- It checks for any waiting event (that can be a Key, Mouse event,
- and other internal events like focus or menu)
-*/
-int is_idle (void)
-{
- DWORD dw;
- if (GetNumberOfConsoleInputEvents (hConsoleInput, &dw))
- if (dw > 15)
- return 0;
- return 1;
-}
-
-/* get_modifier */
-int get_modifier()
-{
- int retval = 0;
-
- if (dwSaved_ControlState & LEFT_ALT_PRESSED) /* code is not clean, because we return Linux-like bitcodes*/
- retval |= ALTL_PRESSED;
- if (dwSaved_ControlState & RIGHT_ALT_PRESSED)
- retval |= ALTR_PRESSED;
-
- if (dwSaved_ControlState & RIGHT_CTRL_PRESSED ||
- dwSaved_ControlState & LEFT_CTRL_PRESSED)
- retval |= CONTROL_PRESSED;
-
- if (dwSaved_ControlState & SHIFT_PRESSED)
- retval |= SHIFT_PRESSED;
-
- return retval;
-}
-
-/* void functions for UNIX compatibility */
-void define_sequence (int code, char* vkcode, int action) {}
-void channels_up() {}
-void channels_down() {}
-void init_key_input_fd (void) {}
-void numeric_keypad_mode (void) {}
-void application_keypad_mode (void) {}
-
-/* mouse is not yet supported, sorry */
-void init_mouse (void) {}
-void shut_mouse (void) {}
-
-#endif /* _OS_NT */
diff --git a/rosapps/applications/mc/pc/key_os2.c b/rosapps/applications/mc/pc/key_os2.c
deleted file mode 100644
index 06fe1b747da..00000000000
--- a/rosapps/applications/mc/pc/key_os2.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/* Keyboard support routines.
- for OS/2 system.
-
- 20. April 97: Alexander Dong (ado)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include
-#ifndef __os2__
-#error This file is for OS/2 systems.
-#else
-
-#define INCL_BASE
-#define INCL_NOPM
-#define INCL_VIO
-#define INCL_KBD
-#define INCL_DOS
-#define INCL_DOSERRORS
-#define INCL_WININPUT
-#include
-#include
-#include "../src/mouse.h"
-#include "../src/global.h"
-#include "../src/main.h"
-#include "../src/key.h"
-#include "../vfs/vfs.h"
-#include "../src/tty.h"
-
-/* Code to read keystrokes in a separate thread */
-
-typedef struct kbdcodes {
- UCHAR ascii;
- UCHAR scan;
- USHORT shift; /* .ado: change for mc */
-} KBDCODES;
-
-/* Global variables */
-int old_esc_mode = 0;
-/* HANDLE hConsoleInput;
-DWORD dwSaved_ControlState; */
-Gpm_Event evSaved_Event;
-
-/* Unused variables */
-int double_click_speed; /* they are here to keep linker happy */
-int mou_auto_repeat;
-int use_8th_bit_as_meta = 0;
-
-static int VKtoCurses (int vkcode);
-
-/* -------------------------------------------------------------- */
-/* DEFINITIONS:
- Return from SLANG: KeyCode: 0xaaaabbcc
-
- where: aaaa = Flags
- bb = Scan code
- cc = ASCII-code (if available)
-
- if no flags (CTRL and ALT) is set, cc will be returned.
- If CTRL is pressed, cc is already the XCTRL(code).
- case cc is:
- 0xE0: The scan code will be used for the following keys:
- Insert: 0x52, DEL: 0x53,
- Page_Up: 0x49, Page_Down: 0x51,
- Pos1: 0x47, Ende: 0x4F,
- Up: 0x48, Down: 0x50,
- Left: 0x4B, Right: 0x4D,
-
- 0x00: The function keys are defined as:
- F1: 3b00, F2: 3c00 ... F10: 4400, F11: 8500, F12: 8600.
- With ALT-bit set:
- ALT(F1): 6800, 6900,... ALT(F10): 7100, ALT(F11): 8b00
- ALT(F12): 8c00
-
- Mapping for ALT(key_code):
- For Mapping with normal keys, only the scan code can be
- used. (see struct ALT_table)
-
- Special keys:
- ENTER (number block): 0xaaaaE00D
- + (number block): 0xaaaa4E2B Normal: 1B2B
- - (number block): 0xaaaa4A2D Normal: 352D
- * (number block): 0xaaaa372A Normal: 1B2A
- / (number block): 0xaaaaE02F
-*/
-/* -------------------------------------------------------------- */
-#define RIGHT_SHIFT_PRESSED 1
-#define LEFT_SHIFT_PRESSED 2
-#define CTRL_PRESSED 4
-#define ALT_PRESSED 8
-#define SCROLL_LOCK_MODE 16
-#define NUM_LOCK_MODE 32
-#define CAPS_LOCK_MODE 64
-#define INSERT_MODE 128
-#define LEFT_CTRL_PRESSED 256
-#define LEFT_ALT_PRESSED 512
-#define RIGHT_CTRL_PRESSED 1024
-#define RIGHT_ALT_PRESSED 2048
-#define SCROLL_LOCK_PRESSED 4096
-#define NUM_LOCK_PRESSED 8192
-#define CAPS_LOCK_PRESSED 16384
-#define SYSREQ 32768
-/* -------------------------------------------------------------- */
-
-/* Static Tables */
-struct {
- int key_code;
- int vkcode;
-} fkt_table [] = {
- { KEY_F(1), 0x3B },
- { KEY_F(2), 0x3C },
- { KEY_F(3), 0x3D },
- { KEY_F(4), 0x3E },
- { KEY_F(5), 0x3F },
- { KEY_F(6), 0x40 },
- { KEY_F(7), 0x41 },
- { KEY_F(8), 0x42 },
- { KEY_F(9), 0x43 },
- { KEY_F(10), 0x44 },
- { KEY_F(11), 0x85 },
- { KEY_F(12), 0x86 },
- { 0, 0}
-};
-
-
-struct {
- int key_code;
- int vkcode;
-} ALT_table [] = {
- { ALT('a'), 0x1E },
- { ALT('b'), 0x30 },
- { ALT('c'), 0x2E },
- { ALT('d'), 0x20 },
- { ALT('e'), 0x12 },
- { ALT('f'), 0x21 },
- { ALT('g'), 0x22 },
- { ALT('h'), 0x23 },
- { ALT('i'), 0x17 },
- { ALT('j'), 0x24 },
- { ALT('k'), 0x25 },
- { ALT('l'), 0x26 },
- { ALT('m'), 0x32 },
- { ALT('n'), 0x31 },
- { ALT('o'), 0x18 },
- { ALT('p'), 0x19 },
- { ALT('q'), 0x10 },
- { ALT('r'), 0x13 },
- { ALT('s'), 0x1F },
- { ALT('t'), 0x14 },
- { ALT('u'), 0x16 },
- { ALT('v'), 0x2F },
- { ALT('w'), 0x11 },
- { ALT('x'), 0x2D },
- { ALT('y'), 0x15 },
- { ALT('z'), 0x2C },
- { ALT('\n'), 0x1c },
- { ALT('\n'), 0xA6 },
- { ALT(KEY_F(1)), 0x68 },
- { ALT(KEY_F(2)), 0x69 },
- { ALT(KEY_F(3)), 0x6A },
- { ALT(KEY_F(4)), 0x6B },
- { ALT(KEY_F(5)), 0x6C },
- { ALT(KEY_F(6)), 0x6D },
- { ALT(KEY_F(7)), 0x6E },
- { ALT(KEY_F(8)), 0x6F },
- { ALT(KEY_F(9)), 0x70 },
- { ALT(KEY_F(10)), 0x71 },
- { ALT(KEY_F(11)), 0x8B },
- { ALT(KEY_F(12)), 0x8C },
- { 0, 0}
-};
-
-
-struct {
- int key_code;
- int vkcode;
-} movement [] = {
- { KEY_IC, 0x52 },
- { KEY_DC, 0x53 },
- { KEY_PPAGE, 0x49 },
- { KEY_NPAGE, 0x51 },
- { KEY_LEFT, 0x4B },
- { KEY_RIGHT, 0x4D },
- { KEY_UP, 0x48 },
- { KEY_DOWN, 0x50 },
- { KEY_HOME, 0x47 },
- { KEY_END, 0x4F },
- { 0, 0}
-};
-
-
-/* init_key -- to make linker happy */
-void init_key (void)
-{
- return;
-}
-
-
-/* The maximum sequence length (32 + null terminator) */
-static int seq_buffer[33];
-static int *seq_append = 0;
-
-static int push_char (int c)
-{
- if (!seq_append)
- seq_append = seq_buffer;
-
- if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
- return 0;
- *(seq_append++) = c;
- *seq_append = 0;
- return 1;
-}
-
-int get_key_code (int no_delay)
-{
- unsigned int inp_ch;
-
- if (no_delay) {
- /* Check if any input pending, otherwise return */
- nodelay (stdscr, TRUE);
- inp_ch = SLang_input_pending(0);
- if (inp_ch == 0) {
- return 0;
- }
- }
-
- if (no_delay) {
- return (VKtoCurses(inp_ch));
- }
-
- do {
- inp_ch = SLang_getkey();
- if (!inp_ch)
- inp_ch = (SLang_getkey() << 8);
- if (inp_ch) return (VKtoCurses(inp_ch));
- } while (!no_delay);
- return 0;
-}
-
-static int VKtoCurses (int a_vkc)
-{
- int ctrlState = 0;
- int altState = 0;
-
- int fsState;
- char scanCode;
- char asciiCode;
- register int i;
- int rtnCode = 0;
-
- fsState = (a_vkc & 0xFFFF0000) >> 16;
- fsState &= (~INSERT_MODE); /* Ignore Insertion mode */
-
- scanCode = (char) ((a_vkc & 0x0000FFFF) >> 8);
- asciiCode = (char) (a_vkc & 0x000000FF);
-
- ctrlState = (fsState & CTRL_PRESSED);
- altState = (fsState & ALT_PRESSED);
-
- rtnCode = asciiCode;
-
- if (ctrlState) {
- /* CTRL pressed */
- rtnCode = XCTRL(asciiCode);
- }
-
- if (altState) {
- /* ALT pressed
- * rtnCode = ALT(asciiCode);
- *
- * With German keyboards, the Values between 7B -> 7D
- * and 5b, 5d, 40, fd, fc and e6 are only reachable with the AltGr
- * key. If such a combination is used, asciiCode will not be zero.
- * With the normal ALT key, the asciiCode will always be zero.
- */
- if (asciiCode) {
- return asciiCode;
- }
- }
-
- /* Scan Movement codes */
- if (asciiCode == 0) {
- /* Replace key code with that in table */
- for (i=0; movement[i].vkcode != 0 || movement[i].key_code != 0; i++)
- if (scanCode == movement[i].vkcode)
- return (movement[i].key_code);
- }
-
- if (asciiCode == 0) {
- /* Function-key detected */
- for (i=0; fkt_table[i].vkcode != 0 || fkt_table[i].key_code != 0; i++)
- if (scanCode == fkt_table[i].vkcode)
- return (fkt_table[i].key_code);
- /* ALT - KEY */
- /* if (altState) */ {
- for (i=0; ALT_table[i].vkcode != 0 || ALT_table[i].key_code != 0; i++)
- if (scanCode == ALT_table[i].vkcode)
- return (ALT_table[i].key_code);
- }
- }
-
- if (asciiCode == 0x0d) {
- return '\n';
- }
-
- return rtnCode;
-}
-
-
-static int getch_with_delay (void)
-{
- int c;
-
- while (1) {
- /* Try to get a character */
- c = get_key_code (0);
- if (c != ERR)
- break;
- }
- /* Success -> return the character */
- return c;
-}
-
-int get_event (Gpm_Event *event, int redo_event, int block)
-{
- int c;
- static int dirty = 3;
-
- if ((dirty == 1) || is_idle ()){
- refresh ();
- doupdate ();
- dirty = 1;
- } else
- dirty++;
-
- vfs_timeout_handler ();
-
- c = block ? getch_with_delay () : get_key_code (1);
- if (!c) {
- /* Code is 0, so this is a Control key or mouse event */
- *event = evSaved_Event;
- return EV_NONE; /* FIXME: when should we return EV_MOUSE ? */
- }
-
- return c;
-}
-
-/* Returns a key press, mouse events are discarded */
-int mi_getch ()
-{
- Gpm_Event ev;
- int key;
-
- while ((key = get_event (&ev, 0, 1)) == 0)
- ;
- return key;
-}
-
-
-/*
- is_idle - A function to check if we're idle.
- It checks for any waiting event (that can be a Key, Mouse event,
- and other internal events like focus or menu)
-*/
-int is_idle (void)
-{
- return 1;
-}
-
-/* get_modifier */
-int get_modifier()
-{
- return 0;
-}
-
-int ctrl_pressed ()
-{
- return 0;
-}
-
-
-/* void functions for UNIX copatibility */
-void define_sequence (int code, char* vkcode, int action) {}
-void channels_up() {}
-void channels_down() {}
-void init_key_input_fd (void) {}
-void numeric_keypad_mode (void) {}
-void application_keypad_mode (void) {}
-
-/* mouse is not yet supported, sorry */
-void init_mouse (void) {}
-void shut_mouse (void) {}
-
-#endif /* __os2__ */
diff --git a/rosapps/applications/mc/pc/mc.rc b/rosapps/applications/mc/pc/mc.rc
deleted file mode 100644
index 79299fd12f0..00000000000
--- a/rosapps/applications/mc/pc/mc.rc
+++ /dev/null
@@ -1,60 +0,0 @@
-#include "../VERSION"
-#ifndef WINDRES
-# include "windows.h"
-# include "winver.h"
-#endif
-
-/* English (U.S.) resources */
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-
-#ifdef _WIN32
-#ifndef WINDRES
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#endif
-#pragma code_page(1252)
-#endif /* _WIN32 */
-
-/* Version */
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 3,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40000L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904E4"
- BEGIN
- VALUE "CompanyName", "Free Software Foundation"
- VALUE "FileDescription", "GNU Midnight Commander"
- VALUE "FileVersion", VERSION
- VALUE "InternalName", "MC"
- VALUE "LegalCopyright", "(c) Free Software Foundation"
- VALUE "LegalTrademarks", "see GNU General Public License"
- VALUE "OriginalFilename", "MC.EXE"
- VALUE "ProductName", "GNU Midnight Commander"
- VALUE "ProductVersion", VERSION
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
-
-
-/* Icon */
-// 0 ICON DISCARDABLE "mc_nt.ico"
-// 1 ICON DISCARDABLE "bez03.ico"
-
-#endif /* English (U.S.) resources */
-
diff --git a/rosapps/applications/mc/pc/readme b/rosapps/applications/mc/pc/readme
deleted file mode 100644
index f9bc036be19..00000000000
--- a/rosapps/applications/mc/pc/readme
+++ /dev/null
@@ -1,41 +0,0 @@
- This is the port of Midnight Commander for OS/2, Windows 95 and Windows NT.
-
- This port is based on the port for Windows NT by
- Juan Grigera
-and the port for OS/2 by
- Alexander Dong
-and is currently maintained by
- Pavel Roskin
-
- This port of the Midnight Commander is released under the GNU General
-Public License version 2.0 or any later version. See file COPYING for
-details.
-
- Following compilers are supported:
- For Windows NT:
- Makefile.VC4: Microsoft Visual C++ 4.0 and above
- Makefile.BC5: Borland C++ 5.x
- For OS/2:
- Makefile.EMX: EMX/GCC
- Makefile.BC2: Borland C++ 2.x
- Makefile.IBM: IBM CSet or Visual Age C++
-
- You need GNU make in order to compile mc. Other implementation of
-make will not work! Run
-
-gmake -f Makefile.xxx [RELEASE=1]
-
-where gmake is name of GNU make and Makefile.xxx is the makefile for
-your compiler. You may want to add RELEASE=1 if you want to compile an
-optimized version without debug information.
- Please note, that not all compilers are equal. You may need to create
-dummy include files or change something in order to be able to compile
-mc. BUT PLEASE DON'T TRY TO INCORPORATE SUCH QUICK HACKS INTO THE
-MC DISTRIBUTION! Try to make your changes work with all other compilers.
- If you add a file, don't forget to add it into FILES statement of
-Makefile in this directory. Otherwise this file will not be copied to
-the distribution.
- This port is not very stable now. See files BUGS and TODO in this
-directory.
-
-Pavel Roskin
diff --git a/rosapps/applications/mc/pc/slint_pc.c b/rosapps/applications/mc/pc/slint_pc.c
deleted file mode 100644
index 9aa9110af96..00000000000
--- a/rosapps/applications/mc/pc/slint_pc.c
+++ /dev/null
@@ -1,271 +0,0 @@
-/* Slang interface to the Midnight Commander for Windows NT and OS/2
- This emulates some features of ncurses on top of slang
- S-lang is not fully consistent between its Unix and non-Unix versions.
-
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include
-#include
-#include