From 177bbf72624a04c19010a53ce6960371df9ffbdb Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 7 Mar 1998 20:34:15 +0000 Subject: [PATCH] .cvsignores for the Midnight Commander --- doc/.cvsignore | 4 + icons/.cvsignore | 1 + lib/.cvsignore | 2 + os2/.cvsignore | 0 os2/Makefile.EMX | 59 ++++++++++ os2/Makefile.OS2 | 149 ++++++++++++++++++++++++ os2/direct.h | 1 + slang/slos2tty.c | 261 +++++++++++++++++++++++++++++++++++++++++++ src/.cvsignore | 6 + vfs/.cvsignore | 2 + vfs/extfs/.cvsignore | 8 ++ 11 files changed, 493 insertions(+) create mode 100644 doc/.cvsignore create mode 100644 icons/.cvsignore create mode 100644 lib/.cvsignore create mode 100644 os2/.cvsignore create mode 100644 os2/Makefile.EMX create mode 100644 os2/Makefile.OS2 create mode 100644 os2/direct.h create mode 100644 slang/slos2tty.c create mode 100644 src/.cvsignore create mode 100644 vfs/.cvsignore create mode 100644 vfs/extfs/.cvsignore diff --git a/doc/.cvsignore b/doc/.cvsignore new file mode 100644 index 000000000..8e736bcd4 --- /dev/null +++ b/doc/.cvsignore @@ -0,0 +1,4 @@ +mc.1 +mcserv.8 +mcedit.1 +Makefile diff --git a/icons/.cvsignore b/icons/.cvsignore new file mode 100644 index 000000000..f3c7a7c5d --- /dev/null +++ b/icons/.cvsignore @@ -0,0 +1 @@ +Makefile diff --git a/lib/.cvsignore b/lib/.cvsignore new file mode 100644 index 000000000..295336055 --- /dev/null +++ b/lib/.cvsignore @@ -0,0 +1,2 @@ +Makefile +mc.ext diff --git a/os2/.cvsignore b/os2/.cvsignore new file mode 100644 index 000000000..e69de29bb diff --git a/os2/Makefile.EMX b/os2/Makefile.EMX new file mode 100644 index 000000000..47c86aa69 --- /dev/null +++ b/os2/Makefile.EMX @@ -0,0 +1,59 @@ +# Makefile.vc4 +# +# Midnight Commander for Win32 makefile +# for Microsoft Visual C++ 4.x +# +# Hacked by Dan Nicolaescu from Visual IDE mak +# Hacked by Pavel Roskin to make it work with cmd.exe from Windows NT4 +# 980206 hacked by Pavel Roskin to make it work with GNU make +# -------------------------------------------------------------------------- + +MC_LIBS= + +# ---- Path (case-sensitive!) is searched for executables +# If the command line contains quotes, it is passed to shell +# Errors are ignored in this case! +Path=d:/emx/bin +CC=gcc.exe +# Just comment RSC out if you have problems with resources +# RSC=rc.exe +LINK=gcc.exe +OBJ_SUFFIX=o +OBJ_PLACE=-o +RES_PLACE=-fo + +# ---- Compiler-specific optional stuff +MC_MISC_CFLAGS=-Zmt + +ifndef RELEASE +# ---- Debug build +OBJS_DIR=debug +EXTRA_MC_SRCS= +SPECIFIC_DEFINES= +SPECIFIC_MC_CFLAGS=-g -O0 $(MC_MISC_CFLAGS) +SPECIFIC_MC_LFLAGS_EXTRA= +SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS) +SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS) +RC_DEFINES=-D_DEBUG +else +# ---- Release build +OBJS_DIR=release +EXTRA_MC_SRCS= +SPECIFIC_DEFINES= +SPECIFIC_MC_CFLAGS=-O2 $(MC_MISC_CFLAGS) +SPECIFIC_MC_LFLAGS_EXTRA= +SPECIFIC_SLANG_CFLAGS=$(SPECIFIC_MC_CFLAGS) +SPECIFIC_MCEDIT_CFLAGS=$(SPECIFIC_MC_CFLAGS) +RC_DEFINES=-DRELEASE=$(RELEASE) +endif + +SPECIFIC_MC_LFLAGS= \ + -o $(OBJS_DIR)/mc.exe \ + $(SPECIFIC_MC_LFLAGS_EXTRA) + +# ---- Compiler independent defines +include Makefile.OS2 + +# ---- Linkers are very compiler-specific +$(OBJS_DIR)/mc.exe: $(MC_RES) $(OBJS) $(MCEDIT_OBJS) $(SLANG_OBJS) + $(LINK) -Zmt $(MC_LIBS) $(SPECIFIC_MC_LFLAGS) $+ diff --git a/os2/Makefile.OS2 b/os2/Makefile.OS2 new file mode 100644 index 000000000..cd70fd1c1 --- /dev/null +++ b/os2/Makefile.OS2 @@ -0,0 +1,149 @@ +# Makefile +# 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 +# +# This is the Makefile for Midnight Commander under OS/2. +# +# Supported Compilers: +# +# makefile.vc4: Microsoft Visual C++ 4.x +# ... + +# ---- Directories +MC_NT_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 + +# --- Midnight Defines +MC_DEFINES=$(SPECIFIC_DEFINES) -D_CONSOLE -DHAVE_CONFIG_H -DUSE_INTERNAL_EDIT +MC_INCLUDES=-I$(MC_SRC_DIR) -I$(MC_NT_DIR) -I$(SLANG_SRC_DIR) +SLANG_DEFINES=$(SPECIFIC_DEFINES) +SLANG_INCLUDES=-I$(MC_NT_DIR) -I$(SLANG_SRC_DIR) +MCEDIT_DEFINES=$(SPECIFIC_DEFINES) -D_CONSOLE -DHAVE_CONFIG_H +MCEDIT_INCLUDES=-I$(MC_NT_DIR) -I$(MC_SRC_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 +RSC_FLAGS=$(RES_PLACE)$(OBJS_DIR)/mc.res $(RC_DEFINES) + + + + +all: object-dirs mc +object-dirs: $(OBJS_DIR) $(SLANG_OBJS_DIR) $(MCEDIT_OBJS_DIR) + +mc: $(OBJS_DIR)/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_NT_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)$@ $< + +SRCS= $(EXTRA_MC_SRCS) \ + util.os2.c \ + terms.c \ + user.c \ + subshell.c \ + file.c \ + listmode.c \ + cmd.c \ + dirent.os2.c \ + command.c \ + help.c \ + menu.c \ + view.c \ + dir.c \ + info.c \ + widget.c \ + cons.handler.os2.c \ + option.c \ + dlg.c \ + panelize.c \ + profile.c \ + util.c \ + dialog.c \ + ext.c \ + color.c \ + drive.os2.c \ + key.os2.c \ + layout.c \ + setup.c \ + regex.c \ + hotlist.c \ + slint.os2.c \ + tree.c \ + win.c \ + chmod.os2.c \ + complete.c \ + find.c \ + wtools.c \ + boxes.c \ + background.c \ + dirhist.c \ + main.c \ + popt.c \ + mouse.c \ + text.c \ + screen.c + +SLANG_SRCS= \ + slos2tty.c \ + slerr.c \ + slgetkey.c \ + slsmg.c \ + slvideo.c + +MCEDIT_SRCS= \ + edit.c \ + editcmd.c \ + editdraw.c \ + editmenu.c \ + editoptions.c \ + editwidget.c \ + wordproc.c + + +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 +MC_RES=$(OBJS_DIR)/mc.res +else +MC_RES= +endif + +$(OBJS_DIR)/mc.res: $(MC_NT_DIR)/mc.rc $(MC_NT_DIR)/mc.ico $(MC_NT_DIR)/config.h ../VERSION + $(RSC) $(RSC_FLAGS) $(MC_NT_DIR)/mc.rc diff --git a/os2/direct.h b/os2/direct.h new file mode 100644 index 000000000..2997587d8 --- /dev/null +++ b/os2/direct.h @@ -0,0 +1 @@ +/* dummy */ diff --git a/slang/slos2tty.c b/slang/slos2tty.c new file mode 100644 index 000000000..e056fff3c --- /dev/null +++ b/slang/slos2tty.c @@ -0,0 +1,261 @@ +/* Copyright (c) 1992, 1995 John E. Davis + * All rights reserved. + * + * You may distribute under the terms of either the GNU General Public + * License or the Perl Artistic License. + */ + +#include "config.h" + +#include + +#include "slang.h" +#include "_slang.h" + +#define INCL_BASE +#define INCL_NOPM +#define INCL_VIO +#define INCL_KBD +#define INCL_DOS +#if 0 +# define INCL_DOSSEMAPHORES +#endif +#ifdef LONG +#undef LONG +#endif +#ifdef VOID +#undef VOID +#endif +#include + +#include +#include + +KBDINFO initialKbdInfo; /* keyboard info */ + +/* Code to read keystrokes in a separate thread */ + +typedef struct kbdcodes { + UCHAR ascii; + UCHAR scan; +/* USHORT shift; */ +} KBDCODES; + +#define BUFFER_LEN 4096 +static KBDCODES threadKeys[BUFFER_LEN]; +static int atEnd = 0; +static int startBuf; +static int endBuf; + +/* Original code used semaphores to control access to threadKeys. + * It is expected that the semaphore code will be deleted after 0.97. +*/ +#if 0 + +#ifdef __os2_16__ + +typedef USHORT APIRET; +static HSEM Hmtx; + +#define DosRequestMutexSem(hmtx,timeout) DosSemRequest(hmtx,timeout) +#define DosReleaseMutexSem(hmtx) DosSemClear(hmtx) +#define DosCloseMutexSem(hmtx) DosCloseSem(hmtx) + +#else /* !defined(__os2_16__) */ + +static HMTX Hmtx; /* Mutex Semaphore */ + +#endif + + +static APIRET CreateSem(void) +{ +#ifdef __os2_16__ + char SemName[32]; + sprintf(SemName, "\\SEM\\jed\\%u", getpid()); + return ( DosCreateSem (0, &Hmtx, SemName) ); +#else + return ( DosCreateMutexSem (NULL, &Hmtx, 0, 0) ); +#endif +} + +static APIRET RequestSem(void) +{ + return ( DosRequestMutexSem (Hmtx, -1) ); +} + +static APIRET ReleaseSem(void) +{ + return ( DosReleaseMutexSem (Hmtx) ); +} + +static APIRET CloseSem(void) +{ + return( DosCloseMutexSem (Hmtx) ); +} + +#else + +#define CreateSem() +#define RequestSem() +#define ReleaseSem() +#define CloseSem() + +#endif + + +static void set_kbd(void) +{ + KBDINFO kbdInfo; + + kbdInfo = initialKbdInfo; + kbdInfo.fsMask &= ~0x0001; /* not echo on */ + kbdInfo.fsMask |= 0x0002; /* echo off */ + kbdInfo.fsMask &= ~0x0008; /* cooked mode off */ + kbdInfo.fsMask |= 0x0004; /* raw mode */ + kbdInfo.fsMask &= ~0x0100; /* shift report off */ + KbdSetStatus(&kbdInfo, 0); +} + +static void thread_getkey () +{ + KBDKEYINFO keyInfo; + int n; + + while (!atEnd) { /* at end is a flag */ + set_kbd(); + KbdCharIn(&keyInfo, IO_NOWAIT, 0); /* get a character */ + if (keyInfo.fbStatus & 0x040) { /* found a char process it */ + if (keyInfo.chChar == SLang_Abort_Char) { + if (SLang_Ignore_User_Abort == 0) SLang_Error = USER_BREAK; + SLKeyBoard_Quit = 1; + } + n = (endBuf + 1) % BUFFER_LEN; + if (n == startBuf) { + DosBeep (500, 20); + KbdFlushBuffer(0); + continue; + } + RequestSem(); + threadKeys [n].ascii = keyInfo.chChar; + threadKeys [n].scan = keyInfo.chScan; +/* threadKeys [n].shift = keyInfo.fsState; */ + endBuf = n; + ReleaseSem(); + } else /* no char available*/ + DosSleep (20); + } +} + +static void thread_code (void *Args) +{ + (void) Args; + startBuf = -1; /* initialize the buffer pointers */ + endBuf = -1; + thread_getkey (); + atEnd = 0; /* reset the flag */ + _endthread(); +} + + +/* The code below is in the main thread */ + +int SLang_init_tty(int abort_char, int dum2, int dum3) +{ + VIOCURSORINFO cursorInfo, OldcursorInfo; + + (void) dum2; (void) dum3; + if (abort_char == -1) abort_char = 3; /* ^C */ + SLang_Abort_Char = abort_char; + + /* set ^C off */ + signal (SIGINT, SIG_IGN); + signal (SIGBREAK, SIG_IGN); + + /* set up the keyboard */ + + initialKbdInfo.cb = sizeof(initialKbdInfo); + KbdGetStatus(&initialKbdInfo, 0); + set_kbd(); + + /* open a semaphore */ + CreateSem(); + + /* start a separate thread to read the keyboard */ +#if defined(__BORLANDC__) + _beginthread (thread_code, 8096, NULL); +#else + _beginthread (thread_code, NULL, 8096, NULL); +#endif + + VioGetCurType (&OldcursorInfo, 0); + cursorInfo.yStart = 1; + cursorInfo.cEnd = 15; + cursorInfo.cx = 1; + cursorInfo.attr = 1; + if (VioSetCurType (&cursorInfo, 0)) + VioSetCurType (&OldcursorInfo, 0); /* reset to previous value */ + + return 0; +} + +void SLang_reset_tty (void) +{ + atEnd = 1; /* set flag and wait until thread ends */ + while (atEnd) {DosSleep (0);} + + CloseSem(); + + /* close the keyboard */ + KbdSetStatus(&initialKbdInfo, 0); /* restore original state */ +} + +#define keyWaiting() (endBuf != startBuf) + +/* sleep for *tsecs tenths of a sec waiting for input */ + +int SLsys_input_pending(int tsecs) +{ + int count = tsecs * 5; + + if (count) + { + while(count > 0) + { + DosSleep(20); /* 20 ms or 1/50 sec */ + if (keyWaiting ()) break; + count--; + } + return(count); + } + else return(keyWaiting ()); +} + +unsigned int SLsys_getkey () +{ + unsigned int c; + unsigned char scan; + + int tsecs = 300; + + if (!keyWaiting()) + while (!SLsys_input_pending(tsecs)); + + /* read codes from buffer */ + RequestSem(); + startBuf = (startBuf + 1) % BUFFER_LEN; + c = threadKeys [startBuf].ascii; + scan = threadKeys [startBuf].scan; + ReleaseSem(); + + if ((c == 8) && (scan == 0x0e)) c = 127; + if (c == 0xE0) c = 0; + if (c == 0) SLang_ungetkey (scan); + return (c); +} + + +void SLang_set_abort_signal (void (*dum)(int)) +{ + (void) dum; +} diff --git a/src/.cvsignore b/src/.cvsignore new file mode 100644 index 000000000..f298517be --- /dev/null +++ b/src/.cvsignore @@ -0,0 +1,6 @@ +cons.saver +mcmft +mcmfmt +mfmt +mc +Makefile diff --git a/vfs/.cvsignore b/vfs/.cvsignore new file mode 100644 index 000000000..a495927d4 --- /dev/null +++ b/vfs/.cvsignore @@ -0,0 +1,2 @@ +mcserv +Makefile diff --git a/vfs/extfs/.cvsignore b/vfs/extfs/.cvsignore new file mode 100644 index 000000000..9f231e8d3 --- /dev/null +++ b/vfs/extfs/.cvsignore @@ -0,0 +1,8 @@ +rar +deb +cpio +lha +lslR +zoo +zip +ftplist