Mon Mar 16 13:03:45 1998 Pavel Roskin <pavel@absolute.spb.su>

* cmd.c: Internal edit is used by default. vi may be
        confusing for some users.

	* tree.c: tree_rmdir_cmd() should not return any value,
        because it is not analyzed for errors.

	* main.c: NT code: use O_BINARY instead of _O_BINARY

	* util.c: DO not test for arguments that do not make sense under
	Windows NT.

	* file.c: utime.h always included for Windows NT port.

	* view.c: Events are flushed only if the ports supports it.


Lots of Windows/NT changes, but I will let Pavlov write the ChangeLog
entries.

Mon Mar 16 13:05:47 1998  Pavel Roskin <pavel@absolute.spb.su>

	* tkview.c: Include stdio.h;  Minor spelling corrections added.
This commit is contained in:
Miguel de Icaza 1998-03-16 19:09:24 +00:00
parent 9c3a48bbf6
commit 9d4987c84b
15 changed files with 85 additions and 46 deletions

View File

@ -16,6 +16,7 @@
#include "global.h"
#include "panel.h"
#include "gscreen.h"
#include "ext.h"
#include <gdk/gdkx.h>
/* Types of desktop icons:

View File

@ -10,7 +10,7 @@ include ../Make.common
FILES = Makefile TODO dirent.c mc.ico bugs mc.rc config.h dirent.h \
Makefile.NT chmod.nt.c drive.nt.c slint.nt.c cons.handler.nt.c \
key.nt.c utilnt.c Makefile.NT Makefile.VC4 \
key.nt.c utilnt.c Makefile.NT Makefile.VC4 Makefile.BC5 \
util.WinNT.c util.debug.c util.Win32.c util.Win32.h util.debug.h \
drive.h

View File

@ -94,10 +94,13 @@
// Typedefs (some useless under NT)
typedef int gid_t; // Not defined in <sys/types.h>
typedef int uid_t;
typedef int mode_t;
typedef int pid_t;
typedef unsigned int umode_t;
#ifndef __BORLANDC__
typedef int mode_t;
typedef unsigned int nlink_t;
#endif
#define INLINE
#define inline
@ -106,15 +109,9 @@ typedef unsigned int nlink_t;
// File attributes
#define S_ISLNK(x) 0
#ifdef _MSC_VER // Already defined in Watcom C headers
#define S_ISBLK( m ) 0 /* Some of these are not actual values*/
#define S_IFBLK 0010000 /* but don't worry, these are yet not possible on NT */
#define S_IFLNK 0010000
#ifndef __WATCOMC__ // Already defined in Watcom C headers
#define S_IRWXU 0000700
#define S_IRUSR 0000400
#define S_IWUSR 0000200
#define S_IXUSR 0000100
#define S_IFLNK 0010000
#define S_IRWXG 0000070
#define S_IRGRP 0000040
@ -130,6 +127,16 @@ typedef unsigned int nlink_t;
#define S_ISGID 0002000
#define S_ISVTX 0001000
#ifndef __BORLANDC__
#define S_ISBLK( m ) 0 /* Some of these are not actual values*/
#define S_IFBLK 0010000 /* but don't worry, these are yet not possible on NT */
#define S_IRWXU 0000700
#define S_IRUSR 0000400
#define S_IWUSR 0000200
#define S_IXUSR 0000100
#define S_IFIFO _S_IFIFO /* pipe */
#define S_ISCHR( m ) (((m) & S_IFMT) == S_IFCHR)
@ -137,6 +144,11 @@ typedef unsigned int nlink_t;
#define S_ISREG( m ) (((m) & S_IFMT) == S_IFREG)
#define S_ISFIFO( m ) (((m) & S_IFMT) == S_IFIFO)
/* Missing mask definition */
#define O_ACCMODE 0003
#endif /* not __BORLANDC__ */
/* Symbolic constants for the access() function */
#define R_OK 4 /* Test for read permission */
#define W_OK 2 /* Test for write permission */
@ -147,9 +159,7 @@ typedef unsigned int nlink_t;
/* Missing Errno definitions */
#define ELOOP 40 /* Too many symbolic links encountered */
/* Missing mask definition */
#define O_ACCMODE 0003
#endif //_MSC_VER
#endif /* not __WATCOMC__ */
// ---------------------------------------------------------------------------

