summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/cvs/windows-NT/SCC
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/cvs/windows-NT/SCC')
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore4
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog76
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in2
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/README.txt53
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/pubscc.h538
-rw-r--r--gnu/usr.bin/cvs/windows-NT/SCC/scc.c154
6 files changed, 730 insertions, 97 deletions
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore b/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore
index be11970367c..e880feb51ab 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore
@@ -1,4 +1,8 @@
SCC.mdp
SCC.ncb
+SCC.opt
+SCC.dsw
+SCC.plg
Debug
+Release
Makefile
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
index d1f67a76fd1..9673b144931 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog
@@ -1,3 +1,79 @@
+Tue Jan 27 12:54:05 1998 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt: Update bug-cvs address to gnu.org.
+
+Thu Dec 11 22:17:45 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt: Add Access to list of development environments which
+ implement SCC.
+
+Wed Oct 29 11:45:20 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt: CVSwiz runs the command line CVS; it is not an
+ independent implementation of the protocol.
+
+Sun Oct 26 14:57:33 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt: Add section "OTHER INTERFACES".
+
+Tue Oct 21 23:25:43 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt (TOOLS IMPLEMENTING THE SCC): Add comment about
+ Powerbuilder versions.
+
+Mon Sep 8 08:52:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt (TOOLS IMPLEMENTING THE SCC): Be a little more
+ specific about Powersoft and CodeWright.
+
+ * Makefile.in (DISTFILES): Add pubscc.h. Thanks to Frederic Van
+ Haren for pointing this out.
+
+Tue Sep 2 13:39:17 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt (SPECIFICATIONS OR OTHER DOCUMENTS DESCRIBING THE
+ SCC): New section.
+
+Mon Aug 4 10:46:59 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * pubscc.h: Add comment listing new CodeWright 5.00c functions.
+ Add comment about CodeWright calling SccQueryInfo without
+ SCC_cap_QueryInfo set. Thanks to Frederic Van Haren for
+ pointing out these issues.
+
+4 Aug 1997 Jim Kingdon
+
+ Changes for Visual C++ 5.0:
+ * SCC.dsp: New file.
+ * .cvsignore: add SCC.dsw SCC.opt SCC.plg Release.
+
+ * scc.c (SccGet): Replace #if 0'd code with a comment and
+ adjust to avoid compiler warning.
+
+Mon Aug 4 09:58:11 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * scc.c: Split out the interface declarations into a new file
+ pubscc.h. This should make it easier to handle multiple
+ scc.c-equivalents.
+
+Mon Jul 14 15:58:25 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * scc.c: Add many comments and defines to document additional
+ aspects of the SCC API.
+
+7 Jul 1997 Frederic Van Haren <Frederic.Van.Haren@lhs.be>
+
+ * scc.c (SccHistory): file_names is LPSTR * not LPSTR.
+
+Mon Jul 7 16:45:16 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * scc.c (SccGetVersion): Change arguments from () to (void).
+ Clarify context_arg. Also document 'window' arg.
+
+Sat Jul 5 13:01:51 1997 Jim Kingdon <kingdon@harvey.cyclic.com>
+
+ * README.txt: PowerJ and Power++ are also said to implement SCC.
+
21 Mar 1997 Jim Kingdon
* scc.c (SccCheckout): Write to debuglog and return
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
index 9b1f59428a1..cafed149acd 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in
@@ -14,7 +14,7 @@ SHELL = /bin/sh
DISTFILES = \
.cvsignore ChangeLog Makefile.in README.txt \
- SCC.mak scc.c scc.def
+ SCC.mak scc.c scc.def pubscc.h
all:
.PHONY: all
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/README.txt b/gnu/usr.bin/cvs/windows-NT/SCC/README.txt
index bc8cc76c6c3..816ede95e47 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/README.txt
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/README.txt
@@ -61,6 +61,53 @@ the programs which implement the Integrated Development Environment
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
+* Microsoft Developer Studio 4.x Professional (not Standard, not 2.x).
+* Microsoft Access V7.0
+* Powersoft's Optima++, PowerJ, and Power++
+ (not sure which versions, but this information was added in 1997 if
+ that helps. Someone on usenet reports 32 bit Powerbuilder version
+ 5.03 but not version 4, version 5.0, or 16 bit Powerbuilder.).
+* Premia's CodeWright editor
+ (versions 5.00b and 5.00c; not sure about older versions).
+
+SPECIFICATIONS OR OTHER DOCUMENTS DESCRIBING THE SCC
+
+The only publicly available document which we are aware of is pubscc.h
+in this directory. This should be sufficient to get a start at
+playing around with the SCC, and if you have done that and then
+proceed to run into those areas which pubscc.h does not document well,
+you are encouraged to send mail to bug-cvs@gnu.org with your
+questions.
+
+OTHER INTERFACES
+
+There are other interfaces which interface between a development
+environment (or other front-end) and a source control system. That
+is, in general terms they provide somewhat the function of the SCC,
+although they may be at a somewhat different level and systems may
+support/use several interfaces rather than it being an either/or thing.
+
+If you know of other interfaces which should be added here I guess the
+best place to make suggestions is bug-cvs@prep.ai.mit.edu (although
+this list is not intended to be CVS-centric).
+
+* The CVS remote protocol is documented in doc/cvsclient.texi in the
+CVS distribution and has at least 2 implementations of the client
+(jCVS and CVS command line client), in addition to having been
+implemented at least once by a special-purpose perl script.
+
+* Microsoft's OLE Automation interface. The spec is available for
+download at http://www.microsoft.com/ssafe. I'm not sure whether this
+has been implemented by other source control systems. Metrowerks
+implements this via a module which speaks the Metrowerks API out one
+end and the OLE Automation interface out the other (the module runs on
+Windows, not Mac).
+
+* There is an API (for Java, I think) which is supported by Symantec's
+Visual Cafe 2.0, and will be supported by a service pack which will
+implement it for StarTeam 2.1 (source: usenet post by Steve Reynolds
+of StarBase, Oct 1997).
+
+* Metrowerks publishes and implements the CodeWarrior IDE Version
+Control System API. I think maybe the way to get a copy of the spec
+is as part of CodeWarrior but I'm not completely clear on that.
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/pubscc.h b/gnu/usr.bin/cvs/windows-NT/SCC/pubscc.h
new file mode 100644
index 00000000000..0962abdba9a
--- /dev/null
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/pubscc.h
@@ -0,0 +1,538 @@
+/* This file was written by Jim Kingdon, and is hereby placed
+ in the public domain. */
+
+/* Bits of the SCC 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.
+
+ Note that some of the descriptions here have a certain amount of
+ guesswork (for example, sometimes I have tried to translate to CVS
+ terminology without actually verifying that the item means what I
+ think it does). If you find errors, please let us know according to
+ the usual procedures for reporting CVS bugs. */
+typedef long SCC_return;
+#define SCC_return_success 0
+#define SCC_return_unknown_project -2
+/* The file is not under SCC control. */
+#define SCC_return_non_scc_file -11
+/* This operation is not supported. I believe this status can only
+ be returned from SccGet, SccAdd, SccRemove, SccHistory, or
+ SccQueryInfo. I'm not really sure what happens if it is returned
+ from other calls. */
+#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 1L
+#define SCC_outproc_warning 2L
+#define SCC_outproc_error 3L
+/* Codes 4-7 relate to cancels and are only supported if the
+ development environment said so with SccSetOption. */
+/* A status message, typically goes in something analogous to the emacs
+ minibuffer. For both this and SCC_outproc_nostatus, the development
+ environment returns SCC_outproc_return_cancelled if the user has
+ hit the cancel button. */
+#define SCC_outproc_status 4L
+/* Like SCC_outproc_status, but there is no message to report. */
+#define SCC_outproc_nostatus 5L
+/* Tell the development environment to offer a cancel button. */
+#define SCC_outproc_cancel_on 6L
+/* Tell the development environment to not offer a cancel button. */
+#define SCC_outproc_cancel_off 7L
+
+/* Return values from outproc. */
+#define SCC_outproc_return_success 0L
+#define SCC_outproc_return_cancelled -1L
+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
+
+/* Status codes, as used by QueryInfo and GetEvents. */
+/* This means that we can't get status. If the status is not
+ SCC_status_error, then the status is a set of bit flags, as defined by
+ the other SCC_status_* codes. */
+#define SCC_status_error -1L
+
+/* The following status codes are things which the development environment
+ is encouraged to check to determine things like whether to allow
+ a checkin. */
+/* The current user has the file checked out (that is, under "cvs edit").
+ It may or may not be in the directory where the development
+ environment thinks it should be. */
+#define SCC_status_out_me 0x1000L
+/* Should be set only if out_me is set. The file is checked out where
+ the development environment thinks it should be. */
+#define SCC_status_out_here 2L
+/* Some other user has the file checked out. */
+#define SCC_status_out_someoneelse 4L
+/* Reserved checkouts are in effect for the file. */
+#define SCC_status_reserved 8L
+/* Reserved checkouts are not in effect for the file. Multiple users
+ can edit it. Only one of SCC_status_reserved or SCC_status_nonreserved
+ should be set. I think maybe this flag should only be set if there
+ actually is more than one copy currently checked out. */
+#define SCC_status_nonreserved 0x10L
+
+/* The following flags are intended for the development environment to
+ display the status of a file. We are allowed to support them or not
+ as we choose. */
+/* The file in the working directory is not the latest version in the
+ repository. Like when "cvs status" says "Needs Checkout". */
+#define SCC_status_needs_update 0x20L
+/* The file is no longer in the project. I think this is the case where
+ cvs update prints "file xxx is no longer pertinent" (but I don't know,
+ there are other statuses involved with removed files). */
+#define SCC_status_not_pertinent 0x40L
+/* No checkins are permitted for this file. No real CVS analogue, because
+ this sort of thing would be done by commitinfo, &c. */
+#define SCC_status_no_checkins 0x80L
+/* There was a merge, but the user hasn't yet dealt with it. I think this
+ probably should be used both if there were conflicts on the merge and
+ if there were not (not sure, though). */
+#define SCC_status_had_conflicts 0x100L
+/* This indicates something has happened to the file. I suspect it mainly
+ is intended for cases in which we detect that something happened to the
+ file behind our backs. I suppose CVS might use this for cases in which
+ sanity checks on the CVSADM files fail, or in which the file has been
+ made read/write without a "cvs edit", or that sort of thing.
+
+ Or maybe it should be set if the file has been edited in the
+ normal fashion. I'm not sure. */
+#define SCC_status_munged 0x800L
+/* The file exists in several projects. In CVS I would suppose the
+ equivalent probably would be that several modules (using features
+ like -d) are capable of checking out a given file in the repository
+ in several locations. CVS has no current ability to give a different
+ status when that has happened, but it might be cool. */
+#define SCC_status_several_projects 0x200L
+/* There is a sticky tag or date in effect. */
+#define SCC_status_stuck 0x400L
+
+/* Bits to set in the caps used by SccInitialize. Most of these are
+ relatively straightforward, for example SCC_cap_QueryInfo is set to
+ indicate that the SccQueryInfo function is supported. */
+/* CodeWright 5.00b and 5.00c seem to call SccQueryInfo regardless of whether
+ this bit is set in caps. */
+#define SCC_cap_QueryInfo 0x80L
+#define SCC_cap_GetProjPath 0x200L
+#define SCC_cap_AddFromScc 0x400L
+#define SCC_cap_want_outproc 0x8000L
+
+/* These are command options. Some of them are specific to a particular
+ command, some of them are good for more than one command. Because many
+ values are reused for different commands, look at the listed commands
+ to see what a particular value means for a particular command. */
+/* Recurse into directories. SccGet. */
+#define SCC_cmdopt_recurse 2L
+/* This means to get all the files in a directory. SccGet. */
+#define SCC_cmdopt_dir 1L
+/* Without this flag, after a checkin, files are normally not checked
+ out. This flag disables that handling, and if it is set files will
+ still be checked out after the checkin completes. SccCheckin, SccAdd. */
+#define SCC_cmdopt_no_unedit 0x1000L
+/* File is text. SccAdd. */
+#define SCC_cmdopt_text 1L
+/* File is binary. SccAdd. */
+#define SCC_cmdopt_binary 2L
+/* We are supposed to decide whether it is text or binary. We can use the
+ CVS wrappers stuff to decide based on the file name. Obviously, this
+ constant is just another way of saying that neither SCC_cmdopt_text nor
+ SCC_cmdopt_binary are set. SccAdd. */
+#define SCC_cmdopt_auto 0L
+/* Maintain only a head revision for the file, no history. SccAdd. */
+#define SCC_cmdopt_only_one 4L
+/* In addition to removing the file from the repository, also delete it
+ from the working directory. My guess is that development environments
+ would generally tend to pass this flag by default. SccRemove. */
+#define SCC_cmdopt_retain_local 1L
+/* Compare files in a case-insensitive fashion. SccDiff. */
+#define SCC_cmdopt_case_insensitive 2L
+/* Ignore whitespace in comparing files. SccDiff. */
+#define SCC_cmdopt_ignore_all_space 4L
+/* Instead of generating diffs, just say whether files are equal, based on
+ the file contents. SccDiff. */
+#define SCC_cmdopt_compare_files 0x10L
+/* Instead of generating diffs, just say whether files are equal. This may
+ use a checksum if we want, or if not, it can be the same as
+ SCC_cmdopt_compare_files. */
+#define SCC_cmdopt_consult_checksum 0x20L
+/* Instead of generating diffs, just say whether files are equal. This may
+ use a timestamp if we want, or if not, it can be the same as either
+ SCC_cmdopt_consult_checksum or SCC_cmdopt_compare_files. */
+#define SCC_cmdopt_consult_timestamp 0x40L
+
+/* Values for the flags argument to OpenProject. */
+/* If this is set, and the development environment tries to open a project
+ which doesn't exist, then create it. */
+#define SCC_open_autocreate 1L
+/* If autocreate is not set, and the development environment tries to
+ open a project which doesn't exist, and may_prompt is set, we are
+ allowed to prompt the user to create a new project. If may_prompt
+ is not set, we should just return SCC_return_unknown_project and
+ not open the project. */
+#define SCC_open_may_prompt 2L
+
+/* Constants for SccSetOption. */
+#define SCC_option_background 1L
+/* If option is SCC_option_background, then val turns background
+ processing on or off. If it is off, we can, if we need to, queue
+ up events or something which won't disturb the development
+ environment. */
+# define SCC_option_background_yes 1L
+# define SCC_option_background_no 0L
+#define SCC_option_cancel 3L
+/* If option is SCC_option_cancel, then val says whether the development
+ environment supports the SCC_outproc_* codes related to having the
+ development environment handle a cancel button. If this is not set,
+ we are allowed/encouraged to implement a cancel button ourselves. */
+# define SCC_option_cancel_on 1L
+# define SCC_option_cancel_off 0L
+/* A SCC_option_* value of 10 has also been observed (I think from
+ CodeWright 5.00). I have no idea what it means; it isn't documented
+ by the SCC API from Microsoft (version 0.99.0823). */
+
+/* The "void *context_arg" argument to most of the Scc* functions
+ stores a pointer to a structure that the version control system
+ gets to allocate, so it doesn't need any global variables. */
+
+/* In addition to context_arg, most of the Scc* functions take a
+ "HWND window" argument. This is so that we can put up dialogs.
+ The window which is passed in is the IDE's window, which we
+ should use as the parent of dialogs that we put up. */
+
+#include <windows.h>
+
+/* Return the version of the SCC spec, major version in the high word,
+ minor version in the low word. Recommended value is 0x10001 for
+ version 1.1 of the spec. */
+extern LONG SccGetVersion (void);
+
+/* Set up the version control system. This should be called before any
+ other SCC calls other than SccGetVersion. */
+extern SCC_return SccInitialize
+ (/* The version control system should allocate the context argument
+ in SccInitialize and store a pointer to it in *contextp. */
+ void **contextp,
+
+ HWND window, LPSTR caller,
+ /* Version control system should copy in the
+ name of the version control system here,
+ up to SCC_max_name bytes. */
+ LPSTR name,
+
+ /* Version control system should set *caps to indicate what it
+ supports, using bits from SCC_cap_*. */
+ LPLONG caps,
+
+ /* Version control system should copy in a string here, that the
+ development environment can put places like a makefile to
+ distinguish this version control system from others. Up to
+ SCC_max_init_path bytes. */
+ LPSTR path,
+
+ /* Version control system should set these to the maximum size for
+ checkout comments and comments. I'm not sure whether existing
+ development environments tend to allocate fixed size arrays
+ based on the return length (I would recommend that a development
+ environment not do so, but that is a different question). */
+ LPDWORD co_comment_len,
+ LPDWORD comment_len);
+
+/* The version control system should free any resources it has allocated,
+ including the context structure itself. */
+extern SCC_return SccUninitialize (void *context_arg);
+
+extern SCC_return SccOpenProject
+ (void *context_arg, HWND window, LPSTR user,
+ LPSTR project, LPSTR local_proj,
+ LPSTR aux_proj,
+ LPSTR comment,
+
+ /* This is the function which the version control system can call
+ to ask the development environment to display output, or
+ (SCC_outproc)0 if the development environment doesn't support
+ the outproc feature. */
+ SCC_outproc outproc,
+
+ /* One or more of the SCC_open_* settings. */
+ LONG flags);
+
+extern SCC_return SccCloseProject (void *context_arg);
+
+/* cvs get. */
+extern SCC_return SccGet
+ (void *context_arg, HWND window,
+
+ /* Files to get, where file_names is an array
+ of num_files names. */
+ /* 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 the local directory specified by the local_proj argument
+ to SccOpenProject, although I don't know whether there are any
+ exceptions to that. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ /* Command options. */
+ LONG options,
+
+ void *prov_options);
+
+/* cvs edit. */
+extern SCC_return SccCheckout
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ LPSTR comment,
+
+ /* Command options. I'm not sure what command options, if any, are
+ defined for SccCheckout. */
+ LONG options,
+
+ void *prov_options);
+
+/* cvs ci. */
+extern SCC_return SccCheckin
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ LPSTR comment,
+
+ /* Command options. */
+ LONG options,
+
+ void *prov_options);
+
+/* cvs unedit. */
+extern SCC_return SccUncheckout
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ /* Command options. I'm not sure what command options, if any, are
+ defined for SccUncheckout. */
+ LONG options,
+
+ void *prov_options);
+
+/* cvs add + cvs ci, more or less, I think (but see also
+ the "keep checked out" flag in options). */
+extern SCC_return SccAdd
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ LPSTR comment,
+
+ /* Array of num_files command options, one for each file. */
+ LONG *options,
+
+ void *prov_options);
+
+/* 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>". */
+extern SCC_return SccRemove
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ LPSTR comment,
+
+ /* Command options. */
+ LONG options,
+
+ void *prov_options);
+
+/* mv, cvs add, cvs rm, and cvs ci, I think. */
+extern SCC_return SccRename
+ (void *context_arg, HWND window, LPSTR old_name,
+ LPSTR new_name);
+
+/* If SCC_cmdopt_compare_files, SCC_cmdopt_consult_checksum, or
+ SCC_cmdopt_consult_timestamp, then we are supposed to silently
+ return a status, without providing any information directly to the
+ user. 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 return text via
+ outproc). */
+extern SCC_return SccDiff
+ (void *context_arg, HWND window, LPSTR file_name,
+
+ /* Command options. */
+ LONG options,
+
+ void *prov_options);
+
+/* 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. */
+extern SCC_return SccHistory
+ (void *context_arg, HWND window,
+
+ /* Files to operate on, where file_names is an array of num_files
+ names. */
+ LONG num_files,
+ LPSTR *file_names,
+
+ /* Command options. I'm not sure what command options,
+ if any, are defined for SccHistory. */
+ LONG options,
+
+ void *prov_options);
+
+/* cvs status, presumably. */
+extern SCC_return SccProperties
+ (void *context_arg, HWND window, LPSTR file_name);
+
+/* 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. */
+extern SCC_return SccRunScc
+ (void *context_arg, HWND window,
+
+ LONG num_files,
+ LPSTR *file_names);
+
+/* Lots of things that we could do here. Options to get/update
+ such as -r -D -k etc. just for starters. Note that the terminology is
+ a little confusing here. This function relates to "provider options"
+ (prov_options) which are a way for us to provide extra dialogs beyond
+ the basic ones for a particular command. It is unrelated to "command
+ options" (SCC_cmdopt_*). */
+extern SCC_return SccGetCommandOptions
+ (void *context_arg, HWND window,
+ enum SCC_command command,
+ void **prov_optionsp);
+
+/* 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. */
+extern SCC_return SccPopulateList
+ (void *context_arg, enum SCC_command command,
+
+ LONG num_files,
+ LPSTR *file_names,
+
+ SCC_popul_proc populate,
+ void *callerdat,
+
+ /* Command options. I'm not sure what command options,
+ if any, are defined for SccPopulateList. */
+ LONG options);
+
+/* cvs status, sort of. */
+extern SCC_return SccQueryInfo
+ (void *context_arg,
+
+ LONG num_files, LPSTR *file_names,
+
+ /* This is an array of NUM_FILES entries. In each one
+ we store a SCC_status_* code. */
+ LPLONG status);
+
+/* Like QueryInfo, but fast and for only a single file. For example, the
+ development environment might call this quite frequently to keep its
+ screen display updated. Supposed to only return cached status
+ information, not go to disk or anything. I assume that
+ QueryInfo and probably the usual calls like Get would cause
+ the version control system to cache the status in the first place. */
+extern SCC_return SccGetEvents
+ (void *context_arg, LPSTR file_name,
+
+ /* Here the version control system stores the SCC_status_* code. */
+ LPLONG status,
+
+ LPLONG events_remaining);
+
+/* This is where the user gives us the CVSROOT. */
+extern SCC_return SccGetProjPath
+ (void *context_arg, HWND window, LPSTR user,
+
+ /* Version control system copies in the project name
+ here, up to SCC_max_path bytes. */
+ LPSTR proj_name,
+
+ /* If allow_change, the version control system may copy
+ into this field, up to SCC_max_path bytes. */
+ LPSTR local_proj,
+
+ /* Version control system copies into this field, up to
+ SCC_max_path bytes. */
+ LPSTR aux_proj,
+
+ BOOL allow_change, BOOL *new);
+
+/* Pretty much similar to SccPopulateList. Not sure whether this also
+ involves getting the files, or whether the development environment will
+ typically call SccGet after this function. */
+extern SCC_return SccAddFromScc
+ (void *context_arg, HWND window,
+
+ /* Version control system sets *files to the number of files and
+ *file_names to an array each element of which and contains the
+ name of one of the files. The names can be relative pathnames
+ (e.g. "foo.c"). If files is NULL, that means something different;
+ the version control system should free the memory that it allocated
+ for file_names. */
+ LONG *files,
+ char ***file_names);
+
+/* This changes several aspects of how we interact with the IDE. */
+extern SCC_return SccSetOption
+ (void *context_arg,
+ /* One of the SCC_option_* codes. */
+ LONG option,
+ /* Meaning of this will depend on the value of option. */
+ LONG val);
+
+/* New functions with CodeWright 5.00c: SccAddRef, SccRelease,
+ SccDiffToRev, SccLabel, SccLock and SccMerge. I don't have any
+ details on them. */
diff --git a/gnu/usr.bin/cvs/windows-NT/SCC/scc.c b/gnu/usr.bin/cvs/windows-NT/SCC/scc.c
index c8f10512b3a..9f74af4c6b1 100644
--- a/gnu/usr.bin/cvs/windows-NT/SCC/scc.c
+++ b/gnu/usr.bin/cvs/windows-NT/SCC/scc.c
@@ -5,70 +5,11 @@
#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
-/* The file is not under SCC control. */
-#define SCC_return_non_scc_file -11
-/* This operation is not supported. I believe this status can only
- be returned from SccGet, SccAdd, SccRemove, SccHistory, or
- SccQueryInfo. I'm not really sure what happens if it is returned
- from other calls. */
-#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
-
+#include "pubscc.h"
/* We get to put whatever we want here, and the caller will pass it
- to us, so we don't need any global variables. */
+ to us, so we don't need any global variables. This is the
+ "void *context_arg" argument to most of the Scc* functions. */
struct context {
FILE *debuglog;
/* Value of the CVSROOT we are currently working with (that is, the
@@ -80,6 +21,11 @@ struct context {
SCC_outproc outproc;
};
+/* In addition to context_arg, most of the Scc* functions take a
+ "HWND window" argument. This is so that we can put up dialogs.
+ The window which is passed in is the IDE's window, which we
+ should use as the parent of dialogs that we put up. */
+
#include <windows.h>
/* Report a malloc error and return the SCC_return_* value which the
@@ -97,7 +43,7 @@ malloc_error (struct context *context)
/* Return the version of the SCC spec, major version in the high word,
minor version in the low word. */
LONG
-SccGetVersion ()
+SccGetVersion (void)
{
/* We implement version 1.1 of the spec. */
return 0x10001;
@@ -161,8 +107,9 @@ SccUninitialize (void *context_arg)
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)
+ LPSTR project, LPSTR local_proj, LPSTR aux_proj,
+ LPSTR comment, SCC_outproc outproc,
+ LONG flags)
{
struct context *context = (struct context *)context_arg;
@@ -218,7 +165,9 @@ SccCloseProject (void *context_arg)
/* cvs get. */
SCC_return
SccGet (void *context_arg, HWND window, LONG num_files,
- LPSTR *file_names, LONG options, void *prov_options)
+ LPSTR *file_names,
+ LONG options,
+ void *prov_options)
{
struct context *context = (struct context *)context_arg;
int i;
@@ -232,25 +181,21 @@ SccGet (void *context_arg, HWND window, LONG num_files,
}
#endif
fprintf (context->debuglog, "\n");
- if (options & SCC_DIR)
+ if (options & SCC_cmdopt_dir)
fprintf (context->debuglog, " Get all\n");
/* Should be using this flag to set -R vs. -l. */
- if (options & SCC_RECURSE)
+ if (options & SCC_cmdopt_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
+ /* Here we would write to the file named fname. */
}
fprintf (context->debuglog, "\nExiting SccGet\n");
fflush (context->debuglog);
@@ -260,7 +205,8 @@ SccGet (void *context_arg, HWND window, LONG num_files,
/* cvs edit. */
SCC_return
SccCheckout (void *context_arg, HWND window, LONG num_files,
- LPSTR *file_names, LPSTR comment, LONG options,
+ LPSTR *file_names, LPSTR comment,
+ LONG options,
void *prov_options)
{
struct context *context = (struct context *)context_arg;
@@ -278,7 +224,8 @@ SccCheckout (void *context_arg, HWND window, LONG num_files,
/* cvs ci. */
SCC_return
SccCheckin (void *context_arg, HWND window, LONG num_files,
- LPSTR *file_names, LPSTR comment, LONG options,
+ LPSTR *file_names, LPSTR comment,
+ LONG options,
void *prov_options)
{
return SCC_return_not_supported;
@@ -287,7 +234,9 @@ SccCheckin (void *context_arg, HWND window, LONG num_files,
/* cvs unedit. */
SCC_return
SccUncheckout (void *context_arg, HWND window, LONG num_files,
- LPSTR *file_names, LONG options, void *prov_options)
+ LPSTR *file_names,
+ LONG options,
+ void *prov_options)
{
return SCC_return_not_supported;
}
@@ -296,7 +245,8 @@ SccUncheckout (void *context_arg, HWND window, LONG num_files,
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,
+ LPSTR *file_names, LPSTR comment,
+ LONG *options,
void *prov_options)
{
return SCC_return_not_supported;
@@ -307,7 +257,8 @@ SccAdd (void *context_arg, HWND window, LONG num_files,
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,
+ LPSTR *file_names, LPSTR comment,
+ LONG options,
void *prov_options)
{
return SCC_return_not_supported;
@@ -321,15 +272,19 @@ SccRename (void *context_arg, HWND window, LPSTR old_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). */
+/* If SCC_cmdopt_compare_files, SCC_cmdopt_consult_checksum, or
+ SCC_cmdopt_consult_timestamp, then we are supposed to silently
+ return a status, without providing any information directly to the
+ user. 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 return text via
+ outproc). */
SCC_return
SccDiff (void *context_arg, HWND window, LPSTR file_name,
- LONG options, void *prov_options)
+ LONG options,
+ void *prov_options)
{
return SCC_return_not_supported;
}
@@ -339,7 +294,9 @@ SccDiff (void *context_arg, HWND window, LPSTR file_name,
do "cvs update -r", etc. */
SCC_return
SccHistory (void *context_arg, HWND window, LONG num_files,
- LPSTR file_names, LONG options, void *prov_options)
+ LPSTR *file_names,
+ LONG options,
+ void *prov_options)
{
return SCC_return_not_supported;
}
@@ -362,7 +319,11 @@ SccRunScc (void *context_arg, HWND window, LONG num_files,
}
/* Lots of things that we could do here. Options to get/update
- such as -r -D -k etc. just for starters. */
+ such as -r -D -k etc. just for starters. Note that the terminology is
+ a little confusing here. This function relates to "provider options"
+ (prov_options) which are a way for us to provide extra dialogs beyond
+ the basic ones for a particular command. It is unrelated to "command
+ options" (SCC_cmdopt_*). */
SCC_return
SccGetCommandOptions (void *context_arg, HWND window,
enum SCC_command command,
@@ -378,7 +339,8 @@ SCC_return
SccPopulateList (void *context_arg, enum SCC_command command,
LONG num_files,
LPSTR *file_names, SCC_popul_proc populate,
- void *callerdat, LONG options)
+ void *callerdat,
+ LONG options)
{
return SCC_return_success;
}
@@ -391,14 +353,18 @@ SccQueryInfo (void *context_arg, LONG num_files, LPSTR *file_names,
return SCC_return_not_supported;
}
+/* Like QueryInfo, but fast and for only a single file. For example, the
+ development environment might call this quite frequently to keep its
+ screen display updated. */
SCC_return
-SccGetEvents (void *context_arg, LPSTR file_name, LPLONG status,
+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. */
+ information, not go to disk or anything. I assume that
+ QueryInfo and probably the usual calls like Get would cause
+ us to cache the status in the first place. */
return SCC_return_success;
}
@@ -495,7 +461,9 @@ SccAddFromScc (void *context_arg, HWND window, LONG *files,
/* This changes several aspects of how we interact with the IDE. */
SCC_return
-SccSetOption (void *context_arg, LONG option, LONG val)
+SccSetOption (void *context_arg,
+ LONG option,
+ LONG val)
{
return SCC_return_success;
}