bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch for RISC OS platform support in CVS


From: John Tytgat
Subject: Patch for RISC OS platform support in CVS
Date: Wed, 25 Oct 2000 03:52:37 +0100
User-agent: Messenger-Pro/2.10d (MsgServe/1.10) (RISC-OS/4.03) POPstar/2.02

Please find below a context diff with current 1.11.0.1 CVS sources
for RISC OS support in CVS (for more info about RISC OS, see
<URL:http://www.riscos.com/> and <URL:http://www.riscos.org/>).
Basically it is adding a couple of new files (mainly makefiles) and a
fix in lib/regex.c and zlib/Makefile.riscos.  The rest of the CVS source
code remains untouched.

I would appreciate if this patch could be incorporated in the official
CVS source tree.  This port has been tested by several beta testers during
more than a year and is considered as 'stable'.

I grant permission to distribute this patch under the terms of the
GNU Public License.

John.
<URL:mailto:John.Tytgat@aaug.net>

=========================================================================

<CVS$BinDir>.cvs diff: Diffing ccvs
Index: ccvs/ChangeLog
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/ChangeLog,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ChangeLog
*** ccvs/ChangeLog      2000/10/25 00:55:59     1.1.1.1
--- ccvs/ChangeLog      2000/10/25 01:03:42
***************
*** 1,3 ****
--- 1,9 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * riscos: added for RISC OS port
+       * NEWS: added a comment about the RISC OS port
+       * Makefile/in: added riscos sub project
+ 
  2000-10-18  Derek Price  <derek.price@openavenue.com>
  
        * .cvsignore: Added .fname & .version, two temporary files used in spec
Index: ccvs/Makefile.in
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/Makefile.in,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile.in
*** ccvs/Makefile.in    2000/10/25 00:56:07     1.1.1.1
--- ccvs/Makefile.in    2000/10/25 01:03:14
***************
*** 97,103 ****
  USOURCE_SUBDIRS = lib zlib diff src
  # All other subdirs:
  SUBDIRS = ${USOURCE_SUBDIRS} man doc contrib tools \
!       windows-NT os2 emx vms
  # Only make TAGS/tags files in these directories.
  TSUBDIRS= src lib
  
--- 97,103 ----
  USOURCE_SUBDIRS = lib zlib diff src
  # All other subdirs:
  SUBDIRS = ${USOURCE_SUBDIRS} man doc contrib tools \
!       windows-NT os2 emx vms riscos
  # Only make TAGS/tags files in these directories.
  TSUBDIRS= src lib
  
Index: ccvs/NEWS
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/NEWS,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 NEWS
*** ccvs/NEWS   2000/10/25 00:56:08     1.1.1.1
--- ccvs/NEWS   2000/10/24 23:31:05
***************
*** 1,5 ****
--- 1,7 ----
  Changes since 1.11:
  
+ * Support for CVS on RISC OS platform.
+ 
  * The ~/.cvspass file has a slightly modified format.  Now two slightly
  different CVSROOTs which represent the same repository and user name no 
longer  require separate calls to 'cvs login' to use.  The new code should be 
backwards
<CVS$BinDir>.cvs diff: Diffing ccvs/contrib
<CVS$BinDir>.cvs diff: Diffing ccvs/contrib/elib
<CVS$BinDir>.cvs diff: Diffing ccvs/contrib/elib/elib-1.0
<CVS$BinDir>.cvs diff: Diffing ccvs/contrib/pcl-cvs
<CVS$BinDir>.cvs diff: Diffing ccvs/contrib/pcl-cvs/elib
<CVS$BinDir>.cvs diff: Diffing ccvs/diff
Index: ccvs/diff/ChangeLog
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/diff/ChangeLog,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ChangeLog
*** ccvs/diff/ChangeLog 2000/10/25 00:56:21     1.1.1.1
--- ccvs/diff/ChangeLog 2000/10/24 23:22:16
***************
*** 1,3 ****
--- 1,7 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * Makefile/riscos: added for RISC OS port
+ 
  2000-08-03  Larry Jones  <larry.jones@sdrc.com>
  
        * diff3.c (read_diff): Use cvs_temp_name () instead of tmpnam () so
Index: ccvs/diff/Makefile.riscos
===================================================================
RCS file: Makefile.riscos
diff -N Makefile.riscos
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile.riscos     Wed Oct 25 03:27:52 2000
***************
*** 0 ****
--- 1,27 ----
+ # Project:    ccvs/diff/diff_lib
+ # Platform:   RISC OS
+ # License:    GNU Public License
+ # Author:     John Tytgat <John.Tytgat@aaug.net>
+ 
+ # Toolflags:
+ INCL = -I^.lib -I^.riscos -IUnix:
+ DEFS = -DRISCOS -DHAVE_CONFIG_H
+ CC = cc
+ CCFLAGS = -c -depend !Depend $(INCL) -JUnix: -throwback $(DEFS) -fnh -Wp -ec
+ LIBFILE = libfile
+ LIBFILEFLAGS = -c -l -o $@ 
+ 
+ OBJS =        o.analyze o.cmpbuf o.context o.diff o.diff3 o.dir o.ed \
+       o.ifdef o.io o.normal o.side o.util o.version
+ 
+ # Final targets:
+ diff_lib: $(OBJS)
+         $(LIBFILE) $(LIBFILEFLAGS) $(OBJS)
+ 
+ # User-editable dependencies:
+ .c.o:
+         $(CC) $(CCFLAGS) -o $@ $<
+ 
+ # Static dependencies:
+ 
+ # Dynamic dependencies:
<CVS$BinDir>.cvs diff: Diffing ccvs/doc
<CVS$BinDir>.cvs diff: Diffing ccvs/emx
<CVS$BinDir>.cvs diff: Diffing ccvs/examples
<CVS$BinDir>.cvs diff: Diffing ccvs/lib
Index: ccvs/lib/ChangeLog
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/lib/ChangeLog,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ChangeLog
*** ccvs/lib/ChangeLog  2000/10/25 00:56:40     1.1.1.1
--- ccvs/lib/ChangeLog  2000/10/24 23:24:21
***************
*** 1,3 ****
--- 1,9 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * Makefile/riscos: added for RISC OS port
+       * regex.c: removed compile_range() declaration (wasn't used and
+       gave a compile error)
+ 
  2000-07-10  Larry Jones  <larry.jones@sdrc.com>
  
        * savecwd.c: #include <sys/types.h> before <fcntl.h>.
Index: ccvs/lib/Makefile.riscos
===================================================================
RCS file: Makefile.riscos
diff -N Makefile.riscos
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile.riscos     Wed Oct 25 02:24:28 2000
***************
*** 0 ****
--- 1,30 ----
+ # Project:    ccvs/lib/cvs_lib
+ # Platform:   RISC OS
+ # License:    GNU Public License
+ # Author:     John Tytgat <John.Tytgat@aaug.net>
+ 
+ # Toolflags:
+ INCL = -I. -I^.src -I^.riscos -IUnix:
+ DEFS = -DRISCOS -DHAVE_CONFIG_H
+ CC = cc
+ CCFLAGS = -c -depend !Depend $(INCL) -JUnix: -throwback $(DEFS) -fnh -Wp -ec
+ LIBFILE = LibFile
+ LIBFILEFLAGS = -c -l -o $@ 
+ 
+ # o.fncase
+ OBJS =        o.argmatch o.getdate o.getline \
+       o.getopt o.getopt1 o.md5 o.regex \
+       o.savecwd o.sighandle o.stripslash \
+       o.xgetwd o.yesno 
+ 
+ # Final targets:
+ cvs_lib: $(OBJS)
+         $(LIBFILE) $(LIBFILEFLAGS) $(OBJS)
+ 
+ # User-editable dependencies:
+ .c.o:
+         $(CC) $(CCFLAGS) -o $@ $<
+ 
+ # Static dependencies:
+ 
+ # Dynamic dependencies:
Index: ccvs/lib/regex.c
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/lib/regex.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 regex.c
*** ccvs/lib/regex.c    2000/10/25 00:56:35     1.1.1.1
--- ccvs/lib/regex.c    2000/10/24 23:45:54
***************
*** 1534,1540 ****
  static void insert_op1 (), insert_op2 ();
  static boolean at_begline_loc_p (), at_endline_loc_p ();
  static boolean group_in_compile_stack ();
- static reg_errcode_t compile_range ();
  
  /* Fetch the next character in the uncompiled pattern---translating it
     if necessary.  Also cast from a signed character in the constant
--- 1534,1539 ----
***************
*** 5472,5478 ****
              UPDATE_SYNTAX_TABLE (charpos);
  #endif
              s2 = SYNTAX (c2);
!       
              /* Case 2: S2 is not Sword. */
              if (s2 != Sword)
                goto fail;
--- 5471,5477 ----
              UPDATE_SYNTAX_TABLE (charpos);
  #endif
              s2 = SYNTAX (c2);
! 
              /* Case 2: S2 is not Sword. */
              if (s2 != Sword)
                goto fail;
<CVS$BinDir>.cvs diff: Diffing ccvs/macintosh
<CVS$BinDir>.cvs diff: Diffing ccvs/man
<CVS$BinDir>.cvs diff: Diffing ccvs/os2
<CVS$BinDir>.cvs diff: Diffing ccvs/riscos
Index: ccvs/riscos/BuildCVS,feb
===================================================================
RCS file: BuildCVS,feb
diff -N BuildCVS,feb
*** /dev/null   Thu Jan 01 01:00:00 1970
--- BuildCVS,feb        Wed Oct 25 03:34:45 2000
***************
*** 0 ****
--- 1,3 ----
+ | Build the RISC OS version of CVS.
+ Dir <Obey$Dir>
+ TaskWindow "amu -desktop -k -f Makefile" -display -quit -wimpslot 2048k -name 
"Makefile CVS"
\ No newline at end of file
Index: ccvs/riscos/ChangeLog
===================================================================
RCS file: ChangeLog
diff -N ChangeLog
*** /dev/null   Thu Jan 01 01:00:00 1970
--- ChangeLog   Wed Oct 25 00:32:56 2000
***************
*** 0 ****
--- 1,6 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * Makefile,fe1, BuildCVS,feb, MakeClean,feb, ChangeLog, CleanMakeFile,
+       Makefile/in, Makefile/riscos, README, filesubr.c, rcmd.c, ro.c,
+       romain.c, server_if.c, config.c, options.c: add for the RISC OS
+       port.
Index: ccvs/riscos/CleanMakeFile
===================================================================
RCS file: CleanMakeFile
diff -N CleanMakeFile
*** /dev/null   Thu Jan 01 01:00:00 1970
--- CleanMakeFile       Sat Oct 21 17:12:49 2000
***************
*** 0 ****
--- 1,42 ----
+    100 REM > CleanMakeFile
+    200 REM Removes the dynamic dependencies in RISC OS makefiles
+    300 REM (i.e. removes all the data after the "# Dynamic dependencies:" 
line).
+    400 REM
+    500 REM Written by John Tytgat <John.Tytgat@aaug.net>
+    600 REM GNU Public License
+    700 :
+    800 FileHandle% = 0
+    900 ON ERROR ON ERROR OFF:PROCError:END
+   1000 :
+   1100 SYS "OS_GetEnv" TO A$
+   1200 Offset% = INSTR(A$, " -file")
+   1300 IF Offset% = 0 THEN
+   1400   PRINT "Missing ""-file <filename>"" argument"
+   1500   END
+   1600 ENDIF
+   1700 MakeFileName$ = MID$(A$, Offset% + 7)
+   1800 :
+   1900 FileHandle% = OPENUP(MakeFileName$)
+   2000 IF FileHandle% = 0 THEN ERROR 1, "Can't open RISC OS Makefile 
<"+MakeFileName$+">"
+   2100 :
+   2200 CleanedUp% = FALSE
+   2300 WHILE NOT(EOF#FileHandle%) AND NOT(CleanedUp%)
+   2400   aLine$ = GET$#FileHandle%
+   2500   IF aLine$ = "# Dynamic dependencies:" THEN
+   2600     EXT#FileHandle% = PTR#FileHandle%
+   2700     CleanedUp% = TRUE
+   2800   ENDIF
+   2900 ENDWHILE
+   3000 CLOSE#FileHandle%:FileHandle% = 0
+   3100 :
+   3200 IF NOT(CleanedUp%) THEN
+   3300   PRINT "There was nothing to clean up in the file 
<";MakeFileName$;">"+   3400 ENDIF
+   3500 END
+   3600 :
+   3700 DEF PROCError
+   3800 PRINT "ERROR: ";REPORT$;" at line ";ERL
+   3900 IF FileHandle% <> 0 THEN
+   4000   CLOSE#FileHandle%:FileHandle% = 0
+   4100 ENDIF
+   4200 ENDPROC
Index: ccvs/riscos/MakeClean,feb
===================================================================
RCS file: MakeClean,feb
diff -N MakeClean,feb
*** /dev/null   Thu Jan 01 01:00:00 1970
--- MakeClean,feb       Wed Oct 25 00:06:42 2000
***************
*** 0 ****
--- 1,29 ----
+ | Obey script which removes all generated files during a compilation on
+ | RISC OS and the dependency information in the RISC OS makefiles.
+ | Written by John Tytgat <John.Tytgat@aaug.net>
+ Echo Cleaning zlib subproject...
+ IfThere <Obey$Dir>.^.zlib.o Then Wipe <Obey$Dir>.^.zlib.o ~CFR~V
+ Remove <Obey$Dir>.^.zlib.zlib_lib
+ Basic -quit <Obey$Dir>.CleanMakeFile -file <Obey$Dir>.^.zlib.Makefile/riscos
+ 
+ Echo Cleaning riscos subproject...
+ IfThere <Obey$Dir>.^.riscos.o Then Wipe <Obey$Dir>.^.riscos.o ~CFR~V
+ Remove <Obey$Dir>.^.riscos.ro_lib
+ Basic -quit <Obey$Dir>.CleanMakeFile -file 
<Obey$Dir>.^.riscos.Makefile/riscos+ 
+ Echo Cleaning diff subproject...
+ IfThere <Obey$Dir>.^.diff.o Then Wipe <Obey$Dir>.^.diff.o ~CFR~V
+ Remove <Obey$Dir>.^.diff.diff_lib
+ Basic -quit <Obey$Dir>.CleanMakeFile -file <Obey$Dir>.^.diff.Makefile/riscos
+ 
+ Echo Cleaning lib subproject...
+ IfThere <Obey$Dir>.^.lib.o Then Wipe <Obey$Dir>.^.lib.o ~CFR~V
+ Remove <Obey$Dir>.^.lib.cvs_lib
+ Basic -quit <Obey$Dir>.CleanMakeFile -file <Obey$Dir>.^.lib.Makefile/riscos
+ 
+ Echo Cleaning src subproject...
+ IfThere <Obey$Dir>.^.src.o Then Wipe <Obey$Dir>.^.src.o ~CFR~V
+ Remove <Obey$Dir>.^.src.cvscmd
+ Basic -quit <Obey$Dir>.CleanMakeFile -file <Obey$Dir>.^.src.Makefile/riscos
+ 
+ Echo Done.
\ No newline at end of file
Index: ccvs/riscos/Makefile,fe1
===================================================================
RCS file: Makefile,fe1
diff -N Makefile,fe1
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile,fe1        Sun Jul 23 19:10:36 2000
***************
*** 0 ****
--- 1,36 ----
+ # Project:    cvs
+ # Platform:   RISC OS
+ # License:    GNU Public License
+ # Author:     John Tytgat <John.Tytgat@aaug.net>
+ 
+ # Toolflags:
+ MAKE = amu
+ MAKEFLAGS = -desktop -k
+ 
+ SUBPROJECTS = ^.zlib.zlib_lib ^.riscos.ro_lib ^.diff.diff_lib \
+       ^.lib.cvs_lib
+ 
+ # Final target:
+ ^.src.cvs:    $(SUBPROJECTS)
+       CDir ^.src.o
+         $(MAKE) $(MAKEFLAGS) -f ^.src.Makefile/riscos
+ 
+ # Sub projects:
+ ^.zlib.zlib_lib: FORCE
+       CDir ^.zlib.o
+         $(MAKE) $(MAKEFLAGS) -f ^.zlib.Makefile/riscos
+ 
+ ^.riscos.ro_lib: FORCE
+       CDir ^.riscos.o
+         $(MAKE) $(MAKEFLAGS) -f ^.riscos.Makefile/riscos
+ 
+ ^.diff.diff_lib: FORCE
+       CDir ^.diff.o
+         $(MAKE) $(MAKEFLAGS) -f ^.diff.Makefile/riscos
+ 
+ ^.lib.cvs_lib: FORCE
+       CDir ^.lib.o
+         $(MAKE) $(MAKEFLAGS) -f ^.lib.Makefile/riscos
+ 
+ FORCE:
+       |
Index: ccvs/riscos/Makefile.in
===================================================================
RCS file: Makefile.in
diff -N Makefile.in
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile.in Wed Oct 25 00:13:30 2000
***************
*** 0 ****
--- 1,70 ----
+ #### Under RISC OS we use the BuildCVS Obey file, not this makefile.
+ #### However, we need this file in order for 'make dist' to work
+ #### properly on Unix machines.
+ 
+ srcdir     = @srcdir@
+ top_srcdir = @top_srcdir@
+ cvs_srcdir = @top_srcdir@/src
+ VPATH      = @srcdir@
+ 
+ SHELL = /bin/sh
+ 
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ 
+ 
+ HEADERS = \
+   config.h \
+   options.h
+ SOURCES = \
+   filesubr.c \
+   rcmd.c \
+   ro.c \
+   romain.c \
+   server_if.c
+ DISTFILES = ${HEADERS} ${SOURCES} \
+   BuildCVS,feb MakeClean,feb ChangeLog CleanMakeFile Makefile,fe1
+   Makefile.in Makefile.riscos README
+ 
+ SUBDIRS=SCC
+ 
+ all:
+ 
+ .PHONY: all install uninstall
+ all install uninstall:
+ 
+ installdirs:
+ .PHONY: installdirs
+ 
+ .PHONY: tags TAGS
+ tags TAGS:
+ 
+ .PHONY: ls
+ ls:
+       @echo ${DISTFILES}
+ 
+ .PHONY: clean distclean realclean mostlyclean
+ clean realclean mostlyclean:
+ 
+ distclean:
+       rm -f Makefile
+ 
+ .PHONY: lint
+ lint:
+ 
+ .PHONY: dist-dir
+ dist-dir:
+       mkdir ${DISTDIR}
+       for i in ${DISTFILES}; do \
+         ln $(srcdir)/$${i} ${DISTDIR}; \
+       done
+       for i in ${SUBDIRS}; do \
+         cd $${i}; ${MAKE} dist-dir DISTDIR="../${DISTDIR}/$${i}"; \
+       done
+ 
+ clean:
+       @echo make clean does nothing in riscos subdir
+ 
+ subdir = riscos
+ Makefile: ../config.status Makefile.in
+       cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
Index: ccvs/riscos/Makefile.riscos
===================================================================
RCS file: Makefile.riscos
diff -N Makefile.riscos
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile.riscos     Wed Oct 25 02:36:00 2000
***************
*** 0 ****
--- 1,26 ----
+ # Project:    ccvs/riscos/ro_lib
+ # Platform:   RISC OS
+ # License:    GNU Public License
+ # Author:     John Tytgat <John.Tytgat@aaug.net>
+ 
+ # Toolflags:
+ INCL = -I^.lib -I^.src -I^.riscos -IUnix:
+ DEFS = -DRISCOS -DHAVE_CONFIG_H
+ CC = cc
+ CCFLAGS = -c -depend !Depend $(INCL) -JUnix: -throwback $(DEFS) -fnh -Wp -ec
+ LIBFILE = LibFile
+ LIBFILEFLAGS = -c -l -o $@ 
+ 
+ OBJS =        o.filesubr o.rcmd o.ro o.romain o.server_if
+ 
+ # Final targets:
+ ro_lib: $(OBJS)
+         $(LIBFILE) $(LIBFILEFLAGS) $(OBJS)
+ 
+ # User-editable dependencies:
+ .c.o:
+         $(CC) $(CCFLAGS) -o $@ $<
+ 
+ # Static dependencies:
+ 
+ # Dynamic dependencies:
Index: ccvs/riscos/README
===================================================================
RCS file: README
diff -N README
*** /dev/null   Thu Jan 01 01:00:00 1970
--- README      Sat Oct 21 17:15:12 2000
***************
*** 0 ****
--- 1,200 ----
+                           CVS port to RISC OS
+                           +++++++++++++++++++
+ 
+ This port implements the full set of CVS commands, both local and
+ client.  It does not provide a CVS server for RISC OS.  Multiple users can
+ access a common CVS repository, if they can mount the repository,
+ either directly or via a networked file system.
+ 
+ RISC OS is an OS for ARM processors (and direct derivates like StrongARM
+ and XScale) formally developed by Acorn Ltd and now jointly developed by
+ Pace Ltd <URL:http://www.pacemicro.com> and RISCOS Ltd.
+ <URL:http://www.riscos.com>.
+ 
+ This file details the RISC OS specifique build & run-time instructions.
+ 
+ 1.0 Build procedure:
+ ===================
+ 
+ 1.0.1 You need:
+ --------------
+ 
+   1. Acorn C compiler (I used version 5.06).  Probably the GNU C compiler
+      will also work but I haven't had a change to try this out.
+   2. An UnixLib version which is more recent than 3th July 2000.
+      See <URL:http://hard-mofo.dsvr.net/unixlib/> for more information
+      about UnixLib.
+   3. OSLib 6.01 (a previous or more recent version might work too).
+      See <URL:http://www.mk-net.demon.co.uk/OSLib/> for more information
+      about UnixLib.
+ 
+ 1.0.2 In order build CVS:
+ ------------------------
+ 
+   1. Double click on the 'BuildCVS' Obey file.
+   2. Final binary can be found as 'cvscmd' in the 'src' directory.
+ 
+ 1.0.3 After building:
+ --------------------
+ 
+   You can remove all generated files by double clicking on the 'MakeClean'
+   Obey file (including 'cvscmd', the final target).
+ 
+ 1.1 Run-time requirements
+ =========================
+ 
+ 1.1.1 Long Filenames
+ --------------------
+ 
+ You need at least RISC 3.1 or higher with a filing system which is
+ capable of storing filenames longer than 10 characters (16 characters
+ or more is recommended).
+ 
+ RISC OS 3 users can use programs like raFS, X-files, LongFiles, MacFS,
+ Win95FS or network based FS like NFS, AppleTalk or LanMan98 as an
+ alternative for their 10 character limited FileCore version.
+ 
+ RISC OS 4 users can use the build-in FileCore based FS when their
+ disc medium is formatted with support for 'long filenames' (like
+ E+ or F+ format).
+ 
+ 1.1.2. Network
+ --------------
+ 
+ Only when you intend to access CVS databases across the network
+ (transport modes :server: & :pserver:), you need a working
+ Internet stack.  Only Acorn's Internet v5 has been tested
+ successfully (FreeNet might work but hasn't been tested).
+ 
+ 1.1.3. Usage
+ ------------
+ 
+ The main idea behind the port was to change as less as possible
+ the CVS sources to get it working under RISC OS.  Using the latest
+ version of UnixLib this was more or less possible.  There are few
+ things which show the consequences of this decision :
+ 
+ - as CVS is very much file operation based and those files are
+   referred using Unix filenames, the RISC OS user needs to specify
+   the files & directories using Unixified RISC OS file/dir names.
+   E.g. :
+   
+   cvs -d :local:/SCSI::MyHardDisc/$/cvs/cvsroot init
+   
+   instead of what you may have expected :
+   
+   cvs -d :local:SCSI::MyHardDisc.$.cvs.cvsroot init
+ 
+   The file & directory specifications shown during the CVS operations
+   will also be in such a Unixified way.
+ 
+ - in order to be slightly more RISC OS compliant concerning environment
+   (system) variables, a *second* environment lookup is done when the original
+   CVS environment variables can not be found.  The following table will
+   make it clear :
+ 
+   First try:      Second try:
+ 
+   CVSROOT      -> CVS$ROOT
+   CVS_PASSFILE -> CVS$PASSFILE
+   CVS$HomeDir     <no second try>
+   TMPDIR       -> CVS$TMPDIR
+ 
+   The idea for the user is to use as much the 'CVS$' environment
+   (system) variables as possible but still support the CVS Unix
+   compatible environment variables for those who really want.
+ 
+ - when environment (system) variable CVS$HomeDir is not defined, but
+   Choices$Write is, then cvs will create a sub dir <Choices$Write>.CVS
+   and consider that directory as home dir (where /cvspass file is stored).
+   If CVS$HomeDir is defined, it should point to a directory holding
+   the /cvspass file.
+ 
+ - as CVS uses filename lengths of more than 10 characters for
+   storing its CVSROOT database, you *must* use a filing system
+   which is capable of doing this.  Personally I've used raFS on top
+   of a 10-char limited FileCore based FS quite successfully.  Now
+   I'm using a 'long filename' formatted harddisc under RISC OS 4.03
+   without any problems.  Also when you use the :server: or :pserver:
+   transport mode, you also need a FS which can store sufficent long
+   filename lengths when the source filenames contain more than 10
+   characters.
+ 
+   Watch out with the following gotcha :
+   
+     cvs -d /tmp/cvs init
+ 
+   generates the CVSROOT dir in <Wimp$ScrapDir> (UnixLib maps '/tmp' to
+   <Wimp$ScrapDir> and visa versa) and comes up with several
+   errors like (because of the 10 char FileCore limit) :
+   
+   cvs init: ERROR: cannot write file /tmp/cvs/CVSROOT/commitinfo,v: File open
+   cvs init: ERROR: cannot write file /tmp/cvs/CVSROOT/checkoutlist,v: File 
open
+   cvs init: ERROR: cannot write file /tmp/cvs/CVSROOT/cvswrappers,v: File 
open+   cvs [init aborted]: EOF in value in RCS file commitinfo,v
+ 
+   Solution: be explicit in your definition of CVS$ROOT or -d argument
+   by specifying the transport mode and if that is ':local:' use a
+   Unixified RISC OS directory specfication, like :
+   
+   Set CVS$ROOT :local:/AppleFS::Mac.$/cvs
+   cvs init
+   
+   or
+   
+   cvs -d :local:/AppleFS::Mac.$/cvs init
+ 
+ - Two features in UnixLib were enhanced and/or created for this CVS port :
+ 
+   1. Suffix swapping
+   
+   Files like "main.c" (as Unix file spec) are translated into "c.main"
+   on RISC OS and visa versa.
+ 
+   When you do *not* want this behaviour and would like to map "c.main"
+   (RISC OS) on "c/main" (Unix), you need to (re)define the system
+   variable :
+   
+     Set UnixEnv$cvs$sfix ""
+   
+   When 'UnixEnv$cvs$sfix' is not defined :
+   
+     UnSet UnixEnv$cvs$sfix
+   
+   Then the implicit default value "a:c:cc:f:h:i:ii:l:o:p:s:y" is used
+   (which leads to the above mentioned suffix swapping for the suffixes
+   'a', 'c', 'cc', 'f', 'h', 'i', 'ii', 'l', 'o', 'p', 's' and 'y').
+ 
+   This allows you to checkout e.g. C sources from public CVS servers
+   and have it ready in a ready-to-compile directory structure for
+   RISC OS.  No need for file renaming tools !
+ 
+   2. A second enhancement is the filetype extension
+   
+   Filetype extension happens when non text filetyped RISC OS files
+   get their filetype as a 12bit hex number appended to their
+   Unix 'equivalent' filenames.
+      
+   E.g. 'MakeFile' (filetype &fe1) on RISC OS has the Unix
+        filename 'MakeFile,fe1'.
+ 
+        A second example is 'o.main' (filetype 0xFFD) on
+        RISC OS, which results in the Unix filename 'main.o,ffd'
+        (when suffix swapping is defined for suffix 'o').
+ 
+   This is same filetype mapping as used in the Acorn NFS client.
+ 
+   If you want to have text files ",fff" appended, you have to define
+   the following system variable :
+   
+     Set CVS$FFFExt ""
+ 
+ 2.0 Credits:
+ ===========
+ 
+ Initial RISC OS port by John Tytgat <John.Tytgat@aaug.net>.
+ 
+ Big thanks for all the CVS developers, the people behind UnixLib
+ and the RISC OS CVS beta testers.
+ 
+ -EOF-
Index: ccvs/riscos/config.h
===================================================================
RCS file: config.h
diff -N config.h
*** /dev/null   Thu Jan 01 01:00:00 1970
--- config.h    Tue Oct 24 23:50:27 2000
***************
*** 0 ****
--- 1,339 ----
+ /* config.h --- configuration file for RISC OS platform
+    John Tytgat <John.Tytgat@aaug.net> */
+ 
+ /* This file lives in the riscos subdirectory, which is only included
+    in your header search path if you're working under RISC OS, and use
+    the 'BuildCVS' Obey file for building.  Thus, this is the right place
+    to put configuration information for RISC OS.  */
+ 
+ /* Define if on AIX 3.
+    System headers sometimes define this.
+    We just want to avoid a redefinition error message.  */
+ #ifndef _ALL_SOURCE
+ #undef _ALL_SOURCE
+ #endif
+ 
+ /* Define if the closedir function returns void instead of int.  */
+ #undef CLOSEDIR_VOID
+ 
+ /* Define to empty if the keyword does not work.  */
+ #define const
+ 
+ /* Define to `int' if <sys/types.h> doesn't define.  */
+ /* #undef gid_t */
+ 
+ /* Define if your system has a working fnmatch function.  */
+ #define HAVE_FNMATCH 1
+ 
+ /* Define if you support file names longer than 14 characters.  */
+ #define HAVE_LONG_FILE_NAMES 1
+ 
+ /* Define if your struct stat has st_blksize.  */
+ #define HAVE_ST_BLKSIZE 1
+ 
+ /* Define if your struct stat has st_rdev.  */
+ #define HAVE_ST_RDEV 1
+ 
+ /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
+ #define HAVE_SYS_WAIT_H 1
+ 
+ /* Define if utime(file, NULL) sets file's timestamp to the present.  */
+ #define HAVE_UTIME_NULL 1
+ 
+ /* Define if you have <vfork.h>.  */
+ #undef HAVE_VFORK_H
+ 
+ /* Define if on MINIX.  */
+ #undef _MINIX
+ 
+ /* Define to `int' if <sys/types.h> doesn't define.  */
+ /* #undef mode_t */
+ 
+ /* Define to `int' if <sys/types.h> doesn't define.  */
+ /* #undef pid_t */
+ 
+ /* Define if the system does not provide POSIX.1 features except
+    with this defined.  */
+ #undef _POSIX_1_SOURCE
+ 
+ /* Define if you need to in order for stat and other things to work.  */
+ #undef _POSIX_SOURCE
+ 
+ /* Define as the return type of signal handlers (int or void).  */
+ #define RETSIGTYPE void
+ 
+ /* Define to `unsigned' if <sys/types.h> doesn't define.  */
+ /* #undef size_t */
+ 
+ /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
+ #undef STAT_MACROS_BROKEN
+ 
+ /* Define if you have the ANSI C header files.  */
+ #define STDC_HEADERS 1
+ 
+ /* Define if you can safely include both <sys/time.h> and <time.h>.  */
+ #define TIME_WITH_SYS_TIME 1
+ 
+ /* Define to `int' if <sys/types.h> doesn't define.  */
+ /* #undef uid_t */
+ 
+ /* Define vfork as fork if vfork does not work.  */
+ #undef vfork
+ 
+ /* Define if you have MIT Kerberos version 4 available.  */
+ #undef HAVE_KERBEROS
+ 
+ /* Define if GSS_C_NT_HOSTBASED_SERVICE is defined in the gssapi.h
+    header file.  Only relevant when using GSSAPI.  */
+ #undef HAVE_GSS_C_NT_HOSTBASED_SERVICE
+ 
+ /* Define if you want CVS to be able to be a remote repository client.  */
+ #define CLIENT_SUPPORT 1
+ 
+ /* Define if you want CVS to be able to serve repositories to remote
+    clients.  */
+ #undef SERVER_SUPPORT
+ 
+ /* Define if you want to use the password authenticated server.  */
+ #undef AUTH_SERVER_SUPPORT
+ 
+ /* Define if you want encryption support.  */
+ #undef ENCRYPTION
+ 
+ /* Define if you have the connect function.  */
+ #define HAVE_CONNECT 1
+ 
+ /* Define if you have memchr (always for CVS).  */
+ #define HAVE_MEMCHR 1
+ 
+ /* Define if you have strchr (always for CVS).  */
+ #define HAVE_STRCHR 1
+ 
+ /* Define if utime requires write access to the file (true on Windows,
+    but not Unix).  */
+ #undef UTIME_EXPECTS_WRITABLE
+ 
+ /* Define if setmode is required when writing binary data to stdout.  */
+ #undef USE_SETMODE_STDOUT
+ 
+ /* Define if the diff library should use setmode for binary files.
+    FIXME: Why two different macros for setmode?  */
+ #undef HAVE_SETMODE
+ 
+ /* Define if you have the crypt function.  */
+ #undef HAVE_CRYPT
+ 
+ /* Define if you have the getspnam function.  */
+ #undef HAVE_GETSPNAM
+ 
+ /* Define to force lib/regex.c to use malloc instead of alloca.  */
+ #undef REGEX_MALLOC
+ 
+ /* Define to force lib/regex.c to define re_comp et al.  */
+ #define _REGEX_RE_COMP
+ 
+ /* Define if you have the dup2 function.  */
+ #undef HAVE_DUP2
+ 
+ /* Define if you have the fchdir function.  */
+ #undef HAVE_FCHDIR
+ 
+ /* Define if you have the fchmod function.  */
+ #undef HAVE_FCHMOD
+ 
+ /* Define if you have the fsync function.  */
+ #undef HAVE_FSYNC
+ 
+ /* Define if you have the ftime function.  */
+ #define HAVE_FTIME 1
+ 
+ /* Define if you have the ftruncate function.  */
+ #define HAVE_FTRUNCATE 1
+ 
+ /* Define if you have the getpagesize function.  */
+ #undef HAVE_GETPAGESIZE
+ 
+ /* Define if you have the getpassphrase function.  */
+ #undef HAVE_GETPASSPHRASE
+ 
+ /* Define if you have the initgroups function.  */
+ #undef HAVE_INITGROUPS
+ 
+ /* Define if you have the krb_get_err_text function.  */
+ #undef HAVE_KRB_GET_ERR_TEXT
+ 
+ /* Define if you have the memmove function.  */
+ #define HAVE_MEMMOVE 1
+ 
+ /* Define if you have the mkdir function.  */
+ #define HAVE_MKDIR 1
+ 
+ /* Define if you have the mknod function.  */
+ #define HAVE_MKNOD 1
+ 
+ /* Define if you have the mktemp function.  */
+ #define HAVE_MKTEMP 1
+ 
+ /* Define if you have the putenv function.  */
+ #define HAVE_PUTENV 1
+ 
+ /* Define if you have the readlink function.  */
+ #undef HAVE_READLINK
+ 
+ /* Define if you have the rename function.  */
+ #define HAVE_RENAME 1
+ 
+ /* Define if you have the sigaction function.  */
+ #define HAVE_SIGACTION 1
+ 
+ /* Define if you have the sigblock function.  */
+ #define HAVE_SIGBLOCK 1
+ 
+ /* Define if you have the sigprocmask function.  */
+ #define HAVE_SIGPROCMASK 1
+ 
+ /* Define if you have the sigsetmask function.  */
+ #define HAVE_SIGSETMASK 1
+ 
+ /* Define if you have the sigvec function.  */
+ #define HAVE_SIGVEC 1
+ 
+ /* Define if you have the strerror function.  */
+ #define HAVE_STRERROR 1
+ 
+ /* Define if you have the strstr function.  */
+ #define HAVE_STRSTR 1
+ 
+ /* Define if you have the strtoul function.  */
+ #define HAVE_STRTOUL 1
+ 
+ /* Define if you have the tempnam function.  */
+ #define HAVE_TEMPNAM 1
+ 
+ /* Define if you have the timezone function.  */
+ #define HAVE_TIMEZONE 1
+ 
+ /* Define if you have the tzset function.  */
+ #define HAVE_TZSET 1
+ 
+ /* Define if you have the valloc function.  */
+ #define HAVE_VALLOC 1
+ 
+ /* Define if you have the vprintf function.  */
+ #define HAVE_VPRINTF 1
+ 
+ /* Define if you have the wait3 function.  */
+ #define HAVE_WAIT3 1
+ 
+ /* Define if you have the waitpid function.  */
+ #define HAVE_WAITPID 1
+ 
+ /* Define if you have the <direct.h> header file.  */
+ #undef HAVE_DIRECT_H
+ 
+ /* Define if you have the <dirent.h> header file.  */
+ #define HAVE_DIRENT_H 1
+ 
+ /* Define if you have the <errno.h> header file */
+ #define HAVE_ERRNO_H 1
+ 
+ /* Define if you have the <fcntl.h> header file.  */
+ #define HAVE_FCNTL_H 1
+ 
+ /* Define if you have the <gssapi.h> header file.  */
+ #undef HAVE_GSSAPI_H
+ 
+ /* Define if you have the <gssapi/gssapi.h> header file.  */
+ #undef HAVE_GSSAPI_GSSAPI_H
+ 
+ /* Define if you have the <gssapi/gssapi_generic.h> header file.  */
+ #undef HAVE_GSSAPI_GSSAPI_GENERIC_H
+ 
+ /* Define if you have the <io.h> header file.  */
+ #undef HAVE_IO_H
+ 
+ /* Define if you have the <krb5.h> header file.  */
+ #undef HAVE_KRB5_H
+ 
+ /* Define if you have the <limits.h> header file.  */
+ #define HAVE_LIMITS_H 1
+ 
+ /* Define if you have the <memory.h> header file.  */
+ #define HAVE_MEMORY_H 1
+ 
+ /* Define if you have the <ndbm.h> header file.  */
+ #undef HAVE_NDBM_H
+ 
+ /* Define if you have the <ndir.h> header file.  */
+ #undef HAVE_NDIR_H
+ 
+ /* Define if you have the <string.h> header file.  */
+ #define HAVE_STRING_H 1
+ 
+ /* Define if you have the <sys/bsdtypes.h> header file.  */
+ #undef HAVE_SYS_BSDTYPES_H
+ 
+ /* Define if you have the <sys/dir.h> header file.  */
+ #define HAVE_SYS_DIR_H 1
+ 
+ /* Define if you have the <sys/file.h> header file.  */
+ #define HAVE_SYS_FILE_H 1
+ 
+ /* Define if you have the <sys/ndir.h> header file.  */
+ #undef HAVE_SYS_NDIR_H
+ 
+ /* Define if you have the <sys/param.h> header file.  */
+ #define HAVE_SYS_PARAM_H 1
+ 
+ /* Define if you have the <sys/resource.h> header file.  */
+ #undef HAVE_SYS_RESOURCE_H
+ 
+ /* Define if you have the <sys/select.h> header file.  */
+ #undef HAVE_SYS_SELECT_H
+ 
+ /* Define if you have the <sys/time.h> header file.  */
+ #define HAVE_SYS_TIME_H 1
+ 
+ /* Define if you have the <sys/timeb.h> header file.  */
+ #define HAVE_SYS_TIMEB_H 1
+ 
+ /* Define if you have the <unistd.h> header file.  */
+ #define HAVE_UNISTD_H 1
+ 
+ /* Define if you have the <utime.h> header file.  */
+ #define HAVE_UTIME_H 1
+ 
+ /* Define if you have the gen library (-lgen).  */
+ #undef HAVE_LIBGEN
+ 
+ /* Define if 'errno.h' is missing.  */
+ #undef ERRNO_H_MISSING
+ 
+ /* Define if CR-LF conversion is broken.  */
+ #undef BROKEN_READWRITE_CONVERSION
+ 
+ /* We have prototypes.  */
+ #define USE_PROTOTYPES 1
+ 
+ #define SYSTEM_INITIALIZE riscos_initialize
+ extern void riscos_initialize(int *argc, char **argv[]);
+ /* #define SYSTEM_CLEANUP ... */
+ 
+ #define START_SERVER riscos_start_server
+ #define SHUTDOWN_SERVER riscos_shutdown_server
+ extern void riscos_start_server (int *tofd, int *fromfd,
+                                char *client_user,
+                                char *server_user,
+                                char *server_host,
+                                char *server_cvsroot);
+ extern void riscos_shutdown_server (int to);
+ 
+ #define SYSTEM_GETCALLER ro_getlogin
+ extern char *ro_getlogin(void);
+ 
+ /* Overrule the 'getenv' call to look for 'CVS$*' environment vars
+  * when equivalent 'CVS*' environment vars can't be found.  Slightly more
+  * RISC OS compliant concerning environment names.
+  */
+ #define getenv ro_getenv
+ extern char *ro_getenv(const char *env);
Index: ccvs/riscos/filesubr.c
===================================================================
RCS file: filesubr.c
diff -N filesubr.c
*** /dev/null   Thu Jan 01 01:00:00 1970
--- filesubr.c  Tue Jan 18 00:10:32 2000
***************
*** 0 ****
--- 1,792 ----
+ /* filesubr.c --- subroutines for dealing with files
+    Jim Blandy <jimb@cyclic.com>
+ 
+    This file is part of GNU CVS.
+ 
+    GNU CVS is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2, or (at your option) any
+    later version.
+ 
+    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.  */
+ 
+ /* These functions were moved out of subr.c because they need different
+    definitions under operating systems (like, say, Windows NT) with different
+    file system semantics.  */
+ 
+ /* filesubr.c version for RISC OS by John Tytgat <John.Tytgat@aaug.net> */
+ 
+ #include <unixlib/local.h>
+ #include "cvs.h"
+ 
+ static int deep_remove_dir PROTO((const char *path));
+ 
+ /*
+  * Copies "from" to "to".
+  */
+ void
+ copy_file (from, to)
+     const char *from;
+     const char *to;
+ {
+     struct stat sb;
+     struct utimbuf t;
+     int fdin, fdout;
+ 
+ /* fprintf(stderr, "copy_file(): from '%s' to '%s'\n", from, to); */
+ 
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> copy(%s,%s)\n",
+                       (server_active) ? 'S' : ' ', from, to);
+ #else
+       (void) fprintf (stderr, "-> copy(%s,%s)\n", from, to);
+ #endif
+     if (noexec)
+       return;
+ 
+     if ((fdin = open (from, O_RDONLY | O_BINARY)) < 0)
+       error (1, errno, "cannot open %s for copying", from);
+     if (fstat (fdin, &sb) < 0)
+       error (1, errno, "cannot fstat %s", from);
+     if ((fdout = open (to, O_CREAT | O_TRUNC | O_RDWR | O_BINARY,
+                      (int) sb.st_mode & 07777)) < 0)
+       error (1, errno, "cannot create %s for copying", to);
+     if (sb.st_size > 0)
+     {
+       char buf[BUFSIZ];
+       int n;
+ 
+       for (;;)
+       {
+           n = read (fdin, buf, sizeof(buf));
+           if (n == -1)
+           {
+ #ifdef EINTR
+               if (errno == EINTR)
+                   continue;
+ #endif
+               error (1, errno, "cannot read file %s for copying", from);
+           }
+             else if (n == 0)
+               break;
+ 
+           if (write(fdout, buf, n) != n) {
+               error (1, errno, "cannot write file %s for copying", to);
+           }
+       }
+ 
+ #ifdef HAVE_FSYNC
+       if (fsync (fdout))
+           error (1, errno, "cannot fsync file %s after copying", to);
+ #endif
+     }
+ 
+     if (close (fdin) < 0)
+       error (0, errno, "cannot close %s", from);
+     if (close (fdout) < 0)
+       error (1, errno, "cannot close %s", to);
+ 
+     /* now, set the times for the copied file to match those of the original 
*/
+     memset ((char *) &t, 0, sizeof (t));
+     t.actime = sb.st_atime;
+     t.modtime = sb.st_mtime;
+     (void) utime (to, &t);
+ }
+ 
+ /* FIXME-krp: these functions would benefit from caching the char * &
+    stat buf.  */
+ 
+ /*
+  * Returns non-zero if the argument file is a directory, or is a symbolic
+  * link which points to a directory.
+  */
+ int
+ isdir (file)
+     const char *file;
+ {
+     struct stat sb;
+ 
+     if (stat (file, &sb) < 0)
+       return (0);
+     return (S_ISDIR (sb.st_mode));
+ }
+ 
+ /*
+  * Returns non-zero if the argument file is a symbolic link.
+  */
+ int
+ islink (file)
+     const char *file;
+ {
+     return (0);
+ }
+ 
+ /*
+  * Returns non-zero if the argument file is a block or
+  * character special device.
+  */
+ int
+ isdevice (file)
+     const char *file;
+ {
+     return 0;
+ }
+ 
+ /*
+  * Returns non-zero if the argument file exists.
+  */
+ int
+ isfile (file)
+     const char *file;
+ {
+     return isaccessible(file, F_OK);
+ }
+ 
+ /*
+  * Returns non-zero if the argument file is readable.
+  */
+ int
+ isreadable (file)
+     const char *file;
+ {
+     return isaccessible(file, R_OK);
+ }
+ 
+ /*
+  * Returns non-zero if the argument file is writable.
+  */
+ int
+ iswritable (file)
+     const char *file;
+ {
+     return isaccessible(file, W_OK);
+ }
+ 
+ /*
+  * Returns non-zero if the argument file is accessable according to
+  * mode.  If compiled with SETXID_SUPPORT also works if cvs has setxid
+  * bits set.
+  */
+ int
+ isaccessible (file, mode)
+     const char *file;
+     const int mode;
+ {
+ #ifdef SETXID_SUPPORT
+     struct stat sb;
+     int umask = 0;
+     int gmask = 0;
+     int omask = 0;
+     int uid;
+ 
+     if (stat(file, &sb) == -1)
+       return 0;
+     if (mode == F_OK)
+       return 1;
+ 
+     uid = geteuid();
+     if (uid == 0)             /* superuser */
+     {
+       if (mode & X_OK)
+           return sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH);
+       else
+           return 1;
+     }
+ 
+     if (mode & R_OK)
+     {
+       umask |= S_IRUSR;
+       gmask |= S_IRGRP;
+       omask |= S_IROTH;
+     }
+     if (mode & W_OK)
+     {
+       umask |= S_IWUSR;
+       gmask |= S_IWGRP;
+       omask |= S_IWOTH;
+     }
+     if (mode & X_OK)
+     {
+       umask |= S_IXUSR;
+       gmask |= S_IXGRP;
+       omask |= S_IXOTH;
+     }
+ 
+     if (sb.st_uid == uid)
+       return (sb.st_mode & umask) == umask;
+     else if (sb.st_gid == getegid())
+       return (sb.st_mode & gmask) == gmask;
+     else
+       return (sb.st_mode & omask) == omask;
+ #else
+     return access(file, mode) == 0;
+ #endif
+ }
+ 
+ /*
+  * Open a file and die if it fails
+  */
+ FILE *
+ open_file (name, mode)
+     const char *name;
+     const char *mode;
+ {
+     FILE *fp;
+ 
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> open_file(%s)\n",
+                       (server_active) ? 'S' : ' ', name);
+ #else
+       (void) fprintf (stderr, "-> open_file(%s)\n", name);
+ #endif
+ 
+     if ((fp = fopen (name, mode)) == NULL)
+       error (1, errno, "cannot open %s", name);
+     return (fp);
+ }
+ 
+ /*
+  * Make a directory and die if it fails
+  */
+ void
+ make_directory (name)
+     const char *name;
+ {
+     struct stat sb;
+ 
+     if (stat (name, &sb) == 0 && (!S_ISDIR (sb.st_mode)))
+           error (0, 0, "%s already exists but is not a directory", name);
+     if (!noexec && mkdir (name, 0777) < 0)
+       error (1, errno, "cannot make directory %s", name);
+ }
+ 
+ /*
+  * Make a path to the argument directory, printing a message if something
+  * goes wrong.
+  */
+ void
+ make_directories (name)
+     const char *name;
+ {
+     char *cp;
+ 
+     if (noexec)
+       return;
+ 
+     if (mkdir (name, 0777) == 0 || errno == EEXIST)
+       return;
+     if (! existence_error (errno))
+     {
+       error (0, errno, "cannot make path to %s", name);
+       return;
+     }
+     if ((cp = strrchr (name, '/')) == NULL)
+       return;
+     *cp = '\0';
+     make_directories (name);
+     *cp++ = '/';
+     if (*cp == '\0')
+       return;
+     (void) mkdir (name, 0777);
+ }
+ 
+ /* Create directory NAME if it does not already exist; fatal error for
+    other errors.  Returns 0 if directory was created; 1 if it already
+    existed.  */
+ int
+ mkdir_if_needed (name)
+     char *name;
+ {
+     if (mkdir (name, 0777) < 0)
+     {
+       if (!(errno == EEXIST
+             || (errno == EACCES && isdir (name))))
+           error (1, errno, "cannot make directory %s", name);
+       return 1;
+     }
+     return 0;
+ }
+ 
+ /*
+  * Change the mode of a file, either adding write permissions, or removing
+  * all write permissions.  Either change honors the current umask setting.
+  *
+  * Don't do anything if PreservePermissions is set to `yes'.  This may
+  * have unexpected consequences for some uses of xchmod.
+  */
+ void
+ xchmod (fname, writable)
+     char *fname;
+     int writable;
+ {
+     struct stat sb;
+     mode_t mode, oumask;
+ 
+     if (preserve_perms)
+       return;
+ 
+     if (stat (fname, &sb) < 0)
+     {
+       if (!noexec)
+           error (0, errno, "cannot stat %s", fname);
+       return;
+     }
+     oumask = umask (0);
+     (void) umask (oumask);
+     if (writable)
+     {
+       mode = sb.st_mode | (~oumask
+                            & (((sb.st_mode & S_IRUSR) ? S_IWUSR : 0)
+                               | ((sb.st_mode & S_IRGRP) ? S_IWGRP : 0)
+                               | ((sb.st_mode & S_IROTH) ? S_IWOTH : 0)));
+     }
+     else
+     {
+       mode = sb.st_mode & ~(S_IWRITE | S_IWGRP | S_IWOTH) & ~oumask;
+     }
+ 
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> chmod(%s,%o)\n",
+                       (server_active) ? 'S' : ' ', fname,
+                       (unsigned int) mode);
+ #else
+       (void) fprintf (stderr, "-> chmod(%s,%o)\n", fname,
+                       (unsigned int) mode);
+ #endif
+     if (noexec)
+       return;
+ 
+     if (chmod (fname, mode) < 0)
+       error (0, errno, "cannot change mode of file %s", fname);
+ }
+ 
+ /*
+  * Rename a file and die if it fails
+  */
+ void
+ rename_file (from, to)
+     const char *from;
+     const char *to;
+ {
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> rename(%s,%s)\n",
+                       (server_active) ? 'S' : ' ', from, to);
+ #else
+       (void) fprintf (stderr, "-> rename(%s,%s)\n", from, to);
+ #endif
+     if (noexec)
+       return;
+ 
+     if (rename (from, to) < 0)
+       error (1, errno, "cannot rename file %s to %s", from, to);
+ }
+ 
+ /*
+  * unlink a file, if possible.
+  */
+ int
+ unlink_file (f)
+     const char *f;
+ {
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> unlink(%s)\n",
+                       (server_active) ? 'S' : ' ', f);
+ #else
+       (void) fprintf (stderr, "-> unlink(%s)\n", f);
+ #endif
+     if (noexec)
+       return (0);
+ 
+     return (unlink (f));
+ }
+ 
+ /*
+  * Unlink a file or dir, if possible.  If it is a directory do a deep
+  * removal of all of the files in the directory.  Return -1 on error
+  * (in which case errno is set).
+  */
+ int
+ unlink_file_dir (f)
+     const char *f;
+ {
+     struct stat sb;
+ 
+     if (trace
+ #ifdef SERVER_SUPPORT
+       /* This is called by the server parent process in contexts where
+          it is not OK to send output (e.g. after we sent "ok" to the
+          client).  */
+       && !server_active
+ #endif
+       )
+       (void) fprintf (stderr, "-> unlink_file_dir(%s)\n", f);
+ 
+     if (noexec)
+       return (0);
+ 
+     /* For at least some unices, if root tries to unlink() a directory,
+        instead of doing something rational like returning EISDIR,
+        the system will gleefully go ahead and corrupt the filesystem.
+        So we first call stat() to see if it is OK to call unlink().  This
+        doesn't quite work--if someone creates a directory between the
+        call to stat() and the call to unlink(), we'll still corrupt
+        the filesystem.  Where is the Unix Haters Handbook when you need
+        it?  */
+     if (stat (f, &sb) < 0)
+     {
+       if (existence_error (errno))
+       {
+           /* The file or directory doesn't exist anyhow.  */
+           return -1;
+       }
+     }
+     else if (S_ISDIR (sb.st_mode))
+       return deep_remove_dir (f);
+ 
+     return unlink (f);
+ }
+ 
+ /* Remove a directory and everything it contains.  Returns 0 for
+  * success, -1 for failure (in which case errno is set).
+  */
+ 
+ static int
+ deep_remove_dir (path)
+     const char *path;
+ {
+     DIR                 *dirp;
+     struct dirent *dp;
+ 
+     if (rmdir (path) != 0)
+     {
+       if (errno == ENOTEMPTY
+           || errno == EEXIST
+           /* Ugly workaround for ugly AIX 4.1 (and 3.2) header bug
+              (it defines ENOTEMPTY and EEXIST to 17 but actually
+              returns 87).  */
+           || (ENOTEMPTY == 17 && EEXIST == 17 && errno == 87))
+       {
+           if ((dirp = opendir (path)) == NULL)
+               /* If unable to open the directory return
+                * an error
+                */
+               return -1;
+ 
+           while ((dp = readdir (dirp)) != NULL)
+           {
+               char *buf;
+ 
+               if (strcmp (dp->d_name, ".") == 0 ||
+                           strcmp (dp->d_name, "..") == 0)
+                   continue;
+ 
+               buf = xmalloc (strlen (path) + strlen (dp->d_name) + 5);
+               sprintf (buf, "%s/%s", path, dp->d_name);
+ 
+               /* See comment in unlink_file_dir explanation of why we use
+                  isdir instead of just calling unlink and checking the
+                  status.  */
+               if (isdir(buf))
+               {
+                   if (deep_remove_dir(buf))
+                   {
+                       closedir(dirp);
+                       free (buf);
+                       return -1;
+                   }
+               }
+               else
+               {
+                   if (unlink (buf) != 0)
+                   {
+                       closedir(dirp);
+                       free (buf);
+                       return -1;
+                   }
+               }
+               free (buf);
+           }
+           closedir (dirp);
+           return rmdir (path);
+       }
+       else
+           return -1;
+     }
+ 
+     /* Was able to remove the directory return 0 */
+     return 0;
+ }
+ 
+ /* Read NCHARS bytes from descriptor FD into BUF.
+    Return the number of characters successfully read.
+    The number returned is always NCHARS unless end-of-file or error.  */
+ static size_t
+ block_read (fd, buf, nchars)
+     int fd;
+     char *buf;
+     size_t nchars;
+ {
+     char *bp = buf;
+     size_t nread;
+ 
+     do
+     {
+       nread = read (fd, bp, nchars);
+       if (nread == (size_t)-1)
+       {
+ #ifdef EINTR
+           if (errno == EINTR)
+               continue;
+ #endif
+           return (size_t)-1;
+       }
+ 
+       if (nread == 0)
+           break;
+ 
+       bp += nread;
+       nchars -= nread;
+     } while (nchars != 0);
+ 
+     return bp - buf;
+ }
+ 
+ 
+ /*
+  * Compare "file1" to "file2". Return non-zero if they don't compare exactly.
+  * If FILE1 and FILE2 are special files, compare their salient 
characteristics+  * (i.e. major/minor device numbers, links, etc.
+  */
+ int
+ xcmp (file1, file2)
+     const char *file1;
+     const char *file2;
+ {
+     char *buf1, *buf2;
+     struct stat sb1, sb2;
+     int fd1, fd2;
+     int ret;
+ 
+     if (trace)
+ #ifdef SERVER_SUPPORT
+       (void) fprintf (stderr, "%c-> xcmp(%s,%s)\n",
+                       (server_active) ? 'S' : ' ', file1, file2);
+ #else
+       (void) fprintf (stderr, "-> xcmp(%s,%s)\n", file1, file2);
+ #endif
+ 
+     if (CVS_LSTAT (file1, &sb1) < 0)
+       error (1, errno, "cannot lstat %s", file1);
+     if (CVS_LSTAT (file2, &sb2) < 0)
+       error (1, errno, "cannot lstat %s", file2);
+ 
+     /* If FILE1 and FILE2 are not the same file type, they are unequal. */
+     if ((sb1.st_mode & S_IFMT) != (sb2.st_mode & S_IFMT))
+       return 1;
+ 
+     /* If FILE1 and FILE2 are symlinks, they are equal if they point to
+        the same thing. */
+     if (S_ISLNK (sb1.st_mode) && S_ISLNK (sb2.st_mode))
+     {
+       int result;
+       buf1 = xreadlink (file1);
+       buf2 = xreadlink (file2);
+       result = (strcmp (buf1, buf2) == 0);
+       free (buf1);
+       free (buf2);
+       return result;
+     }
+ 
+     /* If FILE1 and FILE2 are devices, they are equal if their device
+        numbers match. */
+     if (S_ISBLK (sb1.st_mode) || S_ISCHR (sb1.st_mode))
+     {
+       if (sb1.st_rdev == sb2.st_rdev)
+           return 0;
+       else
+           return 1;
+     }
+ 
+     if ((fd1 = open (file1, O_RDONLY)) < 0)
+       error (1, errno, "cannot open file %s for comparing", file1);
+     if ((fd2 = open (file2, O_RDONLY)) < 0)
+       error (1, errno, "cannot open file %s for comparing", file2);
+ 
+     /* A generic file compare routine might compare st_dev & st_ino here
+        to see if the two files being compared are actually the same file.
+        But that won't happen in CVS, so we won't bother. */
+ 
+     if (sb1.st_size != sb2.st_size)
+       ret = 1;
+     else if (sb1.st_size == 0)
+       ret = 0;
+     else
+     {
+       /* FIXME: compute the optimal buffer size by computing the least
+          common multiple of the files st_blocks field */
+       size_t buf_size = 8 * 1024;
+       size_t read1;
+       size_t read2;
+ 
+       buf1 = xmalloc (buf_size);
+       buf2 = xmalloc (buf_size);
+ 
+       do
+       {
+           read1 = block_read (fd1, buf1, buf_size);
+           if (read1 == (size_t)-1)
+               error (1, errno, "cannot read file %s for comparing", file1);
+ 
+           read2 = block_read (fd2, buf2, buf_size);
+           if (read2 == (size_t)-1)
+               error (1, errno, "cannot read file %s for comparing", file2);
+ 
+           /* assert (read1 == read2); */
+ 
+           ret = memcmp(buf1, buf2, read1);
+       } while (ret == 0 && read1 == buf_size);
+ 
+       free (buf1);
+       free (buf2);
+     }
+ 
+     (void) close (fd1);
+     (void) close (fd2);
+     return (ret);
+ }
+ 
+ /* Generate a unique temporary filename.  Returns a pointer to a newly
+    malloc'd string containing the name.  Returns successfully or not at
+    all.  */
+ /* There are at least three functions for generating temporary
+    filenames.  We use tempnam (SVID 3) if possible, else mktemp (BSD
+    4.3), and as last resort tmpnam (POSIX). Reason is that tempnam and
+    mktemp both allow to specify the directory in which the temporary
+    file will be created.  */
+ char *
+ cvs_temp_name ()
+ {
+     char *retval;
+     int l;
+ 
+     retval = tempnam (Tmpdir, "cvs");
+     if (retval == NULL)
+       error (1, errno, "cannot generate temporary filename");
+     /* Hack: "<Wimp$ScrapDir>.cvs./cvs52342" -> 
"<Wimp$ScrapDir>.cvs.cvs34543" */
+     l = strlen(Tmpdir);
+     memmove(retval + l, retval + l + 1, strlen(retval + l + 1)+1);
+     /* tempnam returns a pointer to a newly malloc'd string, so there's
+        no need for a xstrdup  */
+     return retval;
+ }
+ 
+ /* Return non-zero iff FILENAME is absolute.
+    Trivial under Unix, but more complicated under other systems.  */
+ int
+ isabsolute (filename)
+     const char *filename;
+ {
+     return filename[0] == '/';
+ }
+ 
+ /*
+  * Return a string (dynamically allocated) with the name of the file to which
+  * LINK is symlinked.
+  */
+ char *
+ xreadlink (link)
+     const char *link;
+ {
+     return NULL;
+ }
+ 
+ 
+ /* Return a pointer into PATH's last component :
+  *  path                        return
+  *  /RAM::RamDisc0/$/test/sub   sub
+  *  /RAM::RamDisc0/$/test       test
+  *  /RAM::RamDisc0/$            /RAM::RamDisc0/$  [!!!]
+  */
+ char *
+ last_component (path)
+     char *path;
+ {
+     char *last = strrchr (path, '/');
+ 
+     if (last && (last != path) && !(last[1] == '$' && last[2] == '\0'))
+         return last + 1;
+     else
+         return path;
+ }
+ 
+ /* Return home dir which is the contents of the <CVS$HomeDir>
+    system variable after making it a Unix path */
+ char *
+ get_homedir ()
+ {
+     static char *buf = NULL;
+     char *home, *result;
+     int buflen;
+     int free_home = 0;
+ 
+     /* Fetch cached result, otherwise big memory leak */
+     if (buf) return(buf);
+ 
+     /* First look for <CVS$HomeDir> */
+     home = getenv ("CVS$HomeDir");
+ 
+     /* if not found, look for <Choices$Write> */
+     if (home == NULL)
+     {
+       buf = getenv ("Choices$Write");
+       if (buf == NULL) return (NULL);
+ 
+       home = xmalloc(strlen(buf) + sizeof(".cvs"));
+       free_home = 1;
+       sprintf(home, "%s.cvs", buf);
+       if (mkdir_if_needed(home))
+       {
+         free(home);
+         return(NULL);
+       }
+     }
+ 
+     buflen = 2*strlen (home) + 1; /* Should be sufficent */
+     buf = xmalloc (buflen);
+     /* More or less internal UnixLib call - might break in later versions */
+     result = __unixify (home, 0, buf, buflen, 
__RISCOSIFY_FILETYPE_NOTSPECIFIED);
+     if (free_home)
+       free(home);
+ 
+     if (result == NULL)
+     {
+         free(buf);
+         buf = NULL;
+     }
+ 
+     return (buf);
+ }
+ 
+ /* See cvs.h for description.  On unix this does nothing, because the
+    shell expands the wildcards.  */
+ void
+ expand_wild (argc, argv, pargc, pargv)
+     int argc;
+     char **argv;
+     int *pargc;
+     char ***pargv;
+ {
+     int i;
+     *pargc = argc;
+     *pargv = (char **) xmalloc (argc * sizeof (char *));
+     for (i = 0; i < argc; ++i)
+       (*pargv)[i] = xstrdup (argv[i]);
+ }
Index: ccvs/riscos/options.h
===================================================================
RCS file: options.h
diff -N options.h
*** /dev/null   Thu Jan 01 01:00:00 1970
--- options.h   Sat Oct 21 17:21:23 2000
***************
*** 0 ****
--- 1,150 ----
+ /*
+  * Copyright (c) 1992, Brian Berliner and Jeff Polk
+  * Copyright (c) 1989-1992, Brian Berliner
+  *
+  * You may distribute under the terms of the GNU General Public License as
+  * specified in the README file that comes with the CVS 1.4 kit.
+  *
+  * This file holds (most of) the configuration tweaks that can be made to
+  * customize CVS for your site.  CVS comes configured for a typical SunOS 4.x
+  * environment.  The comments for each configurable item are intended to be
+  * self-explanatory.  All #defines are tested first to see if an over-riding
+  * option was specified on the "make" command line.
+  *
+  * If special libraries are needed, you will have to edit the Makefile.in 
file+  * or the configure script directly.  Sorry.
+  */
+ 
+ /*
+  * 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
+  * heterogeneous hosts accessing your modules file, turn this option off.
+  */
+ #ifndef MY_NDBM
+ #define       MY_NDBM
+ #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.
+  */
+ #ifndef PATCH_PROGRAM
+ #define PATCH_PROGRAM "patch"
+ #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
+    different directory for temporary files).  */
+ #ifndef TMPDIR_DFLT
+ #define       TMPDIR_DFLT     "<Wimp$ScrapDir>.cvs."
+ #endif
+ 
+ /*
+  * The default editor to use, if one does not specify the "-e" option to cvs,
+  * or does not have an EDITOR environment variable.  I set this to just "vi",
+  * and use the shell to find where "vi" actually is.  This allows sites with
+  * /usr/bin/vi or /usr/ucb/vi to work equally well (assuming that your PATH
+  * is reasonable).
+  */
+ #ifndef EDITOR_DFLT
+ #define       EDITOR_DFLT     ""
+ #endif
+ 
+ /*
+  * The default umask to use when creating or otherwise setting file or
+  * directory permissions in the repository.  Must be a value in the
+  * range of 0 through 0777.  For example, a value of 002 allows group
+  * rwx access and world rx access; a value of 007 allows group rwx
+  * access but no world access.  This value is overridden by the value
+  * of the CVSUMASK environment variable, which is interpreted as an
+  * octal number.
+  */
+ #ifndef UMASK_DFLT
+ #define       UMASK_DFLT      002
+ #endif
+ 
+ /*
+  * The cvs admin command is restricted to the members of the group
+  * CVS_ADMIN_GROUP.  If this group does not exist, all users are
+  * allowed to run cvs admin.  To disable the cvs admin for all users,
+  * create an empty group CVS_ADMIN_GROUP.  To disable access control for
+  * cvs admin, comment out the define below.
+  */
+ #ifdef CVS_ADMIN_GROUP
+ /* #define CVS_ADMIN_GROUP "cvsadmin" */
+ #endif
+ 
+ /*
+  * The Repository file holds the path to the directory within the
+  * source repository that contains the RCS ,v files for each CVS
+  * working directory.  This path is either a full-path or a path
+  * relative to CVSROOT.
+  *
+  * The big advantage that I can see to having a relative path is that
+  * one can change the physical location of the master source
+  * repository, change the contents of CVS/Root files in your
+  * checked-out code, and CVS will work without problems.
+  *
+  * Therefore, RELATIVE_REPOS is now the default.  In the future, this
+  * is likely to disappear entirely as a compile-time (or other) option,
+  * so if you have other software which relies on absolute pathnames,
+  * update them.
+  */
+ #define RELATIVE_REPOS 1
+ 
+ /*
+  * When committing or importing files, you must enter a log message.
+  * Normally, you can do this either via the -m flag on the command line or an
+  * editor will be started for you.  If you like to use logging templates (the
+  * rcsinfo file within the $CVSROOT/CVSROOT directory), you might want to
+  * force people to use the editor even if they specify a message with -m.
+  * Enabling FORCE_USE_EDITOR will cause the -m message to be appended to the
+  * temp file when the editor is started.
+  */
+ #ifndef FORCE_USE_EDITOR
+ /* #define    FORCE_USE_EDITOR */
+ #endif
+ 
+ /*
+  * When locking the repository, some sites like to remove locks and assume
+  * the program that created them went away if the lock has existed for a long
+  * time.  This used to be the default for previous versions of CVS.  CVS now
+  * attempts to be much more robust, so lock files should not be left around
+  * by mistake. The new behaviour will never remove old locks (they must now
+  * be removed by hand).  Enabling CVS_FUDGELOCKS will cause CVS to remove
+  * locks that are older than CVSLCKAGE seconds.
+  * Use of this option is NOT recommended.
+  */
+ #ifndef CVS_FUDGELOCKS
+ /* #define CVS_FUDGELOCKS */
+ #endif
+ 
+ /*
+  * When committing a permanent change, CVS and RCS make a log entry of
+  * who committed the change.  If you are committing the change logged in
+  * as "root" (not under "su" or other root-priv giving program), CVS/RCS
+  * cannot determine who is actually making the change.
+  *
+  * As such, by default, CVS disallows changes to be committed by users
+  * logged in as "root".  You can disable this option by commenting
+  * out the lines below.
+  */
+ #undef CVS_BADROOT
+ 
+ /*
+  * Yes, we can do the authenticated client.
+  */
+ #define AUTH_CLIENT_SUPPORT 1
+ 
+ /* End of CVS configuration section */
+ 
+ /*
+  * Externs that are included in libc, but are used frequently enough to
+  * warrant defining here.
+  */
+ #ifndef STDC_HEADERS
+ extern void exit ();
+ #endif
Index: ccvs/riscos/rcmd.c
===================================================================
RCS file: rcmd.c
diff -N rcmd.c
*** /dev/null   Thu Jan 01 01:00:00 1970
--- rcmd.c      Wed Nov 03 02:03:25 1999
***************
*** 0 ****
--- 1,257 ----
+ /*    $NetBSD: rcmd.c,v 1.12 1995/06/03 22:33:34 mycroft Exp $        */
+ 
+ /* Small changes by John Tytgat <John.Tytgat@aaug.net> to make it
+  * compilable for RISC OS.
+  */
+ 
+ /*
+  * Copyright (c) 1983, 1993, 1994
+  *    The Regents of the University of California.  All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgement:
+  *    This product includes software developed by the University of
+  *    California, Berkeley and its contributors.
+  * 4. Neither the name of the University nor the names of its contributors
+  *    may be used to endorse or promote products derived from this software
+  *    without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ #if 0
+ static char sccsid[] = "@(#)rcmd.c    8.3 (Berkeley) 3/26/94";
+ #else
+ static char *rcsid = "$NetBSD: rcmd.c,v 1.12 1995/06/03 22:33:34 mycroft Exp 
$";
+ #endif
+ #endif /* LIBC_SCCS and not lint */
+ 
+ #define MAXPATHLEN 1024
+ #ifndef MAXHOSTNAMELEN
+ #define       MAXHOSTNAMELEN  256
+ #endif
+ 
+ #if !defined(MAX)
+ #define MAX(a, b) (((a) < (b)) ? (b) : (a))
+ #endif
+ 
+ #include <sys/errno.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/select.h>
+ 
+ #include <netinet/in.h>
+ 
+ #include <signal.h>
+ #include <fcntl.h>
+ #include <netdb.h>
+ #include <unistd.h>
+ #include <pwd.h>
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
+ 
+ int
+ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
+       char **ahost;
+       u_short rport;
+       const char *locuser, *remuser, *cmd;
+       int *fd2p;
+ {
+       struct hostent *hp;
+       struct sockaddr_in sin, from;
+       fd_set reads;
+       long oldmask;
+       pid_t pid;
+       int s, lport, timo;
+       char c;
+ 
+       pid = getpid();
+       hp = gethostbyname(*ahost);
+       if (hp == NULL) {
+               /*herror(*ahost);*/
+               (void)fprintf(stderr,
+                                   "rcmd: socket: gethostbyname failed for 
%s\n", *ahost);
+               return (-1);
+       }
+       *ahost = hp->h_name;
+ /*    oldmask = sigblock(sigmask(SIGURG)); */
+       for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
+               s = rresvport(&lport);
+               if (s < 0) {
+                       if (errno == EDEADLK) /* EDEADLK */
+                               (void)fprintf(stderr,
+                                   "rcmd: socket: All ports in use\n");
+                       else
+                               (void)fprintf(stderr, "rcmd: socket: %s\n",
+                                   strerror(errno));
+ /*                    sigsetmask(oldmask); */
+                       return (-1);
+               }
+               fcntl(s, F_SETOWN, pid);
+ /*            sin.sin_len = sizeof(struct sockaddr_in); */
+               sin.sin_family = hp->h_addrtype;
+               sin.sin_port = rport;
+               bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
+               if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
+                       break;
+               (void)close(s);
+               if (errno == EADDRINUSE) {
+                       lport--;
+                       continue;
+               }
+               if (errno == ECONNREFUSED && timo <= 16) {
+                       (void)sleep(timo);
+                       timo *= 2;
+                       continue;
+               }
+               if (hp->h_addr_list[1] != NULL) {
+                       int oerrno = errno;
+ 
+                       (void)fprintf(stderr, "connect to address %s: ",
+                           inet_ntoa(sin.sin_addr));
+                       errno = oerrno;
+                       perror(0);
+                       hp->h_addr_list++;
+                       bcopy(hp->h_addr_list[0], &sin.sin_addr, hp->h_length);
+                       (void)fprintf(stderr, "Trying %s...\n",
+                           inet_ntoa(sin.sin_addr));
+                       continue;
+               }
+               (void)fprintf(stderr, "%s: %s\n", hp->h_name, strerror(errno));
+ /*            sigsetmask(oldmask); */
+               return (-1);
+       }
+       lport--;
+       if (fd2p == 0) {
+               write(s, "", 1);
+               lport = 0;
+       } else {
+               char num[8];
+               int s2 = rresvport(&lport), s3;
+               int len = sizeof(from);
+               if (s2 < 0)
+                       goto bad;
+               listen(s2, 1);
+               /*(void)snprintf(num, sizeof(num), "%d", lport);*/
+               sprintf(num,"%d", lport);
+               if (write(s, num, strlen(num)+1) != strlen(num)+1) {
+                       (void)fprintf(stderr,
+                           "rcmd: write (setting up stderr): %s\n",
+                           strerror(errno));
+                       (void)close(s2);
+                       goto bad;
+               }
+               FD_ZERO(&reads);
+               FD_SET(s, &reads);
+               FD_SET(s2, &reads);
+               errno = 0;
+               if (select(MAX(s, s2) + 1, &reads, 0, 0, 0) < 1 ||
+                   !FD_ISSET(s2, &reads)) {
+                       if (errno != 0)
+                               (void)fprintf(stderr,
+                                   "rcmd: select (setting up stderr): %s\n",
+                                   strerror(errno));
+                       else
+                               (void)fprintf(stderr,
+                               "select: protocol failure in circuit setup\n");
+                       (void)close(s2);
+                       goto bad;
+               }
+               s3 = accept(s2, (struct sockaddr *)&from, &len);
+               (void)close(s2);
+               if (s3 < 0) {
+                       (void)fprintf(stderr,
+                           "rcmd: accept: %s\n", strerror(errno));
+                       lport = 0;
+                       goto bad;
+               }
+               *fd2p = s3;
+               from.sin_port = ntohs(from.sin_port);
+               if (from.sin_family != AF_INET ||
+                   from.sin_port >= IPPORT_RESERVED ||
+                   from.sin_port < IPPORT_RESERVED / 2) {
+                       (void)fprintf(stderr,
+                           "socket: protocol failure in circuit setup.\n");
+                       goto bad2;
+               }
+       }
+       (void)write(s, locuser, strlen(locuser)+1);
+       (void)write(s, remuser, strlen(remuser)+1);
+       (void)write(s, cmd, strlen(cmd)+1);
+       if (read(s, &c, 1) != 1) {
+               (void)fprintf(stderr,
+                   "rcmd: %s: %s\n", *ahost, strerror(errno));
+               goto bad2;
+       }
+       if (c != 0) {
+               while (read(s, &c, 1) == 1) {
+                       (void)write(STDERR_FILENO, &c, 1);
+                       if (c == '\n')
+                               break;
+               }
+               goto bad2;
+       }
+ /*    sigsetmask(oldmask); */
+       return (s);
+ bad2:
+       if (lport)
+               (void)close(*fd2p);
+ bad:
+       (void)close(s);
+ /*    sigsetmask(oldmask); */
+       return (-1);
+ }
+ 
+ int
+ rresvport(alport)
+       int *alport;
+ {
+       struct sockaddr_in sin;
+       int s;
+ 
+ /*    sin.sin_len = sizeof(struct sockaddr_in); */
+       sin.sin_family = AF_INET;
+       sin.sin_addr.s_addr = INADDR_ANY;
+       s = socket(AF_INET, SOCK_STREAM, 0);
+       if (s < 0)
+               return (-1);
+       for (;;) {
+               sin.sin_port = htons((u_short)*alport);
+               if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) >= 0)
+                       return (s);
+               if (errno != EADDRINUSE) {
+                       (void)close(s);
+                       (void)fprintf(stderr, "rresvport: bind failed with 
%d\n", errno);
+                       return (-1);
+               }
+               (*alport)--;
+               if (*alport == IPPORT_RESERVED/2) {
+                       (void)close(s);
+                       errno = EDEADLK;                /* close */
+                       (void)fprintf(stderr, "rresvport: bind failed with 
EDEADLCK\n");
+                       return (-1);
+               }
+       }
+ }
+ 
Index: ccvs/riscos/ro.c
===================================================================
RCS file: ro.c
diff -N ro.c
*** /dev/null   Thu Jan 01 01:00:00 1970
--- ro.c        Tue Jul 04 00:50:51 2000
***************
*** 0 ****
--- 1,94 ----
+ /* ro.c
+    Utility functions for cvs which are specifique for RISC OS
+    John Tytgat <mailto:John.Tytgat@aaug.net>
+ 
+    This file is part of GNU CVS.
+ 
+    GNU CVS is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2, or (at your option) any
+    later version.
+ 
+    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.  */
+ 
+ /* We may *not* include 'config.h' directly or indirectly otherwise
+  * or 'getenv' filter will not work.
+  */
+ #include <stdio.h>
+ #include <stdlib.h>
+ /* OSLib header file : */
+ #include <OSLibInclude:os.h>
+ 
+ #define kPasswdBufSize 128
+ 
+ char *getpass (const char *prompt)
+ {
+     static char pwd_buf[kPasswdBufSize];
+     int used;
+ 
+   os_write0(prompt);
+   os_read_line_given_echo_suppress_invalid(pwd_buf, kPasswdBufSize, 32, 255, 
'-', &used);
+   pwd_buf[used] = '\0';
+ 
+   return pwd_buf;
+ }
+ 
+ /* 'getenv' filter :
+  *   - if 'CVS_*' env var can't be found, look again for 'CVS$*' env var
+  *   - if 'CVS*' env var can't be found, look again for 'CVS$*' env var
+  *   - if '*' env var can't be found, look again for 'CVS$*' env var
+  */
+ char *ro_getenv(const char *env)
+ {
+     char *rslt;
+ 
+   rslt = getenv(env);
+   if (rslt == NULL)
+   {
+     int tryit;
+ 
+     if (env[0] == 'C' && env[1] == 'V' && env[2] == 'S')
+     {
+       if (env[3] != '$')
+         tryit = (env[3] == '_') ? 4 : 3;
+       else
+         tryit = -1;
+     }
+     else
+       tryit = 0;
+ 
+     if (tryit != -1)
+     {
+       char buf[48];
+ 
+       if (strlen(env + tryit) + 4 >= 48)
+         abort();
+ 
+       buf[0] = 'C';
+       buf[1] = 'V';
+       buf[2] = 'S';
+       buf[3] = '$';
+ 
+       strcpy(buf + 4, env + tryit);
+       rslt = getenv(buf);
+     }
+   }
+ 
+   return(rslt);
+ }
+ 
+ char *ro_getlogin(void)
+ {
+   static char *login;
+ 
+   if (login == NULL)
+   {
+     if ((login = ro_getenv("CVS$USER")) == NULL)
+       login = "uid1";
+   }
+ 
+   return(login);
+ }
Index: ccvs/riscos/romain.c
===================================================================
RCS file: romain.c
diff -N romain.c
*** /dev/null   Thu Jan 01 01:00:00 1970
--- romain.c    Tue Jul 04 00:51:33 2000
***************
*** 0 ****
--- 1,35 ----
+ /* romain.c
+    John Tytgat <mailto:John.Tytgat@aaug.net>
+ 
+    This file is part of GNU CVS.
+ 
+    GNU CVS is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the
+    Free Software Foundation; either version 2, or (at your option) any
+    later version.
+ 
+    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.  */
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/stat.h>
+ #include <unixlib/local.h>
+ #include "config.h"
+ 
+ /* Little hook to setup the way the Unix <-> RISC OS filename mapping
+  * happens.  The default UnixLib convertion is not good enough for us.
+  * We want filetype support as well so we can CVS any file without it
+  * loosing its filetype.
+  */
+ void riscos_initialize(int *argc, char **argv[])
+ {
+   __riscosify_control = (getenv("CVS$FFFEXT")) ?
+     __RISCOSIFY_FILETYPE_EXT + __RISCOSIFY_FILETYPE_FFF_EXT
+     :
+     __RISCOSIFY_FILETYPE_EXT;
+ 
+   mkdir("<Wimp$ScrapDir>.cvs", 0777);
+ }
Index: ccvs/riscos/server_if.c
===================================================================
RCS file: server_if.c
diff -N server_if.c
*** /dev/null   Thu Jan 01 01:00:00 1970
--- server_if.c Wed Nov 10 01:11:21 1999
***************
*** 0 ****
--- 1,70 ----
+ /*
+  * server_if.c
+  * Open connection to the CVS server under RISC OS
+  *
+  * Michael Ladwig <mike@twinpeaks.prc.com> --- November 1995
+  *
+  * Was original for MacOS port, changes made by John Tytgat
+  * <John.Tytgat@aaug.net>
+  */
+ 
+ #include "cvs.h"
+ 
+ #include <sys/socket.h>
+ #include <netdb.h>
+ 
+ static int read_fd, write_fd;
+ 
+ void
+ riscos_start_server (int *tofd, int *fromfd,
+                    char *client_user,
+                    char *server_user,
+                    char *server_host,
+                    char *server_cvsroot)
+ {
+     char *cvs_server;
+     char *command;
+     char *portenv;
+     struct servent *sptr;
+     unsigned short port;
+ 
+     if (! (cvs_server = getenv ("CVS_SERVER")))
+         cvs_server = "cvs";
+     command = xmalloc (strlen (cvs_server)
+                      + strlen (server_cvsroot)
+                      + 50);
+     sprintf (command, "%s -d %s server", cvs_server, server_cvsroot);
+ 
+     portenv = getenv("CVS_RCMD_PORT");
+     if (portenv)
+       port = atoi(portenv);
+     else if ((sptr = getservbyname("shell", "tcp")) != NULL)
+       port = sptr->s_port;
+     else
+       port = 514;
+ 
+     read_fd = rcmd (&server_host,
+                   port,
+                   client_user,
+                   (server_user ? server_user : client_user),
+                   command,
+                   0);
+     if (read_fd < 0)
+       error (1, errno, "cannot start server via rcmd");
+ 
+     /* Split the socket into a reading and a writing half.  */
+     if ((write_fd = dup (read_fd)) < 0)
+         error (1, errno, "duplicating server connection");
+ 
+     *tofd = write_fd;
+     *fromfd = read_fd;
+     free (command);
+ }
+ 
+ 
+ void
+ riscos_shutdown_server (int to_server)
+ {
+       if( close (read_fd) != 0 ) perror( "close on read_fd");
+       if( close (write_fd) != 0 ) perror( "close on write_fd");
+ }
<CVS$BinDir>.cvs diff: Diffing ccvs/src
Index: ccvs/src/ChangeLog
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/src/ChangeLog,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ChangeLog
*** ccvs/src/ChangeLog  2000/10/25 00:57:19     1.1.1.1
--- ccvs/src/ChangeLog  2000/10/25 00:26:27
***************
*** 1,3 ****
--- 1,7 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * Makefile/riscos: added for RISC OS port.
+ 
  2000-10-24  Jim Meyering  <meyering@lucent.com>
  
        Fix a bug, introduced with my fix of 2000-07-10, whereby -kk would