View File

@ -41,11 +41,17 @@ static HANDLE hSaved, hNew;
void show_console_contents (int starty, unsigned char begin_line, unsigned char end_line)
{
DWORD dw;
COORD c0 = {0,0};
COORD csize = {COLS, end_line-begin_line};
SMALL_RECT rect = { 0, begin_line, COLS, 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);

View File

@ -24,6 +24,7 @@
#ifdef _OS_NT
#include <windows.h>
#endif
#include <errno.h>
#include "util.debug.h"
/* Global variables */

View File

@ -38,6 +38,10 @@
#include <util.h>
#include "util.Win32.h"
#ifdef __BORLANDC__
#define ENOTEMPTY ERROR_DIR_NOT_EMPTY
#endif
char *get_owner (int uid)
{
return "none";
@ -135,11 +139,11 @@ int my_system (int as_shell_command, const char *shell, const char *command)
if (as_shell_command) {
/* It is only the shell, /c will not work */
if (command)
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
else
spawnlp (_P_WAIT, shell, (char *) 0);
spawnlp (P_WAIT, shell, (char *) 0);
} else
spawnl (_P_WAIT, shell, shell, command, (char *) 0);
spawnl (P_WAIT, shell, shell, command, (char *) 0);
if (win32_GetPlatform() == OS_Win95) {
SetConsoleTitle ("GNU Midnight Commander"); /* title is gone after spawn... */
@ -150,21 +154,21 @@ int my_system (int as_shell_command, const char *shell, const char *command)
switch(win32_GetEXEType (shell)) {
case EXE_win16: /* Windows 3.x archive or OS/2 */
case EXE_win32GUI: /* NT or Chicago GUI API */
spawnlp (_P_NOWAIT, shell, shell, "/c", command, (char *) 0); /* don't wait for GUI programs to end */
spawnlp (P_NOWAIT, shell, shell, "/c", command, (char *) 0); /* don't wait for GUI programs to end */
break;
case EXE_otherCUI: /* DOS COM, MZ, ZM, Phar Lap */
case EXE_win32CUI: /* NT or Chicago Console API, also OS/2 */
case EXE_Unknown:
default:
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
break;
}
}
else
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
}
else
spawnl (_P_WAIT, shell, shell, command, (char *) 0);
spawnl (P_WAIT, shell, shell, command, (char *) 0);
if (win32_GetPlatform() == OS_Win95) {
SetConsoleTitle ("GNU Midnight Commander"); /* title is gone after spawn... */
@ -405,7 +409,7 @@ int mc_unlink (char *pathName)
}
}
_chmod(pathName, _S_IWRITE); /* make it writable */
chmod(pathName, S_IWRITE); /* make it writable */
rc = DeleteFile(pathName);
returnError = GetLastError();
if (rc == FALSE) {

View File

@ -1,3 +1,20 @@
Mon Mar 16 13:03:45 1998 Pavel Roskin <pavel@absolute.spb.su>
* cmd.c: Internal edit is used by default. vi may be
confusing for some users.
* tree.c: tree_rmdir_cmd() should not return any value,
because it is not analyzed for errors.
* main.c: NT code: use O_BINARY instead of _O_BINARY
* util.c: DO not test for arguments that do not make sense under
Windows NT.
* file.c: utime.h always included for Windows NT port.
* view.c: Events are flushed only if the ports supports it.
Mon Mar 16 12:30:39 1998 Stas Maximov <stmax@u213.srcc.msu.su>
* hotlist.c: Defaults on the hotlist add-current and new-entry is

View File

@ -99,7 +99,7 @@ int output_starts_shell = 0;
int source_route = 0;
/* If set, use the builtin editor */
int use_internal_edit = 0;
int use_internal_edit = 1;
/* Ugly hack in order to distinguish between left and right panel in menubar */
int is_right;

View File

@ -60,12 +60,10 @@
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
#ifdef __os2__
#ifdef OS2_NT
# include <io.h>
# include <direct.h>
#endif
#include <errno.h>
#include "tty.h"
#include <ctype.h>
@ -81,12 +79,7 @@
# include <sys/timeb.h> /* alex: for struct timeb, used in time.h */
#endif /* SCO_FLAVOR */
#include <time.h>
#ifdef OS2_NT
# include <sys/time.h>
# include <sys/utime.h>
#else
# include <utime.h>
#endif
#include <utime.h>
#include "mad.h"
#include "regex.h"
#include "util.h"

View File

@ -2222,7 +2222,7 @@ OS_Setup ()
shell = get_default_shell ();
/* Default opening mode for files is binary, not text (CR/LF translation) */
_fmode = _O_BINARY;
_fmode = O_BINARY;
mc_home = get_mc_lib_dir ();
}

