Browse Source

Sat Mar 7 14:33:38 1998 Pavel Roskin <pavel@absolute.spb.su>

        * src/complete.c: obsolete hack for OS/2 and NT removed.
        Completion works for NT now (not very good)

        * src/main.c: HOME variable is respected by NT and OS/2
        versions. If it is missing, we use LIBDIR on OS2_NT and "/"
        on Unix.

        * src/key.h: SHIFT_PRESSED is set to 0x0010 on NT. This value
        doesn't conflict with definitions for ALT and CTRL, but it is
        SDK-compatible.

        * vfs/vfs.h: Minor changes for OS/2. EMX defines mkdir with
        2 arguments

        * vfs/tcputil,c, vfs/utilvfs.c: signal.h was includes twice.

        * vfs/Makefile.in: undelfs.h is not used and should disapper

        * slang/slos2tty.c: new file, copied from SLang-0.99.38,
        needed for OS/2 port

        * slang/Makefile.in: added slos2tty.c

        * vfs/extfs/README: annoying spell errors corrected

        * src/main.c: --termcap disabled for OS2_NT because it doesn't
        (and cannot) work. ARCH_FLAGS is not needed anymore.

        * src/text.c: most includes removed. Added a warning is someone
        compiles this file with HAVE_X. Improved color scheme for
        consoles with 16 background colors (e.g. OS/2). Hack for OS/2
        removed.

        * src/util.c, src/util.h: STRCOMP and MC_ARCH_FLAGS are moved
        to util.h. It may be useful to use them for filenames' completion
        on OS2_NT
Miguel de Icaza 27 years ago
parent
commit
b52d3a73ca
10 changed files with 75 additions and 196 deletions
  1. 1 1
      slang/Makefile.in
  2. 39 0
      src/ChangeLog
  3. 1 8
      src/complete.c
  4. 7 1
      src/key.h
  5. 9 37
      src/main.c
  6. 12 136
      src/text.c
  7. 0 11
      src/util.c
  8. 4 0
      src/util.h
  9. 1 1
      vfs/Makefile.in
  10. 1 1
      vfs/extfs/README

+ 1 - 1
slang/Makefile.in

@@ -13,7 +13,7 @@ AR = @AR@
 
 SLANGSRCS = 	sldisply.c slerr.c slsmg.c slutty.c slgetkey.c slmemcpy.c \
 		slmemset.c sltermin.c sltoken.c slsignal.c \
-		slvideo.c slw32tty.c
+		slvideo.c slw32tty.c slos2tty.c
 
 SLANGHDRS = slang.h _slang.h sl-feat.h jdmacros.h
 

+ 39 - 0
src/ChangeLog

@@ -1,3 +1,42 @@
+Sat Mar  7 14:33:38 1998  Pavel Roskin <pavel@absolute.spb.su>
+
+        * src/complete.c: obsolete hack for OS/2 and NT removed.
+        Completion works for NT now (not very good)
+
+        * src/main.c: HOME variable is respected by NT and OS/2
+        versions. If it is missing, we use LIBDIR on OS2_NT and "/"
+        on Unix.
+
+        * src/key.h: SHIFT_PRESSED is set to 0x0010 on NT. This value
+        doesn't conflict with definitions for ALT and CTRL, but it is
+        SDK-compatible.
+
+        * vfs/vfs.h: Minor changes for OS/2. EMX defines mkdir with
+        2 arguments
+
+        * vfs/tcputil,c, vfs/utilvfs.c: signal.h was includes twice.
+	
+        * vfs/Makefile.in: undelfs.h is not used and should disapper
+	
+        * slang/slos2tty.c: new file, copied from SLang-0.99.38,
+        needed for OS/2 port
+	
+        * slang/Makefile.in: added slos2tty.c
+	
+        * vfs/extfs/README: annoying spell errors corrected
+	
+        * src/main.c: --termcap disabled for OS2_NT because it doesn't
+        (and cannot) work. ARCH_FLAGS is not needed anymore.
+
+        * src/text.c: most includes removed. Added a warning is someone
+        compiles this file with HAVE_X. Improved color scheme for
+        consoles with 16 background colors (e.g. OS/2). Hack for OS/2
+        removed.
+
+        * src/util.c, src/util.h: STRCOMP and MC_ARCH_FLAGS are moved
+        to util.h. It may be useful to use them for filenames' completion
+        on OS2_NT
+
 Fri Mar  6 19:29:54 1998  Miguel de Icaza  <miguel@nuclecu.unam.mx>
 
 	* find.c: Simplify header files: use the fs.h include file. 

