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

* os2/Makefile.OS2, os2/Makefile.EMX: new files. Use
        "gmake -f Makefile.EMX" to compile

        * os2/slint.os2.c: copied from ../nt/slint.nt.c

        * os2/direct.h: dummy file. Replaces douzen of other dummy
        files :-)

        * os2/Makefile: list of distibution files corrected

        * os2/drive.os2.c, os2/chmod.os2.c: button_new() calls
        updated

        * os2/*: many minor changes for EMX.
This commit is contained in:
Miguel de Icaza 1998-03-07 20:12:44 +00:00
parent 057f69beae
commit 1a9884eb13
11 changed files with 168 additions and 63 deletions

17
os2/ChangeLog Normal file
View File

@ -0,0 +1,17 @@
Sat Mar 7 14:19:29 1998 Pavel Roskin <pavel@absolute.spb.su>
* os2/Makefile.OS2, os2/Makefile.EMX: new files. Use
"gmake -f Makefile.EMX" to compile
* os2/slint.os2.c: copied from ../nt/slint.nt.c
* os2/direct.h: dummy file. Replaces douzen of other dummy
files :-)
* os2/Makefile: list of distibution files corrected
* os2/drive.os2.c, os2/chmod.os2.c: button_new() calls
updated
* os2/*: many minor changes for EMX.

View File

@ -8,16 +8,13 @@
include ../Make.common
FILES = coollocal.h gpm-xterm.h lkeysym.h pwd.h Makefile coolwidget.h grp.h \
makefile.debug slint.os2.c chmod.os2.c dirent.h inst.cmd \
makefile.release config.h dirent.os2.c mc.def termios.h \
cons.handler.os2.c drive.h key.os2.c mc.ico unistd.h cons.saver.h \
drive.os2.c learn.h util.os2.c
FILES = Makefile Makefile.EMX Makefile.OS2 chmod.os2.c config.h \
cons.handler.os2.c cons.saver.h direct.h dirent.h dirent.os2.c \
drive.h drive.os2.c inst.cmd key.os2.c mc.def mc.ico slint.os2.c \
util.os2.c
FILESSYS = sys/param.h sys/time.h sys/wait.h
FILESSYS = sys/param.h sys/time.h
FILESEDIT = os2edit/copyright.h os2edit/dirtools.h \
os2edit/makefile.debug os2edit/makefile.release os2edit/makefile.rf
all:
TAGS: $(FILES)
@ -38,5 +35,3 @@ distcopy:
$(CP) $(FILES) ../../mc-$(VERSION)/os2
-mkdir ../../mc-$(VERSION)/os2/sys
$(CP) $(FILESSYS) ../../mc-$(VERSION)/os2/sys
-mkdir ../../mc-$(VERSION)/os2/os2edit
$(CP) $(FILESEDIT) ../../mc-$(VERSION)/os2/os2edit

View File

@ -16,19 +16,19 @@
*/
#include <config.h>
#ifndef __os2__
#error This file is for the OS/2 operating system.
#else
#include <config.h>
#define INCL_DOSFILEMGR
#include <os2.h>
#include <string.h>
#include <stdio.h>
/* for chmod and stat */
#include <io.h>
#include <sys\stat.h>
#include <sys\types.h>
#include <sys\stat.h>
#include "tty.h"
#include "mad.h"
#include "util.h"
@ -104,28 +104,27 @@ struct {
};
struct {
int ret_cmd, y, x;
char *text;
int hkey, hpos;
int ret_cmd, flags, y, x;
char *text;
} chmod_but[BUTTONS] = {
{
B_CANCEL, 2, 33, "[ Cancel ]", 'c', 2,
B_CANCEL, NORMAL_BUTTON, 2, 33, "&Cancel",
},
{
B_ENTER, 2, 17, "[ Set ]", 's', 2,
B_ENTER, DEFPUSH_BUTTON, 2, 17, "&Set",
},
{
B_CLRMRK, 0, 42, "[ Clear marked ]", 'l', 3,
B_CLRMRK, NORMAL_BUTTON, 0, 42, "C&lear marked",
},
{
B_SETMRK, 0, 27, "[ Set marked ]", 'e', 3,
B_SETMRK, NORMAL_BUTTON, 0, 27, "S&et marked",
},
{
B_MARKED, 0, 12, "[ Marked all ]", 'm', 2,
B_MARKED, NORMAL_BUTTON, 0, 12, "&Marked all",
},
{
B_ALL, 0, 0, "[ Set all ]", 'a', 6,
B_ALL, NORMAL_BUTTON, 0, 0, "Set &all",
},
};
@ -240,7 +239,7 @@ static void init_chmod (void)
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].text, chmod_but[i].hkey, chmod_but[i].hpos, 0, 0, NULL
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++) {
@ -251,7 +250,7 @@ static void init_chmod (void)
}
#define XTRACT2(i) 0, check_perm [i].text, 0, -1, NULL
#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,

View File