View File

@ -1176,15 +1176,15 @@ static int tree_mkdir_cmd (WTree *tree)
return 1;
}
static int tree_rmdir_cmd (WTree *tree)
static void tree_rmdir_cmd (WTree *tree)
{
char old_dir [MC_MAXPATHLEN];
if (tree->selected_ptr){
if (!mc_get_current_wd (old_dir, MC_MAXPATHLEN))
return 0;
return;
if (mc_chdir (PATH_SEP_STR))
return 0;
return;
if (confirm_delete){
char *cmd_buf;
int result;
@ -1195,7 +1195,7 @@ static int tree_rmdir_cmd (WTree *tree)
result = query_dialog (" Delete ", cmd_buf, 3, 2, "&Yes", "&No");
free (cmd_buf);
if (result != 0){
return 0;
return;
}
}
create_op_win (OP_DELETE, 0);
@ -1203,9 +1203,9 @@ static int tree_rmdir_cmd (WTree *tree)
tree_forget_cmd (tree);
destroy_op_win ();
mc_chdir (old_dir);
return 1;
return;
} else
return 0;
return;
}
#if 0

View File

@ -321,7 +321,7 @@ char *string_perm (mode_t mode_bits)
if (ismode (mode_bits, S_IXUSR)) mode [3] = 'x';
if (ismode (mode_bits, S_IWUSR)) mode [2] = 'w';
if (ismode (mode_bits, S_IRUSR)) mode [1] = 'r';
#ifndef __os2__
#ifndef OS2_NT
if (ismode (mode_bits, S_ISUID)) mode [3] = (mode [3] == 'x') ? 's' : 'S';
if (ismode (mode_bits, S_ISGID)) mode [6] = (mode [6] == 'x') ? 's' : 'S';
if (ismode (mode_bits, S_IFCHR)) mode [0] = 'c';

View File

@ -1483,7 +1483,7 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
update_activate = 0;
for (; ; isatbeg = 1, free (s)){
#ifdef HAVE_X
#ifdef PORT_HAS_FLUSH_EVENTS
static int count;
if ((count++ % 32) == 0)

View File

@ -1,3 +1,7 @@
Mon Mar 16 13:05:47 1998 Pavel Roskin <pavel@absolute.spb.su>
* tkview.c: Include stdio.h; Minor spelling corrections added.
1998-03-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
* tkconf.h (PORT_HAS_FILTER_CHANGED): New flag for conditional compilation.

View File

@ -23,6 +23,9 @@
code so that the code knows about the window resize.
*/
#include <stdio.h>
#define WANT_WIDGETS
#include "dlg.h"
#include "view.h"
#include "tkmain.h"
@ -128,7 +131,7 @@ view_percent (WView *view, int p, int w)
static int current_color;
void
view_set_color (int font)
view_set_color (WView *view, int font)
{
current_color = font;
}
@ -152,7 +155,7 @@ void
view_add_string (WView *view, char *s)
{
while (*s)
add_character (view, *s++);
view_add_character (view, *s++);
}
static char *
@ -262,4 +265,4 @@ view_gotoyx (WView *view, int row, int col)
}
view->last_col = col;
}
#endif