+ 1 - 8
src/complete.c

@@ -166,12 +166,6 @@ char *filename_completion_function (char *text, int state)
 	    strcat (tmp, PATH_SEP_STR);
 	    strcat (tmp, entry->d_name);
 	    canonicalize_pathname (tmp);
-#ifdef OS2_NT
-	    if (!stat (tmp, &tempstat)){
-		if (tempstat.st_mode & S_IEXEC)
-		    isexec = 1;
-	    }
-#else
 	    /* Unix version */
 	    if (!stat (tmp, &tempstat)){
 	    	uid_t my_uid = getuid ();
@@ -186,7 +180,6 @@ char *filename_completion_function (char *text, int state)
 	                isexec = 1;
 	        }
 	    }
-#endif
 	    free (tmp);
 	}
 	switch (look_for_executables)
@@ -284,7 +277,7 @@ char *username_completion_function (char *text, int state)
 }
 
 extern char **environ;
-#endif /* _OS_NT */
+#endif /* OS2_NT */
 
 /* We assume text [0] == '$' and want to have a look at text [1], if it is
    equal to '{', so that we should append '}' at the end */

+ 7 - 1
src/key.h

@@ -17,7 +17,13 @@ int mi_getch (void);
 
 /* Used to get the modifier information          */
 /* Currently, it just works on the Linux console */
-#define SHIFT_PRESSED 1
+#ifdef _OS_NT
+#   ifndef SHIFT_PRESSED
+#   define SHIFT_PRESSED 0x0010
+#   endif
+#else
+#   define SHIFT_PRESSED 1
+#endif
 #define ALTR_PRESSED 2
 #define CONTROL_PRESSED 4
 #define ALTL_PRESSED 8

+ 9 - 37
src/main.c

@@ -2426,14 +2426,8 @@ init_sigchld (void)
 
 #endif /* _OS_NT, __os2__, UNIX */
 