Index: ccvs/src/Makefile.riscos
===================================================================
RCS file: Makefile.riscos
diff -N Makefile.riscos
*** /dev/null   Thu Jan 01 01:00:00 1970
--- Makefile.riscos     Wed Oct 25 02:39:21 2000
***************
*** 0 ****
--- 1,44 ----
+ # Project:    ccvs/src/cvscmd
+ # Platform:   RISC OS
+ # License:    GNU Public License
+ # Author:     John Tytgat <John.Tytgat@aaug.net>
+ 
+ # Toolflags:
+ INCL = -I^.riscos -I^.lib -I^.diff -I^.zlib -IUnix:
+ DEFS = -DRISCOS -DHAVE_CONFIG_H
+ CC = cc
+ CCFLAGS = -c -depend !Depend $(INCL) -JUnix: -throwback $(DEFS) -fnh -Wp -ec
+ C++FLAGS = -c -depend !Depend -IC: -throwback
+ LINK = link
+ LINKFLAGS = -aif -c++ -o $@ 
+ OBJASMFLAGS = -throwback -NoCache -depend !Depend
+ SQUEEZE = squeeze
+ SQUEEZEFLAGS = -f -v $@
+ 
+ OBJS1 =       o.add o.admin o.buffer o.checkin o.checkout o.classify o.client 
\
+       o.commit o.create_adm o.cvsrc o.diff o.edit o.entries o.error \
+       o.expand_path o.fileattr o.find_names o.hardlink \
+       o.hash o.history o.ignore o.import o.lock o.log o.login \
+       o.logmsg o.main o.mkmodules o.modules o.myndbm o.no_diff \
+       o.parseinfo o.patch o.rcs o.rcscmds o.recurse o.release \
+       o.remove o.repos o.root o.rtag o.run o.scramble o.server \
+       o.status o.subr o.tag o.update o.version o.vers_ts o.watch \
+       o.wrapper o.zlib
+ OBJS2 = o.cvsdir o.entries o.error o.hash o.rcs o.recurse o.subr
+ LIBS =        ^.riscos.ro_lib ^.lib.cvs_lib ^.diff.diff_lib ^.zlib.zlib_lib \
+       Unix:o.UnixLib oslib:o.oslib
+ 
+ # Final targets:
+ all:  cvscmd
+ 
+ cvscmd:       $(OBJS1) $(LIBS)
+         $(LINK) $(LINKFLAGS) $(OBJS1) $(LIBS)
+       $(SQUEEZE) $(SQUEEZEFLAGS)
+ 
+ # User-editable dependencies:
+ .c.o:
+         $(CC) $(CCFLAGS) -o $@ $<
+ 
+ # Static dependencies:
+ 
+ # Dynamic dependencies:
<CVS$BinDir>.cvs diff: Diffing ccvs/tools
<CVS$BinDir>.cvs diff: Diffing ccvs/tools/pcl-cvs
<CVS$BinDir>.cvs diff: Diffing ccvs/vms
<CVS$BinDir>.cvs diff: Diffing ccvs/windows-NT
<CVS$BinDir>.cvs diff: Diffing ccvs/windows-NT/SCC
<CVS$BinDir>.cvs diff: Diffing ccvs/zlib
Index: ccvs/zlib/ChangeLog
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/zlib/ChangeLog,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 ChangeLog
*** ccvs/zlib/ChangeLog 2000/10/25 00:58:00     1.1.1.1
--- ccvs/zlib/ChangeLog 2000/10/24 23:30:20
***************
*** 1,3 ****
--- 1,7 ----
+ 2000-10-25  John Tytgat  <John.Tytgat@aaug.net>
+ 
+       * Makefile/riscos: it is object file 'uncompr', not 'uncompress'
+ 
  1999-05-06  Jim Kingdon  <http://www.cyclic.com>
  
        * Makefile.in (DISTFILES): Remove zlib.mak.