@ -31,7 +31,27 @@
#ifndef __CONFIG_H //Prevent multiple includes
#define __CONFIG_H
#include "../VERSION"
#ifndef __BORLANDC__
# include <../VERSION>
#else
# include <../VERSION.>
#endif
#ifndef OS2
# define OS2
#endif
#ifndef __os2__
# define __os2__
#endif
#ifndef pc_system
# define pc_system
#endif
#define OS2_NT
#define FLOAT_TYPE
#define MIDNIGHT
// ---------------------------------------------------------------------------
// Headers
@ -44,17 +64,21 @@
// ---------------------------------------------------------------------------
// "Standard" Library
#define HAS_MEMSET
#define HAS_MEMCHR
#define HAS_MEMCPY
#define HAS_MEMCMP
#define HAVE_MEMSET
#define HAVE_MEMCHR
#define HAVE_MEMCPY
#define HAVE_MEMCMP
#define HAVE_MEMMOVE
#define HAVE_STRDUP
#define HAVE_STRERROR
#define HAVE_MEMMOVE
#define HAVE_TRUNCATE
#define REGEX_MALLOC
#define NO_TERM
#define NO_INFOMOUNT
#ifndef __EMX__
#define HAVE_SHORT_MKDIR
#endif
// ---------------------------------------------------------------------------
// Windowing library
@ -68,22 +92,25 @@
// ---------------------------------------------------------------------------
// Typedefs (some useless under NT)
typedef unsigned int umode_t;
#ifndef __EMX__
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;
typedef unsigned int nlink_t;
#define INLINE
#define inline
#define OS2_NT 1
#define ENOTDIR -1
#endif /* not __EMX__ */
// ---------------------------------------------------------------------------
// File attributes
#define S_ISLNK(x) 0
#define S_ISBLK(m) 0 /* Some of these are not actual values*/
#define S_ISLNK(x) 0
#ifndef __EMX__
#define S_ISFIFO(x) 0
#define S_IFBLK 0010000 /* but don't worry, these are yet not possible on NT */
#define S_IFLNK 0010000
@ -124,15 +151,17 @@ typedef unsigned int nlink_t;
#define W_OK 2 /* Test for write permission */
#define X_OK 1 /* Test for execute permission */
#define F_OK 0 /* Test for existence of file */
#endif /* __EMX__ */
// ---------------------------------------------------------------------------
// Inline definitions
// Pipes
#ifndef __EMX__
#define popen _popen
#define pclose _pclose
#define pipe(p) _pipe(p, 4096, 0x8000 /*_O_BINARY*/)
#endif
#ifndef MAX_PATH
# define MAX_PATH 260

View File

@ -20,6 +20,7 @@
*/
#include <config.h>
#ifndef __os2__
#error This file is for OS/2 operating systems.
#else
@ -32,7 +33,6 @@
#define INCL_SUB
#define INCL_DOSERRORS
#include <config.h>
#include <os2.h>
#include "tty.h"

View File

@ -1,6 +1,9 @@
#define INCL_DOSFILEMGR
#define INCL_DOSERRORS
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -16,13 +16,13 @@
*/
#include <config.h>
#ifndef __os2__
#error This file is for the OS/2 operating systems.
#else
#define INCL_DOSDEVICES /* Device values */
#define INCL_DOSERRORS /* Error values */
#include <config.h>
#include <os2.h>
#include <stdio.h>
#include <stdlib.h>
@ -163,9 +163,9 @@ static void drive_cmd()
add_widgetl (drive_dlg,
button_new (5, (m_drv-i-1)*2+4 - (MAX_LGH*2 - nDrivesAvail) * 2,
B_DRIVE_BASE+((int) szTempBuf[0] - (int) 'A'),
HIDDEN_BUTTON,
szTempBuf,
szTempBuf[0],
0, NULL, NULL, NULL),
0, NULL, NULL),
XV_WLAY_RIGHTOF);
}
}
@ -176,11 +176,10 @@ static void drive_cmd()
button_new (3,
(m_drv-i-1)*2+4,
B_DRIVE_BASE+((int)szTempBuf[0] - (int) 'A'),
HIDDEN_BUTTON,
szTempBuf,
szTempBuf[0],
0,
NULL,
NULL,
NULL),
XV_WLAY_RIGHTOF);
}

View File