-#ifdef HAVE_SLANG
-#ifdef OS2_NT
-#define ARCH_FLAGS "S:"
-    static
-#else
-    extern
-#endif
-    int SLtt_Try_Termcap;
+#if defined(HAVE_SLANG) && !defined(OS2_NT)
+    extern int SLtt_Try_Termcap;
 #endif
 
 static struct poptOption argumentTable[] = {
@@ -2472,7 +2466,7 @@ static struct poptOption argumentTable[] = {
 #ifdef HAVE_SUBSHELL_SUPPORT
     { "subshell", 	'U', POPT_ARG_NONE, 	NULL, 			  'U' },
 #endif
-#ifdef HAVE_SLANG
+#if defined(HAVE_SLANG) && !defined(OS2_NT)
     { "termcap", 	't', 0, 		&SLtt_Try_Termcap, 	  0 },
 #endif
     { "version", 	'V', 			POPT_ARG_NONE, NULL,      'V'},
@@ -2482,8 +2476,6 @@ static struct poptOption argumentTable[] = {
     { NULL, 		0,			0, NULL, 0 }
 };
 
-#define ARCH_FLAGS ""
-
 static void
 print_usage (void)
 {
@@ -2510,7 +2502,7 @@ print_usage (void)
     "                   default.\n"
     "-P, --printwd      At exit, print the last working directory.\n"
     "-s, --slow         Disables verbose operation (for slow terminals).\n"
-#ifdef HAVE_SLANG
+#if defined(HAVE_SLANG) && !defined(OS2_NT)
     "-t, --termcap      Activate support for the TERMCAP variable.\n"
 #endif
 #ifdef USE_NETCODE
@@ -2829,34 +2821,14 @@ int main (int argc, char *argv [])
     init_sigfatals ();
     
     /* This variable is used by the subshell */
-#if defined _OS_NT
-    home_dir = copy_strings (getenv ("HOMEDRIVE"), getenv ("HOMEPATH"), NULL);
-    /* we need to malloc something (we free(home_dir)) */
+    home_dir = getenv ("HOME");
     if (!home_dir) {
-	home_dir = malloc(MAX_PATH);
-	GetWindowsDirectory(home_dir, MAX_PATH);
-    }
-#elif defined(__os2__)
-    drv      = getenv ("HOMEDRIVE");
-    drv_path = getenv ("HOMEPATH");
-
-    if ((!drv) || (!drv_path)){
-        char *p;
-        home_dir = getenv("USER_INI");
-        if (!home_dir) {
-            message(1, "Error", "HOMEDRIVE and HOMEPATH must be set!");
-            return -1;
-        } else {
-            p = strstr(home_dir, "OS2.INI");
-            *(--p) = (char) 0;
-        } 
-    } else {
-        home_dir = copy_strings (drv, drv_path, NULL);
-    }
+#ifndef OS2_NT
+    home_dir = PATH_SEP_STR;
 #else
-    home_dir = getenv ("HOME");
-    home_dir = home_dir ? home_dir : PATH_SEP_STR;
+    home_dir = mc_home; /* LIBDIR, calculated in OS_Setup() */
 #endif
+    }
 
     compatibility_move_mc_files ();
     

+ 12 - 136
src/text.c

@@ -4,139 +4,20 @@
  *
  */
 #include <config.h>
-#include <locale.h>
 
-#ifdef _OS_NT
-#    include <windows.h>
+#ifdef HAVE_X
+#error This file is for text-mode editions only.
 #endif
 
-#ifdef __os2__
-#    define INCL_DOS
-#    define INCL_DOSFILEMGR
-#    define INCL_DOSERRORS
-#    include <os2.h>
-#    include <io.h>
-#    include <direct.h>
-#endif
-
-#include "tty.h"
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/param.h>
-
-#include <sys/stat.h>
-
-#ifdef HAVE_UNISTD_H
-#   include <unistd.h>
-#endif
-
-/* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */
-#if defined(HAVE_DIRENT_H) || defined(_POSIX_VERSION)
-#   include <dirent.h>
-#   define NLENGTH(dirent) (strlen ((dirent)->d_name))
-#else
-#   define dirent direct
-#   define NLENGTH(dirent) ((dirent)->d_namlen)
-
-#   ifdef HAVE_SYS_NDIR_H
-#       include <sys/ndir.h>
-#   endif /* HAVE_SYS_NDIR_H */
-
-#   ifdef HAVE_SYS_DIR_H
-#       include <sys/dir.h>
-#   endif /* HAVE_SYS_DIR_H */
-
-#   ifdef HAVE_NDIR_H
-#       include <ndir.h>
-#   endif /* HAVE_NDIR_H */
-#endif /* not (HAVE_DIRENT_H or _POSIX_VERSION) */
 
-#if HAVE_SYS_WAIT_H
-#   include <sys/wait.h>	/* For waitpid() */
-#endif
-
-#include <errno.h>
-#ifndef OS2_NT
-#    include <pwd.h>
-#endif
-#include <ctype.h>
-#include <fcntl.h>	/* For O_RDWR */
-#include <signal.h>
-
-/* Program include files */
-#include "mad.h"
-#include "dir.h"
-#include "color.h"
-#include "global.h"
-#include "util.h"
-#include "dialog.h"
-#include "menu.h"
-#include "file.h"
-#include "panel.h"
 #define WANT_WIDGETS
-#include "main.h"
 #include "win.h"
-#include "user.h"
-#include "mem.h"
-#include "mouse.h"
-#include "option.h"
-#include "tree.h"
-#include "cons.saver.h"
-#include "subshell.h"
-#include "key.h"	/* For init_key() and mi_getch() */
-#include "setup.h"	/* save_setup() */
-#include "profile.h"	/* free_profiles() */
-#include "boxes.h"
-#include "layout.h"
-#include "cmd.h"		/* Normal commands */
-#include "hotlist.h"
-#include "panelize.h"
-#ifndef __os2__
-#    include "learn.h"
-#endif
-#include "listmode.h"
-#include "background.h"
-#include "dirhist.h"
-#include "ext.h"	/* For flush_extension_file() */
-
-/* Listbox for the command history feature */
+#include "tty.h"
+#include "key.h"
 #include "widget.h"
-#include "command.h"
-#include "wtools.h"
-#include "complete.h"		/* For the free_completion */
-
-#include "chmod.h"
-#include "chown.h"
-
-#ifdef OS2_NT
-#    include <drive.h>
-#endif
-
-#include "../vfs/vfs.h"
-#include "../vfs/extfs.h"
-
-#ifdef HAVE_XVIEW
-#   include "../xv/xvmain.h"
-#endif
-
-#ifdef HAVE_TK
-#   include "tkmain.h"
-#endif
-
-#include "popt.h"
-
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
-#ifndef USE_VFS
-#ifdef USE_NETCODE
-#undef USE_NETCODE
-#endif
-#endif
-
+#include "main.h"
+#include "cons.saver.h"
 
 char *default_edition_colors =
 "normal=lightgray,blue:"
@@ -145,23 +26,18 @@ char *default_edition_colors =
 "markselect=yellow,cyan:"
 "errors=white,red:"
 "menu=white,cyan:"
-"reverse=black,white:"
-"dnormal=black,white:"
+"reverse=black,lightgray:"
+"dnormal=black,lightgray:"
 "dfocus=black,cyan:"
-#if defined(__os2__)
-"dhotnormal=magenta,white:"	/* .ado: yellow */
-"dhotfocus=magenta,cyan:"
-#else
-"dhotnormal=yellow,white:"
+"dhotnormal=yellow,lightgray:"
 "dhotfocus=yellow,cyan:"
-#endif
 "viewunderline=brightred,blue:"
 "menuhot=yellow,cyan:"
 "menusel=white,black:"
 "menuhotsel=yellow,black:"
-"helpnormal=black,white:"
-"helpitalic=red,white:"
-"helpbold=blue,white:"
+"helpnormal=black,lightgray:"
+"helpitalic=red,lightgray:"
+"helpbold=blue,lightgray:"
 "helplink=black,cyan:"
 "helpslink=yellow,blue:"
 "gauge=white,black:"

+ 0 - 11
src/util.c

@@ -477,17 +477,6 @@ char *convert_pattern (char *pattern, int match_type, int do_group)
 	return pattern;
 }
 
-/* 1 if string matches
-   0 if string doesn't match
-   -1 if error in pattern */
-#ifdef OS2_NT
-#  define STRCOMP stricmp
-#  define MC_ARCH_FLAGS REG_ICASE
-#else
-#  define STRCOMP strcmp
-#  define MC_ARCH_FLAGS 0
-#endif
-
 int regexp_match (char *pattern, char *string, int match_type)
 {
     static regex_t r;

+ 4 - 0
src/util.h

@@ -183,6 +183,8 @@ void tell_parent (int msg);
 #    define PATH_SEP_STR "\\"
 #    define PATH_ENV_SEP ';'
 #    define OS_SORT_CASE_SENSITIVE_DEFAULT 0
+#    define STRCOMP stricmp
+#    define MC_ARCH_FLAGS REG_ICASE
      char *get_default_shell (void);
      char *get_default_editor (void);
      int lstat (const char* pathname, struct stat *buffer);
@@ -192,6 +194,8 @@ void tell_parent (int msg);
 #    define PATH_ENV_SEP ':'
 #    define get_default_editor() "vi"
 #    define OS_SORT_CASE_SENSITIVE_DEFAULT 1
+#    define STRCOMP strcmp
+#    define MC_ARCH_FLAGS 0
 #endif
 
 /* GNOME provides the internationalization code as well */

+ 1 - 1
vfs/Makefile.in

@@ -24,7 +24,7 @@ VFSSRCS = local.c vfs.c mcfs.c tcputil.c tar.c names.c \
 	ftpfs.c container.c mcserv.c extfs.c undelfs.c utilvfs.c
 
 VFSHDRS = vfs.h mcfs.h tcputil.h tar.h container.h ftpfs.h names.h \
-	extfs.h undelfs.h
+	extfs.h
 
 VFSOBJS = $(NONETFILES) @NETFILES@
 

+ 1 - 1
vfs/extfs/README

@@ -25,7 +25,7 @@ prefix=space_separated_extensions
 e.g.
 zip=.zip .ZIP
 
-The second one my require some your knowledges of shell/c programming:
+The second one may require some your knowledge of shell/c programming:
 You have to create a program (with executable permissions) prefix in
 $(libdir)/extfs (in our example $(libdir)/extfs/zip).
 

Some files were not shown because too many files changed in this diff