Index: ccvs/zlib/Makefile.riscos
===================================================================
RCS file: /ADFS::Kobayashi/$/build/org_cvs/ccvs/zlib/Makefile.riscos,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 Makefile.riscos
*** ccvs/zlib/Makefile.riscos   2000/10/25 00:58:06     1.1.1.1
--- ccvs/zlib/Makefile.riscos   2000/10/25 01:25:24
***************
*** 14,23 ****
  # Final targets:
  @.zlib_lib:   @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
          @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees 
@.o.infutil @.o.trees \
!         @.o.uncompress @.o.zutil 
          LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 
@.o.deflate \
          @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate 
@.o.inftrees @.o.infutil \
!         @.o.trees @.o.uncompress @.o.zutil 
  @.test:   @.tests.minigzip @.tests.example 
          echo Please run "Test" in directory tests 
  @.tests.minigzip:   @.o.minigzip @.zlib_lib C:o.Stubs 
--- 14,23 ----
  # Final targets:
  @.zlib_lib:   @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
          @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees 
@.o.infutil @.o.trees \
!         @.o.uncompr @.o.zutil 
          LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 
@.o.deflate \
          @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate 
@.o.inftrees @.o.infutil \
!         @.o.trees @.o.uncompr @.o.zutil 
  @.test:   @.tests.minigzip @.tests.example 
          echo Please run "Test" in directory tests 
  @.tests.minigzip:   @.o.minigzip @.zlib_lib C:o.Stubs 
***************
*** 38,46 ****
  
  
  # Dynamic dependencies:
- o.minigzip:   tests.c.minigzip
- o.minigzip:   h.zlib
- o.minigzip:   h.zconf
- o.example:    tests.c.example
- o.example:    h.zlib
- o.example:    h.zconf
--- 38,40 ----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]