diff options
Diffstat (limited to 'gnu/usr.bin/cvs/windows-NT')
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/ChangeLog | 129 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/README | 58 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/.cvsignore | 4 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/ChangeLog | 76 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/Makefile.in | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/README.txt | 53 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/pubscc.h | 538 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/SCC/scc.c | 154 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/config.h | 51 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/filesubr.c | 159 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/ndir.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/ndir.h | 5 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/options.h | 64 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/pwd.c | 5 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/pwd.h | 5 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/rcmd.c | 11 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/run.c | 114 | ||||
-rw-r--r-- | gnu/usr.bin/cvs/windows-NT/win32.c | 13 |
18 files changed, 972 insertions, 474 deletions
diff --git a/gnu/usr.bin/cvs/windows-NT/ChangeLog b/gnu/usr.bin/cvs/windows-NT/ChangeLog index 806b73a3345..7b73005f3c3 100644 --- a/gnu/usr.bin/cvs/windows-NT/ChangeLog +++ b/gnu/usr.bin/cvs/windows-NT/ChangeLog @@ -1,3 +1,132 @@ +Fri Jan 16 00:57:31 1998 Jim Kingdon <kingdon@harvey.cyclic.com> + + * sanity.sh: Remove. As far as I know the Windows hacks in this + file have been superceded by improvements to Cygwin and/or Ian's + recent changes to src/sanity.sh. The ones I noticed: we had been + working around lack of /dev/null (apprently Cygwin now has it); we + had been not expecting rm -rf to delete readonly files (apparently + it now does); there was an issue with case of arguments passed on + command line (it would seem like Cygwin has changed this). + I also notice that the file had not even been in the distribution + because it was missing from Makefile.in (ugh). + +13 Jan 1998 Jim Kingdon + + * run.c (run_exec): Change parameters from char * to const char *. + +Tue Jan 13 16:57:56 1998 Ian Lance Taylor <ian@cygnus.com> + + * config.h (FOLD_FN_CHAR): Don't define; instead move to + lib/system.h, where it is defined conditionally. + (FILENAMES_CASE_INSENSITIVE, ISDIRSEP): Likewise. + (WNT_filename_classes, fncmp, fnfold): Likewise for declarations. + * filesubr.c (WNT_filename_classes): Remove; now in lib/fncase.c. + (fncmp, fnfold): Likewise. + +Tue Jan 13 13:15:34 1998 Jim Kingdon <kingdon@harvey.cyclic.com> + + * run.c: Adjust run_setup for new calling convention. + + * config.h (DIFF): Remove; no longer used. + * options.h (DIFF, RCSBIN_DFLT): Remove; no longer used. + +Wed Dec 31 10:56:39 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * config.h, filesubr.c (convert_file): Remove; no longer used + (except for BROKEN_READWRITE_CONVERSION which doesn't apply). + +Sat Dec 27 16:57:41 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * options.h (HAVE_RCS5): Remove; no longer used. + + * config.h (LINES_CRLF_TERMINATED): Remove; no longer used. + +Tue Dec 23 08:28:44 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * README: Change bug-cvs address from prep.ai.mit.edu to gnu.org + per email from Martin Hamilton. + +Sun Nov 30 18:03:02 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * run.c (run_args): Remove; nowhere used. + +Sat Nov 29 22:21:19 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * options.h: Remove declaration of getwd; see lib/ChangeLog for + rationale. + +Wed, 12 Nov 1997 Jim Kingdon + + * config.h: Define same_file. + +Sun, 9 Nov 1997 Jim Kingdon + + * config.h: Define HAVE_SETMODE. + +Mon Nov 10 11:15:54 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * run.c (call_diff, call_diff3): Removed, per change to + src/rcscmds.c. + +Fri Oct 31 16:52:30 1997 Abe Feldman + + * config.h: Define UTIME_EXPECTS_WRITABLE. + +Tue Oct 28 14:50:37 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * run.c: Also define call_diff and call_diff3. + +Sat Sep 13 20:13:09 1997 <Martin.Sjoelin@ubs.ch> + indentation/whitespace fixes by Jim Kingdon + + * run.c (quote): quote any " included in argument string to + avoid having ci choke on message string format. + +Sun Sep 7 19:59:56 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * README: Add section on coding standards (win32, ANSI, &c). + +Fri Aug 29 19:13:56 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * filesubr.c (isabsolute): Add comment about interaction with + strip_trailing_slashes (reported by Jin S Choi <jsc@w3health.com>). + +Thu Aug 28 12:06:37 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * filesubr.c (link_file): Remove #if 0'd version; the real version + is elsewhere in this file. + +Sun Aug 10 21:08:12 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * ndir.c, ndir.h, pwd.c, pwd.h: Remove $Header; we decided to + get rid of these some time ago. + +Sun Aug 3 21:14:33 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * README: Note KLUDGE_FOR_WNT_TESTSUITE when discussing tests. + +Fri Jul 18 09:49:52 1997 Jim Kingdon <kingdon@harvey.cyclic.com> + + * README: Adjust discussion of makefiles to deal with Visual C++ + 5.x. One doesn't need patch if client and server are current. + +10 Jul 1997 Jim Kingdon + + * config.h: Define USE_SETMODE_STDOUT. + +8 Jul 1997 Jim Kingdon + + * rcmd.c (rcmd_authenticate): With error message, print the + user names that we were attempting to use. + * win32.c (win32getlogin): If GetUserName returns "", return + NULL. + +Sun, 22 Jun 1997 Jim Kingdon + + * win32.c: Also include winsock.h. + Include stdlib.h (for exit()). + * rcmd.c: Move include of cvs.h above test of HAVE_WINSOCK_H. + Tue Jun 17 16:35:06 1997 Jim Kingdon (unknown@beezley) * rcmd.c: Check HAVE_WINSOCK_H in figuring out which files diff --git a/gnu/usr.bin/cvs/windows-NT/README b/gnu/usr.bin/cvs/windows-NT/README index 2a821746b4b..60321e659a1 100644 --- a/gnu/usr.bin/cvs/windows-NT/README +++ b/gnu/usr.bin/cvs/windows-NT/README @@ -19,22 +19,29 @@ distribution's top directory. At least with the tar port I'm using, the sources get extracted without carriage returns and you must add carriage returns to the end of every line in cvsnt.mak. I also had to add them to src/server.c. It doesn't seem to be necessary to add them -to any other file. This makefile was generated with Visual C++ 2.1. -As far as is known, it should work with Visual C++ 4.0 also. - -Send bug reports to bug-cvs@prep.ai.mit.edu. - -This port passes all of the tests in src/sanity.sh, save the one that -deals with reserved all-upper-case tags (BASE and HEAD), due to a -limitation in the NT command shell. sanity.sh provides pretty minimal -feature coverage, but still gives me some confidence it isn't totally -broken. - -To operate in client mode, you will need GNU patch. To do compressed -transfers with old versions of CVS (1.8 and older), you also need -gzip. Note that you do NOT need an rsh client if you are using the -:server: access method (which uses the internal rsh client), except -perhaps for debugging. +to any other file. This makefile was generated with Visual C++ 4.x. +For Visual C++ 5.x use cvsnet.dsp (which is probably more likely to be +up to date than cvsnt.mak anyway). For Visual C++ 2.x you probably +are in the position of digging through old versions of CVS for a +cvsnt.mak and then updating it. Feel free to let us know about +problems of this sort as with other bug reports; our impression thus +far is that relatively few people care about which versions of Visual +C++ work. + +Send bug reports to bug-cvs@gnu.org. + +As of May 1996, this port passed all of the tests in src/sanity.sh, +save the one that deals with reserved all-upper-case tags (BASE and +HEAD), due to a limitation in the NT command shell. sanity.sh +provides pretty minimal feature coverage, but still gives me some +confidence it isn't totally broken. The tests were run by defining +KLUDGE_FOR_WNT_TESTSUITE (see src/main.c). + +To operate in client mode with old versions of CVS (1.9 and older), +you will need GNU patch. To do compressed transfers with old versions +of CVS (1.8 and older), you also need gzip. Note that you do NOT need +an rsh client if you are using the :server: access method (which uses +the internal rsh client), except perhaps for debugging. To operate in local mode, you will need GNU patch, GNU diffutils, and rcs version 5.7 installed on your system. Make @@ -100,3 +107,22 @@ The following harmless warnings are known: .\lib\getdate.c(1612) : warning C4102: 'yynewstate' : unreferenced label +CODING STANDARDS for Windows + +For general coding standards, see ../HACKING. + +In my opinion win32 is the right API to write to. Microsoft seems to +be better about compatibility across versions than unix vendors (on a +good day, anyway)--the Visual C++ package I bought has not only win32 +but also win16 too (that is, they also include Visual C++ 1.x). As +far as I know there is only one win32 (not counting win32s or win32c +or whatever), not multiple versions. + +ANSI C is also good. As far as I know these calls work fairly well on +NT. + +What one should avoid like the plague on NT (IMHO) is POSIX calls such +as stat(). These tend to be very poorly supported, and tend to break +from version to version or vendor to vendor (the latter being +particularly an issue on OS/2, with IBM, Watcom, and EMX all having +_very_ different C libraries). 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; } diff --git a/gnu/usr.bin/cvs/windows-NT/config.h b/gnu/usr.bin/cvs/windows-NT/config.h index b4d6f94765b..f385726166c 100644 --- a/gnu/usr.bin/cvs/windows-NT/config.h +++ b/gnu/usr.bin/cvs/windows-NT/config.h @@ -34,6 +34,10 @@ I have neither the CD-ROM nor a CD-ROM drive to put it in. */ #define HAVE_UTIME_NULL 1 +/* On Windows NT, when a file is being watched, utime expects a file + to be writable */ +#define UTIME_EXPECTS_WRITABLE + /* Define if on MINIX. */ /* Hah. */ #undef _MINIX @@ -100,10 +104,6 @@ that's always there. */ #undef SERVER_SUPPORT -/* the path to the gnu diff program on your system */ -/* We don't need this for CLIENT side. */ -#undef DIFF - /* Define if you have the connect function. */ /* Not used? */ #define HAVE_CONNECT @@ -254,37 +254,18 @@ unsigned int sleep (unsigned int); #define popen _popen #define pclose _pclose -/* Under Windows NT, filenames are case-insensitive, and both / and \ - are path component separators. */ -#define FOLD_FN_CHAR(c) (WNT_filename_classes[(unsigned char) (c)]) -extern unsigned char WNT_filename_classes[]; -#define FILENAMES_CASE_INSENSITIVE 1 - -/* Is the character C a path name separator? Under - Windows NT, you can use either / or \. */ -#define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/') - -/* Like strcmp, but with the appropriate tweaks for file names. - Under Windows NT, filenames are case-insensitive but case-preserving, - and both \ and / are path element separators. */ -extern int fncmp (const char *n1, const char *n2); - -/* Fold characters in FILENAME to their canonical forms. - If FOLD_FN_CHAR is not #defined, the system provides a default - definition for this. */ -extern void fnfold (char *FILENAME); - -/* #define this if your system terminates lines in text files with - CRLF instead of plain LF, and your I/O functions automatically - translate between using LF in memory and CRLF on disk, unless you - specifically tell them not to. */ -#define LINES_CRLF_TERMINATED 1 - -/* Read data from INFILE, and copy it to OUTFILE. - Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS. - This is useful for converting between CRLF and LF line formats. */ -extern void convert_file (char *INFILE, int INFLAGS, - char *OUTFILE, int OUTFLAGS); +/* When writing binary data to stdout, we better set + stdout to binary mode using setmode. */ +#define USE_SETMODE_STDOUT 1 + +/* Diff also has an ifdef for setmode, and it is HAVE_SETMODE. */ +#define HAVE_SETMODE 1 + +/* Diff needs us to define this. I think it could always be + -1 for CVS, because we pass temporary files to diff, but + config.h seems like the easiest place to put this, so for + now we put it here. */ +#define same_file(s,t) (-1) /* This is where old bits go to die under Windows NT. */ #define DEVNULL "nul" diff --git a/gnu/usr.bin/cvs/windows-NT/filesubr.c b/gnu/usr.bin/cvs/windows-NT/filesubr.c index 6ad8d76359f..5cb15300eea 100644 --- a/gnu/usr.bin/cvs/windows-NT/filesubr.c +++ b/gnu/usr.bin/cvs/windows-NT/filesubr.c @@ -408,33 +408,6 @@ rename_file (from, to) error (1, errno, "cannot rename file %s to %s", from, to); } -/* Windows NT doesn't have hard links or symbolic links. - There was only one place in CVS which used this function, - so I rewrote it to work another way, so this function isn't - used any more. */ -#if 0 -/* - * link a file, if possible. - */ -int -link_file (from, to) - const char *from; - const char *to; -{ - if (trace) -#ifdef SERVER_SUPPORT - (void) fprintf (stderr, "%c-> link(%s,%s)\n", - (server_active) ? 'S' : ' ', from, to); -#else - (void) fprintf (stderr, "-> link(%s,%s)\n", from, to); -#endif - if (noexec) - return (0); - - return (link (from, to)); -} -#endif - /* * unlink a file, if possible. */ @@ -660,103 +633,6 @@ xcmp (file1, file2) return (ret); } - -/* The equivalence class mapping for filenames. - Windows NT filenames are case-insensitive, but case-preserving. - Both / and \ are path element separators. - Thus, this table maps both upper and lower case to lower case, and - both / and \ to /. */ - -#if 0 -main () -{ - int c; - - for (c = 0; c < 256; c++) - { - int t; - - if (c == '\\') - t = '/'; - else - t = tolower (c); - - if ((c & 0x7) == 0x0) - printf (" "); - printf ("0x%02x,", t); - if ((c & 0x7) == 0x7) - putchar ('\n'); - else if ((c & 0x7) == 0x3) - putchar (' '); - } -} -#endif - - -unsigned char -WNT_filename_classes[] = -{ - 0x00,0x01,0x02,0x03, 0x04,0x05,0x06,0x07, - 0x08,0x09,0x0a,0x0b, 0x0c,0x0d,0x0e,0x0f, - 0x10,0x11,0x12,0x13, 0x14,0x15,0x16,0x17, - 0x18,0x19,0x1a,0x1b, 0x1c,0x1d,0x1e,0x1f, - 0x20,0x21,0x22,0x23, 0x24,0x25,0x26,0x27, - 0x28,0x29,0x2a,0x2b, 0x2c,0x2d,0x2e,0x2f, - 0x30,0x31,0x32,0x33, 0x34,0x35,0x36,0x37, - 0x38,0x39,0x3a,0x3b, 0x3c,0x3d,0x3e,0x3f, - 0x40,0x61,0x62,0x63, 0x64,0x65,0x66,0x67, - 0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f, - 0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77, - 0x78,0x79,0x7a,0x5b, 0x2f,0x5d,0x5e,0x5f, - 0x60,0x61,0x62,0x63, 0x64,0x65,0x66,0x67, - 0x68,0x69,0x6a,0x6b, 0x6c,0x6d,0x6e,0x6f, - 0x70,0x71,0x72,0x73, 0x74,0x75,0x76,0x77, - 0x78,0x79,0x7a,0x7b, 0x7c,0x7d,0x7e,0x7f, - 0x80,0x81,0x82,0x83, 0x84,0x85,0x86,0x87, - 0x88,0x89,0x8a,0x8b, 0x8c,0x8d,0x8e,0x8f, - 0x90,0x91,0x92,0x93, 0x94,0x95,0x96,0x97, - 0x98,0x99,0x9a,0x9b, 0x9c,0x9d,0x9e,0x9f, - 0xa0,0xa1,0xa2,0xa3, 0xa4,0xa5,0xa6,0xa7, - 0xa8,0xa9,0xaa,0xab, 0xac,0xad,0xae,0xaf, - 0xb0,0xb1,0xb2,0xb3, 0xb4,0xb5,0xb6,0xb7, - 0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0xbe,0xbf, - 0xc0,0xc1,0xc2,0xc3, 0xc4,0xc5,0xc6,0xc7, - 0xc8,0xc9,0xca,0xcb, 0xcc,0xcd,0xce,0xcf, - 0xd0,0xd1,0xd2,0xd3, 0xd4,0xd5,0xd6,0xd7, - 0xd8,0xd9,0xda,0xdb, 0xdc,0xdd,0xde,0xdf, - 0xe0,0xe1,0xe2,0xe3, 0xe4,0xe5,0xe6,0xe7, - 0xe8,0xe9,0xea,0xeb, 0xec,0xed,0xee,0xef, - 0xf0,0xf1,0xf2,0xf3, 0xf4,0xf5,0xf6,0xf7, - 0xf8,0xf9,0xfa,0xfb, 0xfc,0xfd,0xfe,0xff, -}; - -/* Like strcmp, but with the appropriate tweaks for file names. - Under Windows NT, filenames are case-insensitive but case-preserving, - and both \ and / are path element separators. */ -int -fncmp (const char *n1, const char *n2) -{ - while (*n1 && *n2 - && (WNT_filename_classes[(unsigned char) *n1] - == WNT_filename_classes[(unsigned char) *n2])) - n1++, n2++; - return (WNT_filename_classes[(unsigned char) *n1] - - WNT_filename_classes[(unsigned char) *n2]); -} - -/* Fold characters in FILENAME to their canonical forms. - If FOLD_FN_CHAR is not #defined, the system provides a default - definition for this. */ -void -fnfold (char *filename) -{ - while (*filename) - { - *filename = FOLD_FN_CHAR (*filename); - filename++; - } -} - /* Generate a unique temporary filename. Returns a pointer to a newly malloc'd string containing the name. Returns successfully or not at @@ -778,6 +654,12 @@ int isabsolute (filename) const char *filename; { + /* FIXME: This routine seems to interact poorly with + strip_trailing_slashes. For example, specify ":local:r:\" as + CVSROOT. The CVS/Root file will contain ":local:r:" and then + isabsolute will complain about the root not being an absolute + pathname. My guess is that strip_trailing_slashes is the right + place to fix this. */ return (ISDIRSEP (filename[0]) || (filename[0] != '\0' && filename[1] == ':' @@ -802,35 +684,6 @@ last_component (char *path) } -/* Read data from INFILE, and copy it to OUTFILE. - Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS. - This is useful for converting between CRLF and LF line formats. */ -void -convert_file (char *infile, int inflags, - char *outfile, int outflags) -{ - int infd, outfd; - char buf[8192]; - int len; - - if ((infd = open (infile, inflags)) < 0) - error (1, errno, "couldn't read %s", infile); - if ((outfd = open (outfile, outflags, S_IWRITE)) < 0) - error (1, errno, "couldn't write %s", outfile); - - while ((len = read (infd, buf, sizeof (buf))) > 0) - if (write (outfd, buf, len) < 0) - error (1, errno, "error writing %s", outfile); - if (len < 0) - error (1, errno, "error reading %s", infile); - - if (close (outfd) < 0) - error (0, errno, "warning: couldn't close %s", outfile); - if (close (infd) < 0) - error (0, errno, "warning: couldn't close %s", infile); -} - - /* NT has two evironment variables, HOMEPATH and HOMEDRIVE, which, when combined as ${HOMEDRIVE}${HOMEPATH}, give the unix equivalent of HOME. Some NT users are just too unixy, though, and set the diff --git a/gnu/usr.bin/cvs/windows-NT/ndir.c b/gnu/usr.bin/cvs/windows-NT/ndir.c index a5045b210af..9db46b385a6 100644 --- a/gnu/usr.bin/cvs/windows-NT/ndir.c +++ b/gnu/usr.bin/cvs/windows-NT/ndir.c @@ -9,10 +9,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - $Header: /cvs/OpenBSD/src/gnu/usr.bin/cvs/windows-NT/ndir.c,v 1.1.1.3 1997/06/28 03:29:36 tholo Exp $ - */ + GNU General Public License for more details. */ /* Everything non trivial in this code is from: @(#)msd_dir.c 1.4 87/11/06. A public domain implementation of BSD directory routines diff --git a/gnu/usr.bin/cvs/windows-NT/ndir.h b/gnu/usr.bin/cvs/windows-NT/ndir.h index 6cc9e40fc9b..4cfc0b3fa18 100644 --- a/gnu/usr.bin/cvs/windows-NT/ndir.h +++ b/gnu/usr.bin/cvs/windows-NT/ndir.h @@ -9,10 +9,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - $Header: /cvs/OpenBSD/src/gnu/usr.bin/cvs/windows-NT/ndir.h,v 1.1.1.4 1997/06/28 03:29:35 tholo Exp $ - */ + GNU General Public License for more details. */ /* Everything non trivial in this code is taken from: @(#)msd_dir.c 1.4 87/11/06. A public domain implementation of BSD directory routines diff --git a/gnu/usr.bin/cvs/windows-NT/options.h b/gnu/usr.bin/cvs/windows-NT/options.h index 33103dda051..d8f17fc1acc 100644 --- a/gnu/usr.bin/cvs/windows-NT/options.h +++ b/gnu/usr.bin/cvs/windows-NT/options.h @@ -16,18 +16,6 @@ */ /* - * CVS provides the most features when used in conjunction with the Version-5 - * release of RCS. Thus, it is the default. This also assumes that GNU diff - * Version-1.15 is being used as well -- you will have to configure your RCS - * V5 release separately to make this the case. If you do not have RCS V5 and - * GNU diff V1.15, comment out this define. You should not try mixing and - * matching other combinations of these tools. - */ -#ifndef HAVE_RCS5 -#define HAVE_RCS5 -#endif - -/* * For portability and heterogeneity reasons, CVS is shipped by default using * my own text-file version of the ndbm database library in the src/myndbm.c * file. If you want better performance and are not concerned about @@ -38,23 +26,6 @@ #endif /* - * The "diff" program to execute when creating patch output. This "diff" - * must support the "-c" option for context diffing. Specify a full - * pathname if your site wants to use a particular diff. If you are - * using the GNU version of diff (version 1.15 or later), this should - * be "diff -a". - * - * NOTE: this program is only used for the ``patch'' sub-command (and - * for ``update'' if you are using the server). The other commands - * use rcsdiff which will use whatever version of diff was specified - * when rcsdiff was built on your system. - */ - -#ifndef DIFF -#define DIFF "diff" -#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. @@ -63,36 +34,6 @@ #define PATCH_PROGRAM "patch" #endif -/* - * By default, RCS programs are executed with the shell or through execlp(), - * so the user's PATH environment variable is searched. If you'd like to - * bind all RCS programs to a certain directory (perhaps one not in most - * people's PATH) then set the default in RCSBIN_DFLT. Note that setting - * this here will cause all RCS programs to be executed from this directory, - * unless the user overrides the default with the RCSBIN environment variable - * or the "-b" option to CVS. - * - * If you use the password-authenticating server, then you need to - * make sure that the server can find the RCS programs to invoke them. - * The authenticating server starts out running as root, and then - * switches to run as the appropriate user once authentication is - * complete. But no actual shell is ever started by that user, so the - * PATH environment variable may not contain the directory with the - * RCS binaries, even though if that user logged in normally, PATH - * would include the directory. - * - * One way to solve this problem is to set RCSBIN_DFLT here. An - * alternative is to make sure that root has the right directory in - * its path already. Another, probably better alternative is to - * specify -b in /etc/inetd.conf. - * - * This define should be either the empty string ("") or a full pathname to the - * directory containing all the installed programs from the RCS distribution. - */ -#ifndef RCSBIN_DFLT -#define RCSBIN_DFLT "" -#endif - /* Directory used for storing temporary files, if not overridden by environment variables or the -T global option. There should be little need to change this (-T is a better mechanism if you need to use a @@ -224,8 +165,3 @@ #ifndef STDC_HEADERS extern void exit (); #endif - -#ifndef getwd -extern char *getwd (); -#endif - diff --git a/gnu/usr.bin/cvs/windows-NT/pwd.c b/gnu/usr.bin/cvs/windows-NT/pwd.c index 3a3d10097c2..683bb0c3653 100644 --- a/gnu/usr.bin/cvs/windows-NT/pwd.c +++ b/gnu/usr.bin/cvs/windows-NT/pwd.c @@ -9,10 +9,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - $Header: /cvs/OpenBSD/src/gnu/usr.bin/cvs/windows-NT/pwd.c,v 1.1.1.3 1997/06/28 03:29:37 tholo Exp $ -*/ + GNU General Public License for more details. */ /* This 'implementation' is conjectured from the use of this functions in the RCS and BASH distributions. Of course these functions don't do too diff --git a/gnu/usr.bin/cvs/windows-NT/pwd.h b/gnu/usr.bin/cvs/windows-NT/pwd.h index 614c41785ac..ad225a1c7e4 100644 --- a/gnu/usr.bin/cvs/windows-NT/pwd.h +++ b/gnu/usr.bin/cvs/windows-NT/pwd.h @@ -9,10 +9,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - $Header: /cvs/OpenBSD/src/gnu/usr.bin/cvs/windows-NT/pwd.h,v 1.1.1.3 1997/06/28 03:29:35 tholo Exp $ -*/ + GNU General Public License for more details. */ /* This 'implementation' is conjectured from the use of this functions in the RCS and BASH distributions. Of course these functions don't do too diff --git a/gnu/usr.bin/cvs/windows-NT/rcmd.c b/gnu/usr.bin/cvs/windows-NT/rcmd.c index 3a45b625623..8437e3cd438 100644 --- a/gnu/usr.bin/cvs/windows-NT/rcmd.c +++ b/gnu/usr.bin/cvs/windows-NT/rcmd.c @@ -12,6 +12,9 @@ Jim Blandy <jimb@cyclic.com> --- August 1995 */ +#include "cvs.h" +#include "rcmd.h" + #include <io.h> #include <fcntl.h> #include <malloc.h> @@ -39,9 +42,6 @@ #include <stdio.h> #include <assert.h> -#include "cvs.h" -#include "rcmd.h" - /* The rest of this file contains the rcmd() code, which is used only by START_SERVER. The idea for a long-term direction is that this code can be made portable (by using SOCK_ERRNO and @@ -167,6 +167,11 @@ rcmd_authenticate (int fd, char *locuser, char *remuser, char *command) } if (c != '\0') { + /* All the junk with USER, LOGNAME, GetUserName, &c, is so + confusing that we better give some clue as to what sort + of user name we decided on. */ + error (0, 0, "cannot log in as local user '%s', remote user '%s'", + locuser, remuser); error (1, 0, "Permission denied by rshd"); } } diff --git a/gnu/usr.bin/cvs/windows-NT/run.c b/gnu/usr.bin/cvs/windows-NT/run.c index d3e20865c26..e3411cba477 100644 --- a/gnu/usr.bin/cvs/windows-NT/run.c +++ b/gnu/usr.bin/cvs/windows-NT/run.c @@ -22,19 +22,6 @@ #include <io.h> #include <fcntl.h> -#ifdef HAVE_VPRINTF -#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) -#include <stdarg.h> -#define VA_START(args, lastarg) va_start(args, lastarg) -#else -#include <varargs.h> -#define VA_START(args, lastarg) va_start(args) -#endif -#else -#define va_alist a1, a2, a3, a4, a5, a6, a7, a8 -#define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; -#endif - static void run_add_arg PROTO((const char *s)); static void run_init_prog PROTO((void)); @@ -53,29 +40,17 @@ extern char *strtok (); * The execvp() syscall will be used, so that the PATH is searched correctly. * File redirections can be performed in the call to run_exec(). */ -static char *run_prog; static char **run_argv; static int run_argc; static int run_argc_allocated; -/* VARARGS */ -#if defined (HAVE_VPRINTF) && (defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)) -void -run_setup (const char *fmt,...) -#else -void -run_setup (fmt, va_alist) - char *fmt; - va_dcl -#endif +void +run_setup (const char *prog) { -#ifdef HAVE_VPRINTF - va_list args; -#endif char *cp; int i; - run_init_prog (); + char *run_prog; /* clean out any malloc'ed values from run_argv */ for (i = 0; i < run_argc; i++) @@ -88,18 +63,13 @@ run_setup (fmt, va_alist) } run_argc = 0; - /* process the varargs into run_prog */ -#ifdef HAVE_VPRINTF - VA_START (args, fmt); - (void) vsprintf (run_prog, fmt, args); - va_end (args); -#else - (void) sprintf (run_prog, fmt, a1, a2, a3, a4, a5, a6, a7, a8); -#endif + run_prog = xstrdup (prog); /* put each word into run_argv, allocating it as we go */ for (cp = strtok (run_prog, " \t"); cp; cp = strtok ((char *) NULL, " \t")) run_add_arg (cp); + + free (run_prog); } void @@ -109,50 +79,32 @@ run_arg (s) run_add_arg (s); } -/* VARARGS */ -#if defined (HAVE_VPRINTF) && (defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)) -void -run_args (const char *fmt,...) -#else -void -run_args (fmt, va_alist) - char *fmt; - va_dcl -#endif -{ -#ifdef HAVE_VPRINTF - va_list args; -#endif - - run_init_prog (); - - /* process the varargs into run_prog */ -#ifdef HAVE_VPRINTF - VA_START (args, fmt); - (void) vsprintf (run_prog, fmt, args); - va_end (args); -#else - (void) sprintf (run_prog, fmt, a1, a2, a3, a4, a5, a6, a7, a8); -#endif - - /* and add the (single) argument to the run_argv list */ - run_add_arg (run_prog); -} - /* Return a malloc'd copy of s, with double quotes around it. */ static char * quote (const char *s) { - size_t s_len = strlen (s); - char *copy = xmalloc (s_len + 3); - char *scan = copy; - + size_t s_len = 0; + char *copy = NULL; + char *scan = (char *) s; + + /* scan string for extra quotes ... */ + while (*scan) + if ('"' == *scan++) + s_len += 2; /* one extra for the quote character */ + else + s_len++; + /* allocate length + byte for ending zero + for double quotes around */ + scan = copy = xmalloc(s_len + 3); *scan++ = '"'; - strcpy (scan, s); - scan += s_len; + while (*s) + { + if ('"' == *s) + *scan++ = '\\'; + *scan++ = *s++; + } + /* ending quote and closing zero */ *scan++ = '"'; *scan++ = '\0'; - return copy; } @@ -177,20 +129,11 @@ run_add_arg (s) run_argv[run_argc] = (char *) 0; /* not post-incremented on purpose! */ } -static void -run_init_prog () -{ - /* make sure that run_prog is allocated once */ - if (run_prog == (char *) 0) - run_prog = xmalloc (10 * 1024); /* 10K of args for _setup and _arg */ -} - - int run_exec (stin, stout, sterr, flags) - char *stin; - char *stout; - char *sterr; + const char *stin; + const char *stout; + const char *sterr; int flags; { int shin, shout, sherr; @@ -339,7 +282,6 @@ run_exec (stin, stout, sterr, flags) return (status); } - void run_print (fp) FILE *fp; diff --git a/gnu/usr.bin/cvs/windows-NT/win32.c b/gnu/usr.bin/cvs/windows-NT/win32.c index 35710ef63c6..8a25aa6e6ba 100644 --- a/gnu/usr.bin/cvs/windows-NT/win32.c +++ b/gnu/usr.bin/cvs/windows-NT/win32.c @@ -12,6 +12,8 @@ #include <windows.h> #include <config.h> +#include <winsock.h> +#include <stdlib.h> void init_winsock () @@ -42,11 +44,14 @@ int gethostname(char* name, int namelen) } #endif -char* win32getlogin() +char *win32getlogin() { - static char name[256]; - DWORD dw = 256; - GetUserName(name, &dw); + static char name[256]; + DWORD dw = 256; + GetUserName (name, &dw); + if (name[0] == '\0') + return NULL; + else return name; } |