summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/windows-NT
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/cvs/windows-NT')
-rw-r--r--gnu/usr.bin/cvs/windows-NT/ChangeLog33
-rw-r--r--gnu/usr.bin/cvs/windows-NT/Makefile.in5
-rw-r--r--gnu/usr.bin/cvs/windows-NT/README14
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore3
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog52
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in39
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/README.txt66
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/SCC.mak216
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/scc.c486
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/scc.def25
-rw-r--r--gnu/usr.bin/cvs/windows-NT/config.h13
-rw-r--r--gnu/usr.bin/cvs/windows-NT/filesubr.c40
-rw-r--r--gnu/usr.bin/cvs/windows-NT/options.h11
13 files changed, 961 insertions, 42 deletions
diff --git a/gnu/usr.bin/cvs/windows-NT/ChangeLog b/gnu/usr.bin/cvs/windows-NT/ChangeLog
index c902c92c76f..3ec249be90d 100644
--- a/gnu/usr.bin/cvs/windows-NT/ChangeLog
+++ b/gnu/usr.bin/cvs/windows-NT/ChangeLog
@@ -1,3 +1,36 @@
+13 Mar 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * filesubr.c (get_homedir): Allocate pathbuf; removes arbitrary
+ limit.
+
+Wed Mar 12 16:10:01 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * filesubr.c (get_homedir): Expand comment about HOME
+ vs. HOMEDRIVE/HOMEPATH.
+
+ * config.h (HAVE_SETVBUF): Removed; no longer used.
+
+Thu Mar 6 19:46:53 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README: tab stop setting apparently was under "Editor" in Visual
+ C++ 2.x but it is under "Tabs" in Visual C++ 4.x.
+ List number of warnings for regex.c (103, which is actually down
+ from 121 prior to the change I just made to regex.c).
+
+Sat Feb 15 15:27:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * Makefile.in (dist-dir): Also handle SUBDIRS.
+ (SUBDIRS): New variable.
+
+Wed Jan 29 18:28:17 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * config.h, options.h (GREP): Remove; no longer used.
+
+Tue Jan 28 18:29:03 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * config.h: Remove SIZEOF_INT and SIZEOF_LONG; no longer needed
+ with lib/md5.c changes.
+
1997-01-08 Jim Kingdon
* filesubr.c (expand_wild): If we just find a file (that
diff --git a/gnu/usr.bin/cvs/windows-NT/Makefile.in b/gnu/usr.bin/cvs/windows-NT/Makefile.in
index 76d7760c59f..1798db912ee 100644
--- a/gnu/usr.bin/cvs/windows-NT/Makefile.in
+++ b/gnu/usr.bin/cvs/windows-NT/Makefile.in
@@ -33,6 +33,8 @@ SOURCES = \
DISTFILES = ${HEADERS} ${SOURCES} \
README ChangeLog Makefile.in .cvsignore
+SUBDIRS=SCC
+
all:
.PHONY: all install uninstall
@@ -63,6 +65,9 @@ dist-dir:
for i in ${DISTFILES}; do \
ln $(srcdir)/$${i} ${DISTDIR}; \
done
+ for i in ${SUBDIRS}; do \
+ cd $${i}; ${MAKE} dist-dir DISTDIR="../${DISTDIR}/$${i}"; \
+ done
clean:
@echo make clean does nothing in windows-NT subdir
diff --git a/gnu/usr.bin/cvs/windows-NT/README b/gnu/usr.bin/cvs/windows-NT/README
index b86a28601d4..f4115e9f7d2 100644
--- a/gnu/usr.bin/cvs/windows-NT/README
+++ b/gnu/usr.bin/cvs/windows-NT/README
@@ -77,17 +77,19 @@ Here are some other things which may be of interest for unix junkies:
http://www.halcyon.com/gvr/vim/ (VI clone)
ftp://wuarchive.wustl.edu/systems/ibmpc/gnuish/less177.zip
+If you want to browse/edit the sources using Visual C++, we recommend
+setting tab stops to 8 spaces, since that is what the CVS sources
+expect. The tab stop setting is in the "Editor" or "Tabs" section of
+the "Options..." dialog which is in the "Tools..." menu.
+
The following harmless warnings are known:
-- regex.c: These are signed/unsigned comparison conflicts. I am not
- going to *touch* this code. :-) I got my fill of it when I was
+- regex.c: 103 warnings, mostly signed/unsigned comparison conflicts.
+ I am not going to *touch* this code. :-) I got my fill of it when I was
hacking GNU Emacs.
+
.\lib\getdate.c(760) : warning C4013: 'getdate_yyparse' undefined; assuming extern returning int
.\lib\getdate.c(1612) : warning C4102: 'yyerrlab' : unreferenced label
.\lib\getdate.c(1612) : warning C4102: 'yynewstate' : unreferenced label
-If you want to browse/edit the sources using Visual C++, we recommend
-setting tab stops to 8 spaces, since that is what the CVS sources
-expect. The tab stop setting is in the "Editor" section of the "Options..."
-dialog which is in the "Tools..." menu.
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore b/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore
new file mode 100644
index 00000000000..fa65c0961ea
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore
@@ -0,0 +1,3 @@
+SCC.mdp
+SCC.ncb
+Debug
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
new file mode 100644
index 00000000000..5b3ca835f1e
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
@@ -0,0 +1,52 @@
+14 Mar 1997 Jim Kingdon
+
+ * scc.c: Go back to using debuglog not outproc for
+ most debugging messages. Developer Studio tends to
+ erase the outproc messages on an error.
+ More playing around with projects.
+ * README.txt: Describe results of this. I am making
+ grey (source controlled) file icons appear, which is
+ exciting.
+
+4 Mar 1997 Jim Kingdon
+
+ Still some distance from being able to open a
+ project, but that's what I'm playing with:
+ * scc.c (SccOpenProject): Use outproc not debuglog
+ for debugging messages.
+ (SccGet): Add debugging messages.
+ (SccAddFromScc): Implemented.
+ (SccInitialize): Return AddFromScc in capabilities.
+ * scc.c: Change out_proc to outproc for consistency.
+
+2 Mar 1997 Jim Kingdon
+
+ * scc.c: Add a bunch of things, to SccOpenProject,
+ SccGetProjPath, and perhaps elsewhere. The project
+ stuff doesn't really work yet, but the outproc does.
+
+27 Feb 1997 Jim Kingdon
+
+ * scc.c (SCC_max_init_path, SCC_max_name): Added.
+ (SccInitialize): Set and use more arguments.
+ (SccUninitialize): Might want to check ferror here.
+ (SccOpenProject): Print to debug log if we get here.
+
+Thu Feb 27 19:02:50 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt (TOOLS IMPLEMENTING THE SCC): New section.
+
+Wed Feb 26 22:55:43 1997 David H. Hovemeyer <Hovemeyer_D@mediasoft.net>
+ and Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * scc.c (SccGetVersion): Return the version number of the SCC
+ spec; we don't get to pick what to return here.
+ * README.txt: Update with current status.
+
+Sat Feb 15 15:19:41 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * Makefile.in: New file.
+
+ * README.txt: Clarify a little more what this stuff does (and more
+ the point, does not) do.
+
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
new file mode 100644
index 00000000000..9b1f59428a1
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
@@ -0,0 +1,39 @@
+# Makefile for distributing files. Note that it only has a dist-dir
+# target, so other targets should not recurse into this directory.
+# This makefile is in the public domain.
+
+#### Start of system configuration section. ####
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+# Just in case...
+SHELL = /bin/sh
+@SET_MAKE@
+
+DISTFILES = \
+ .cvsignore ChangeLog Makefile.in README.txt \
+ SCC.mak scc.c scc.def
+
+all:
+.PHONY: all
+
+dist-dir: ${DISTFILES}
+ mkdir ${DISTDIR}
+ for i in ${DISTFILES}; do \
+ ln $(srcdir)/$${i} ${DISTDIR}; \
+ done
+.PHONY: dist-dir
+
+subdir = windows-NT/SCC
+Makefile: ../../config.status Makefile.in
+ cd ../.. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
+
+# CYGNUS LOCAL: don't depend on auto-re-config
+#../config.status: ../configure
+# cd .. ; $(SHELL) config.status --recheck
+
+# CYGNUS LOCAL: don't depend on auto-re-config
+#../configure: ../configure.in
+# cd $(top_srcdir) ; autoconf
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/README.txt b/gnu/usr.bin/cvs/windows-NT/SCC/README.txt
new file mode 100644
index 00000000000..bc8cc76c6c3
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/README.txt
@@ -0,0 +1,66 @@
+This is an experimental attempt to interface to the SCC API.
+
+Note that this code doesn't (yet) do anything useful; this file
+is currently for people who want to help hack on our SCC interface,
+not people who want to use it.
+
+To install it, build scc.dll and then add the following
+to the registry using the registry editor:
+
+key/value what to put there
+HKEY_LOCAL_MACHINE
+ SOFTWARE
+ CVS
+ CVS
+ SCCServerName Concurrent Versions System
+ SCCServerPath <full pathname of scc.dll>
+ SourceCodeControlProvider
+ ProviderRegKey "SOFTWARE\CVS\CVS"
+ InstalledSCCProviders
+ Concurrent Versions System "SOFTWARE\CVS\CVS"
+
+Note that ProviderRegKey is the default source control
+system, and InstalledSCCProviders list _all_ installed
+source control systems. A development environment is allowed
+to use either or both, so you should set both of them.
+
+Note also that we are using "CVS" as the supplier of CVS.
+CVS is not owned by any one company, so CVS seems like the
+most appropriate string to put there.
+
+If you do this right, then "Source Control" should appear
+under the "Tools" menu.
+
+NOW WHAT?
+
+Well, I haven't yet figured out _all_ the different ways
+that projects work at the SCC level. But here is what I
+have done which has worked. SPECIAL NOTE: many paths are
+hardcoded in scc.c, so you will need to fix that or put
+things the same place I did. As you try the following you
+will want to follow along in d:\debug.scc.
+
+* Create a dummy project in d:\sccwork.
+* On the Tools/Source Control menu, select "Share from CVS..."
+* This will cause SccAddFromScc to be called, which will
+ claim there are two files, foo.c and bar.c, which should
+ appear as source controlled (grey) files in the file
+ listing.
+* Now select one of the files and pick "Get Latest Version..."
+ from Tools/Source Control. You'll get a cheezy dialog (we
+ need to see why it is cheezy--by that I mean the size and
+ placement are funny), and if you say OK, then SccGet will
+ get called (which doesn't currently do anything).
+
+TOOLS IMPLEMENTING THE SCC
+
+I'm not sure whether we'll want to try to make this a comprehensive
+list, but at least for the moment it seems worthwhile to list a few of
+the programs which implement the Integrated Development Environment
+(IDE) side of the SCC. Some of this information is based on rumor or,
+worse yet, usenet posting, so it probably should be verified before
+relying on it.
+
+* Microsoft Developer Studio 4.x Professional (not Standard, not 2.x)
+* Powersoft's Optima++
+* CodeWright editor
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/SCC.mak b/gnu/usr.bin/cvs/windows-NT/SCC/SCC.mak
new file mode 100644
index 00000000000..ef4da647699
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/SCC.mak
@@ -0,0 +1,216 @@
+# Microsoft Developer Studio Generated NMAKE File, Format Version 40001
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+!IF "$(CFG)" == ""
+CFG=SCC - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to SCC - Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "SCC - Win32 Release" && "$(CFG)" != "SCC - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE on this makefile
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SCC.mak" CFG="SCC - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SCC - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "SCC - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+################################################################################
+# Begin Project
+# PROP Target_Last_Scanned "SCC - Win32 Debug"
+CPP=cl.exe
+RSC=rc.exe
+MTL=mktyplib.exe
+
+!IF "$(CFG)" == "SCC - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+OUTDIR=.\Release
+INTDIR=.\Release
+
+ALL : "$(OUTDIR)\SCC.dll"
+
+CLEAN :
+ -@erase ".\Release\SCC.dll"
+ -@erase ".\Release\scc.obj"
+ -@erase ".\Release\SCC.lib"
+ -@erase ".\Release\SCC.exp"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
+CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
+ /Fp"$(INTDIR)/SCC.pch" /YX /Fo"$(INTDIR)/" /c
+CPP_OBJS=.\Release/
+CPP_SBRS=
+# ADD BASE MTL /nologo /D "NDEBUG" /win32
+# ADD MTL /nologo /D "NDEBUG" /win32
+MTL_PROJ=/nologo /D "NDEBUG" /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/SCC.bsc"
+BSC32_SBRS=
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
+ /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)/SCC.pdb" /machine:I386\
+ /def:".\scc.def" /out:"$(OUTDIR)/SCC.dll" /implib:"$(OUTDIR)/SCC.lib"
+DEF_FILE= \
+ ".\scc.def"
+LINK32_OBJS= \
+ "$(INTDIR)/scc.obj"
+
+"$(OUTDIR)\SCC.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ELSEIF "$(CFG)" == "SCC - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+OUTDIR=.\Debug
+INTDIR=.\Debug
+
+ALL : "$(OUTDIR)\SCC.dll"
+
+CLEAN :
+ -@erase ".\Debug\vc40.pdb"
+ -@erase ".\Debug\vc40.idb"
+ -@erase ".\Debug\SCC.dll"
+ -@erase ".\Debug\scc.obj"
+ -@erase ".\Debug\SCC.ilk"
+ -@erase ".\Debug\SCC.lib"
+ -@erase ".\Debug\SCC.exp"
+ -@erase ".\Debug\SCC.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
+CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\
+ /Fp"$(INTDIR)/SCC.pch" /YX /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c
+CPP_OBJS=.\Debug/
+CPP_SBRS=
+# ADD BASE MTL /nologo /D "_DEBUG" /win32
+# ADD MTL /nologo /D "_DEBUG" /win32
+MTL_PROJ=/nologo /D "_DEBUG" /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+BSC32_FLAGS=/nologo /o"$(OUTDIR)/SCC.bsc"
+BSC32_SBRS=
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\
+ /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)/SCC.pdb" /debug\
+ /machine:I386 /def:".\scc.def" /out:"$(OUTDIR)/SCC.dll"\
+ /implib:"$(OUTDIR)/SCC.lib"
+DEF_FILE= \
+ ".\scc.def"
+LINK32_OBJS= \
+ "$(INTDIR)/scc.obj"
+
+"$(OUTDIR)\SCC.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+!ENDIF
+
+.c{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_OBJS)}.obj:
+ $(CPP) $(CPP_PROJ) $<
+
+.c{$(CPP_SBRS)}.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+.cpp{$(CPP_SBRS)}.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+.cxx{$(CPP_SBRS)}.sbr:
+ $(CPP) $(CPP_PROJ) $<
+
+################################################################################
+# Begin Target
+
+# Name "SCC - Win32 Release"
+# Name "SCC - Win32 Debug"
+
+!IF "$(CFG)" == "SCC - Win32 Release"
+
+!ELSEIF "$(CFG)" == "SCC - Win32 Debug"
+
+!ENDIF
+
+################################################################################
+# Begin Source File
+
+SOURCE=.\scc.c
+
+"$(INTDIR)\scc.obj" : $(SOURCE) "$(INTDIR)"
+
+
+# End Source File
+################################################################################
+# Begin Source File
+
+SOURCE=.\scc.def
+
+!IF "$(CFG)" == "SCC - Win32 Release"
+
+!ELSEIF "$(CFG)" == "SCC - Win32 Debug"
+
+!ENDIF
+
+# End Source File
+# End Target
+# End Project
+################################################################################
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/scc.c b/gnu/usr.bin/cvs/windows-NT/SCC/scc.c
new file mode 100644
index 00000000000..6815208f357
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/scc.c
@@ -0,0 +1,486 @@
+/* This file was written by Jim Kingdon, and is hereby placed
+ in the public domain. */
+
+#include <Wtypes.h>
+#include <stdio.h>
+#include <direct.h> /* For chdir */
+
+
+/* Bits of the interface.
+ For paranoia's sake, I'm not using the same names as Microsoft.
+ I don't imagine copying a few names could be a credible copyright
+ case, but it seems safer to stick to only what is necessary for
+ the interface to work. */
+typedef long SCC_return;
+#define SCC_return_success 0
+#define SCC_return_unknown_project -2
+#define SCC_return_not_supported -14
+#define SCC_return_non_specific_error -15
+enum SCC_command
+{
+ SCC_command_get,
+ SCC_command_checkout,
+ SCC_command_checkin,
+ SCC_command_uncheckout,
+ SCC_command_add,
+ SCC_command_remove,
+ SCC_command_diff,
+ SCC_command_history,
+ SCC_command_rename,
+ SCC_command_properties,
+ SCC_command_options
+};
+
+/* Outproc codes, for second argument to outproc. */
+#define SCC_outproc_info 1
+#define SCC_outproc_warning 2
+#define SCC_outproc_error 3
+typedef long (*SCC_outproc) (char *, long);
+
+typedef BOOL (*SCC_popul_proc) (LPVOID callerdat, BOOL add_keep,
+ LONG status, LPCSTR file);
+
+/* Maximum sizes of various strings. These are arbitrary limits
+ which are imposed by the SCC. */
+/* Name argument to SccInitialize. */
+#define SCC_max_name 31
+/* Path argument to SccInitialize. */
+#define SCC_max_init_path 31
+/* Various paths many places in the interface. */
+#include <stdlib.h>
+#define SCC_max_path _MAX_PATH
+
+/* Bits to set in the caps used by SccInitialize. */
+#define SCC_cap_GetProjPath 0x200L
+#define SCC_cap_AddFromScc 0x400L
+#define SCC_cap_want_outproc 0x8000L
+
+/* Flags for SccGet. */
+#define SCC_RECURSE 2L
+/* This means to get all the files in a directory. */
+#define SCC_DIR 1L
+
+
+/* We get to put whatever we want here, and the caller will pass it
+ to us, so we don't need any global variables. */
+struct context {
+ FILE *debuglog;
+ /* Value of the CVSROOT we are currently working with (that is, the
+ "open project" in SCC terminology), malloc'd, or NULL if there is
+ no project currently open. */
+ char *root;
+ /* Local directory (working directory in CVS parlance). */
+ char *local;
+ SCC_outproc outproc;
+};
+
+#include <windows.h>
+
+/* Report a malloc error and return the SCC_return_* value which the
+ caller should return to the IDE. Probably this should be getting
+ the window argument too, but for the moment we don't need it.
+ Note that we only use this for errors which occur after the
+ context->outproc is set up. */
+SCC_return
+malloc_error (struct context *context)
+{
+ (*context->outproc) ("Out of memory\n", SCC_outproc_error);
+ return SCC_return_non_specific_error;
+}
+
+/* Return the version of the SCC spec, major version in the high word,
+ minor version in the low word. */
+LONG
+SccGetVersion ()
+{
+ /* We implement version 1.1 of the spec. */
+ return 0x10001;
+}
+
+SCC_return
+SccInitialize (void **contextp, HWND window, LPSTR caller, LPSTR name,
+ LPLONG caps, LPSTR path, LPDWORD co_comment_len,
+ LPDWORD comment_len)
+{
+ struct context *context;
+ FILE *fp;
+ fp = fopen ("d:\\debug.scc", "w");
+ if (fp == NULL)
+ /* Do what? Return some error value? */
+ abort ();
+ context = malloc (sizeof (struct context));
+ if (context == NULL)
+ {
+ fprintf (fp, "Out of memory\n");
+ fclose (fp);
+ /* Do what? Return some error? */
+ abort ();
+ }
+ context->debuglog = fp;
+ context->root = NULL;
+ *contextp = context;
+ fprintf (fp, "Made it into SccInitialize!\n");
+ *caps = (SCC_cap_GetProjPath
+ | SCC_cap_AddFromScc
+ | SCC_cap_want_outproc);
+
+ /* I think maybe this should have some more CVS-like
+ name, like "CVS Root", if we decide that is what
+ a SCC "project" is. */
+ strncpy (path, "CVS Project:", SCC_max_init_path);
+ fprintf (fp, "Caller name is %s\n", caller);
+ strncpy (name, "CVS", SCC_max_name);
+ /* CVS has no limit on comment length. But I suppose
+ we need to return a value which is small enough for
+ a caller to allocate a buffer this big. Not that I
+ would write a caller that way, but..... */
+ *co_comment_len = 8192;
+ *comment_len = 8192;
+ fflush (fp);
+ return SCC_return_success;
+}
+
+SCC_return
+SccUninitialize (void *context_arg)
+{
+ struct context *context = (struct context *)context_arg;
+ if (ferror (context->debuglog))
+ /* FIXME: return error value... */
+ if (fclose (context->debuglog) == EOF)
+ /* FIXME: return error value, I think. */
+ ;
+ free (context);
+ return SCC_return_success;
+}
+
+SCC_return
+SccOpenProject (void *context_arg, HWND window, LPSTR user,
+ LPSTR project, LPSTR local_proj, LPSTR aux_proj,
+ LPSTR comment, SCC_outproc outproc, LONG flags)
+{
+ struct context *context = (struct context *)context_arg;
+
+ /* This can happen if the IDE opens a project which is not under
+ CVS control. I'm not sure whether checking for aux_proj
+ being "" is the right way to detect this case, but it seems
+ it should work because I think that the source code control
+ system is what has control over the contents of aux_proj. */
+ if (aux_proj[0] == '\0')
+ return SCC_return_unknown_project;
+
+ context->root = malloc (strlen (aux_proj) + 5);
+ if (context->root == NULL)
+ return SCC_return_non_specific_error;
+ strcpy (context->root, aux_proj);
+ /* Since we don't yet support creating projects, we don't
+ do anything with flags. */
+
+ if (outproc == 0)
+ {
+ /* This supposedly can happen if the IDE chooses not to implement
+ the outproc feature. */
+ fprintf (context->debuglog, "Uh oh. outproc is a null pointer\n");
+ context->root = NULL;
+ fflush (context->debuglog);
+ return SCC_return_non_specific_error;
+ }
+ context->outproc = outproc;
+
+ fprintf (context->debuglog, "SccOpenProject (aux_proj=%s)\n", aux_proj);
+
+ context->local = malloc (strlen (local_proj) + 5);
+ if (context->local == NULL)
+ return malloc_error (context);
+ strcpy (context->local, local_proj);
+
+ fflush (context->debuglog);
+ return SCC_return_success;
+}
+
+SCC_return
+SccCloseProject (void *context_arg)
+{
+ struct context *context = (struct context *)context_arg;
+ fprintf (context->debuglog, "SccCloseProject\n");
+ fflush (context->debuglog);
+ if (context->root != NULL)
+ free (context->root);
+ context->root = NULL;
+ return SCC_return_success;
+}
+
+/* cvs get. */
+SCC_return
+SccGet (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LONG options, void *prov_options)
+{
+ struct context *context = (struct context *)context_arg;
+ int i;
+ char *fname;
+
+ fprintf (context->debuglog, "SccGet: %d; files:", num_files);
+#if 1
+ for (i = 0; i < num_files; ++i)
+ {
+ fprintf (context->debuglog, "%s ", file_names[i]);
+ }
+#endif
+ fprintf (context->debuglog, "\n");
+ if (options & SCC_DIR)
+ fprintf (context->debuglog, " Get all\n");
+ /* Should be using this flag to set -R vs. -l. */
+ if (options & SCC_RECURSE)
+ fprintf (context->debuglog, " recurse\n");
+
+ for (i = 0; i < num_files; ++i)
+ {
+ FILE *fp;
+
+ /* As with all file names passed to us by the SCC, these
+ file names are absolute pathnames. I think they will
+ tend to be paths within context->local, although I
+ don't know whether there are any exceptions to that. */
+ fname = file_names[i];
+ fprintf (context->debuglog, "%s ", fname);
+#if 0
+ fp = fopen (fname, "w");
+#endif
+ }
+ fprintf (context->debuglog, "\nExiting SccGet\n");
+ fflush (context->debuglog);
+ return SCC_return_success;
+}
+
+/* cvs edit. */
+SCC_return
+SccCheckout (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LPSTR comment, LONG options,
+ void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs ci. */
+SCC_return
+SccCheckin (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LPSTR comment, LONG options,
+ void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs unedit. */
+SCC_return
+SccUncheckout (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LONG options, void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs add + cvs ci, more or less, I think (but see also
+ the "keep checked out" flag in options). */
+SCC_return
+SccAdd (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LPSTR comment, LONG *options,
+ void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs rm -f + cvs ci, I think. Should barf if SCC_REMOVE_KEEP
+ (or maybe just put the file there, as if the user had removed
+ it and then done a "copy <saved-file> <filename>". */
+SCC_return
+SccRemove (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names, LPSTR comment, LONG options,
+ void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* mv, cvs add, cvs rm, and cvs ci, I think. */
+SCC_return
+SccRename (void *context_arg, HWND window, LPSTR old_name,
+ LPSTR new_name)
+{
+ return SCC_return_not_supported;
+}
+
+/* If "contents flag", then implement this ourself. For no
+ args or checksum (which we fall back to full compare) basically a
+ call to No_Diff or ? in the client case. For timestamp, just a
+ Classify_File. Now, if contents not set, then want to do a
+ cvs diff, and preferably start up WinDiff or something (to be
+ determined, for now perhaps could just shove in the text). */
+SCC_return
+SccDiff (void *context_arg, HWND window, LPSTR file_name,
+ LONG options, void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs log, I presume. If we want to get fancier we could bring
+ up a screen more analogous to the tkCVS log window, let the user
+ do "cvs update -r", etc. */
+SCC_return
+SccHistory (void *context_arg, HWND window, LONG num_files,
+ LPSTR file_names, LONG options, void *prov_options)
+{
+ return SCC_return_not_supported;
+}
+
+/* cvs status, presumably. */
+SCC_return
+SccProperties (void *context_arg, HWND window, LPSTR file_name)
+{
+ return SCC_return_not_supported;
+}
+
+/* Not sure what this should do. The most obvious thing is some
+ kind of front-end to "cvs admin" but I'm not actually sure that
+ is the most useful thing. */
+SCC_return
+SccRunScc (void *context_arg, HWND window, LONG num_files,
+ LPSTR *file_names)
+{
+ return SCC_return_not_supported;
+}
+
+/* Lots of things that we could do here. Options to get/update
+ such as -r -D -k etc. just for starters. */
+SCC_return
+SccGetCommandOptions (void *context_arg, HWND window,
+ enum SCC_command command,
+ void **prov_optionsp)
+{
+ return SCC_return_not_supported;
+}
+
+/* Not existing CVS functionality, I don't think.
+ Need to be able to tell user about what files
+ are out there without actually getting them. */
+SCC_return
+SccPopulateList (void *context_arg, enum SCC_command command,
+ LONG num_files,
+ LPSTR *file_names, SCC_popul_proc populate,
+ void *callerdat, LONG options)
+{
+ return SCC_return_success;
+}
+
+/* cvs status, sort of. */
+SCC_return
+SccQueryInfo (void *context_arg, LONG num_files, LPSTR *file_names,
+ LPLONG status)
+{
+ return SCC_return_not_supported;
+}
+
+SCC_return
+SccGetEvents (void *context_arg, LPSTR file_name, LPLONG status,
+ LPLONG events_remaining)
+{
+ /* They say this is supposed to only return cached status
+ information, not go to disk or anything. OK, although I
+ haven't really figured out what calls would cause us to
+ cache status without returning it then. */
+ return SCC_return_success;
+}
+
+/* This is where the user gives us the CVSROOT. */
+SCC_return
+SccGetProjPath (void *context_arg, HWND window, LPSTR user,
+ LPSTR proj_name, LPSTR local_proj, LPSTR aux_proj,
+ BOOL allow_change, BOOL *new)
+{
+ /* For now we just hardcode the CVSROOT. In the future we will
+ of course prompt the user for it (simple implementation would
+ have them supply a string; potentially better implementation
+ would have menus or something for access methods and so on,
+ although it might also have a way of bypassing that in case
+ CVS supports new features that the GUI code doesn't
+ understand). We probably will also at some point want a
+ "project" to encompass both a CVSROOT and a directory or
+ module name within that CVSROOT, but we don't try to handle
+ that yet either. We also will want to be able to use "user"
+ instead of having the username encoded in the aux_proj or
+ proj_name, probably. */
+
+ struct context *context = (struct context *)context_arg;
+ fprintf (context->debuglog, "SccGetProjPath called\n");
+
+ /* At least for now we leave the proj_name alone, and just use
+ the aux_proj. */
+ strncpy (proj_name, "zwork", SCC_max_path);
+ strncpy (aux_proj, ":server:harvey:/home/kingdon/zwork/cvsroot",
+ SCC_max_path);
+ if (local_proj[0] == '\0' && allow_change)
+ strncpy (local_proj, "d:\\sccwork", SCC_max_path);
+ /* I don't think I saw anything in the spec about this,
+ but let's see if it helps. */
+ if (_chdir (local_proj) < 0)
+ fprintf (context->debuglog, "Error in chdir: %s", strerror (errno));
+
+ if (*new)
+ /* It is OK for us to prompt the user for creating a new
+ project. */
+ /* We will say that the user said to create a new one. */
+ *new = 1;
+
+ fflush (context->debuglog);
+ return SCC_return_success;
+}
+
+/* Pretty much similar to SccPopulateList. */
+SCC_return
+SccAddFromScc (void *context_arg, HWND window, LONG *files,
+ char ***file_names)
+{
+ struct context *context = (struct context *)context_arg;
+
+ /* For now we have hardcoded the notion that there are two files,
+ foo.c and bar.c. */
+#define NUM_FILES 2
+ if (files == NULL)
+ {
+ char **p;
+
+ /* This means to free the memory that is allocated for
+ file_names. */
+ for (p = *file_names; *p != NULL; ++p)
+ {
+ fprintf (context->debuglog, "Freeing %s\n", *p);
+ free (*p);
+ }
+ }
+ else
+ {
+ *file_names = malloc ((NUM_FILES + 1) * sizeof (char **));
+ if (*file_names == NULL)
+ return malloc_error (context);
+ (*file_names)[0] = malloc (80);
+ if ((*file_names)[0] == NULL)
+ return malloc_error (context);
+ strcpy ((*file_names)[0], "foo.c");
+ (*file_names)[1] = malloc (80);
+ if ((*file_names)[1] == NULL)
+ return malloc_error (context);
+ strcpy ((*file_names)[1], "bar.c");
+ (*file_names)[2] = NULL;
+ *files = 2;
+
+ /* Are we supposed to also Get the files? Or is the IDE
+ next going to call SccGet on each one? The spec doesn't
+ say explicitly. */
+ }
+ fprintf (context->debuglog, "Success in SccAddFromScc\n");
+ fflush (context->debuglog);
+ return SCC_return_success;
+}
+
+/* This changes several aspects of how we interact with the IDE. */
+SCC_return
+SccSetOption (void *context_arg, LONG option, LONG val)
+{
+ return SCC_return_success;
+}
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/scc.def b/gnu/usr.bin/cvs/windows-NT/SCC/scc.def
new file mode 100644
index 00000000000..cf4eded511e
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/scc.def
@@ -0,0 +1,25 @@
+LIBRARY SCC
+EXPORTS
+ SccInitialize @1
+ SccUninitialize @2
+ SccOpenProject @3
+ SccCloseProject @4
+ SccGet @5
+ SccCheckout @6
+ SccUncheckout @7
+ SccCheckin @8
+ SccAdd @9
+ SccRemove @10
+ SccRename @11
+ SccDiff @12
+ SccHistory @13
+ SccProperties @14
+ SccRunScc @15
+ SccGetCommandOptions @16
+ SccQueryInfo @17
+ SccGetEvents @18
+ SccGetProjPath @19
+ SccPopulateList @20
+ SccAddFromScc @21
+ SccSetOption @22
+ SccGetVersion @23
diff --git a/gnu/usr.bin/cvs/windows-NT/config.h b/gnu/usr.bin/cvs/windows-NT/config.h
index 736390a7b4b..abcf0189597 100644
--- a/gnu/usr.bin/cvs/windows-NT/config.h
+++ b/gnu/usr.bin/cvs/windows-NT/config.h
@@ -104,16 +104,6 @@
/* We don't need this for CLIENT side. */
#undef DIFF
-/* the path to the gnu grep program on your system */
-/* We don't need this for CLIENT side. */
-#undef GREP
-
-/* The number of bytes in a int. */
-#define SIZEOF_INT 4
-
-/* The number of bytes in a long. */
-#define SIZEOF_LONG 4
-
/* Define if you have the connect function. */
/* Not used? */
#define HAVE_CONNECT
@@ -145,9 +135,6 @@
/* Define if you have the putenv function. */
#define HAVE_PUTENV 1
-/* Define if you have the setvbuf function. */
-#define HAVE_SETVBUF 1
-
/* Define if you have the sigaction function. */
#undef HAVE_SIGACTION
diff --git a/gnu/usr.bin/cvs/windows-NT/filesubr.c b/gnu/usr.bin/cvs/windows-NT/filesubr.c
index 7ab5814d0f5..da5a3c86230 100644
--- a/gnu/usr.bin/cvs/windows-NT/filesubr.c
+++ b/gnu/usr.bin/cvs/windows-NT/filesubr.c
@@ -831,27 +831,43 @@ convert_file (char *infile, int inflags,
when combined as ${HOMEDRIVE}${HOMEPATH}, give the unix equivalent
of HOME. Some NT users are just too unixy, though, and set the
HOME variable themselves. Therefore, we check for HOME first, and
- then try to combine the other two if that fails. */
+ then try to combine the other two if that fails.
+
+ Looking for HOME strikes me as bogus, particularly if the only reason
+ is to cater to "unixy users". On the other hand, if the reasoning is
+ there should be a single variable, rather than requiring people to
+ set both HOMEDRIVE and HOMEPATH, then it starts to make a little more
+ sense.
+
+ Win95: The system doesn't set HOME, HOMEDRIVE, or HOMEPATH (at
+ least if you set it up as the "all users under one user ID" or
+ whatever the name of that option is). Based on thing overheard on
+ the net, it seems that users of the pserver client have gotten in
+ the habit of setting HOME (if you don't use pserver, you can
+ probably get away without having a reasonable return from
+ get_homedir. Of course you lose .cvsrc and .cvsignore, but many
+ users won't notice). So it would seem that we should be somewhat
+ careful if we try to change the current behavior.
+
+ NT 3.51 or NT 4.0: I haven't checked this myself, but I am told
+ that HOME gets set, but not to the user's home directory. It is
+ said to be set to c:\users\default by default. */
char *
get_homedir ()
{
- static char pathbuf[PATH_MAX * 2];
+ static char *pathbuf;
char *hd, *hp;
- if ((hd = getenv ("HOME")))
+ if (pathbuf != NULL)
+ return pathbuf;
+ else if ((hd = getenv ("HOME")))
return hd;
else if ((hd = getenv ("HOMEDRIVE")) && (hp = getenv ("HOMEPATH")))
{
- /* Watch for buffer overruns. */
-
-#define cvs_min(x,y) ((x <= y) ? (x) : (y))
-
- int ld = cvs_min (PATH_MAX, strlen (hd));
- int lp = cvs_min (PATH_MAX, strlen (hp));
-
- strncpy (pathbuf, hd, ld);
- strncpy (pathbuf + ld, hp, lp);
+ pathbuf = xmalloc (strlen (hd) + strlen (hp) + 5);
+ strcpy (pathbuf, hd);
+ strcat (pathbuf, hp);
return pathbuf;
}
diff --git a/gnu/usr.bin/cvs/windows-NT/options.h b/gnu/usr.bin/cvs/windows-NT/options.h
index b9bba3ffc3a..33103dda051 100644
--- a/gnu/usr.bin/cvs/windows-NT/options.h
+++ b/gnu/usr.bin/cvs/windows-NT/options.h
@@ -55,17 +55,6 @@
#endif
/*
- * The "grep" program to execute when checking to see if a merged file had
- * any conflicts. This "grep" must support the "-s" option and a standard
- * regular expression as an argument. Specify a full pathname if your site
- * wants to use a particular grep.
- */
-
-#ifndef GREP
-#define GREP "grep"
-#endif
-
-/*
* The "patch" program to run when using the CVS server and accepting
* patches across the network. Specify a full pathname if your site
* wants to use a particular patch.