@ -19,6 +19,7 @@
*/
#include <config.h>
#ifndef __os2__
#error This file is for OS/2 systems.
#else
@ -31,7 +32,6 @@
#define INCL_DOSERRORS
#define INCL_WININPUT
#include <os2.h>
#include <config.h>
#include <stdio.h>
#include "mouse.h"
#include "global.h"
@ -240,7 +240,7 @@ int get_key_code (int no_delay)
if (no_delay) {
/* Check if any input pending, otherwise return */
nodelay (stdscr, TRUE);
inp_ch = SLsys_getkey_ndelay();
inp_ch = SLsys_input_pending();
if (inp_ch == 0) {
return 0;
} /* endif */
@ -364,7 +364,7 @@ extern int max_dirt_limit;
/* Also takes care of generated mouse events */
/* Returns 0 if it is a mouse event */
/* The current behavior is to block allways */
int get_event (Gpm_Event *event, int redo_event)
int get_event (Gpm_Event *event, int redo_event, int block)
{
int c;
@ -403,7 +403,7 @@ int mi_getch ()
Gpm_Event ev;
int key;
while ((key = get_event (&ev, 0)) == 0)
while ((key = get_event (&ev, 0, 1)) == 0)
;
return key;
}
@ -445,4 +445,7 @@ void learn_keys()
{
message (1, "Learn Keys", "Sorry, no learn keys on OS/2");
}
void init_key_input_fd (void)
{
}
#endif /* __os2__ */

View File

@ -1,4 +1,4 @@
/* Slang interface to the Midnight Commander for OS/2
/* 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.
@ -17,9 +17,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <config.h>
#include <stdio.h>
#include <os2.h>
#include "tty.h"
#include "mad.h"
#include "color.h"
@ -31,6 +30,47 @@
#ifdef HAVE_SLANG
/* {{{ Copied from ../slang/slgetkey.c, removed the DEC_8Bit_HACK, */
extern unsigned int SLang_Input_Buffer_Len;
extern unsigned char SLang_Input_Buffer [];
extern unsigned int SLsys_getkey (void);
extern int SLsys_input_pending (int);
static unsigned int SLang_getkey2 (void)
{
unsigned int imax;
unsigned int ch;
if (SLang_Input_Buffer_Len)
{
ch = (unsigned int) *SLang_Input_Buffer;
SLang_Input_Buffer_Len--;
imax = SLang_Input_Buffer_Len;
memcpy ((char *) SLang_Input_Buffer,
(char *) (SLang_Input_Buffer + 1), imax);
return(ch);
}
else return(SLsys_getkey ());
}
static int SLang_input_pending2 (int tsecs)
{
int n;
unsigned char c;
if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
n = SLsys_input_pending (tsecs);
if (n <= 0) return 0;
c = (unsigned char) SLang_getkey2 ();
SLang_ungetkey_string (&c, 1);
return n;
}
/* }}} */
//??
static void slang_sigterm ()
{
@ -41,7 +81,7 @@ static int slinterrupt;
void enable_interrupt_key(void)
{
// SLang_set_abort_signal(NULL);
SLang_set_abort_signal(NULL);
slinterrupt = 1;
}
void disable_interrupt_key(void)
@ -83,7 +123,7 @@ void slang_shutdown ()
{
slang_shell_mode ();
do_exit_ca_mode ();
// SLang_reset_tty ();
SLang_reset_tty ();
/* reset the colors to those that were
* active when the program was started up
@ -192,7 +232,11 @@ void load_terminfo_keys ()
int getch ()
{
return _getch();
if (no_slang_delay)
if (SLang_input_pending2 (0) == 0)
return -1;
return SLang_getkey2 ();
}
extern int slow_terminal;
@ -208,6 +252,7 @@ int got_interrupt ()
void mc_refresh (void)
{
/* if (!we_are_background) (no background mode yet) */
refresh ();
}

View File

@ -1,2 +1,7 @@
/* Nothing, just dummy */
/* Systems having sys/param.h should not include this file */
#ifdef HAVE_PARAM_H
#error Remove this file if you have real sys/param.h
#else
/* FIXME: We should warn, that this file should not be included */
#endif

View File

@ -33,10 +33,7 @@
#include <string.h>
#include <sys/types.h>
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <io.h>
@ -45,7 +42,6 @@
#include <limits.h> /* INT_MAX */
#include <sys/time.h> /* select: timeout */
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <process.h>
@ -366,12 +362,13 @@ char *tilde_expand (char *directory)
return strdup (directory);
}
#ifndef __EMX__
void
sleep(unsigned long dwMiliSecs)
{
DosSleep(dwMiliSecs);
}
#endif
/* Canonicalize path, and return a new path. Do everything in situ.
@ -690,6 +687,7 @@ geteuid(void)
return 0;
}
#ifndef __EMX__
char *
getcwd(char *buffer, int size)
{
@ -717,6 +715,7 @@ getcwd(char *buffer, int size)
return NULL;
} /* endif */
}
#endif
int
mc_chdir(char *pathname)
@ -762,7 +761,7 @@ conv_os2_unx_rc(int os2rc)
case ERROR_SHARING_VIOLATION:
case ERROR_SHARING_BUFFER_EXCEEDED:
case ERROR_ACCESS_DENIED:
errCode = EOS2ERR;
errCode = EACCES;
break;
case ERROR_INVALID_PARAMETER:
errCode = EINVAL;
@ -876,7 +875,7 @@ getpid (void)
int
errno_dir_not_empty (int err)
{
if (err == EACCESS)
if (err == ENOTEMPTY)
return 1;
return 0;
}
@ -891,3 +890,14 @@ get_mc_lib_dir ()
return mchome;
} /* endif */
}
int get_user_rights (struct stat *buf)
{
return 2;
}
void init_groups (void)
{
}
void delete_groups (void)
{
}