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.
Этот коммит содержится в:
родитель
9c3a48bbf6
Коммит
9d4987c84b
@ -16,6 +16,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "panel.h"
|
#include "panel.h"
|
||||||
#include "gscreen.h"
|
#include "gscreen.h"
|
||||||
|
#include "ext.h"
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
|
||||||
/* Types of desktop icons:
|
/* Types of desktop icons:
|
||||||
|
@ -10,7 +10,7 @@ include ../Make.common
|
|||||||
|
|
||||||
FILES = Makefile TODO dirent.c mc.ico bugs mc.rc config.h dirent.h \
|
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 \
|
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 \
|
util.WinNT.c util.debug.c util.Win32.c util.Win32.h util.debug.h \
|
||||||
drive.h
|
drive.h
|
||||||
|
|
||||||
|
34
nt/config.h
34
nt/config.h
@ -94,10 +94,13 @@
|
|||||||
// Typedefs (some useless under NT)
|
// Typedefs (some useless under NT)
|
||||||
typedef int gid_t; // Not defined in <sys/types.h>
|
typedef int gid_t; // Not defined in <sys/types.h>
|
||||||
typedef int uid_t;
|
typedef int uid_t;
|
||||||
typedef int mode_t;
|
|
||||||
typedef int pid_t;
|
typedef int pid_t;
|
||||||
typedef unsigned int umode_t;
|
typedef unsigned int umode_t;
|
||||||
|
|
||||||
|
#ifndef __BORLANDC__
|
||||||
|
typedef int mode_t;
|
||||||
typedef unsigned int nlink_t;
|
typedef unsigned int nlink_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define INLINE
|
#define INLINE
|
||||||
#define inline
|
#define inline
|
||||||
@ -106,15 +109,9 @@ typedef unsigned int nlink_t;
|
|||||||
// File attributes
|
// File attributes
|
||||||
#define S_ISLNK(x) 0
|
#define S_ISLNK(x) 0
|
||||||
|
|
||||||
#ifdef _MSC_VER // Already defined in Watcom C headers
|
#ifndef __WATCOMC__ // 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
|
|
||||||
|
|
||||||
#define S_IRWXU 0000700
|
#define S_IFLNK 0010000
|
||||||
#define S_IRUSR 0000400
|
|
||||||
#define S_IWUSR 0000200
|
|
||||||
#define S_IXUSR 0000100
|
|
||||||
|
|
||||||
#define S_IRWXG 0000070
|
#define S_IRWXG 0000070
|
||||||
#define S_IRGRP 0000040
|
#define S_IRGRP 0000040
|
||||||
@ -130,6 +127,16 @@ typedef unsigned int nlink_t;
|
|||||||
#define S_ISGID 0002000
|
#define S_ISGID 0002000
|
||||||
#define S_ISVTX 0001000
|
#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_IFIFO _S_IFIFO /* pipe */
|
||||||
|
|
||||||
#define S_ISCHR( m ) (((m) & S_IFMT) == S_IFCHR)
|
#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_ISREG( m ) (((m) & S_IFMT) == S_IFREG)
|
||||||
#define S_ISFIFO( m ) (((m) & S_IFMT) == S_IFIFO)
|
#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 */
|
/* Symbolic constants for the access() function */
|
||||||
#define R_OK 4 /* Test for read permission */
|
#define R_OK 4 /* Test for read permission */
|
||||||
#define W_OK 2 /* Test for write permission */
|
#define W_OK 2 /* Test for write permission */
|
||||||
@ -147,9 +159,7 @@ typedef unsigned int nlink_t;
|
|||||||
/* Missing Errno definitions */
|
/* Missing Errno definitions */
|
||||||
#define ELOOP 40 /* Too many symbolic links encountered */
|
#define ELOOP 40 /* Too many symbolic links encountered */
|
||||||
|
|
||||||
/* Missing mask definition */
|
#endif /* not __WATCOMC__ */
|
||||||
#define O_ACCMODE 0003
|
|
||||||
#endif //_MSC_VER
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
@ -41,11 +41,17 @@ static HANDLE hSaved, hNew;
|
|||||||
void show_console_contents (int starty, unsigned char begin_line, unsigned char end_line)
|
void show_console_contents (int starty, unsigned char begin_line, unsigned char end_line)
|
||||||
{
|
{
|
||||||
DWORD dw;
|
DWORD dw;
|
||||||
COORD c0 = {0,0};
|
COORD c0 = { 0, 0 };
|
||||||
COORD csize = {COLS, end_line-begin_line};
|
COORD csize;
|
||||||
SMALL_RECT rect = { 0, begin_line, COLS, end_line };
|
SMALL_RECT rect;
|
||||||
CHAR_INFO *pchar;
|
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
|
// -- This code reads characters and attributes
|
||||||
pchar = malloc (sizeof(CHAR_INFO) * (end_line-begin_line) * COLS);
|
pchar = malloc (sizeof(CHAR_INFO) * (end_line-begin_line) * COLS);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#ifdef _OS_NT
|
#ifdef _OS_NT
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <errno.h>
|
||||||
#include "util.debug.h"
|
#include "util.debug.h"
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
20
nt/utilnt.c
20
nt/utilnt.c
@ -38,6 +38,10 @@
|
|||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include "util.Win32.h"
|
#include "util.Win32.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#define ENOTEMPTY ERROR_DIR_NOT_EMPTY
|
||||||
|
#endif
|
||||||
|
|
||||||
char *get_owner (int uid)
|
char *get_owner (int uid)
|
||||||
{
|
{
|
||||||
return "none";
|
return "none";
|
||||||
@ -135,11 +139,11 @@ int my_system (int as_shell_command, const char *shell, const char *command)
|
|||||||
if (as_shell_command) {
|
if (as_shell_command) {
|
||||||
/* It is only the shell, /c will not work */
|
/* It is only the shell, /c will not work */
|
||||||
if (command)
|
if (command)
|
||||||
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
|
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
|
||||||
else
|
else
|
||||||
spawnlp (_P_WAIT, shell, (char *) 0);
|
spawnlp (P_WAIT, shell, (char *) 0);
|
||||||
} else
|
} else
|
||||||
spawnl (_P_WAIT, shell, shell, command, (char *) 0);
|
spawnl (P_WAIT, shell, shell, command, (char *) 0);
|
||||||
|
|
||||||
if (win32_GetPlatform() == OS_Win95) {
|
if (win32_GetPlatform() == OS_Win95) {
|
||||||
SetConsoleTitle ("GNU Midnight Commander"); /* title is gone after spawn... */
|
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)) {
|
switch(win32_GetEXEType (shell)) {
|
||||||
case EXE_win16: /* Windows 3.x archive or OS/2 */
|
case EXE_win16: /* Windows 3.x archive or OS/2 */
|
||||||
case EXE_win32GUI: /* NT or Chicago GUI API */
|
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;
|
break;
|
||||||
case EXE_otherCUI: /* DOS COM, MZ, ZM, Phar Lap */
|
case EXE_otherCUI: /* DOS COM, MZ, ZM, Phar Lap */
|
||||||
case EXE_win32CUI: /* NT or Chicago Console API, also OS/2 */
|
case EXE_win32CUI: /* NT or Chicago Console API, also OS/2 */
|
||||||
case EXE_Unknown:
|
case EXE_Unknown:
|
||||||
default:
|
default:
|
||||||
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
|
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
spawnlp (_P_WAIT, shell, shell, "/c", command, (char *) 0);
|
spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
spawnl (_P_WAIT, shell, shell, command, (char *) 0);
|
spawnl (P_WAIT, shell, shell, command, (char *) 0);
|
||||||
|
|
||||||
if (win32_GetPlatform() == OS_Win95) {
|
if (win32_GetPlatform() == OS_Win95) {
|
||||||
SetConsoleTitle ("GNU Midnight Commander"); /* title is gone after spawn... */
|
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);
|
rc = DeleteFile(pathName);
|
||||||
returnError = GetLastError();
|
returnError = GetLastError();
|
||||||
if (rc == FALSE) {
|
if (rc == FALSE) {
|
||||||
|
@ -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>
|
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
|
* hotlist.c: Defaults on the hotlist add-current and new-entry is
|
||||||
|
@ -99,7 +99,7 @@ int output_starts_shell = 0;
|
|||||||
int source_route = 0;
|
int source_route = 0;
|
||||||
|
|
||||||
/* If set, use the builtin editor */
|
/* 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 */
|
/* Ugly hack in order to distinguish between left and right panel in menubar */
|
||||||
int is_right;
|
int is_right;
|
||||||
|
11
src/file.c
11
src/file.c
@ -60,12 +60,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef __os2__
|
#ifdef OS2_NT
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
# include <direct.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "tty.h"
|
#include "tty.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -81,12 +79,7 @@
|
|||||||
# include <sys/timeb.h> /* alex: for struct timeb, used in time.h */
|
# include <sys/timeb.h> /* alex: for struct timeb, used in time.h */
|
||||||
#endif /* SCO_FLAVOR */
|
#endif /* SCO_FLAVOR */
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifdef OS2_NT
|
#include <utime.h>
|
||||||
# include <sys/time.h>
|
|
||||||
# include <sys/utime.h>
|
|
||||||
#else
|
|
||||||
# include <utime.h>
|
|
||||||
#endif
|
|
||||||
#include "mad.h"
|
#include "mad.h"
|
||||||
#include "regex.h"
|
#include "regex.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
@ -2222,7 +2222,7 @@ OS_Setup ()
|
|||||||
shell = get_default_shell ();
|
shell = get_default_shell ();
|
||||||
|
|
||||||
/* Default opening mode for files is binary, not text (CR/LF translation) */
|
/* Default opening mode for files is binary, not text (CR/LF translation) */
|
||||||
_fmode = _O_BINARY;
|
_fmode = O_BINARY;
|
||||||
|
|
||||||
mc_home = get_mc_lib_dir ();
|
mc_home = get_mc_lib_dir ();
|
||||||
}
|
}
|
||||||
|
12
src/tree.c
12
src/tree.c
@ -1176,15 +1176,15 @@ static int tree_mkdir_cmd (WTree *tree)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tree_rmdir_cmd (WTree *tree)
|
static void tree_rmdir_cmd (WTree *tree)
|
||||||
{
|
{
|
||||||
char old_dir [MC_MAXPATHLEN];
|
char old_dir [MC_MAXPATHLEN];
|
||||||
|
|
||||||
if (tree->selected_ptr){
|
if (tree->selected_ptr){
|
||||||
if (!mc_get_current_wd (old_dir, MC_MAXPATHLEN))
|
if (!mc_get_current_wd (old_dir, MC_MAXPATHLEN))
|
||||||
return 0;
|
return;
|
||||||
if (mc_chdir (PATH_SEP_STR))
|
if (mc_chdir (PATH_SEP_STR))
|
||||||
return 0;
|
return;
|
||||||
if (confirm_delete){
|
if (confirm_delete){
|
||||||
char *cmd_buf;
|
char *cmd_buf;
|
||||||
int result;
|
int result;
|
||||||
@ -1195,7 +1195,7 @@ static int tree_rmdir_cmd (WTree *tree)
|
|||||||
result = query_dialog (" Delete ", cmd_buf, 3, 2, "&Yes", "&No");
|
result = query_dialog (" Delete ", cmd_buf, 3, 2, "&Yes", "&No");
|
||||||
free (cmd_buf);
|
free (cmd_buf);
|
||||||
if (result != 0){
|
if (result != 0){
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
create_op_win (OP_DELETE, 0);
|
create_op_win (OP_DELETE, 0);
|
||||||
@ -1203,9 +1203,9 @@ static int tree_rmdir_cmd (WTree *tree)
|
|||||||
tree_forget_cmd (tree);
|
tree_forget_cmd (tree);
|
||||||
destroy_op_win ();
|
destroy_op_win ();
|
||||||
mc_chdir (old_dir);
|
mc_chdir (old_dir);
|
||||||
return 1;
|
return;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -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_IXUSR)) mode [3] = 'x';
|
||||||
if (ismode (mode_bits, S_IWUSR)) mode [2] = 'w';
|
if (ismode (mode_bits, S_IWUSR)) mode [2] = 'w';
|
||||||
if (ismode (mode_bits, S_IRUSR)) mode [1] = 'r';
|
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_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_ISGID)) mode [6] = (mode [6] == 'x') ? 's' : 'S';
|
||||||
if (ismode (mode_bits, S_IFCHR)) mode [0] = 'c';
|
if (ismode (mode_bits, S_IFCHR)) mode [0] = 'c';
|
||||||
|
@ -1483,7 +1483,7 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
|
|||||||
update_activate = 0;
|
update_activate = 0;
|
||||||
|
|
||||||
for (; ; isatbeg = 1, free (s)){
|
for (; ; isatbeg = 1, free (s)){
|
||||||
#ifdef HAVE_X
|
#ifdef PORT_HAS_FLUSH_EVENTS
|
||||||
static int count;
|
static int count;
|
||||||
|
|
||||||
if ((count++ % 32) == 0)
|
if ((count++ % 32) == 0)
|
||||||
|
@ -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>
|
1998-03-04 Federico Mena Quintero <federico@nuclecu.unam.mx>
|
||||||
|
|
||||||
* tkconf.h (PORT_HAS_FILTER_CHANGED): New flag for conditional compilation.
|
* tkconf.h (PORT_HAS_FILTER_CHANGED): New flag for conditional compilation.
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
code so that the code knows about the window resize.
|
code so that the code knows about the window resize.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define WANT_WIDGETS
|
||||||
#include "dlg.h"
|
#include "dlg.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "tkmain.h"
|
#include "tkmain.h"
|
||||||
@ -128,7 +131,7 @@ view_percent (WView *view, int p, int w)
|
|||||||
static int current_color;
|
static int current_color;
|
||||||
|
|
||||||
void
|
void
|
||||||
view_set_color (int font)
|
view_set_color (WView *view, int font)
|
||||||
{
|
{
|
||||||
current_color = font;
|
current_color = font;
|
||||||
}
|
}
|
||||||
@ -152,7 +155,7 @@ void
|
|||||||
view_add_string (WView *view, char *s)
|
view_add_string (WView *view, char *s)
|
||||||
{
|
{
|
||||||
while (*s)
|
while (*s)
|
||||||
add_character (view, *s++);
|
view_add_character (view, *s++);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -262,4 +265,4 @@ view_gotoyx (WView *view, int row, int col)
|
|||||||
}
|
}
|
||||||
view->last_col = col;
|
view->last_col = col;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user