Only in source: README.kenji
diff -r -c ../ingres.ptf/source/conf/Makefile source/conf/Makefile
*** ../ingres.ptf/source/conf/Makefile	Mon Nov 16 14:38:10 1992
--- source/conf/Makefile	Fri Sep 25 17:54:12 1992
***************
*** 68,74 ****
  #
  
  # the ingres subtree
! INGRES=	../..
  # the location of the system header files
  H=	../h
  # the residence of the system (internal) libraries
--- 68,74 ----
  #
  
  # the ingres subtree
! INGRES=	/usr/ingres
  # the location of the system header files
  H=	../h
  # the residence of the system (internal) libraries
***************
*** 77,87 ****
  # this entry must be reflected in the process table
  BIN=	$(INGRES)/bin
  # the location of user binaries
! SYSBIN=	/usr/local
  # the location of user libraries (libq.a)
! SYSLIB=	/usr/local/lib
  # the cputype, VAX or SUN
! CPUTYPE=SUN
  
  ALL=	monitor univingres sysmonitor sysmodfunc printadmin sysdump
  
--- 77,87 ----
  # this entry must be reflected in the process table
  BIN=	$(INGRES)/bin
  # the location of user binaries
! SYSBIN=	/usr/local/bin
  # the location of user libraries (libq.a)
! SYSLIB=	/usr/lib
  # the cputype, VAX or SUN
! CPUTYPE=VAX
  
  ALL=	monitor univingres sysmonitor sysmodfunc printadmin sysdump
  
***************
*** 109,120 ****
  DECOMP=	$(LIB)/decomp
  OVQP=	$(LIB)/ovqp
  DBULIB=	$(LIB)/dbulib
  
  #
  #  Assorted commands & other garbage
  #
! CFLAGS=	-I$H -O
  LDFLAGS=
  CHMOD=	chmod
  BINMODE=751
  SUMODE=	4751
--- 109,122 ----
  DECOMP=	$(LIB)/decomp
  OVQP=	$(LIB)/ovqp
  DBULIB=	$(LIB)/dbulib
+ EXTRALIB=
  
  #
  #  Assorted commands & other garbage
  #
! CFLAGS=	-O -I$H -Dbsd386
  LDFLAGS=
+ 
  CHMOD=	chmod
  BINMODE=751
  SUMODE=	4751
***************
*** 141,147 ****
  #  Sysmodfunc
  
  sysmodfunc: version.o sysmodfunc.o $(DBULIB) $(CTLMOD) $(ALLLIB)
! 	$(CC) $(LDFLAGS) version.o $@.o $(DBULIB) $(OTHERS) $(ALLLIB) -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
--- 143,149 ----
  #  Sysmodfunc
  
  sysmodfunc: version.o sysmodfunc.o $(DBULIB) $(CTLMOD) $(ALLLIB)
! 	$(CC) $(LDFLAGS) version.o $@.o $(DBULIB) $(OTHERS) $(ALLLIB) $(EXTRALIB) ../dbu/create.o ../gutil/oatoi.o -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
***************
*** 148,154 ****
  #  Sysdump
  
  sysdump: version.o sysdump.o $(CTLMOD) $(ALLLIB)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(ALLLIB) -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
--- 150,156 ----
  #  Sysdump
  
  sysdump: version.o sysdump.o $(CTLMOD) $(ALLLIB)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(ALLLIB) $(EXTRALIB) -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
***************
*** 155,161 ****
  #  Monitor
  
  monitor: version.o monitor.o $(MONITOR) $(CTLMOD) $(IUTIL) $(GUTIL)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(MONITOR) $(CTLMOD) $(IUTIL) $(GUTIL) -o $@
  	$(CHMOD) $(BINMODE) $@
  	ls -l $@; size $@
  
--- 157,163 ----
  #  Monitor
  
  monitor: version.o monitor.o $(MONITOR) $(CTLMOD) $(IUTIL) $(GUTIL)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(MONITOR) $(CTLMOD) $(IUTIL) $(GUTIL) $(EXTRALIB) -o $@
  	$(CHMOD) $(BINMODE) $@
  	ls -l $@; size $@
  
***************
*** 162,168 ****
  #  SysMonitor 
  
  sysmonitor: version.o sysmonitor.o $(SYSMONITOR) $(DBULIB) $(IUTIL) $(GUTIL)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(SYSMONITOR) $(CTLMOD) $(IUTIL) $(GUTIL) -o $@
  	$(CHMOD) $(BINMODE) $@
  	ls -l $@; size $@
  
--- 164,170 ----
  #  SysMonitor 
  
  sysmonitor: version.o sysmonitor.o $(SYSMONITOR) $(DBULIB) $(IUTIL) $(GUTIL)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(SYSMONITOR) $(CTLMOD) $(IUTIL) $(GUTIL) $(EXTRALIB) -o $@
  	$(CHMOD) $(BINMODE) $@
  	ls -l $@; size $@
  
***************
*** 171,177 ****
  ALLLIBS=$(PARSER) $(QRYMOD) $(DECOMP) $(OVQP) $(DBULIB) $(ALLLIB)
  
  univingres: version.o univingres.o $(ALLLIBS)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(ALLLIBS) $(MATH) -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
--- 173,179 ----
  ALLLIBS=$(PARSER) $(QRYMOD) $(DECOMP) $(OVQP) $(DBULIB) $(ALLLIB)
  
  univingres: version.o univingres.o $(ALLLIBS)
! 	$(CC) $(LDFLAGS) version.o $@.o $(OTHERS) $(ALLLIBS) $(MATH) $(EXTRALIB) -o $@
  	$(CHMOD) $(SUMODE) $@
  	ls -l $@; size $@
  
diff -r -c ../ingres.ptf/source/conf/monitor.c source/conf/monitor.c
*** ../ingres.ptf/source/conf/monitor.c	Mon Nov 16 14:38:10 1992
--- source/conf/monitor.c	Tue Sep 15 18:22:39 1992
***************
*** 1,3 ****
--- 1,4 ----
+ # include       <ingres.h>
  # include	<func.h>
  # include	<sccs.h>
  
***************
*** 16,18 ****
--- 17,22 ----
  };
  
  int	NumFunc = sizeof FuncVect / sizeof FuncVect[0];
+ 
+ DESC	Btreesec;
+ int	Btree_fd;
diff -r -c ../ingres.ptf/source/ctlmod/Makefile source/ctlmod/Makefile
*** ../ingres.ptf/source/ctlmod/Makefile	Mon Nov 16 14:38:12 1992
--- source/ctlmod/Makefile	Thu Oct  8 13:57:12 1992
***************
*** 4,10 ****
  #	@(#)Makefile	8.4	4/22/86
  #
  
! INGRES=	../..
  H=	../h
  LIB=	$(INGRES)/lib
  
--- 4,10 ----
  #	@(#)Makefile	8.4	4/22/86
  #
  
! INGRES=	/usr/ingres
  H=	../h
  LIB=	$(INGRES)/lib
  
***************
*** 89,95 ****
  
  tags: sources
  	-fgrep ../ tags > othertags
! 	ctags  $(SRCS) $(HDRS)
  	sort -o tags tags othertags
  	-rm -f othertags
  
--- 89,95 ----
  
  tags: sources
  	-fgrep ../ tags > othertags
! 	ctags  $(SRCS1) $(SRCS2) $(HDRS)
  	sort -o tags tags othertags
  	-rm -f othertags
  
diff -r -c ../ingres.ptf/source/ctlmod/call.c source/ctlmod/call.c
*** ../ingres.ptf/source/ctlmod/call.c	Mon Nov 16 14:38:12 1992
--- source/ctlmod/call.c	Thu Oct  1 14:14:46 1992
***************
*** 8,13 ****
--- 8,18 ----
  
  SCCSID(@(#)call.c	8.1	12/31/84)
  
+ int   call();
+ int   calln();
+ int   call_setup();
+ extern  int   resetp();
+ 
  /*
  **  CALL -- Call a state with return.
  **
***************
*** 53,58 ****
--- 58,64 ----
  **		5
  */
  
+ int
  call(entpt, errfn)
  int	entpt;
  int	(*errfn)();
***************
*** 74,79 ****
--- 80,86 ----
  **		(see call)
  */
  
+ int
  calln(entpt, errfn)
  int	entpt;
  int	(*errfn)();
***************
*** 85,91 ****
  	struct monitor		*savemon;
  	struct monitor		mon;
  	extern struct monitor	*markperf();
! # endif MONITOR
  
  # ifdef xCTR1
  	if (tTf(5, 0))
--- 92,98 ----
  	struct monitor		*savemon;
  	struct monitor		mon;
  	extern struct monitor	*markperf();
! # endif xMONITOR
  
  # ifdef xCTR1
  	if (tTf(5, 0))
***************
*** 184,189 ****
--- 191,197 ----
  **		none.
  */
  
+ int
  call_setup(ppb, state, errfn)
  register pb_t	*ppb;
  int		state;
diff -r -c ../ingres.ptf/source/ctlmod/call_fn.c source/ctlmod/call_fn.c
*** ../ingres.ptf/source/ctlmod/call_fn.c	Mon Nov 16 14:38:12 1992
--- source/ctlmod/call_fn.c	Wed Sep 16 15:01:21 1992
***************
*** 4,9 ****
--- 4,11 ----
  
  SCCSID(@(#)call_fn.c	8.1	12/31/84)
  
+ int   call_fn();
+ 
  /*
  **  CALL_FN -- call a local function
  **
***************
*** 31,36 ****
--- 33,39 ----
  struct monitor	MonBuf[CM_MAXST];
  # endif xMONITOR
  
+ int
  call_fn(fno, pc, pv)
  int	fno;
  int	pc;
diff -r -c ../ingres.ptf/source/ctlmod/cm_cleanup.c source/ctlmod/cm_cleanup.c
*** ../ingres.ptf/source/ctlmod/cm_cleanup.c	Mon Nov 16 14:38:12 1992
--- source/ctlmod/cm_cleanup.c	Mon Jun  8 17:45:51 1992
***************
*** 32,38 ****
  	register struct fn_def	*f;
  	extern char		*Proc_name;
  	extern jmp_buf		CmReset;
! 	extern			rubcatch();
  	register ctx_t		*ctx;
  
  # ifdef xCTR2
--- 32,38 ----
  	register struct fn_def	*f;
  	extern char		*Proc_name;
  	extern jmp_buf		CmReset;
! 	extern	void		rubcatch();
  	register ctx_t		*ctx;
  
  # ifdef xCTR2
diff -r -c ../ingres.ptf/source/ctlmod/main.c source/ctlmod/main.c
*** ../ingres.ptf/source/ctlmod/main.c	Mon Nov 16 14:38:14 1992
--- source/ctlmod/main.c	Mon Oct 19 18:25:23 1992
***************
*** 5,10 ****
--- 5,11 ----
  # include	<resp.h>
  # include	<ingres.h>
  # include	<aux.h>
+ # include       <access.h>
  # include	<lock.h>
  # include	<sccs.h>
  
***************
*** 43,48 ****
--- 44,50 ----
  **
  **	Trace Flags:
  **		1
+ **
  */
  
  struct resp	Resp;		/* State response structure */
***************
*** 58,69 ****
  char		*Pathname;	/* the pathname of the root of INGRES */
  int		Equel;		/* set if running an Equel program */
  int		RubLevel;	/* rubout level, -1 if ignored */
! struct out_arg	Out_arg;	/* output arguments */
  jmp_buf		CmReset;	/* restart addr on interrupt */
  # ifdef xMONITOR
  struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
  # endif xMONITOR
  
  main(argc, argv)
  int	argc;
  char	**argv;
--- 60,77 ----
  char		*Pathname;	/* the pathname of the root of INGRES */
  int		Equel;		/* set if running an Equel program */
  int		RubLevel;	/* rubout level, -1 if ignored */
! extern struct out_arg	Out_arg;	/* output arguments */
  jmp_buf		CmReset;	/* restart addr on interrupt */
  # ifdef xMONITOR
  struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
  # endif xMONITOR
  
+ extern	void	rubcatch();
+ extern	int	error();
+ extern pb_t	*MonPpb;
+ extern long	CmOfiles;	/* defined in markopen.c */
+ 
+ 
  main(argc, argv)
  int	argc;
  char	**argv;
***************
*** 74,84 ****
  	register char	*p;
  	pb_t		pb;
  	static int	reenter;
- 	extern		rubcatch();
- 	extern		error();
  	bool		nobuffer;
- 	extern pb_t	*MonPpb;
- 	extern long	CmOfiles;	/* defined in markopen.c */
  	int		lock_type = -1;	/* type of data base lock to request */
  	int		wait_action = -1;	/* type of wait action on the data abse */
  	char		*args; 	/* used to process args of sysmod */
--- 82,88 ----
***************
*** 150,156 ****
  				lock_type = atoi(&p[2]);
  				if ( wait_action < 0 )
  					break;
! 				if ( setdbl(wait_action,lock_type) < 0 )
  				{
  					syserr("Data base temporarily unavailable");
  				}
--- 154,160 ----
  				lock_type = atoi(&p[2]);
  				if ( wait_action < 0 )
  					break;
!                                 if ( setdbl(wait_action,lock_type) < 0 )
  				{
  					syserr("Data base temporarily unavailable");
  				}
***************
*** 304,311 ****
--- 308,320 ----
  **
  **	Side Effects:
  **		Flushes pipes, etc.
+ **
+ **      This module should be renamed to compile the stuffs in the ../support
+ **          directory, because the latter modules also define rubproc() in
+ **          a different manner.
  */
  
+ void
  rubproc()
  {
  	register int	i;
diff -r -c ../ingres.ptf/source/ctlmod/pb_read.c source/ctlmod/pb_read.c
*** ../ingres.ptf/source/ctlmod/pb_read.c	Mon Nov 16 14:38:14 1992
--- source/ctlmod/pb_read.c	Tue Jun  9 13:09:45 1992
***************
*** 36,42 ****
  {
  	register int	type;
  	register int	from;
! 	extern int	(*ExitFn)();
  
  	/*
  	**  Top Loop.
--- 36,42 ----
  {
  	register int	type;
  	register int	from;
! 	extern void	(*ExitFn)();
  
  	/*
  	**  Top Loop.
diff -r -c ../ingres.ptf/source/ctlmod/proc_err.c source/ctlmod/proc_err.c
*** ../ingres.ptf/source/ctlmod/proc_err.c	Mon Nov 16 14:38:15 1992
--- source/ctlmod/proc_err.c	Wed Sep 16 19:48:18 1992
***************
*** 4,9 ****
--- 4,20 ----
  
  SCCSID(@(#)proc_err.c	8.1	12/31/84)
  
+ int  proc_err();
+ extern int pb_prime();
+ extern int pb_flush();
+ extern int pb_dump();
+ extern int send_off();
+ extern int resetp();
+ 
+ extern char		*Proc_name;
+ extern pb_t		*MonPpb;
+ 
+ 
  /*
  **  PROC_ERR -- Process error message
  **
***************
*** 38,44 ****
  **		6.8 - 6.15
  */
  
! 
  proc_err(ppb, pc, pv)
  pb_t	*ppb;
  int	pc;
--- 49,55 ----
  **		6.8 - 6.15
  */
  
! int
  proc_err(ppb, pc, pv)
  pb_t	*ppb;
  int	pc;
***************
*** 45,54 ****
  PARM	pv[];
  {
  	register struct fn_def	*f;
- 	extern char		*Proc_name;
  	register int		i;
  	register ctx_t		*ctx;
- 	extern pb_t		*MonPpb;
  
  # ifdef xCTR2
  	if (tTf(6, 8))
--- 56,63 ----
diff -r -c ../ingres.ptf/source/ctlmod/readinput.c source/ctlmod/readinput.c
*** ../ingres.ptf/source/ctlmod/readinput.c	Mon Nov 16 14:38:15 1992
--- source/ctlmod/readinput.c	Wed Sep 16 20:08:50 1992
***************
*** 8,13 ****
--- 8,24 ----
  
  SCCSID(@(#)readinput.c	8.1	12/31/84)
  
+ int   readinput();
+ int   read_arg();
+ extern  int   markbuf();
+ extern  int   pb_prime();
+ extern  int   pb_get();
+ extern  int   pb_dump();
+ extern  int   proc_err();
+ extern char	*need();
+ extern QTREE	*readqry();
+ 
+ 
  /*
  **  READINPUT -- read the input pipe and determine next function
  **
***************
*** 34,39 ****
--- 45,52 ----
  **		10.0 - 10.5
  */
  
+ 
+ int
  readinput(ppb)
  register pb_t	*ppb;
  {
***************
*** 139,145 ****
  **	Trace Flags:
  **		10.6 - 10.7
  */
! 
  read_arg(ppb, pparm)
  register pb_t	*ppb;
  register PARM	*pparm;
--- 152,158 ----
  **	Trace Flags:
  **		10.6 - 10.7
  */
! int
  read_arg(ppb, pparm)
  register pb_t	*ppb;
  register PARM	*pparm;
***************
*** 149,156 ****
  	register int	i;
  	register char	*p;
  	QTREE		*q;
- 	extern char	*need();
- 	extern QTREE	*readqry();
  
  	/* get the parameter type */
  	i = pb_get(ppb, &ptype, 1);
--- 162,167 ----
diff -r -c ../ingres.ptf/source/ctlmod/readqry.c source/ctlmod/readqry.c
*** ../ingres.ptf/source/ctlmod/readqry.c	Mon Nov 16 14:38:13 1992
--- source/ctlmod/readqry.c	Wed Sep 16 20:06:25 1992
***************
*** 9,14 ****
--- 9,28 ----
  SCCSID(@(#)readqry.c	8.3	12/8/85)
  
  
+ QTREE   *readqry();
+ bool	leaf();
+ 
+ extern QTREE	*readtree();
+ extern QTREE	*trbuild();
+ extern QTREE	*readsym();
+ extern char	*need();
+ extern char	*xalloc();
+ extern int      clrrange();
+ extern int      declare();
+ extern int      markbuf();
+ extern int      freebuf();
+ extern int      nodepr();
+ 
  /*
  ** READQRY
  **
***************
*** 31,41 ****
  	register QTREE	*q;
  	register QTREE	*rtval;
  	register DESC	*d;
- 	extern QTREE	*readtree();
- 	extern char	*xalloc();
- 	extern QTREE	*trbuild();
  	int		mark;
- 	extern QTREE	*readsym();
  	int		i;
  	int		j;
  
--- 45,51 ----
***************
*** 110,116 ****
  	register int	len;
  	register int	t;
  	register QTREE	*q;
- 	extern char	*need();
  	int		rlen;
  
  	q = (QTREE *) need(Qbuf, QT_HDR_SIZ);
--- 120,125 ----
***************
*** 178,184 ****
  {
  	register QTREE	*q;
  	register QTREE	*rtval;
- 	extern char	*need();
  
  	rtval = tresym;
  
--- 187,192 ----
***************
*** 224,230 ****
  	register char	*p;
  	register SYMBOL	*s;
  	QTREE		*treestack[STACKSIZ];
- 	extern bool	leaf();
  
  
  	stackptr = treestack;
--- 232,237 ----
diff -r -c ../ingres.ptf/source/ctlmod/resetp.c source/ctlmod/resetp.c
*** ../ingres.ptf/source/ctlmod/resetp.c	Mon Nov 16 14:38:13 1992
--- source/ctlmod/resetp.c	Wed Sep 16 19:16:45 1992
***************
*** 5,10 ****
--- 5,13 ----
  
  SCCSID(@(#)resetp.c	8.2	12/8/85)
  
+ int   resetp();
+ extern char	*Proc_name;
+ 
  /*
  **  RESETP -- reset parameters from call.
  **
***************
*** 26,35 ****
  **	Trace Flags:
  **		4.4 - 4.7
  */
! 
  resetp()
  {
- 	extern char	*Proc_name;
  
  # ifdef xCTR1
  	if (tTf(4, 4))
--- 29,37 ----
  **	Trace Flags:
  **		4.4 - 4.7
  */
! int
  resetp()
  {
  
  # ifdef xCTR1
  	if (tTf(4, 4))
diff -r -c ../ingres.ptf/source/ctlmod/send_off.c source/ctlmod/send_off.c
*** ../ingres.ptf/source/ctlmod/send_off.c	Mon Nov 16 14:38:15 1992
--- source/ctlmod/send_off.c	Thu Sep 17 14:39:05 1992
***************
*** 4,13 ****
--- 4,25 ----
  # include	<symbol.h>
  # include	<tree.h>
  # include	<resp.h>
+ # include	<ingres.h>
+ # include	<aux.h>
+ # include	<access.h>
  # include	<sccs.h>
  
  SCCSID(@(#)send_off.c	8.1	12/31/84)
  
+ int  send_off();
+ int  send_arg();
+ extern	int pb_put();
+ extern	int closecatalog();
+ extern  int pb_dump();
+ extern  int freebuf();
+ extern  int pb_tput();
+ extern  int writeqry();
+ 
  /*
  **  SEND_OFF -- send a call off to another process
  **
***************
*** 36,41 ****
--- 48,54 ----
  **		11.0 - 11.7
  */
  
+ int
  send_off(ppb, pc, pv)
  register pb_t	*ppb;
  int		pc;
***************
*** 104,115 ****
  **		do_seq
  */
  
  send_arg(pparm, ppb)
  register PARM	*pparm;
  register pb_t	*ppb;
  {
  	register char	*p;
- 	extern		pb_put();
  
  	switch (pparm->pv_type)
  	{
--- 117,128 ----
  **		do_seq
  */
  
+ int
  send_arg(pparm, ppb)
  register PARM	*pparm;
  register pb_t	*ppb;
  {
  	register char	*p;
  
  	switch (pparm->pv_type)
  	{
diff -r -c ../ingres.ptf/source/ctlmod/sysdump.c source/ctlmod/sysdump.c
*** ../ingres.ptf/source/ctlmod/sysdump.c	Mon Nov 16 14:38:16 1992
--- source/ctlmod/sysdump.c	Tue Sep 15 11:14:15 1992
***************
*** 11,18 ****
  */
  
  extern int	sysdump();
! extern int	null_fn();
! extern int	dump_cm();
  
  short	tTsysdump[40];
  
--- 11,18 ----
  */
  
  extern int	sysdump();
! extern void	null_fn();
! extern void	dump_cm();
  
  short	tTsysdump[40];
  
***************
*** 81,86 ****
--- 81,87 ----
  */
  
  /*ARGSUSED*/
+ void
  dump_cm(argc, argv)
  int	argc;
  char	**argv;
***************
*** 87,93 ****
  {
  	register int		i;
  	register state_t	*s;
! 	register proc_t		*pr;
  	static int		reenter;
  
  	if (!tTf(30, 0) || reenter++ > 0)
--- 88,94 ----
  {
  	register int		i;
  	register state_t	*s;
!         register proc_t	        *pr;
  	static int		reenter;
  
  	if (!tTf(30, 0) || reenter++ > 0)
diff -r -c ../ingres.ptf/source/ctlmod/treepr.c source/ctlmod/treepr.c
*** ../ingres.ptf/source/ctlmod/treepr.c	Mon Nov 16 14:38:16 1992
--- source/ctlmod/treepr.c	Wed Sep 16 17:18:42 1992
***************
*** 6,11 ****
--- 6,15 ----
  
  SCCSID(@(#)treepr.c	8.2	5/1/86)
  
+ int        treepr();
+ static int rcsvtrpr();
+ int        nodepr();
+ 
  /*
  **  TREEPR -- print tree for debugging
  **
***************
*** 21,26 ****
--- 25,31 ----
  **		output to terminal
  */
  
+ int
  treepr(tree)
  QTREE	*tree;
  {
***************
*** 102,107 ****
--- 107,113 ----
  **		output to terminal
  */
  
+ int
  nodepr(tree)
  QTREE	*tree;
  {
diff -r -c ../ingres.ptf/source/dbu/Makefile source/dbu/Makefile
*** ../ingres.ptf/source/dbu/Makefile	Mon Nov 16 14:38:18 1992
--- source/dbu/Makefile	Tue Sep 22 20:28:06 1992
***************
*** 4,10 ****
  #	@(#)Makefile	8.4 	12/18/85
  #
  
! INGRES=	../..
  H=	../h
  LIB=	$(INGRES)/lib
  BIN=	$(INGRES)/bin
--- 4,10 ----
  #	@(#)Makefile	8.4 	12/18/85
  #
  
! INGRES=	/usr/ingres
  H=	../h
  LIB=	$(INGRES)/lib
  BIN=	$(INGRES)/bin
***************
*** 35,42 ****
  
  AR=	-ar
  ARFLAGS=rvu
! RANLIB=	ranlib
! CFLAGS=	-I$H -O -I../ctlmod
  LDFLAGS=
  CP=	cp
  CHMOD=	chmod
--- 35,41 ----
  
  AR=	-ar
  ARFLAGS=rvu
! CFLAGS=	-O -I$H -I../ctlmod -Dbsd386
  LDFLAGS=
  CP=	cp
  CHMOD=	chmod
***************
*** 52,62 ****
  dbulib: $(OBJS)
  	$(AR) $(ARFLAGS) dbulib $?
  	$(CHMOD) $(LIBMODE) dbulib
- 	$(RANLIB) dbulib
  
  $(LIB)/dbulib: dbulib
  	$(CP) dbulib $(LIB)/dbulib
- 	$(RANLIB) $(LIB)/dbulib
  
  install: $(LIB)/dbulib $(LIB)/sysmonlib
  
--- 51,59 ----
***************
*** 63,73 ****
  sysmonlib: $(SOBJS)
  	$(AR) $(ARFLAGS) sysmonlib $?
  	$(CHMOD) $(LIBMODE) sysmonlib
- 	$(RANLIB) sysmonlib
  
  $(LIB)/sysmonlib: sysmonlib
  	$(CP) sysmonlib $(LIB)/sysmonlib
- 	$(RANLIB) $(LIB)/sysmonlib
  
  sysmonitor: $(LIB)/sysmonlib
  	
--- 60,68 ----
diff -r -c ../ingres.ptf/source/dbu/copy.c source/dbu/copy.c
*** ../ingres.ptf/source/dbu/copy.c	Mon Nov 16 14:38:17 1992
--- source/dbu/copy.c	Tue Sep 15 15:35:53 1992
***************
*** 26,32 ****
  
  extern short	tTdbu[100];
  extern int	copy();
! extern int	null_fn();
  
  struct fn_def CopyFn =
  {
--- 26,32 ----
  
  extern short	tTdbu[100];
  extern int	copy();
! extern void	null_fn();
  
  struct fn_def CopyFn =
  {
***************
*** 110,116 ****
  	register int	i, pid;
  	register char	*cp;
  	int		stat;
! 	int		copydone();
  	int		op;
  
  #	ifdef xZTR1
--- 110,116 ----
  	register int	i, pid;
  	register char	*cp;
  	int		stat;
! 	void		copydone();
  	int		op;
  
  #	ifdef xZTR1
***************
*** 261,266 ****
--- 261,267 ----
  **	digits are returned. i is either 0 or a number like 58??
  */
  
+ void
  copydone(i)
  int	i;
  {
***************
*** 911,916 ****
--- 912,918 ----
  char	*param;
  {
  	register char	*np, *ret;
+ 	char			*dumvalue();
  
  	np = param;
  	ret = Delimitor;	/* assume default delimitors */
diff -r -c ../ingres.ptf/source/dbu/create.c source/dbu/create.c
*** ../ingres.ptf/source/dbu/create.c	Mon Nov 16 14:38:19 1992
--- source/dbu/create.c	Tue Sep 22 20:39:27 1992
***************
*** 13,19 ****
  
  extern	short	tTdbu[];
  extern	int	create();
! extern	int	null_fn();
  
  struct fn_def CreateFn =
  {
--- 13,19 ----
  
  extern	short	tTdbu[];
  extern	int	create();
! extern	void	null_fn();
  
  struct fn_def CreateFn =
  {
***************
*** 49,54 ****
--- 49,57 ----
  	char	frml;
  };
  
+ extern int   errno;
+ extern DESC   Reldes, Attdes;
+ 
  /*
  **  CREATE -- create new relation
  **
***************
*** 111,119 ****
  	struct relation		rel, key;
  	struct attribute	att;
  	DESC			desr;
- 	extern char		*Usercode;
- 	extern DESC		Reldes, Attdes;
- 	extern int		errno;
  	register int		relstat;
  	long			temptid;
  	long			npages;
--- 114,119 ----
diff -r -c ../ingres.ptf/source/dbu/destroy.c source/dbu/destroy.c
*** ../ingres.ptf/source/dbu/destroy.c	Mon Nov 16 14:38:18 1992
--- source/dbu/destroy.c	Tue Jun  9 14:14:17 1992
***************
*** 10,16 ****
  
  extern	short	tTdbu[];
  extern	int	destroy();
! extern 	int	null_fn();
  
  struct fn_def DstroyFn =
  {
--- 10,16 ----
  
  extern	short	tTdbu[];
  extern	int	destroy();
! extern 	void	null_fn();
  
  struct fn_def DstroyFn =
  {
diff -r -c ../ingres.ptf/source/dbu/display.c source/dbu/display.c
*** ../ingres.ptf/source/dbu/display.c	Mon Nov 16 14:38:19 1992
--- source/dbu/display.c	Tue Jun  9 14:14:16 1992
***************
*** 21,27 ****
  
  extern short	tTdbu[];
  extern int	display();
! extern int	null_fn();
  
  struct fn_def DsplayFn =
  {
--- 21,27 ----
  
  extern short	tTdbu[];
  extern int	display();
! extern void	null_fn();
  
  struct fn_def DsplayFn =
  {
diff -r -c ../ingres.ptf/source/dbu/help.c source/dbu/help.c
*** ../ingres.ptf/source/dbu/help.c	Mon Nov 16 14:38:20 1992
--- source/dbu/help.c	Mon Oct 19 18:51:07 1992
***************
*** 12,18 ****
  
  extern short 	tTdbu[100];
  extern int	help();
! extern int	null_fn();
  
  struct fn_def HelpFn =
  {
--- 12,18 ----
  
  extern short 	tTdbu[100];
  extern int	help();
! extern void	null_fn();
  
  struct fn_def HelpFn =
  {
***************
*** 200,206 ****
  #		ifndef xB_UNIX
  		setgid(getgid());
  #		endif
! 		naa = ztack(Pathname, "/doc/iaa");
  		execl("/bin/nroff", "nroff", naa, manual, 0);
  		execl("/usr/bin/nroff", "nroff", naa, manual, 0);
  		syserr("help: exec: nroff");
--- 200,206 ----
  #		ifndef xB_UNIX
  		setgid(getgid());
  #		endif
! 		naa = ztack(Pathname, "/doc/naa");
  		execl("/bin/nroff", "nroff", naa, manual, 0);
  		execl("/usr/bin/nroff", "nroff", naa, manual, 0);
  		syserr("help: exec: nroff");
diff -r -c ../ingres.ptf/source/dbu/index.c source/dbu/index.c
*** ../ingres.ptf/source/dbu/index.c	Mon Nov 16 14:38:18 1992
--- source/dbu/index.c	Wed Sep 16 16:01:07 1992
***************
*** 13,19 ****
  
  extern short	tTdbu[];
  extern int	indexx();
! extern int	null_fn();
  
  struct fn_def	IndexFn =
  {
--- 13,19 ----
  
  extern short	tTdbu[];
  extern int	indexx();
! extern void	null_fn();
  
  struct fn_def	IndexFn =
  {
***************
*** 53,58 ****
--- 53,59 ----
  	char	frm[5];
  };
  
+ int
  indexx(pc, pv)
  int	pc;
  PARM	pv[];
diff -r -c ../ingres.ptf/source/dbu/ksort.c source/dbu/ksort.c
*** ../ingres.ptf/source/dbu/ksort.c	Mon Nov 16 14:38:17 1992
--- source/dbu/ksort.c	Wed Sep 16 16:44:08 1992
***************
*** 29,37 ****
  **	Trace Flag:	Z37
  */
  
  extern short	tTdbu[100];
- extern int	ksort();
- extern int	null_fn();
  
  struct fn_def KsortFn =
  {
--- 29,39 ----
  **	Trace Flag:	Z37
  */
  
+ int	ksort();
+ extern void	null_fn();
+ extern int	cmpa();
+ 
  extern short	tTdbu[100];
  
  struct fn_def KsortFn =
  {
***************
*** 61,67 ****
  static long		Ccount;
  static char		**Lspace;
  static char		*Tspace;
- extern int		cmpa();
  static long		Tupsout;
  static int		firstime	= 1;
  static FILE		*Btree_fp;
--- 63,68 ----
***************
*** 69,74 ****
--- 70,76 ----
  int			Btree_fd;
  int			Nfiles;
  
+ int
  ksort(pc, pv)
  int	pc;
  PARM	*pv;
***************
*** 536,541 ****
--- 538,544 ----
  {
  	register struct merg	*merg;
  	register int		i;
+         char                    *setfil();
  
  	merg = mp;
  	if ((i = fread(merg->tup, 1, Tupsize, merg->fiop)) != Tupsize)
***************
*** 602,607 ****
--- 605,611 ----
  int	error;
  {
  	register int	i;
+         char     *setfil();
  
  	if (Nfiles == 1)
  		Nfiles++;
diff -r -c ../ingres.ptf/source/dbu/modify.c source/dbu/modify.c
*** ../ingres.ptf/source/dbu/modify.c	Mon Nov 16 14:38:19 1992
--- source/dbu/modify.c	Thu Sep 17 15:55:07 1992
***************
*** 17,24 ****
  SCCSID(@(#)modify.c	8.8	5/7/85)
  
  extern	short	tTdbu[];
! extern	int	modify();
! extern 	int	null_fn();
  
  struct fn_def ModifyFn =
  {
--- 17,24 ----
  SCCSID(@(#)modify.c	8.8	5/7/85)
  
  extern	short	tTdbu[];
! int	modify();
! extern 	void	null_fn();
  
  struct fn_def ModifyFn =
  {
***************
*** 1619,1624 ****
--- 1619,1625 ----
  	struct locator	tidpos;
  	extern char	*iocv();
  	extern DESC	Reldes;
+         extern int    create();
  
  	pv[0].pv_val.pv_str = "0000002";
  	capital(trim_relname(relname), btree);
diff -r -c ../ingres.ptf/source/dbu/print.c source/dbu/print.c
*** ../ingres.ptf/source/dbu/print.c	Mon Nov 16 14:38:18 1992
--- source/dbu/print.c	Tue Jun  9 14:14:13 1992
***************
*** 13,19 ****
  
  extern	short	tTdbu[];
  extern	int	print();
! extern	int	null_fn();
  
  struct fn_def PrintFn =
  {
--- 13,19 ----
  
  extern	short	tTdbu[];
  extern	int	print();
! extern	void	null_fn();
  
  struct fn_def PrintFn =
  {
diff -r -c ../ingres.ptf/source/dbu/resetrel.c source/dbu/resetrel.c
*** ../ingres.ptf/source/dbu/resetrel.c	Mon Nov 16 14:38:19 1992
--- source/dbu/resetrel.c	Tue Jun  9 14:14:13 1992
***************
*** 10,16 ****
  
  extern	short	tTdbu[];
  extern	int	resetrel();
! extern	int	null_fn();
  
  struct fn_def ResetrFn =
  {
--- 10,16 ----
  
  extern	short	tTdbu[];
  extern	int	resetrel();
! extern	void	null_fn();
  
  struct fn_def ResetrFn =
  {
diff -r -c ../ingres.ptf/source/dbu/rmqm.c source/dbu/rmqm.c
*** ../ingres.ptf/source/dbu/rmqm.c	Mon Nov 16 14:38:19 1992
--- source/dbu/rmqm.c	Tue Jun  9 14:14:12 1992
***************
*** 20,26 ****
  
  extern	short	tTdbu[];
  extern	int	dest_const();
! extern	int	null_fn();
  
  struct fn_def RmqmFn =
  {
--- 20,26 ----
  
  extern	short	tTdbu[];
  extern	int	dest_const();
! extern	void	null_fn();
  
  struct fn_def RmqmFn =
  {
diff -r -c ../ingres.ptf/source/dbu/rupdate.c source/dbu/rupdate.c
*** ../ingres.ptf/source/dbu/rupdate.c	Mon Nov 16 14:38:20 1992
--- source/dbu/rupdate.c	Tue Jun  9 14:14:12 1992
***************
*** 7,13 ****
  
  extern	short	tTdbu[];
  extern	int	rupdate();
! extern	int	null_fn();
  
  struct fn_def RupdatFn =
  {
--- 7,13 ----
  
  extern	short	tTdbu[];
  extern	int	rupdate();
! extern	void	null_fn();
  
  struct fn_def RupdatFn =
  {
diff -r -c ../ingres.ptf/source/dbu/save.c source/dbu/save.c
*** ../ingres.ptf/source/dbu/save.c	Mon Nov 16 14:38:20 1992
--- source/dbu/save.c	Fri Sep 25 13:47:31 1992
***************
*** 3,11 ****
--- 3,13 ----
  # include	<aux.h>
  # include 	<func.h>
  # include	<opsys.h>
+ # ifndef bsd386          /*  by  K.Okamoto   */
  # ifdef xV7_UNIX
  # include	<sys/timeb.h>
  # endif xV7_UNIX
+ # endif bsd386
  # include	<sccs.h>
  # include	<errors.h>
  
***************
*** 13,19 ****
  
  extern	short	tTdbu[];
  extern	int	save();
! extern	int	null_fn();
  
  struct fn_def SaveFn =
  {
--- 15,21 ----
  
  extern	short	tTdbu[];
  extern	int	save();
! extern	void	null_fn();
  
  struct fn_def SaveFn =
  {
***************
*** 57,68 ****
  	extern char	*Usercode;
  	struct relation	relk, relt;
  	int		day, month, year;
  # ifdef xV7_UNIX
  	struct timeb	timeb;
  # else xV7_UNIX
  	extern int	timezone;	/* defined by ctime(3) */
  # endif xV7_UNIX
! 	extern int	dysize();	/* ditto */
  
  	/* convert date */
  	/* "date" will be # of days from 1970 for a while */
--- 59,74 ----
  	extern char	*Usercode;
  	struct relation	relk, relt;
  	int		day, month, year;
+ # ifndef bsd386                          /*  by   K.Okamoto   */
  # ifdef xV7_UNIX
  	struct timeb	timeb;
  # else xV7_UNIX
  	extern int	timezone;	/* defined by ctime(3) */
  # endif xV7_UNIX
! # else bsd386                           /*  by   K.Okamoto     */
! 	extern int	timezone;	/* defined by ctime(3) */
! # endif
! /*	extern int	dysize();	 ditto */ 
  
  	/* convert date */
  	/* "date" will be # of days from 1970 for a while */
***************
*** 115,126 ****
  	date *= 60 * 60;
  
  	/* adjust to local time */
! # ifdef xV7_UNIX
  	ftime(&timeb);
  	date += ((long) timeb.timezone) * 60;
  # else xV7_UNIX
  	date += timezone;
  # endif xV7_UNIX
  
  #	ifdef xZTR1
  	if (tTf(45, 1))
--- 121,136 ----
  	date *= 60 * 60;
  
  	/* adjust to local time */
! # ifndef bsd386                        /*  by   K.Okamoto   */
! # if defined(xV7_UNIX)
  	ftime(&timeb);
  	date += ((long) timeb.timezone) * 60;
  # else xV7_UNIX
  	date += timezone;
  # endif xV7_UNIX
+ # else bsd386                         /*   by  K.Okamoto   */
+ 	date += timezone;
+ # endif
  
  #	ifdef xZTR1
  	if (tTf(45, 1))
***************
*** 237,240 ****
--- 247,259 ----
  
  	return (size);
  
+ }
+ 
+ dysize(year)
+ int year;
+ {
+   int days=365;
+   if (year % 4 == 0 && year % 100 != 0)
+     days=366;
+   return(days);
  }
diff -r -c ../ingres.ptf/source/dbu/sysfunc.c source/dbu/sysfunc.c
*** ../ingres.ptf/source/dbu/sysfunc.c	Mon Nov 16 14:38:20 1992
--- source/dbu/sysfunc.c	Wed Sep 16 16:40:50 1992
***************
*** 8,16 ****
  
  SCCSID (@(#)sysfunc.c	8.2 	1/15/85)
  
  short		tTdbu[100];
- extern int	sysfunc();
- extern int 	null_fn();
  
  int		Noupdt = FALSE;
  
--- 8,25 ----
  
  SCCSID (@(#)sysfunc.c	8.2 	1/15/85)
  
+ int	sysfunc();
+ int     optn_rel();
+ extern void 	null_fn();
+ # ifdef xSTR1
+ extern int      prvect();
+ # endif
+ extern int      sequal();
+ extern int      initp();
+ extern int      setp();
+ extern int      openr();
+ 
  short		tTdbu[100];
  
  int		Noupdt = FALSE;
  
***************
*** 112,117 ****
--- 121,127 ----
  **
  */
  
+ int
  sysfunc (pc, pv)
  int 	pc;
  PARM 	*pv;
***************
*** 194,200 ****
  	return(0);
  }
  
! 
  optn_rel(mx)
  struct modtabl	*mx;
  {
--- 204,210 ----
  	return(0);
  }
  
! int
  optn_rel(mx)
  struct modtabl	*mx;
  {
***************
*** 217,224 ****
  	return (ret);
  }
  
! /* rubproc()
  {
  	printf("sysmod interrupted\n");
  	return(1);
! } */
--- 227,237 ----
  	return (ret);
  }
  
! /*
! void
! rubproc()
  {
  	printf("sysmod interrupted\n");
  	return(1);
! }
! */
diff -r -c ../ingres.ptf/source/dbu/sysmon.c source/dbu/sysmon.c
*** ../ingres.ptf/source/dbu/sysmon.c	Mon Nov 16 14:38:20 1992
--- source/dbu/sysmon.c	Wed Sep 23 16:26:52 1992
***************
*** 24,31 ****
  
  
  
! extern		systm_mon();
! extern		systm_init();
  short		tTsysttymon[100];
  PARM		pv[PV_MAXPC+ 1];
  int		pc;
--- 24,31 ----
  
  
  
! extern	int	systm_mon();
! extern	void	systm_init();
  short		tTsysttymon[100];
  PARM		pv[PV_MAXPC+ 1];
  int		pc;
***************
*** 45,50 ****
--- 45,51 ----
  	0
  };
  
+ void
  systm_init(argc, argv)
  int	argc;
  char	*argv[];
***************
*** 194,206 ****
  **
  **	To keep from loading access methods.
  */
- 
  closecatalog()
  {
  }
! 
! 
! /*
  **  GET FLAG
  **
  */
--- 195,204 ----
  **
  **	To keep from loading access methods.
  */
  closecatalog()
  {
  }
! /*
  **  GET FLAG
  **
  */
diff -r -c ../ingres.ptf/source/decomp/Makefile source/decomp/Makefile
*** ../ingres.ptf/source/decomp/Makefile	Mon Nov 16 14:38:23 1992
--- source/decomp/Makefile	Wed Sep 23 16:09:20 1992
***************
*** 33,39 ****
  	lockit.c pull_const.c \
  	call_ovqp.c call_dbu.c 
  
! CFLAGS=	-I$H -O
  LINTFLAGS= -huc -I$H
  LDFLAGS=
  AR=	-ar
--- 33,39 ----
  	lockit.c pull_const.c \
  	call_ovqp.c call_dbu.c 
  
! CFLAGS=	-O -I$H 
  LINTFLAGS= -huc -I$H
  LDFLAGS=
  AR=	-ar
diff -r -c ../ingres.ptf/source/decomp/de_init.c source/decomp/de_init.c
*** ../ingres.ptf/source/decomp/de_init.c	Mon Nov 16 14:38:22 1992
--- source/decomp/de_init.c	Mon Oct 19 18:51:07 1992
***************
*** 7,12 ****
--- 7,13 ----
  SCCSID(@(#)de_init.c	8.1	12/31/84)
  
  /*ARGSUSED*/
+ void
  de_init(argc, argv)
  int	argc;
  char	**argv;
***************
*** 42,48 ****
  **		rubcatch
  */
  
! 
  de_rubproc()
  {
  	extern int	Equel;
--- 43,49 ----
  **		rubcatch
  */
  
! void
  de_rubproc()
  {
  	extern int	Equel;
***************
*** 60,64 ****
  
  	endovqp(RUBACK);
  	reinit();
! 	return;
  }
--- 61,65 ----
  
  	endovqp(RUBACK);
  	reinit();
! /*	return;           by  K.Okamoto     */
  }
diff -r -c ../ingres.ptf/source/decomp/globs.h source/decomp/globs.h
*** ../ingres.ptf/source/decomp/globs.h	Mon Nov 16 14:38:21 1992
--- source/decomp/globs.h	Thu Jun  4 12:00:32 1992
***************
*** 80,86 ****
  {
  	int	relop;	/* value of relop in simp clause*/
  	int	att;	/* attno of attribute */
! 	SYMBOL	*const;	/* pointer to constant value symbol */
  };
  
  
--- 80,86 ----
  {
  	int	relop;	/* value of relop in simp clause*/
  	int	att;	/* attno of attribute */
!         SYMBOL  *constv; /* pointer to constant value symbol */
  };
  
  
diff -r -c ../ingres.ptf/source/decomp/openrs.c source/decomp/openrs.c
*** ../ingres.ptf/source/decomp/openrs.c	Mon Nov 16 14:38:23 1992
--- source/decomp/openrs.c	Tue Sep 15 11:40:55 1992
***************
*** 254,259 ****
--- 254,260 ----
  int	var;
  {
  	register struct desc_tab	*dt;
+ 	struct desc_tab			*desc_get();
  
  	/* get descv for the relation */
  	dt = desc_get(De.de_rangev[var].relnum, TRUE);
diff -r -c ../ingres.ptf/source/decomp/qryproc.c source/decomp/qryproc.c
*** ../ingres.ptf/source/decomp/qryproc.c	Mon Nov 16 14:38:21 1992
--- source/decomp/qryproc.c	Fri Sep 25 14:51:52 1992
***************
*** 13,20 ****
  
  /* Control Module configuration information structure */
  
! extern	int de_init();
! extern	int de_rubproc();
  extern	int qryproc();
  
  struct fn_def	DeOvqpFn =
--- 13,20 ----
  
  /* Control Module configuration information structure */
  
! extern	void de_init();
! extern	void de_rubproc();
  extern	int qryproc();
  
  struct fn_def	DeOvqpFn =
diff -r -c ../ingres.ptf/source/decomp/usubr.c source/decomp/usubr.c
*** ../ingres.ptf/source/decomp/usubr.c	Mon Nov 16 14:38:22 1992
--- source/decomp/usubr.c	Fri Sep 25 15:01:07 1992
***************
*** 16,26 ****
--- 16,35 ----
  **	utility routines to handle setting up params, etc for DBU calls
  */
  
+ static char *getformat();
+ int         domnam();
+ int         lnode();
+ int         dstr_rel();
+ int         dstr_mark();
+ int         mak_t_rel();
+ QTREE       **mksqlist();
+ long        rel_pages();
  
  
  /*
   *	generate domain names, formats
   */
+ int
  domnam(lnp, pre)
  QTREE	**lnp;
  char	*pre;
***************
*** 62,68 ****
  /*
  **	makes list of nodes (depth first)
  */
! 
  lnode(nod, lnodv, count)
  QTREE 	*nod, *lnodv[];
  int	count;
--- 71,77 ----
  /*
  **	makes list of nodes (depth first)
  */
! int
  lnode(nod, lnodv, count)
  QTREE 	*nod, *lnodv[];
  int	count;
***************
*** 83,89 ****
  /*
  **	Immediately destroys the relation if it is an _SYS
  */
! 
  dstr_rel(relnum)
  int	relnum;
  {
--- 92,98 ----
  /*
  **	Immediately destroys the relation if it is an _SYS
  */
! int
  dstr_rel(relnum)
  int	relnum;
  {
***************
*** 104,110 ****
  **	Trace Flags:
  **		65
  */
! 
  dstr_mark(relnum)
  int	relnum;
  {
--- 113,119 ----
  **	Trace Flags:
  **		65
  */
! int
  dstr_mark(relnum)
  int	relnum;
  {
***************
*** 134,140 ****
  **	If rnum is positive, use it as the relation number,
  **	Otherwise allocate a new one.
  */
! 
  mak_t_rel(tree, prefix, rnum)
  QTREE	*tree;
  char	*prefix;
--- 143,149 ----
  **	If rnum is positive, use it as the relation number,
  **	Otherwise allocate a new one.
  */
! int
  mak_t_rel(tree, prefix, rnum)
  QTREE	*tree;
  char	*prefix;
diff -r -c ../ingres.ptf/source/equel/constants.h source/equel/constants.h
*** ../ingres.ptf/source/equel/constants.h	Mon Nov 16 14:38:30 1992
--- source/equel/constants.h	Mon Sep 14 18:14:16 1992
***************
*** 27,33 ****
  
  /* debugging info conditional compilation flag */
  # define	xDEBUG			/* on for "-c" and "-v" flags */
! # define	YYDEBUG			/* must ALWAYS be on-used in yyparse()*/
  
  
  /* 
--- 27,33 ----
  
  /* debugging info conditional compilation flag */
  # define	xDEBUG			/* on for "-c" and "-v" flags */
! # define	YYDEBUG	1		/* must ALWAYS be on-used in yyparse()*/
  
  
  /* 
diff -r -c ../ingres.ptf/source/equel/prtout.c source/equel/prtout.c
*** ../ingres.ptf/source/equel/prtout.c	Mon Nov 16 14:38:30 1992
--- source/equel/prtout.c	Thu Sep 10 17:43:35 1992
***************
*** 353,364 ****
  		{
  			if (In_quote)
  			{
! 				puts("\");\nIIwrite(\"", Out_file);
  				Charcnt = 9;
  			}
  			else
  			{
! 				puts("\\\n", Out_file);
  				Charcnt = 0;
  			}
  		}
--- 353,364 ----
  		{
  			if (In_quote)
  			{
! 				fputs("\");\nIIwrite(\"", Out_file);
  				Charcnt = 9;
  			}
  			else
  			{
! 				fputs("\\\n", Out_file);
  				Charcnt = 0;
  			}
  		}
***************
*** 374,379 ****
--- 374,381 ----
  **  PUTS -- put a string on an output file using putc()
  */
  
+ /*  -----------      deleted  by  K.Okamoto 
+ 
  puts(s, file)
  char	*s;
  FILE	*file;
***************
*** 385,387 ****
--- 387,391 ----
  	for (sp = s; *sp; )
  		putc(*sp++, f);
  }
+ 
+ ----------------------------------------------*/
diff -r -c ../ingres.ptf/source/gutil/Makefile source/gutil/Makefile
*** ../ingres.ptf/source/gutil/Makefile	Mon Nov 16 14:38:31 1992
--- source/gutil/Makefile	Thu Oct  8 13:52:52 1992
***************
*** 4,13 ****
  #	@(#)Makefile	8.3	12/18/85
  #
  
! INGRES=	../..
  H=	../h
  LIB=	$(INGRES)/lib
! CPUTYPE=VAX
  
  OBJS=	append.o atof.o bequal.o bitcnt.o bitpos.o cat.o \
  	concat.o freebuf.o ftoa.o fullwait.o \
--- 4,13 ----
  #	@(#)Makefile	8.3	12/18/85
  #
  
! INGRES=	/usr/ingres
  H=	../h
  LIB=	$(INGRES)/lib
! CPUTYPE1 = i386
  
  OBJS=	append.o atof.o bequal.o bitcnt.o bitpos.o cat.o \
  	concat.o freebuf.o ftoa.o fullwait.o \
***************
*** 16,25 ****
  	prargs.o scompare.o sequal.o set_si_buf.o set_so_buf.o \
  	setflag.o trace.o atol.o smove.o \
  	lprintf.o clrmem.o xputchar.o ztack.o syserr.o \
! 	min.o xfree.o bmove.$(CPUTYPE).o perror.o locv.o capital.o
  
  SRCS1=	append.c atof.c bequal.c bitcnt.c bitpos.c cat.c \
! 	concat.c freebuf.c ftoa.c fullwait.c \
  	getufield.c iocv.c itoa.c length.c \
  	xalloc.c need.c oatoi.c pad.c pmove.c capital.c
  SRCS2=	prargs.c scompare.c sequal.c set_si_buf.c set_so_buf.c \
--- 16,25 ----
  	prargs.o scompare.o sequal.o set_si_buf.o set_so_buf.o \
  	setflag.o trace.o atol.o smove.o \
  	lprintf.o clrmem.o xputchar.o ztack.o syserr.o \
! 	min.o xfree.o bmove.$(CPUTYPE1).o perror.o locv.o capital.o
  
  SRCS1=	append.c atof.c bequal.c bitcnt.c bitpos.c cat.c \
! 	concat.c freebuf.c fota.c fullwait.c \
  	getufield.c iocv.c itoa.c length.c \
  	xalloc.c need.c oatoi.c pad.c pmove.c capital.c
  SRCS2=	prargs.c scompare.c sequal.c set_si_buf.c set_so_buf.c \
***************
*** 26,40 ****
  	setflag.c trace.c atol.c smove.c \
  	xputchar.c ztack.c syserr.c \
  	min.c xfree.c lprintf.c clrmem.c perror.c locv.c
! ASSRC=  bmove.VAX.s bmove.SUN.c
  SRCS=	$(SRCS1) $(SRCS2) $(ASSRC)
  LINTSRCS= $(SRCS1) $(SRCS2)
  
! CFLAGS=	-I$H -O
  LINTFLAGS= -huc -I$H
  AR=	-ar
  ARFLAGS=urv
! RANLIB=	ranlib
  GET=	sccs get
  REL=
  LINT=	lint
--- 26,40 ----
  	setflag.c trace.c atol.c smove.c \
  	xputchar.c ztack.c syserr.c \
  	min.c xfree.c lprintf.c clrmem.c perror.c locv.c
! ASSRC=  bmove.VAX.s bmove.SUN.c bmove.i386.c
  SRCS=	$(SRCS1) $(SRCS2) $(ASSRC)
  LINTSRCS= $(SRCS1) $(SRCS2)
  
! CFLAGS=	-O -I$H
  LINTFLAGS= -huc -I$H
  AR=	-ar
  ARFLAGS=urv
! 
  GET=	sccs get
  REL=
  LINT=	lint
Only in source/gutil: bmove.i386.c
diff -r -c ../ingres.ptf/source/gutil/freebuf.c source/gutil/freebuf.c
*** ../ingres.ptf/source/gutil/freebuf.c	Mon Nov 16 14:38:33 1992
--- source/gutil/freebuf.c	Wed Sep 16 19:34:21 1992
***************
*** 15,25 ****
  **		seterr()
  */
  
  
  
- 
- 
- 
  /* structure that the routines use to allocate space */
  struct nodbuffer
  {
--- 15,25 ----
  **		seterr()
  */
  
+ int    freebuf();
+ int    markbuf();
+ int    seterr();
  
  
  /* structure that the routines use to allocate space */
  struct nodbuffer
  {
***************
*** 43,49 ****
  **	Side Effects:
  **		none
  */
! 
  markbuf(bf)
  struct nodbuffer	*bf;
  {
--- 43,49 ----
  **	Side Effects:
  **		none
  */
! int
  markbuf(bf)
  struct nodbuffer	*bf;
  {
***************
*** 65,71 ****
  **	Side Effects:
  **		none
  */
! 
  freebuf(bf, bytes)
  struct nodbuffer	*bf;
  int			bytes;
--- 65,71 ----
  **	Side Effects:
  **		none
  */
! int
  freebuf(bf, bytes)
  struct nodbuffer	*bf;
  int			bytes;
***************
*** 94,100 ****
  **	Side Effects:
  **		adjusts buffer structure
  */
! 
  seterr(bf, errnum, err_func)
  struct nodbuffer	*bf;
  int			errnum;
--- 94,100 ----
  **	Side Effects:
  **		adjusts buffer structure
  */
! int
  seterr(bf, errnum, err_func)
  struct nodbuffer	*bf;
  int			errnum;
diff -r -c ../ingres.ptf/source/gutil/ftoa.c source/gutil/ftoa.c
*** ../ingres.ptf/source/gutil/ftoa.c	Mon Nov 16 14:38:32 1992
--- source/gutil/ftoa.c	Thu Nov 19 14:44:27 1992
***************
*** 1,8 ****
--- 1,11 ----
+ #include <math.h>
+ #include <useful.h>
  # include	<sccs.h>
  
  SCCSID(@(#)ftoa.c	8.1	12/31/84)
  
  # define	MAXDIG		25
+ # define        MAXEXP          40
  
  /*
  **  FLOATING POINT TO ASCII CONVERSION
***************
*** 30,35 ****
--- 33,52 ----
  **	of the output field (sometimes shorter than 'width').
  */
  
+ 
+ /*
+  * Macros for converting digits to letters and vice versa
+  */
+ #define	to_digit(c)	((c) - '0')
+ #define is_digit(c)	((unsigned)to_digit(c) <= 9)
+ #define	to_char(n)	((n) + '0')
+ 
+ static char *fcvt();
+ static char *ecvt();
+ static char *round();
+ static char *exponent();
+ 
+ int
  ftoa(value, ascii, width, prec1, format)
  double	value;
  char	*ascii;
***************
*** 45,51 ****
  	char		mode;
  	int		lowercase;
  	int		prec;
! 	extern char	*ecvt(), *fcvt();
  
  	prec = prec1;
  	mode = format;
--- 62,69 ----
  	char		mode;
  	int		lowercase;
  	int		prec;
!         char            buf[MAXEXP];    /*  K.Okamoto  */
!         char      *startp, *endp;
  
  	prec = prec1;
  	mode = format;
***************
*** 58,64 ****
  	if (mode != 'E')
  	{
  		/* try 'F' style output */
! 		p = fcvt(value, prec, &expon, &sign);
  		avail = width;
  		a = ascii;
  
--- 76,85 ----
  	if (mode != 'E')
  	{
  		/* try 'F' style output */
! 	        startp = buf;
! 	        endp = buf + sizeof(buf);
! 		p = fcvt(value, prec, &expon, &sign, startp, endp);
! 
  		avail = width;
  		a = ascii;
  
***************
*** 107,113 ****
  	if (mode != 'F')
  	{
  		/* try to do E style output */
! 		p = ecvt(value, prec + 1, &expon, &sign);
  		avail = width - 5;
  		a = ascii;
  
--- 128,136 ----
  	if (mode != 'F')
  	{
  		/* try to do E style output */
! 	        startp = buf;
! 	        endp = buf + sizeof(buf);
! 		p = ecvt(value, prec + 1, &expon, &sign, startp, endp);
  		avail = width - 5;
  		a = ascii;
  
***************
*** 141,147 ****
  	avail = 1;
  
    frac_out:
! 	*a++ = '.';
  	while (prec > 0)
  	{
  		prec--;
--- 164,171 ----
  	avail = 1;
  
    frac_out:
! /*	*a++ = '.';           K.Okamoto      */
!         prec++;           /*  K.Okamoto  */
  	while (prec > 0)
  	{
  		prec--;
***************
*** 187,190 ****
--- 211,486 ----
  	*a = 0;
  	avail = a - ascii;
  	return (avail);
+ }
+ 
+ 
+ /*-
+  * Copyright (c) 1990 The Regents of the University of California.
+  * All rights reserved.
+  *
+  * This code is derived from software contributed to Berkeley by
+  * Chris Torek.
+  *
+  * 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.
+  */
+ /*  the following four functions are stolen from the source code of 
+  *  function cvt() in 386bsd itself in /usr/src/lib/libc/stdio/vfprintf.c 
+  *        by  K.Okamoto 
+  */
+ 
+ char *
+ fcvt(number, prec, expon, sign, startp, endp)
+ 	double number;
+ 	register int prec;
+ 	int *expon, *sign;
+         char *startp, *endp;
+ {
+ 	register char *p, *t;
+ 	register double fract;
+ 	int expcnt;
+ 	double integer, tmp;
+ 
+         *startp = '\0';
+ 	expcnt = 0;
+ 	if (number < 0) {
+ 		number = -number;
+ 		*sign = 1;
+ 	} else
+ 		*sign = 0;
+ 
+ 	fract = modf(number, &integer);
+ 
+ 	/* get an extra slot for rounding. */
+ 	t = ++startp;
+ 
+ 	/*
+ 	 * get integer portion of number; put into the end of the buffer; the
+ 	 * .01 is added for modf(356.0 / 10, &integer) returning .59999999...
+ 	 */
+ 	for (p = endp - 1; integer; ++expcnt) {
+ 		tmp = modf(integer / 10, &integer);
+ 		*p-- = to_char((int)((tmp + .01) * 10));
+ 	}
+ 	/* reverse integer into beginning of buffer */
+ 	if (expcnt)
+ 		for (; ++p < endp; *t++ = *p);
+ 	else
+ 		*t++ = '0';
+ 	/*
+ 	 * if precision required, add in a decimal point.
+ 	 */
+ 	if (prec )
+ 		*t++ = '.';
+ 	/* if requires more precision and some fraction left */
+ 	if (fract) {
+ 		if (prec)
+ 			do {
+ 				fract = modf(fract * 10, &tmp);
+ 				*t++ = to_char((int)tmp);
+ 			} while (--prec && fract);
+ 		if (fract)
+ 			startp = round(fract, (int *)NULL, startp,
+ 			    t - 1, (char)0, sign);
+ 	}
+ 	for (; prec--; *t++ = '0');
+         *expon = expcnt;
+ 	return ((char *)(startp));
+ }
+ 
+ 
+ char *
+ ecvt(number, prec, expon, sign, startp, endp)
+ 	double number;
+ 	register int prec;
+ 	int *expon, *sign;
+         char *startp, *endp;
+ {
+ 	register char *p, *t;
+ 	register double fract;
+ 	int expcnt, gformat;
+ 	double integer, tmp;
+ 
+         *startp = '\0';
+ 	expcnt = gformat = 0;
+ 	if (number < 0) {
+ 		number = -number;
+ 		*sign = 1;
+ 	} else
+ 		*sign = 0;
+ 
+ 	fract = modf(number, &integer);
+ 
+ 	/* get an extra slot for rounding. */
+ 	t = ++startp;
+ 
+ 	/*
+ 	 * get integer portion of number; put into the end of the buffer; the
+ 	 * .01 is added for modf(356.0 / 10, &integer) returning .59999999...
+ 	 */
+ 	for (p = endp - 1; integer; ++expcnt) {
+ 		tmp = modf(integer / 10, &integer);
+ 		*p-- = to_char((int)((tmp + .01) * 10));
+ 	}
+ 	if (expcnt) {
+ 		*t++ = *++p;
+ 		if (prec)
+ 			*t++ = '.';
+ 		/* if requires more precision and some integer left */
+ 		for (; prec && ++p < endp; --prec)
+ 			*t++ = *p;
+ 		/*
+ 		 * if done precision and more of the integer component,
+ 		 * round using it; adjust fract so we don't re-round
+ 		 * later.
+ 		 */
+ 		if (!prec && ++p < endp) {
+ 			fract = 0;
+ 			startp = round((double)0, &expcnt, startp,
+ 			    t - 1, *p, sign);
+ 		}
+ 		/* adjust expcnt for digit in front of decimal */
+ 		--expcnt;
+ 	}
+ 	/* until first fractional digit, decrement exponent */
+ 	else if (fract) {
+ 		/* adjust expcnt for digit in front of decimal */
+ 		for (expcnt = -1;; --expcnt) {
+ 			fract = modf(fract * 10, &tmp);
+ 			if (tmp)
+ 				break;
+ 		}
+ 		*t++ = to_char((int)tmp);
+ 		if (prec)
+ 			*t++ = '.';
+ 	}
+ 	else {
+ 		*t++ = '0';
+ 		if (prec)
+ 			*t++ = '.';
+ 	}
+ 	/* if requires more precision and some fraction left */
+ 	if (fract) {
+ 		if (prec)
+ 			do {
+ 				fract = modf(fract * 10, &tmp);
+ 			        *t++ = to_char((int)tmp);
+ 			} while (--prec && fract);
+ 		if (fract)
+ 			startp = round(fract, &expcnt, startp,
+ 			    t - 1, (char)0, sign);
+ 	}
+ 	/* if requires more precision */
+ 	for (; prec--; *t++ = '0');
+ 	/* unless alternate flag, trim any g/G format trailing 0's */
+ 	if (gformat) {
+ 		while (t > startp && *--t == '0');
+ 		if (*t == '.')
+ 			--t;
+ 		++t;
+ 	}
+ 	t = exponent(t, expcnt);
+         *expon = expcnt;
+ 	return ((char *)(startp));
+ }
+ 
+ static char *
+ round(fract, exp, start, end, ch, sign)
+ 	double fract;
+ 	int *exp;
+ 	register char *start, *end;
+ 	char ch;
+         int *sign;
+ {
+ 	double tmp;
+ 
+ 	if (fract)
+ 		(void)modf(fract * 10, &tmp);
+ 	else
+ 		tmp = to_digit(ch);
+ 	if (tmp > 4)
+ 		for (;; --end) {
+ 			if (*end == '.')
+ 				--end;
+ 			if (++*end <= '9')
+ 				break;
+ 			*end = '0';
+ 			if (end == start) {
+ 				if (exp) {	/* e/E; increment exponent */
+ 					*end = '1';
+ 					++*exp;
+ 				}
+ 				else {		/* f; add extra digit */
+ 				*--end = '1';
+ 				--start;
+ 				}
+ 				break;
+ 			}
+ 		}
+ 	/* ``"%.3f", (double)-0.0004'' gives you a negative 0. */
+ 	else if (*sign != 0)
+ 		for (;; --end) {
+ 			if (*end == '.')
+ 				--end;
+ 			if (*end != '0')
+ 				break;
+ 			if (end == start)
+ 				*sign = 0;
+ 		}
+ 	return (start);
+ }
+ 
+ static char *
+ exponent(p, exp)
+ 	register char *p;
+ 	register int exp;
+ {
+ 	register char *t;
+ 	char expbuf[MAXEXP];
+ 
+ 	*p++ = 'E';
+ 	if (exp < 0) {
+ 		exp = -exp;
+ 		*p++ = '-';
+ 	}
+ 	else
+ 		*p++ = '+';
+ 	t = expbuf + MAXEXP;
+ 	if (exp > 9) {
+ 		do {
+ 			*--t = to_char(exp % 10);
+ 		} while ((exp /= 10) > 9);
+ 		*--t = to_char(exp);
+ 		for (; t < expbuf + MAXEXP; *p++ = *t++);
+ 	}
+ 	else {
+ 		*p++ = '0';
+ 		*p++ = to_char(exp);
+ 	}
+ 	return (p);
  }
diff -r -c ../ingres.ptf/source/gutil/syserr.c source/gutil/syserr.c
*** ../ingres.ptf/source/gutil/syserr.c	Mon Nov 16 14:38:35 1992
--- source/gutil/syserr.c	Tue Jun  9 13:09:44 1992
***************
*** 22,29 ****
  
  char	*Proc_name;
  int	Accerror;
! extern	exit(), abort();
! int	(*ExitFn)()	 = exit;
  
  syserr(pv)
  char	*pv;
--- 22,29 ----
  
  char	*Proc_name;
  int	Accerror;
! extern	void exit(), abort();
! void	(*ExitFn)()	 = exit;
  
  syserr(pv)
  char	*pv;
diff -r -c ../ingres.ptf/source/h/func.h source/h/func.h
*** ../ingres.ptf/source/h/func.h	Mon Nov 16 14:38:26 1992
--- source/h/func.h	Mon Sep 14 18:42:08 1992
***************
*** 11,18 ****
  {
  	char		*fn_name;	/* the name of the function */
  	int		(*fn_fn)();	/* a pointer to the actual function */
! 	int		(*fn_initfn)();	/* initialization function */
! 	int		(*fn_cleanup)();/* interrupt cleanup function */
  	char		*fn_gptr;	/* pointer to global space */
  	unsigned	fn_gsize;	/* size of global space */
  	short		*fn_tvect;	/* the trace vector itself */
--- 11,20 ----
  {
  	char		*fn_name;	/* the name of the function */
  	int		(*fn_fn)();	/* a pointer to the actual function */
! /*	int		(*fn_initfn)();	 initialization function */
! /*	int		(*fn_cleanup)(); interrupt cleanup function */
! 	void		(*fn_initfn)();	/* initialization function */
! 	void		(*fn_cleanup)();/* interrupt cleanup function */
  	char		*fn_gptr;	/* pointer to global space */
  	unsigned	fn_gsize;	/* size of global space */
  	short		*fn_tvect;	/* the trace vector itself */
diff -r -c ../ingres.ptf/source/h/ingres.h source/h/ingres.h
*** ../ingres.ptf/source/h/ingres.h	Mon Nov 16 14:38:25 1992
--- source/h/ingres.h	Fri Sep 25 14:20:56 1992
***************
*** 1,4 ****
- 
  /*
  **  INGRES.H -- basic header file for ingres.
  **
--- 1,3 ----
***************
*** 25,31 ****
  **	Currently the default is to the 32 bits existant on VAX 11/780s.
  */
  
! # ifndef	sun
  # define	VAX
  # endif
  
--- 24,31 ----
  **	Currently the default is to the 32 bits existant on VAX 11/780s.
  */
  
! # ifdef i386                   /*  by   K.Okamoto   */
! /*   # ifndef sun                  by   K.Okamoto   */
  # define	VAX
  # endif
  
***************
*** 131,140 ****
  
  struct tup_id
  {
! # ifdef VAX
  	c_1	line_id, pg2, pg1, pg0;
  # else
  	c_1	pg0, pg1, pg2, line_id;
  # endif
  };
  
--- 131,142 ----
  
  struct tup_id
  {
! # ifdef VAX   /*  also for i386   by  K.Okamoto */
  	c_1	line_id, pg2, pg1, pg0;
+ /*	c_1	pg2, pg1, pg0, line_id;    K.Okamoto  */
  # else
  	c_1	pg0, pg1, pg2, line_id;
+ /*	c_1	line_id, pg0, pg1, pg2;    K.Okamoto  */
  # endif
  };
  
diff -r -c ../ingres.ptf/source/h/lock.h source/h/lock.h
*** ../ingres.ptf/source/h/lock.h	Mon Nov 16 14:38:26 1992
--- source/h/lock.h	Mon Jun  8 12:50:52 1992
***************
*** 34,40 ****
  					 *	=1 request lock,err return
  					 *	=2 request lock,sleep
  					 *	=3 release lock
! 					 *	=release all locks for pid
  					 */
  	char	lrtype;			/* type of lock:
  					 *   =0, critical section lock
--- 34,40 ----
  					 *	=1 request lock,err return
  					 *	=2 request lock,sleep
  					 *	=3 release lock
! 					 *	=4 release all locks for pid
  					 */
  	char	lrtype;			/* type of lock:
  					 *   =0, critical section lock
diff -r -c ../ingres.ptf/source/h/opsys.h source/h/opsys.h
*** ../ingres.ptf/source/h/opsys.h	Mon Nov 16 14:38:26 1992
--- source/h/opsys.h	Mon Oct  5 14:31:43 1992
***************
*** 1,5 ****
- #
- 
  /*
  **  OPSYS.H -- operating system dependent definitions.
  **
--- 1,3 ----
diff -r -c ../ingres.ptf/source/h/resp.h source/h/resp.h
*** ../ingres.ptf/source/h/resp.h	Mon Nov 16 14:38:27 1992
--- source/h/resp.h	Thu Jun  4 15:42:33 1992
***************
*** 13,19 ****
  	long	resp_tups;	/* count of tuples touched */
  	long	resp_pread;	/* pages read */
  	long	resp_pwrit;	/* pages written */
! 	/* PARM	resp_rval;	/* the module return value */
  };
  
  extern struct resp	Resp;	/* the current response */
--- 13,19 ----
  	long	resp_tups;	/* count of tuples touched */
  	long	resp_pread;	/* pages read */
  	long	resp_pwrit;	/* pages written */
! 	/* PARM	resp_rval;	 the module return value */
  };
  
  extern struct resp	Resp;	/* the current response */
diff -r -c ../ingres.ptf/source/h/tree.h source/h/tree.h
*** ../ingres.ptf/source/h/tree.h	Mon Nov 16 14:38:27 1992
--- source/h/tree.h	Fri Sep 25 14:20:54 1992
***************
*** 205,219 ****
  # define	QT_HDR_SIZ	12
  # define	SYM_HDR_SIZ	4
  # define	TYP_LEN_SIZ	2
- 
- 
- 
- 
  # endif PDP11
- 
- 
- 
- 
  
  /*
  **  Query Tree Header.
--- 205,211 ----
diff -r -c ../ingres.ptf/source/iutil/Makefile source/iutil/Makefile
*** ../ingres.ptf/source/iutil/Makefile	Mon Nov 16 14:38:41 1992
--- source/iutil/Makefile	Fri Sep 25 17:53:34 1992
***************
*** 43,49 ****
  	sort.c
  SRCS=	$(SRCS1) $(SRCS2) 
  
! CFLAGS=	-I$H -O -I../ctlmod
  LINTFLAGS = -huc -I$H
  AR=	-ar
  ARFLAGS=urv
--- 43,49 ----
  	sort.c
  SRCS=	$(SRCS1) $(SRCS2) 
  
! CFLAGS=	-O -I$H -I../ctlmod
  LINTFLAGS = -huc -I$H
  AR=	-ar
  ARFLAGS=urv
diff -r -c ../ingres.ptf/source/iutil/accbuf.c source/iutil/accbuf.c
*** ../ingres.ptf/source/iutil/accbuf.c	Mon Nov 16 14:38:41 1992
--- source/iutil/accbuf.c	Mon Oct 19 18:52:44 1992
***************
*** 31,37 ****
  int		Acc_init	=	FALSE;
  
  char		Acclock;		/* locks enabled flag */
! int		Alockdes;		/* file descriptor for lock device*/
  int		Lockrel;		/* lock relations flag*/
  /*
  **	Flush the indicated page and reset all
--- 31,37 ----
  int		Acc_init	=	FALSE;
  
  char		Acclock;		/* locks enabled flag */
! extern int	Alockdes;		/* file descriptor for lock device*/
  int		Lockrel;		/* lock relations flag*/
  /*
  **	Flush the indicated page and reset all
diff -r -c ../ingres.ptf/source/iutil/dblocks.c source/iutil/dblocks.c
*** ../ingres.ptf/source/iutil/dblocks.c	Mon Nov 16 14:38:41 1992
--- source/iutil/dblocks.c	Mon Oct 19 18:56:21 1992
***************
*** 5,10 ****
--- 5,11 ----
  SCCSID(@(#)dblocks.c	8.2	6/12/88)
  
  struct	lockreq	Lock;
+ 
  /*
   *	setdbl - set data base lock for either exclusive or shared
   *		 access.
***************
*** 18,24 ****
  	auto	int	ret_val;
  
  #	ifdef xATR1
! 	if ( tTf(28,6) )
  		printf(" setdbl act=%o md=%o\n", act, mod);
  #	endif
  	if (Alockdes < 0)
--- 19,25 ----
  	auto	int	ret_val;
  
  #	ifdef xATR1
! 	if ( tTf(28,6) ) 
  		printf(" setdbl act=%o md=%o\n", act, mod);
  #	endif
  	if (Alockdes < 0)
diff -r -c ../ingres.ptf/source/iutil/getservent.c source/iutil/getservent.c
*** ../ingres.ptf/source/iutil/getservent.c	Mon Nov 16 14:38:45 1992
--- source/iutil/getservent.c	Wed Sep 16 12:44:12 1992
***************
*** 5,16 ****
  #include <sys/socket.h>
  #include <netdb.h>
  #include <ctype.h>
! # include	<sccs.h>
  
  SCCSID(@(#)getservent.c	8.1	12/31/84)
  
  #define	MAXALIASES	35
  
  static char SERVDB[] = "/etc/services";
  static FILE *servf = NULL;
  static char line[BUFSIZ+1];
--- 5,22 ----
  #include <sys/socket.h>
  #include <netdb.h>
  #include <ctype.h>
! #include <sccs.h>
  
  SCCSID(@(#)getservent.c	8.1	12/31/84)
  
  #define	MAXALIASES	35
  
+ void        setservent();
+ void        endservent();
+ struct servent *getservent();
+ static char *any();
+ static int  myatoi();
+ 
  static char SERVDB[] = "/etc/services";
  static FILE *servf = NULL;
  static char line[BUFSIZ+1];
***************
*** 17,24 ****
  static struct servent serv;
  static char *serv_aliases[MAXALIASES];
  static int stayopen = 0;
- static char *any();
  
  setservent(f)
  	int f;
  {
--- 23,30 ----
  static struct servent serv;
  static char *serv_aliases[MAXALIASES];
  static int stayopen = 0;
  
+ void                        /* added by K.Okamoto  */ 
  setservent(f)
  	int f;
  {
***************
*** 29,34 ****
--- 35,41 ----
  	stayopen |= f;
  }
  
+ void                      /* added by K.Okamoto  */
  endservent()
  {
  	if (servf && !stayopen) {
diff -r -c ../ingres.ptf/source/iutil/ingresname.c source/iutil/ingresname.c
*** ../ingres.ptf/source/iutil/ingresname.c	Mon Nov 16 14:38:45 1992
--- source/iutil/ingresname.c	Tue Sep 22 14:36:47 1992
***************
*** 3,8 ****
--- 3,11 ----
  
  SCCSID(@(#)ingresname.c	8.1	12/31/84)
  
+ extern char	*pmove();
+ int  ingresname();
+ 
  /*
  **  MAKE INGRES FILE NAME
  **
***************
*** 21,27 ****
  char	*outname;
  {
  	register char	*p;
- 	extern char	*pmove();
  
  	p = outname;
  	p = pmove(iname, p, MAXNAME, ' ');
--- 24,29 ----
diff -r -c ../ingres.ptf/source/iutil/initucode.c source/iutil/initucode.c
*** ../ingres.ptf/source/iutil/initucode.c	Mon Nov 16 14:38:41 1992
--- source/iutil/initucode.c	Mon Oct 19 18:23:41 1992
***************
*** 145,151 ****
  char	*Pathname;	/* path of INGRES subtree */
  int	Status;		/* the user status of the real user */
  int	Rubignored;	/* set if rubouts ignored */
! 			/* (also in initproc for system processes) */
  int	Wait_action;	/* the action on the db_lock */
  char	*Dbpath;	/* the pathname of the database */
  char	*Flagvect[MAXFARGS+1];	/* the flags from argv */
--- 145,151 ----
  char	*Pathname;	/* path of INGRES subtree */
  int	Status;		/* the user status of the real user */
  int	Rubignored;	/* set if rubouts ignored */
! 		/* (also in initproc for system processes) */
  int	Wait_action;	/* the action on the db_lock */
  char	*Dbpath;	/* the pathname of the database */
  char	*Flagvect[MAXFARGS+1];	/* the flags from argv */
***************
*** 153,158 ****
--- 153,179 ----
  int	Ing_uid;	/* the user id of the INGRES user */
  jmp_buf	Initbuf;	/* Buffer to go back to initucode with */
  
+ #ifndef gtty
+ #define gtty(fd, argp) ioctl(fd, TIOCGETP, argp)
+ #endif
+ #ifndef stty
+ #define stty(fd, argp) ioctl(fd, TIOCSETP, argp)
+ #endif
+ 
+ int    initucode();
+ int    db_lock();
+ int    initdbpath();
+ extern	void	rubcatch();
+ 
+ /*------ needless for 386bsd  by  K.Okamoto -------
+ 	struct	passwd	*getpwnam();
+ # ifdef xV7_UNIX
+ 	extern char	*getenv();
+ # endif xV7_UNIX
+ -------------------------------------------------*/
+ 
+ 
+ int
  initucode(argc, argv, dbflag, paramlist, waitmode)
  int	argc;
  char	**argv;
***************
*** 180,193 ****
  	int		fvi, pvi;
  	char		**avp;
  	char		usr_ovrd[3];
- 	extern		rubcatch();
  	static short	tvect[100];
  	bool		nobuffer;
  	struct	passwd	*pwd;
- 	struct	passwd	*getpwnam();
- # ifdef xV7_UNIX
- 	extern char	*getenv();
- # endif xV7_UNIX
  
  	/*
  	**  Set up interrupts.
--- 201,209 ----
***************
*** 223,229 ****
  	if ( (pwd = getpwnam(USERINGRES)) == NULL )
  		syserr("initucode: No user %s in password file",USERINGRES);
  # ifdef xV7_UNIX
! 	Pathname = getenv("INGPATH");
  	if (Pathname == NULL)
  	{
  # endif xV7_UNIX
--- 239,245 ----
  	if ( (pwd = getpwnam(USERINGRES)) == NULL )
  		syserr("initucode: No user %s in password file",USERINGRES);
  # ifdef xV7_UNIX
! 	Pathname = (char *)getenv("INGPATH");
  	if (Pathname == NULL)
  	{
  # endif xV7_UNIX
***************
*** 329,335 ****
  	**  Scan the "users" file.
  	*/
  
! 	if ((iop = fopen(ztack(Pathname, "/files/users"), "r")) == NULL)
  		syserr("initucode: open error");
  	
  	/* get uid (out of loop) for test */
--- 345,351 ----
  	**  Scan the "users" file.
  	*/
  
! 	if ((iop = fopen((char *)ztack(Pathname, "/files/users"), "r")) == NULL)
  		syserr("initucode: open error");
  	
  	/* get uid (out of loop) for test */
***************
*** 407,413 ****
  		*/
  
  		Usercode = sbufp;
! 		sbufp += smove(field[UF_UCODE], sbufp) + 1;
  		Status = oatoi(field[UF_STAT]);
  		if (paramlist != NULL)
  		{
--- 423,430 ----
  		*/
  
  		Usercode = sbufp;
!                 sbufp += smove(field[UF_UCODE], sbufp) + 1;
! 
  		Status = oatoi(field[UF_STAT]);
  		if (paramlist != NULL)
  		{
***************
*** 490,496 ****
  
  		if (rtval == 0 || rtval == INDIRECT)
  		{
! 			i = open(ztack(Dbpath, "/admin"), O_RDONLY);
  			if (i < 0)
  				rtval += 1;
  			else
--- 507,513 ----
  
  		if (rtval == 0 || rtval == INDIRECT)
  		{
! 			i = open((char *)ztack(Dbpath, "/admin"), O_RDONLY);
  			if (i < 0)
  				rtval += 1;
  			else
***************
*** 566,571 ****
--- 583,589 ----
  
  struct lockreq	Lock;	/* the database lock structure */
  
+ int
  db_lock(mode)
  int	mode;
  {
***************
*** 579,584 ****
--- 597,603 ----
  		exit(1);
  	}
  }
+ 
  /*
  **  INITDBPATH -- initialize the pathname of the database
  **
***************
*** 605,610 ****
--- 624,630 ----
  **		none.
  */
  
+ int
  initdbpath(database, dbpath, follow)
  char	*database;
  char	*dbpath;
diff -r -c ../ingres.ptf/source/iutil/lock.c source/iutil/lock.c
*** ../ingres.ptf/source/iutil/lock.c	Mon Nov 16 14:38:40 1992
--- source/iutil/lock.c	Mon Oct 19 18:22:20 1992
***************
*** 10,15 ****
--- 10,17 ----
  
  SCCSID(@(#)lock.c	8.2	5/1/86)
  
+ int  start_up_lock_driver();
+ 
  /*
  ** start_up_lock_driver
  **	Attempt to start up a connection to the lock driver.
***************
*** 25,30 ****
--- 27,33 ----
  ** Trace Flags
  **	28
  */
+ int
  start_up_lock_driver()
  {
  	struct	sockaddr_in	addr;		/* address to attach to for server */
***************
*** 65,71 ****
  	/*
  	** Connect to the lock_driver
  	*/
! 	if ( connect(to_driver,&addr,sizeof (addr)) == -1 )
  	{
  #	ifdef xATR1
  		if ( tTf(28,4) )
--- 68,74 ----
  	/*
  	** Connect to the lock_driver
  	*/
! 	if ( connect(to_driver, (struct sockaddr *)&addr, sizeof (addr)) == -1 )
  	{
  #	ifdef xATR1
  		if ( tTf(28,4) )
***************
*** 74,85 ****
  		close(to_driver);
  		return ( -1 );
  	}
- 
- 
  	return ( to_driver );
  }/* start_up_lock_driver */
  
  
  struct servent *
  getservbyname(name, proto)
  	char *name, *proto;
--- 77,87 ----
  		close(to_driver);
  		return ( -1 );
  	}
  	return ( to_driver );
  }/* start_up_lock_driver */
  
  
+ /*   ---- deleted by  K.Okamoto  -------------
  struct servent *
  getservbyname(name, proto)
  	char *name, *proto;
***************
*** 102,104 ****
--- 104,109 ----
  	endservent();
  	return (p);
  }
+ 
+ -----------deleted by K.Okamoto  ------------------
+ */
\ No newline at end of file
diff -r -c ../ingres.ptf/source/iutil/lockreq.c source/iutil/lockreq.c
*** ../ingres.ptf/source/iutil/lockreq.c	Mon Nov 16 14:38:48 1992
--- source/iutil/lockreq.c	Mon Oct 19 18:21:40 1992
***************
*** 1,5 ****
  #include <ingres.h>
! #include "ildr.h"
  #include <lock.h>
  #include <sccs.h>
  #include <signal.h>
--- 1,5 ----
  #include <ingres.h>
! #include <ildr.h>
  #include <lock.h>
  #include <sccs.h>
  #include <signal.h>
***************
*** 6,11 ****
--- 6,13 ----
  
  SCCSID(%W%	%G%)
  
+ int   dolock();
+ 
  /*
   *	LOCKREQ.C
   *
***************
*** 16,21 ****
--- 18,25 ----
  
  static	int	pid;
  
+ 
+ int
  dolock(lock)
  struct	lockreq	*lock;
  {
diff -r -c ../ingres.ptf/source/iutil/null_fn.c source/iutil/null_fn.c
*** ../ingres.ptf/source/iutil/null_fn.c	Mon Nov 16 14:38:47 1992
--- source/iutil/null_fn.c	Mon Oct 19 18:23:04 1992
***************
*** 62,68 ****
  **		Do not use this routine if you want to do something.
  */
  
  null_fn()
  {
- 	return (0);
  }
--- 62,68 ----
  **		Do not use this routine if you want to do something.
  */
  
+ void
  null_fn()
  {
  }
diff -r -c ../ingres.ptf/source/iutil/page.c source/iutil/page.c
*** ../ingres.ptf/source/iutil/page.c	Mon Nov 16 14:38:47 1992
--- source/iutil/page.c	Sat Sep 19 18:31:43 1992
***************
*** 6,11 ****
--- 6,14 ----
  
  SCCSID(@(#)page.c	8.3	2/8/85)
  
+ extern struct accbuf	*choose_buf();
+ 
+ 
  /*
  **	UNIX read/write counters
  */
***************
*** 34,39 ****
--- 37,43 ----
  **		scan_dups()
  **
  */
+ int
  get_page(d, tid)
  register DESC	*d;
  TID		*tid;
***************
*** 43,50 ****
  	register struct accbuf	*b;
  	struct accbuf		*b1;
  	int			lk;		/* lock condition*/
- 	extern struct accbuf	*choose_buf();
- 	extern long		lseek();
  
  #	ifdef xATR3
  	if (tTf(26, 9))
--- 47,52 ----
***************
*** 63,68 ****
--- 65,71 ----
  	{
  		if (i = pageflush(b))
  			return (i);
+ 
  #		ifdef xATR1
  		if (tTf(26, 10))
  		{
diff -r -c ../ingres.ptf/source/iutil/printup.c source/iutil/printup.c
*** ../ingres.ptf/source/iutil/printup.c	Mon Nov 16 14:38:42 1992
--- source/iutil/printup.c	Fri Oct  9 13:52:05 1992
***************
*** 124,130 ****
  		switch (length)
  		{
  		  case 4:
! 			ftoa(value->f4type, buf, Out_arg.f4width, Out_arg.f4prec, Out_arg.f4style);
  			printfatt(Out_arg.f4width, buf);
  			break;
  
--- 124,132 ----
  		switch (length)
  		{
  		  case 4:
! 		        dbl = (double) value->f4type;
! 
! 			ftoa(dbl, buf, Out_arg.f4width, Out_arg.f4prec, Out_arg.f4style);
  			printfatt(Out_arg.f4width, buf);
  			break;
  
diff -r -c ../ingres.ptf/source/iutil/replace.c source/iutil/replace.c
*** ../ingres.ptf/source/iutil/replace.c	Mon Nov 16 14:38:47 1992
--- source/iutil/replace.c	Thu Sep 17 14:11:36 1992
***************
*** 47,53 ****
  **		24.4-7
  */
  
! 
  replace(d, tid, tuple, checkdups)	
  register DESC	*d;
  register TID	*tid;
--- 47,53 ----
  **		24.4-7
  */
  
! int
  replace(d, tid, tuple, checkdups)	
  register DESC	*d;
  register TID	*tid;
diff -r -c ../ingres.ptf/source/iutil/rub.c source/iutil/rub.c
*** ../ingres.ptf/source/iutil/rub.c	Mon Nov 16 14:38:47 1992
--- source/iutil/rub.c	Mon Jun  8 17:48:13 1992
***************
*** 42,47 ****
--- 42,48 ----
  char	*RubWhy;	/* why are interrupts disabled */
  int	RubGot;		/* set if we have an unprocessed interrupt */
  
+ void
  rubcatch()
  {
  	/* ignore interrupts while we are processing */
diff -r -c ../ingres.ptf/source/iutil/utility.c source/iutil/utility.c
*** ../ingres.ptf/source/iutil/utility.c	Mon Nov 16 14:38:40 1992
--- source/iutil/utility.c	Mon Sep 21 19:13:03 1992
***************
*** 25,31 ****
  
  struct lpage
  {
! # ifdef VAX
  	char	lpg2, lpg1, lpg0, lpgx;
  # else
  	char	lpgx, lpg0, lpg1, lpg2;
--- 25,31 ----
  
  struct lpage
  {
! # ifdef VAX     /* also for i386  by  K.Okamoto  */
  	char	lpg2, lpg1, lpg0, lpgx;
  # else
  	char	lpgx, lpg0, lpg1, lpg2;
diff -r -c ../ingres.ptf/source/libq/IIingres.c source/libq/IIingres.c
*** ../ingres.ptf/source/libq/IIingres.c	Mon Nov 16 14:38:50 1992
--- source/libq/IIingres.c	Tue Sep 15 12:26:07 1992
***************
*** 39,46 ****
  	register char	*cp;
  	char		*argv[12];
  	register char	**ap;
! 	extern		IIresync();
! 	extern		*(IIinterrupt)(),	exit();
  	pb_t		pb;
  
  #	ifdef xETR1
--- 39,46 ----
  	register char	*cp;
  	char		*argv[12];
  	register char	**ap;
! 	extern	void	IIresync();
! 	extern	void	*(IIinterrupt)(),	exit();
  	pb_t		pb;
  
  #	ifdef xETR1
diff -r -c ../ingres.ptf/source/libq/IIresync.c source/libq/IIresync.c
*** ../ingres.ptf/source/libq/IIresync.c	Mon Nov 16 14:38:52 1992
--- source/libq/IIresync.c	Tue Sep 15 12:15:45 1992
***************
*** 15,23 ****
  */
  
  int	IISyncs[CM_MAXPROC];
! extern	exit();
! int	(*IIinterrupt)() =	exit;
  
  IIresync()
  {
  	register int	i;
--- 15,24 ----
  */
  
  int	IISyncs[CM_MAXPROC];
! extern	void  exit();
! void	(*IIinterrupt)() =	exit;
  
+ void
  IIresync()
  {
  	register int	i;
diff -r -c ../ingres.ptf/source/libq/Makefile source/libq/Makefile
*** ../ingres.ptf/source/libq/Makefile	Mon Nov 16 14:38:49 1992
--- source/libq/Makefile	Wed Oct  7 19:48:15 1992
***************
*** 4,10 ****
  #	@(#)Makefile	8.3	12/18/85
  #
  
! INGRES=	../..
  H=	../h
  LIB=	$(INGRES)/lib
  
--- 4,10 ----
  #	@(#)Makefile	8.3	12/18/85
  #
  
! INGRES=	/usr/ingres
  H=	../h
  LIB=	$(INGRES)/lib
  
***************
*** 25,35 ****
  
  SYSLIB=	/usr/local/lib
  
! CFLAGS=	-I$H -I../ctlmod -O
  LINTFLAGS= -huc -I$H -I../ctlmod
  AR=	-ar
  ARFLAGS=rvu
- RANLIB=	ranlib
  CP=	cp
  CHMOD=	chmod
  CHOWN=	-chown
--- 25,34 ----
  
  SYSLIB=	/usr/local/lib
  
! CFLAGS=	-O -I$H -I../ctlmod
  LINTFLAGS= -huc -I$H -I../ctlmod
  AR=	-ar
  ARFLAGS=rvu
  CP=	cp
  CHMOD=	chmod
  CHOWN=	-chown
diff -r -c ../ingres.ptf/source/monitor/Makefile source/monitor/Makefile
*** ../ingres.ptf/source/monitor/Makefile	Mon Nov 16 14:38:36 1992
--- source/monitor/Makefile	Thu Oct  1 16:16:43 1992
***************
*** 26,32 ****
  HDRS=	buf.h monitor.h
  SRCS=	$(SRCS1) $(HDRS)
  
! CFLAGS=	-I$H -O -I../ctlmod
  LINTFLAGS= -huc -I$H -I../ctlmod
  LDFLAGS=
  BIN=	$(INGRES)/bin
--- 26,33 ----
  HDRS=	buf.h monitor.h
  SRCS=	$(SRCS1) $(HDRS)
  
! #CFLAGS=	-O -I$H  -I../ctlmod
! CFLAGS=	-I$H  -I../ctlmod
  LINTFLAGS= -huc -I$H -I../ctlmod
  LDFLAGS=
  BIN=	$(INGRES)/bin
diff -r -c ../ingres.ptf/source/monitor/branch.c source/monitor/branch.c
*** ../ingres.ptf/source/monitor/branch.c	Mon Nov 16 14:38:36 1992
--- source/monitor/branch.c	Mon Oct 19 18:51:06 1992
***************
*** 76,86 ****
  	register char	c;
  
  	smove(label, target);
! 	if (rewind(Input))
! 	{
! 		printf("Cannot branch on a terminal\n");
! 		return (1);
! 	}
  
  	/* search for the label */
  	while ((c = getch()) > 0)
--- 76,87 ----
  	register char	c;
  
  	smove(label, target);
! /*	if (rewind(Input))
!  *	{
!  *		printf("Cannot branch on a terminal\n");
!  *		return (1);
!  *	}
! */
  
  	/* search for the label */
  	while ((c = getch()) > 0)
diff -r -c ../ingres.ptf/source/monitor/buf.c source/monitor/buf.c
*** ../ingres.ptf/source/monitor/buf.c	Mon Nov 16 14:38:36 1992
--- source/monitor/buf.c	Tue Jun  9 13:09:44 1992
***************
*** 203,209 ****
  int	size;
  {
  	register char	*p;
! 	extern int	(*ExitFn)();	/* defined in syserr.c */
  	extern char	*malloc();
  
  	p = malloc(size);
--- 203,209 ----
  int	size;
  {
  	register char	*p;
! 	extern void	(*ExitFn)();	/* defined in syserr.c */
  	extern char	*malloc();
  
  	p = malloc(size);
diff -r -c ../ingres.ptf/source/monitor/clear.c source/monitor/clear.c
*** ../ingres.ptf/source/monitor/clear.c	Mon Nov 16 14:38:37 1992
--- source/monitor/clear.c	Thu Oct  1 11:14:50 1992
***************
*** 16,21 ****
--- 16,22 ----
  */
  
  clear(f)
+     char f;
  {
  	Autoclear = 0;
  
***************
*** 25,30 ****
  	if (Nodayfile >= 0 && f)
  		printf("\07go\n");
  	if (f)
! 		clrline(0);
  	Notnull = 0;
  }
--- 26,31 ----
  	if (Nodayfile >= 0 && f)
  		printf("\07go\n");
  	if (f)
! 		clrline(0);  /* removes '\n' following '\g'etc  */
  	Notnull = 0;
  }
diff -r -c ../ingres.ptf/source/monitor/clrline.c source/monitor/clrline.c
*** ../ingres.ptf/source/monitor/clrline.c	Mon Nov 16 14:38:37 1992
--- source/monitor/clrline.c	Fri Oct  2 15:49:40 1992
***************
*** 32,39 ****
  	Newline = TRUE;
  	/* if char following is a newline, throw it away */
  	c = getch();
! 	Prompt = c == '\n';
! 	if (!Prompt)
  	{
  		ungetc(c, Input);
  	}
--- 32,39 ----
  	Newline = TRUE;
  	/* if char following is a newline, throw it away */
  	c = getch();
! 	Prompt = (c == '\n');
! 	if (!Prompt)              /*  next char != newline K.Okamoto */
  	{
  		ungetc(c, Input);
  	}
diff -r -c ../ingres.ptf/source/monitor/expr.c source/monitor/expr.c
*** ../ingres.ptf/source/monitor/expr.c	Mon Nov 16 14:38:37 1992
--- source/monitor/expr.c	Fri Sep 25 18:05:56 1992
***************
*** 263,269 ****
  
  	  case ' ':
  	  case '\n':
! 	  case '/t':
  	  case '\0':
  		printf("Expression expected: end of expression found.\n");
  		ExprError = TRUE;
--- 263,269 ----
  
  	  case ' ':
  	  case '\n':
! 	  case '\t':
  	  case '\0':
  		printf("Expression expected: end of expression found.\n");
  		ExprError = TRUE;
diff -r -c ../ingres.ptf/source/monitor/getch.c source/monitor/getch.c
*** ../ingres.ptf/source/monitor/getch.c	Mon Nov 16 14:38:37 1992
--- source/monitor/getch.c	Tue Oct  6 15:38:41 1992
***************
*** 11,17 ****
  **  GET CHARACTER
  **
  **	This routine is just a getchar, except it allows a pseudo-
! **	EOF marker.
  */
  
  char
--- 11,17 ----
  **  GET CHARACTER
  **
  **	This routine is just a getchar, except it allows a pseudo-
! **	EOF (i.e. == '\0') marker.
  */
  
  char
***************
*** 20,38 ****
  	register char	c;
  
  	if (GiveEof)
! 		c = '\0';
  	else
  		c = getc(Input);
- 	if (c < 0)
- 		c = '\0';
  
  	/* deliver EOF if newline in Oneline mode */
  	if (c == '\n' && Oneline)
  	{
  		ungetc(c, Input);
  		c = '\0';
! 	}
! 
  	GiveEof = FALSE;
  	return (c);
  }
--- 20,40 ----
  	register char	c;
  
  	if (GiveEof)
! 		c = '\0';           /* stands for EOF  */
  	else
  		c = getc(Input);
  
+         if (c == EOF)               /*  if (c < 0 )   K.Okamoto  */
+ 	    c = '\0';               /*  if really EOF(-1)
+                                         This should be rewrite to permit
+ 					to input 8 bit code  K.Okamoto */
+ 
  	/* deliver EOF if newline in Oneline mode */
  	if (c == '\n' && Oneline)
  	{
  		ungetc(c, Input);
  		c = '\0';
!         }
  	GiveEof = FALSE;
  	return (c);
  }
diff -r -c ../ingres.ptf/source/monitor/go.c source/monitor/go.c
*** ../ingres.ptf/source/monitor/go.c	Mon Nov 16 14:38:37 1992
--- source/monitor/go.c	Mon Sep 28 14:31:39 1992
***************
*** 27,40 ****
  
  jmp_buf		GoJmpBuf;
  
  go()
  {
  	FILE		*iop;
  	auto char	c;
  	register char	*p;
- 	extern int	fgetc();
  	pb_t		pb;
- 	extern char	*macro();
  
  	clrline(1);
  	fflush(Qryiop);
--- 27,42 ----
  
  jmp_buf		GoJmpBuf;
  
+ extern int	fgetc();
+ extern char	*macro();
+ 
+ int
  go()
  {
  	FILE		*iop;
  	auto char	c;
  	register char	*p;
  	pb_t		pb;
  
  	clrline(1);
  	fflush(Qryiop);
diff -r -c ../ingres.ptf/source/monitor/include.c source/monitor/include.c
*** ../ingres.ptf/source/monitor/include.c	Mon Nov 16 14:38:38 1992
--- source/monitor/include.c	Thu Oct  1 16:43:30 1992
***************
*** 21,26 ****
--- 21,29 ----
  **	Prompts are turned off during the include.
  */
  
+ extern char		*getfilenm();
+ 
+ 
  include(filename)
  char	*filename;
  {
***************
*** 28,37 ****
  	FILE			*saveinp;
  	register char		*f;
  	register FILE		*b;
- 	extern char		*getfilenm();
  
  	f = filename;
! 	if (f == 0)
  		f = getfilenm();
  	if (sequal(f, "-"))
  	{
--- 31,39 ----
  	FILE			*saveinp;
  	register char		*f;
  	register FILE		*b;
  
  	f = filename;
! 	if (f == 0)               /* stands for NULL pointer */
  		f = getfilenm();
  	if (sequal(f, "-"))
  	{
diff -r -c ../ingres.ptf/source/monitor/monitor.c source/monitor/monitor.c
*** ../ingres.ptf/source/monitor/monitor.c	Mon Nov 16 14:38:38 1992
--- source/monitor/monitor.c	Tue Oct  6 15:41:25 1992
***************
*** 4,9 ****
--- 4,10 ----
  # include	<signal.h>
  # include	<ctlmod.h>
  # include	<sccs.h>
+ # include       <sys/ioctl.h>      /*  K.Okamoto  */
  
  SCCSID(@(#)monitor.c	8.1	12/31/84)
  
***************
*** 93,116 ****
  	"$trace",	C_SYSTRACE,
  	"$r",		C_SYSRESET,
  	"$reset",	C_SYSRESET,
! 	0
  };
  
  
  monitor(recurs)
! int	recurs;			/* Is this a recursive call? */
  {
  	register char	chr;
! 	int		timevec[2];
  	register int	controlno;
! 	extern jmp_buf	CmReset;
! 	extern		error();
! 	extern char	*Proc_name;
! 	extern int	RubLevel;
! 	extern		rubcatch();
  
  	if ( recurs == FALSE )
! 		setjmp(CmReset);
  	initbuf(Qbuf, QbufSize, ERR_QBUF, error);
  	clrmem(&Ctx, sizeof Ctx);
  	Ctx.ctx_cmark = Ctx.ctx_pmark = markbuf(Qbuf);
--- 94,121 ----
  	"$trace",	C_SYSTRACE,
  	"$r",		C_SYSRESET,
  	"$reset",	C_SYSRESET,
!         0
  };
  
+ extern jmp_buf	CmReset;
+ extern	int	error();
+ extern char	*Proc_name;
+ extern int	RubLevel;
+ extern	void	rubcatch();
  
+ 
+ int
  monitor(recurs)
! bool	recurs;			/* K.Okamoto Is this a recursive call? */
  {
  	register char	chr;
!         time_t          *timevec;
  	register int	controlno;
!         pid_t           pid;
  
  	if ( recurs == FALSE )
! 	  setjmp(CmReset);
! 
  	initbuf(Qbuf, QbufSize, ERR_QBUF, error);
  	clrmem(&Ctx, sizeof Ctx);
  	Ctx.ctx_cmark = Ctx.ctx_pmark = markbuf(Qbuf);
***************
*** 122,130 ****
  
  	while (chr = getch())
  	{
  		if (chr == '\\')
  		{
- 			
  			/*
  			** do not process "\\" as an escape char
  			*/
--- 127,135 ----
  
  	while (chr = getch())
  	{
+ 
  		if (chr == '\\')
  		{
  			/*
  			** do not process "\\" as an escape char
  			*/
***************
*** 205,221 ****
  
  			  case C_MARK:
  				getfilenm();
! 				prompt(0);
  				continue;
  
  			  case C_BRANCH:
  				branch();
! 				prompt(0);
  				continue;
  
  			  case C_SYSTRACE:
  				trace();
! 				prompt(0);
  				continue;
  
  			  case C_SYSRESET:
--- 210,226 ----
  
  			  case C_MARK:
  				getfilenm();
! 				prompt("");
  				continue;
  
  			  case C_BRANCH:
  				branch();
! 				prompt("");
  				continue;
  
  			  case C_SYSTRACE:
  				trace();
! 				prompt("");
  				continue;
  
  			  case C_SYSRESET:
***************
*** 229,235 ****
  		}
  		putch(chr);
  	}
- 
  	if (Input == stdin)
  	{
  		if (Nodayfile >= 0)
--- 234,239 ----
***************
*** 291,297 ****
  		}
  	}
  
! 	*p = 0;
  	return (buf);
  }
  
--- 295,301 ----
  		}
  	}
  
! 	*p = '\0';
  	return (buf);
  }
  
***************
*** 310,318 ****
  		printf("Funny character 0%o converted to blank\n", c);
  		c = ' ';
  	}
! 	prompt(0);
  	if (Autoclear)
! 		clear(0);
! 	putc(c, Qryiop);
  	Notnull++;
  }
--- 314,325 ----
  		printf("Funny character 0%o converted to blank\n", c);
  		c = ' ';
  	}
! 	prompt(0);     /* if Prompt = !GiveEof == TRUE, show prompt and 
! 			  then fflush(stdout).    K.Okamoto      */
  	if (Autoclear)
! 		clear(0);   /* Qbname -->truncated Qryiop, and show 
! 			     prompt 'go'  Autoclear = Notnull = 0,
! 			     K.Okamoto  */
! 	fputc(c, Qryiop);
  	Notnull++;
  }
diff -r -c ../ingres.ptf/source/monitor/monitor.h source/monitor/monitor.h
*** ../ingres.ptf/source/monitor/monitor.h	Mon Nov 16 14:38:39 1992
--- source/monitor/monitor.h	Thu Oct  1 13:29:25 1992
***************
*** 38,44 ****
  int		Xwaitpid;	/* pid to wait on - zero means none */
  int		Error_id;	/* the error number of the last err */
  
! /* \include support stuff */
  FILE		*Input;		/* current input file */
  int		Idepth;		/* include depth */
  char		Oneline;	/* deliver EOF after one line input */
--- 38,44 ----
  int		Xwaitpid;	/* pid to wait on - zero means none */
  int		Error_id;	/* the error number of the last err */
  
! /* include support stuff */
  FILE		*Input;		/* current input file */
  int		Idepth;		/* include depth */
  char		Oneline;	/* deliver EOF after one line input */
diff -r -c ../ingres.ptf/source/monitor/prompt.c source/monitor/prompt.c
*** ../ingres.ptf/source/monitor/prompt.c	Mon Nov 16 14:38:38 1992
--- source/monitor/prompt.c	Mon Sep 28 15:45:08 1992
***************
*** 19,25 ****
  */
  
  prompt(msg)
! char	*msg;
  {
  	if (!Prompt || GiveEof)
  		return;
--- 19,25 ----
  */
  
  prompt(msg)
!     char	*msg;
  {
  	if (!Prompt || GiveEof)
  		return;
diff -r -c ../ingres.ptf/source/monitor/quit.c source/monitor/quit.c
*** ../ingres.ptf/source/monitor/quit.c	Mon Nov 16 14:38:38 1992
--- source/monitor/quit.c	Mon Oct 19 18:51:06 1992
***************
*** 40,45 ****
--- 40,53 ----
  	"alarm",
  };
  
+ extern void	(*ExitFn)();
+ extern void	exit();
+ extern int	sys_nerr;
+ extern char	*sys_errlist[];
+ extern char	SysIdent[];
+ 
+ 
+ void
  quit()
  {
  	register int	ndx;
***************
*** 48,59 ****
  	char		buf[100];
  	int		status;
  	int		pidlist[50];
- 	extern int	(*ExitFn)();
- 	extern		exit();
- 	extern int	sys_nerr;
- 	extern char	*sys_errlist[];
  	char		indexx[0400];
- 	extern char	SysIdent[];
  
  #	ifdef xMTR1
  	if (tTf(35, -1))
--- 56,62 ----
Only in source/monitor: test.c
Only in source/monitor: test1.c
diff -r -c ../ingres.ptf/source/monitor/ttymon.c source/monitor/ttymon.c
*** ../ingres.ptf/source/monitor/ttymon.c	Mon Nov 16 14:38:39 1992
--- source/monitor/ttymon.c	Tue Oct  6 14:52:49 1992
***************
*** 48,58 ****
  **		11 (proc_err)
  */
  
! extern char	*Usercode;
! extern		tm_mon();
! extern		tm_init();
! extern		tm_intr();
  short		tTttymon[100];
  
  struct fn_def	TtyMonFn =
  {
--- 48,66 ----
  **		11 (proc_err)
  */
  
! extern  char	*Usercode;
! int	tm_mon();
! void	tm_init();
! void	tm_intr();
! extern	void	quit();
! extern  void	(*ExitFn)();
! extern  char	*getufield();
! extern  char	*mcall();
  short		tTttymon[100];
+ extern  int	Equel;
+ extern  jmp_buf	CmReset;
+ extern  jmp_buf	GoJmpBuf;
+ extern  char	SysIdent[];
  
  struct fn_def	TtyMonFn =
  {
***************
*** 68,73 ****
--- 76,84 ----
  	0
  };
  
+ struct sgttyb gttydummy;      /*  K.Okamoto  */
+ 
+ void
  tm_init(argc, argv)
  int	argc;
  char	*argv[];
***************
*** 74,86 ****
  {
  	register int	ndx;
  	register char	*p;
- 	extern		quit();
- 	extern int	(*ExitFn)();
- 	extern int	Equel;
  	char		buff[100];
- 	extern char	*getufield();
- 	extern jmp_buf	CmReset;
- 	extern char	SysIdent[];
  
  
  	/* insure that permissions are ok */
--- 85,91 ----
***************
*** 92,99 ****
  	setjmp(CmReset);
  	signal(SIGPIPE, quit);
  
! 	ExitFn = quit;
! 	set_si_buf();
  
  	/* process arguments */
  	if (!setflag(argv, 'd', 1))
--- 97,104 ----
  	setjmp(CmReset);
  	signal(SIGPIPE, quit);
  
! 	ExitFn = quit;       /*  this points the exit function as quit() in this file  */
! 	set_si_buf();        /*  set stdin buffered  */
  
  	/* process arguments */
  	if (!setflag(argv, 'd', 1))
***************
*** 112,118 ****
  		time(buff);
  		printf("%s login\n%s", SysIdent, ctime(buff));
  	}
! 	if (Nodayfile == 0 && (Qryiop = fopen(ztack(ztack(Pathname, "/files/dayfile"), VERSION), "r")) != NULL)
  	{
  		while ((ndx = getc(Qryiop)) > 0)
  			putchar(ndx);
--- 117,123 ----
  		time(buff);
  		printf("%s login\n%s", SysIdent, ctime(buff));
  	}
! 	if (Nodayfile == 0 && (Qryiop = fopen((char *)ztack(ztack(Pathname, "/files/dayfile"), VERSION), "r")) != NULL)
  	{
  		while ((ndx = getc(Qryiop)) > 0)
  			putchar(ndx);
***************
*** 149,155 ****
  	/*
  	**  Get user input from terminal
  	**
! 	**	THIS CODE IS A CLUDGE!!!
  	**
  	**	This code should return right after the setbuf call,
  	**	but it doesn't because we want the monitor to be in
--- 154,160 ----
  	/*
  	**  Get user input from terminal
  	**
! 	**	THIS CODE IS A KLUDGE!!!
  	**
  	**	This code should return right after the setbuf call,
  	**	but it doesn't because we want the monitor to be in
***************
*** 159,165 ****
  	*/
  
  	Input = stdin;
! 	setbuf(stdin, NULL);
  	monitor(FALSE);
  	quit();
  }
--- 164,170 ----
  	*/
  
  	Input = stdin;
! 	setbuf(stdin, NULL);   /* set stdin non-buffered */
  	monitor(FALSE);
  	quit();
  }
***************
*** 171,176 ****
--- 176,182 ----
  **	Uses trace flag 10
  */
  
+ void
  tm_intr(typ)
  int	typ;
  {
***************
*** 182,188 ****
  	if (Xwaitpid == 0)
  		printf("\nInterrupt\n");
  
! 	lseek(stdin->_file, 0L, 2);
  	Newline = Prompt = TRUE;
  	Nodayfile = Userdflag;
  	Oneline = FALSE;
--- 188,194 ----
  	if (Xwaitpid == 0)
  		printf("\nInterrupt\n");
  
! 	lseek(stdin->_file, 0L, SEEK_END);
  	Newline = Prompt = TRUE;
  	Nodayfile = Userdflag;
  	Oneline = FALSE;
***************
*** 209,214 ****
--- 215,221 ----
  **		30
  */
  
+ int
  proc_err(ppb, pc, pv)
  pb_t	*ppb;
  int	pc;
***************
*** 221,229 ****
  	int		err;
  	FILE		*iop;
  	char		*errfilen();
- 	extern char	*mcall();
  	bool		fatal;
- 	extern jmp_buf	GoJmpBuf;
  
  	if (pc <= 0 || pv[0].pv_type != PV_INT)
  		syserr("proc_err: pc %d pv0type %d", pc, pv[0].pv_type);
--- 228,234 ----
***************
*** 275,281 ****
  			}
  			*p++ = c;
  		}
! 		*p = 0;
  		i = atoi(buf);
  
  		if (i != err)
--- 280,286 ----
  			}
  			*p++ = c;
  		}
! 		*p = '\0';
  		i = atoi(buf);
  
  		if (i != err)
diff -r -c ../ingres.ptf/source/ovqp/Makefile source/ovqp/Makefile
*** ../ingres.ptf/source/ovqp/Makefile	Mon Nov 16 14:38:54 1992
--- source/ovqp/Makefile	Wed Sep 23 16:10:18 1992
***************
*** 10,17 ****
  
  CFLAGS=	-O -I$H
  LINTFLAGS= -huc -I$H
! AR=	-ar
! ARFLAGS=rvu
  RANLIB=	ranlib
  LDFLAGS=
  CP=	cp
--- 10,17 ----
  
  CFLAGS=	-O -I$H
  LINTFLAGS= -huc -I$H
! AR=	ar
! ARFLAGS=-rvu
  RANLIB=	ranlib
  LDFLAGS=
  CP=	cp
diff -r -c ../ingres.ptf/source/ovqp/findsimps.c source/ovqp/findsimps.c
*** ../ingres.ptf/source/ovqp/findsimps.c	Mon Nov 16 14:38:54 1992
--- source/ovqp/findsimps.c	Thu Jun  4 13:47:28 1992
***************
*** 277,284 ****
  */
  
  struct symbol 
! *cpsym(const, len, op)
! struct symbol	*const;
  int		len;
  int		op;
  {
--- 277,284 ----
  */
  
  struct symbol 
! *cpsym(constv, len, op)
! struct symbol	*constv;
  int		len;
  int		op;
  {
***************
*** 294,300 ****
  		need(De.ov_ovqpbuf, op == opLTLE ? i + SYMOFF+1 : i + SYMOFF);
  	s->type = CHAR;
  	sp = s->value.sym_data.c0type;
! 	cp = const->value.sym_data.c0type;
  
  	while (i--)
  	{
--- 294,300 ----
  		need(De.ov_ovqpbuf, op == opLTLE ? i + SYMOFF+1 : i + SYMOFF);
  	s->type = CHAR;
  	sp = s->value.sym_data.c0type;
! 	cp = constv->value.sym_data.c0type;
  
  	while (i--)
  	{
***************
*** 349,356 ****
  **	TRUE else return FALSE
  */
  
! add_simp(const, rel, attno)
! struct symbol	*const;
  int		rel;
  int		attno;
  {
--- 349,356 ----
  **	TRUE else return FALSE
  */
  
! add_simp(constv, rel, attno)
! struct symbol	*constv;
  int		rel;
  int		attno;
  {
***************
*** 362,368 ****
  	s = &De.ov_simp[De.ov_nsimp++];
  
  	s->att = attno;
! 	s->const = const;
  	s->relop = rel;
  
  #	ifdef xOTR1
--- 362,368 ----
  	s = &De.ov_simp[De.ov_nsimp++];
  
  	s->att = attno;
! 	s->constv = constv;
  	s->relop = rel;
  
  #	ifdef xOTR1
***************
*** 382,387 ****
  
  	s = ss;
  	printf("simp:relop=%d,att=%d,val=", s->relop, s->att);
! 	prsym(s->const);
  #	endif
  }
--- 382,387 ----
  
  	s = ss;
  	printf("simp:relop=%d,att=%d,val=", s->relop, s->att);
! 	prsym(s->constv);
  #	endif
  }
diff -r -c ../ingres.ptf/source/ovqp/key.c source/ovqp/key.c
*** ../ingres.ptf/source/ovqp/key.c	Mon Nov 16 14:38:55 1992
--- source/ovqp/key.c	Thu Jun  4 13:48:15 1992
***************
*** 52,58 ****
  			{
  				if (s->relop == opEQ && s->att == d)
  				{
! 					k->keysym = s->const;
  					k->dnumber = (a->sec_index == TRUE) ? i+1 : d;
  					k++;
  #					ifdef xOTR1
--- 52,58 ----
  			{
  				if (s->relop == opEQ && s->att == d)
  				{
! 					k->keysym = s->constv;
  					k->dnumber = (a->sec_index == TRUE) ? i+1 : d;
  					k++;
  #					ifdef xOTR1
***************
*** 59,65 ****
  					if (tTf(85, 1))
  					{
  						printf("exact key on dom %d\tvalue=", d);
! 						prsym(s->const);
  					}
  #					endif
  					break;
--- 59,65 ----
  					if (tTf(85, 1))
  					{
  						printf("exact key on dom %d\tvalue=", d);
! 						prsym(s->constv);
  					}
  #					endif
  					break;
***************
*** 123,129 ****
  			{
  				if (s->relop == opEQ || s->relop == opGTGE)
  				{
! 					l->keysym = s->const;
  					l->dnumber = s->att;
  					if (s->relop == opEQ)
  					{
--- 123,129 ----
  			{
  				if (s->relop == opEQ || s->relop == opGTGE)
  				{
! 					l->keysym = s->constv;
  					l->dnumber = s->att;
  					if (s->relop == opEQ)
  					{
***************
*** 139,145 ****
  				}
  				if (s->relop == opLTLE)
  				{
! 					h->keysym = s->const;
  					h->dnumber = s->att;
  					h++;
  					if (i == -1)
--- 139,145 ----
  				}
  				if (s->relop == opLTLE)
  				{
! 					h->keysym = s->constv;
  					h->dnumber = s->att;
  					h++;
  					if (i == -1)
***************
*** 234,240 ****
  						if (tTf(85, 6))
  							printf("low key on dom %d\t", d);
  #						endif
! 						low->keysym = s->const;
  						low->dnumber = sec_indx ? i+1 : d;
  						low++;
  					}
--- 234,240 ----
  						if (tTf(85, 6))
  							printf("low key on dom %d\t", d);
  #						endif
! 						low->keysym = s->constv;
  						low->dnumber = sec_indx ? i+1 : d;
  						low++;
  					}
***************
*** 245,257 ****
  						if  (tTf(85, 6))
  							printf("high key on dom %d\t", d);
  #						endif
! 						high->keysym = s->const;
  						high->dnumber = sec_indx ? i+1 : d;
  						high++;
  					}
  #					ifdef xOTR1
  					if (tTf(85, 6))
! 						prsym(s->const);
  #					endif
  					if (i == 0)
  						success = TRUE;
--- 245,257 ----
  						if  (tTf(85, 6))
  							printf("high key on dom %d\t", d);
  #						endif
! 						high->keysym = s->constv;
  						high->dnumber = sec_indx ? i+1 : d;
  						high++;
  					}
  #					ifdef xOTR1
  					if (tTf(85, 6))
! 						prsym(s->constv);
  #					endif
  					if (i == 0)
  						success = TRUE;
diff -r -c ../ingres.ptf/source/ovqp/startovqp.c source/ovqp/startovqp.c
*** ../ingres.ptf/source/ovqp/startovqp.c	Mon Nov 16 14:38:54 1992
--- source/ovqp/startovqp.c	Thu Sep 10 18:54:49 1992
***************
*** 20,26 ****
  
  startovqp()
  {
! 	extern	flptexcep();
  
  	if (Equel)
  		startequel();
--- 20,26 ----
  
  startovqp()
  {
!         extern	void   flptexcep();
  
  	if (Equel)
  		startequel();
***************
*** 28,39 ****
  	De.ov_tupsfound = 0;	/* counts the number of tuples which sat the qual */
  	De.ov_retrieve = De.ov_bopen = FALSE;
  	/* catch floating point signals */
! 	signal(SIGFPE, (int) flptexcep);
  }
  
  /*
  **	Give a user error for a floating point exceptions
  */
  flptexcep()
  {
  	ov_err(FLOATEXCEP);
--- 28,40 ----
  	De.ov_tupsfound = 0;	/* counts the number of tuples which sat the qual */
  	De.ov_retrieve = De.ov_bopen = FALSE;
  	/* catch floating point signals */
! 	signal(SIGFPE,  flptexcep);
  }
  
  /*
  **	Give a user error for a floating point exceptions
  */
+ void
  flptexcep()
  {
  	ov_err(FLOATEXCEP);
***************
*** 41,46 ****
--- 42,48 ----
  
  /* Someone here in Berkeley thinks this is a good idea. */
  /* See 4.3 man 3m intro */
+ /*      temporaly deleted by K.Okamoto because of gcc 1.39's double
  double
  infnan(arg)
  register arg;
***************
*** 60,62 ****
--- 62,66 ----
  		return(0.0);
  	}
  }
+ -----------------temporaly deleted-------
+ */
\ No newline at end of file
diff -r -c ../ingres.ptf/source/parser/Makefile source/parser/Makefile
*** ../ingres.ptf/source/parser/Makefile	Mon Nov 16 14:38:56 1992
--- source/parser/Makefile	Mon Oct 19 19:20:06 1992
***************
*** 31,37 ****
  LIBS=	$(IUTIL) $(GUTIL)
  
  YFLAGS= 
! CFLAGS=	-O -I$H
  LINTFLAGS= -huc -I$H
  LDFLAGS=
  AR=	-ar
--- 31,37 ----
  LIBS=	$(IUTIL) $(GUTIL)
  
  YFLAGS= 
! CFLAGS=	-O -I$H  -DDISTRIB
  LINTFLAGS= -huc -I$H
  LDFLAGS=
  AR=	-ar
***************
*** 60,70 ****
  	$(CP) parlib $(LIB)/parser
  	$(RANLIB) $(LIB)/parser
  
  grammar.c: grammar.y
! 	grep -v "DDD" grammar.y > grammar.z
! 	$(YACC) $(YFLAGS) grammar.z
  	mv y.tab.c grammar.c
- 	rm -f grammar.z
  
  grammar.o: tables.y yyerror.y scanner.h parser.h
  
--- 60,76 ----
  	$(CP) parlib $(LIB)/parser
  	$(RANLIB) $(LIB)/parser
  
+ #for non-distributed database
+ #grammar.c: grammar.y
+ #	grep -v "DDD" grammar.y > grammar.z
+ #	$(YACC) $(YFLAGS) grammar.z
+ #	mv y.tab.c grammar.c
+ #	rm -f grammar.z
+ 
+ #for distributed database
  grammar.c: grammar.y
! 	$(YACC) $(YFLAGS) grammar.y
  	mv y.tab.c grammar.c
  
  grammar.o: tables.y yyerror.y scanner.h parser.h
  
diff -r -c ../ingres.ptf/source/parser/att_fcn.c source/parser/att_fcn.c
*** ../ingres.ptf/source/parser/att_fcn.c	Mon Nov 16 14:38:56 1992
--- source/parser/att_fcn.c	Thu Sep 17 19:24:07 1992
***************
*** 18,24 ****
  	0,	INT,	4,	"tid",	0
  };
  #ifdef	DISTRIB
! struct atstash	Fakesid
  {
  	0,	INT,	4,	"sid",	0
  };
--- 18,24 ----
  	0,	INT,	4,	"tid",	0
  };
  #ifdef	DISTRIB
! struct atstash	Fakesid =
  {
  	0,	INT,	4,	"sid",	0
  };
diff -r -c ../ingres.ptf/source/parser/control.c source/parser/control.c
*** ../ingres.ptf/source/parser/control.c	Mon Nov 16 14:38:57 1992
--- source/parser/control.c	Tue Sep 15 18:38:08 1992
***************
*** 333,339 ****
  startgo()
  {
  	extern int	Err_fnd;
! 	extern int	Ing_err;
  	extern int	yyline;
  
  #	ifdef	xPTR3
--- 333,339 ----
  startgo()
  {
  	extern int	Err_fnd;
! 	extern int	Ingerr;
  	extern int	yyline;
  
  #	ifdef	xPTR3
***************
*** 368,373 ****
--- 368,375 ----
  
  endgo()
  {
+ 	extern int	Equel;
+ 	extern int	Err_fnd;
  #	ifdef	xPTR3
  	tTfp(48, 12, "endgo\n");
  #	endif
diff -r -c ../ingres.ptf/source/parser/grammar.y source/parser/grammar.y
*** ../ingres.ptf/source/parser/grammar.y	Mon Nov 16 14:38:59 1992
--- source/parser/grammar.y	Mon Sep 14 18:30:58 1992
***************
*** 27,33 ****
  SCCSID(@(#)grammar.y	8.6	5/30/88)
  
  # ifdef		xPTR1
! # define	YYDEBUG
  # endif
  
  int				i;
--- 27,33 ----
  SCCSID(@(#)grammar.y	8.6	5/30/88)
  
  # ifdef		xPTR1
! # define	YYDEBUG	1
  # endif
  
  int				i;
***************
*** 50,55 ****
--- 50,56 ----
  extern struct atstash 		Faketid;
  extern char			*Tuple;
  extern TID			tid;
+ extern int                      Err_current;
  
  # ifdef	DISTRIB
  extern struct atstash		Fakesid;
Only in source/parser: grammar.z
diff -r -c ../ingres.ptf/source/parser/par_init.c source/parser/par_init.c
*** ../ingres.ptf/source/parser/par_init.c	Mon Nov 16 14:38:57 1992
--- source/parser/par_init.c	Tue Sep 15 12:15:42 1992
***************
*** 13,18 ****
--- 13,19 ----
  **		par_init ~~ 60.0
  */
  
+ void
  par_init(argc, argv1)
  int	argc;
  char	*argv1[];
diff -r -c ../ingres.ptf/source/parser/parser.c source/parser/parser.c
*** ../ingres.ptf/source/parser/parser.c	Mon Nov 16 14:38:57 1992
--- source/parser/parser.c	Tue Sep 15 12:15:43 1992
***************
*** 13,19 ****
  short			tTparser[100];
  
  extern int		parser();
! extern int		par_init();
  
  struct fn_def		ParserFn =
  			{
--- 13,19 ----
  short			tTparser[100];
  
  extern int		parser();
! extern void		par_init();
  
  struct fn_def		ParserFn =
  			{
diff -r -c ../ingres.ptf/source/parser/tree.c source/parser/tree.c
*** ../ingres.ptf/source/parser/tree.c	Mon Nov 16 14:38:58 1992
--- source/parser/tree.c	Thu Sep 10 19:37:29 1992
***************
*** 754,759 ****
--- 754,760 ----
  */
  predef_delims()
  {
+ 	extern DELIMLIST	*Delimhead;
  	DELIMLIST	*d;
  	DMAP		*m, *m2;
  	int		i;
diff -r -c ../ingres.ptf/source/qrymod/d_integ.c source/qrymod/d_integ.c
*** ../ingres.ptf/source/qrymod/d_integ.c	Mon Nov 16 14:39:03 1992
--- source/qrymod/d_integ.c	Tue Jun  9 14:14:09 1992
***************
*** 35,41 ****
  extern DESC	Intdes;
  extern DESC	Reldes;
  
! extern		d_integ(), null_fn();
  extern short	tTqm[80];
  
  struct fn_def	DefIntFn =
--- 35,42 ----
  extern DESC	Intdes;
  extern DESC	Reldes;
  
! extern	void	 null_fn();
! extern          d_integ();
  extern short	tTqm[80];
  
  struct fn_def	DefIntFn =
diff -r -c ../ingres.ptf/source/qrymod/d_prot.c source/qrymod/d_prot.c
*** ../ingres.ptf/source/qrymod/d_prot.c	Mon Nov 16 14:39:04 1992
--- source/qrymod/d_prot.c	Tue Sep 15 12:15:41 1992
***************
*** 73,79 ****
  extern DESC		Prodes;
  extern DESC		Reldes;
  
! extern		d_prot(), null_fn();
  extern short	tTqm[80];
  
  struct fn_def	DefProFn =
--- 73,80 ----
  extern DESC		Prodes;
  extern DESC		Reldes;
  
! extern	void	null_fn();
! extern          d_prot();
  extern short	tTqm[80];
  
  struct fn_def	DefProFn =
diff -r -c ../ingres.ptf/source/qrymod/d_view.c source/qrymod/d_view.c
*** ../ingres.ptf/source/qrymod/d_view.c	Mon Nov 16 14:39:03 1992
--- source/qrymod/d_view.c	Tue Jun  9 14:14:08 1992
***************
*** 42,48 ****
  
  extern DESC	Reldes;
  
! extern		d_view(), null_fn();
  extern short	tTqm[80];
  
  struct fn_def	DefViewFn =
--- 42,49 ----
  
  extern DESC	Reldes;
  
! extern	void	null_fn();
! extern          d_view();
  extern short	tTqm[80];
  
  struct fn_def	DefViewFn =
diff -r -c ../ingres.ptf/source/qrymod/qrymod.c source/qrymod/qrymod.c
*** ../ingres.ptf/source/qrymod/qrymod.c	Mon Nov 16 14:39:04 1992
--- source/qrymod/qrymod.c	Fri Sep 25 15:35:17 1992
***************
*** 33,39 ****
  
  # define TTYIDSIZE	8	/* length of tty id */
  
! extern	qrymod(), qm_init(), null_fn();
  short	tTqm[80];
  char	Terminal[TTYIDSIZE + 1];
  
--- 33,40 ----
  
  # define TTYIDSIZE	8	/* length of tty id */
  
! extern	qrymod();
! extern  void     qm_init(), null_fn();
  short	tTqm[80];
  char	Terminal[TTYIDSIZE + 1];
  
***************
*** 52,58 ****
  };
  
  
! 
  qm_init(argc, argv)
  int	argc;
  char	**argv;
--- 53,59 ----
  };
  
  
! void
  qm_init(argc, argv)
  int	argc;
  char	**argv;
***************
*** 103,109 ****
  **		none.
  */
  
! 
  qrymod(pc, pv)
  int	pc;
  PARM	*pv;
--- 104,110 ----
  **		none.
  */
  
! int
  qrymod(pc, pv)
  int	pc;
  PARM	*pv;
diff -r -c ../ingres.ptf/source/support/Makefile source/support/Makefile
*** ../ingres.ptf/source/support/Makefile	Mon Nov 16 14:39:00 1992
--- source/support/Makefile	Wed Oct 21 16:37:48 1992
***************
*** 8,14 ****
  H=	../h
  LIB=	$(INGRES)/lib
  BIN=	$(INGRES)/bin
! SYSBIN=	/usr/local
  
  ALL=	creatdb destroydb helpr printr purge \
  	restore usersetup ingres printadmin \
--- 8,14 ----
  H=	../h
  LIB=	$(INGRES)/lib
  BIN=	$(INGRES)/bin
! SYSBIN=	/usr/local/bin
  
  ALL=	creatdb destroydb helpr printr purge \
  	restore usersetup ingres printadmin \
***************
*** 16,22 ****
  SRCS=	creatdb.c destroydb.c error.c helpr.c ingres.y \
  	printr.c purge.c subs.c usersetup.c \
  	restore.c copydb.q prvect.c printadmin.c \
! 	demodb.sh initsocket.c ildr.c ingconv.q 
  HDRS=	ildr.h
  
  CTLMOD=	$(LIB)/ctlmod
--- 16,22 ----
  SRCS=	creatdb.c destroydb.c error.c helpr.c ingres.y \
  	printr.c purge.c subs.c usersetup.c \
  	restore.c copydb.q prvect.c printadmin.c \
! 	demodb.sh initsocket.c ildr.c ingconv.q
  HDRS=	ildr.h
  
  CTLMOD=	$(LIB)/ctlmod
***************
*** 25,34 ****
  DBULIB=	$(LIB)/dbulib
  LIBS1=	$(GUTIL)
  LIBS2=	$(IUTIL) $(GUTIL)
! LIBS4=	$(DBULIB) $(IUTIL) $(GUTIL) $(CTLMOD)
! LIBS4=  externs.o $(DBULIB) $(IUTIL) $(CTLMOD) $(GUTIL) $(IUTIL)
  
! CFLAGS=	-O -I$H -I../ctlmod
  EQUEL=	$(BIN)/equel
  LDFLAGS=
  CP=	cp
--- 25,33 ----
  DBULIB=	$(LIB)/dbulib
  LIBS1=	$(GUTIL)
  LIBS2=	$(IUTIL) $(GUTIL)
! LIBS3=  externs.o $(DBULIB) $(IUTIL) $(CTLMOD) $(GUTIL)
  
! CFLAGS=	-O -I$H -I../ctlmod #-DDEBUG
  EQUEL=	$(BIN)/equel
  LDFLAGS=
  CP=	cp
***************
*** 65,82 ****
  	$(CHMOD) $(SUMODE) ingconv
  	ls -l ingconv; size ingconv
  
! creatdb: creatdb.o error.o prvect.o $(LIBS4)
! 	$(CC) $(LDFLAGS) creatdb.o error.o prvect.o $(LIBS4) -lm -o creatdb
  	$(CHMOD) $(SUMODE) creatdb
  	ls -l creatdb; size creatdb
  
! destroydb: destroydb.o $(LIBS4)
! 	$(CC) $(LDFLAGS) destroydb.o $(LIBS4) -lm -o destroydb
  	$(CHMOD) $(SUMODE) destroydb
  	ls -l destroydb; size destroydb
  
! helpr:	helpr.o error.o prvect.o $(LIBS4) 
! 	$(CC) $(LDFLAGS) helpr.o error.o prvect.o $(LIBS4) -lm -o helpr
  	$(CHMOD) $(SUMODE) helpr
  	ls -l helpr; size helpr
  
--- 64,81 ----
  	$(CHMOD) $(SUMODE) ingconv
  	ls -l ingconv; size ingconv
  
! creatdb: creatdb.o error.o prvect.o $(LIBS3)
! 	$(CC) $(LDFLAGS) creatdb.o error.o prvect.o $(LIBS3) ../iutil/closecat.o -lm -o creatdb
  	$(CHMOD) $(SUMODE) creatdb
  	ls -l creatdb; size creatdb
  
! destroydb: destroydb.o $(LIBS3)
! 	$(CC) $(LDFLAGS) destroydb.o $(LIBS3) ../iutil/closecat.o -lm -o destroydb
  	$(CHMOD) $(SUMODE) destroydb
  	ls -l destroydb; size destroydb
  
! helpr:	helpr.o error.o prvect.o $(LIBS3)
! 	$(CC) $(LDFLAGS) helpr.o error.o prvect.o $(LIBS3) ../iutil/closecat.o -lm -o helpr
  	$(CHMOD) $(SUMODE) helpr
  	ls -l helpr; size helpr
  
***************
*** 94,100 ****
  	$(CC) $(CFLAGS) -I../ctlmod -c ingres.c
  
  ingreslock: ildr.o initsocket.o
! 	$(CC) $(CFLAGS) -o ingreslock ildr.o initsocket.o 
  	$(CHMOD) $(BINMODE) ingreslock
  	ls -l ingreslock ; size ingreslock
  
--- 93,99 ----
  	$(CC) $(CFLAGS) -I../ctlmod -c ingres.c
  
  ingreslock: ildr.o initsocket.o
! 	$(CC) $(CFLAGS) -o ingreslock ildr.o initsocket.o
  	$(CHMOD) $(BINMODE) ingreslock
  	ls -l ingreslock ; size ingreslock
  
***************
*** 103,120 ****
  	$(CHMOD) $(SUMODE) printadmin
  	ls -l printadmin; size printadmin
  
! printr: printr.o error.o prvect.o $(LIBS4)
! 	$(CC) $(LDFLAGS) printr.o error.o prvect.o $(LIBS4) -lm -o printr
  	$(CHMOD) $(SUMODE) printr
  	ls -l printr; size printr
  
! purge: purge.o subs.o error.o $(LIBS4)
! 	$(CC) $(LDFLAGS) purge.o subs.o error.o $(LIBS4) -lm  -o purge
  	$(CHMOD) $(SUMODE) purge
  	ls -l purge; size purge
  
! restore: restore.o subs.o error.o $(LIBS4)
! 	$(CC) $(LDFLAGS) restore.o subs.o error.o $(LIBS4) -lm -o restore
  	$(CHMOD) $(SUMODE) restore
  	ls -l restore; size restore
  
--- 102,119 ----
  	$(CHMOD) $(SUMODE) printadmin
  	ls -l printadmin; size printadmin
  
! printr: printr.o error.o prvect.o $(LIBS3)
! 	$(CC) $(LDFLAGS) printr.o error.o prvect.o $(LIBS3) ../iutil/closecat.o -lm -o printr
  	$(CHMOD) $(SUMODE) printr
  	ls -l printr; size printr
  
! purge: purge.o subs.o error.o $(LIBS3)
! 	$(CC) $(LDFLAGS) purge.o subs.o error.o $(LIBS3) -lm  -o purge
  	$(CHMOD) $(SUMODE) purge
  	ls -l purge; size purge
  
! restore: restore.o subs.o error.o $(LIBS3)
! 	$(CC) $(LDFLAGS) restore.o subs.o error.o $(LIBS3) -lm -o restore
  	$(CHMOD) $(SUMODE) restore
  	ls -l restore; size restore
  
diff -r -c ../ingres.ptf/source/support/copydb.q source/support/copydb.q
*** ../ingres.ptf/source/support/copydb.q	Mon Nov 16 14:39:01 1992
--- source/support/copydb.q	Wed Sep 30 14:35:19 1992
***************
*** 13,23 ****
  # define	INT	30
  # define	FLOAT	31
  # define	CHAR	32
! ##char	Usercode[100];
  char	**Wanted;
  int	Status;
  
! extern	int	(*ExitFn)();
  FILE	*Ifile, *Ofile;
  
  struct relation
--- 13,23 ----
  # define	INT	30
  # define	FLOAT	31
  # define	CHAR	32
! ##  char	Usercode[100];
  char	**Wanted;
  int	Status;
  
! extern	void	(*ExitFn)();
  FILE	*Ifile, *Ofile;
  
  struct relation
***************
*** 48,53 ****
--- 48,54 ----
  **	The function to call for an exit to occur, this
  **	is all for the benefit of syserr, so it doesn't core dump.
  */
+ void
  sysexit(value)
  int	value;
  {
***************
*** 100,108 ****
  		printf("Warning %s is not a full path name\n",path);
  
  
! 	if ((Ifile = fopen(ztack(path,"/copy.in"), "w")) == NULL)
  		syserr(0,"Cannot create %s!",ztack(path,"/copy.in"));
! 	if ((Ofile = fopen(ztack(path,"/copy.out"), "w")) == NULL)
  		syserr(0,"Cannot create %s!",ztack(path,"/copy.out"));
  
  
--- 101,109 ----
  		printf("Warning %s is not a full path name\n",path);
  
  
! 	if ((Ifile = fopen((char *)ztack(path,"/copy.in"), "w")) == NULL)
  		syserr(0,"Cannot create %s!",ztack(path,"/copy.in"));
! 	if ((Ofile = fopen((char *)ztack(path,"/copy.out"), "w")) == NULL)
  		syserr(0,"Cannot create %s!",ztack(path,"/copy.out"));
  
  
diff -r -c ../ingres.ptf/source/support/creatdb.c source/support/creatdb.c
*** ../ingres.ptf/source/support/creatdb.c	Mon Nov 16 14:39:00 1992
--- source/support/creatdb.c	Tue Sep 29 15:23:02 1992
***************
*** 1,4 ****
- 
  # include	<stdio.h>
  # include	<ingres.h>
  # include	<aux.h>
--- 1,3 ----
***************
*** 9,17 ****
--- 8,49 ----
  # include	<pv.h>
  # include	<sccs.h>
  # include	<sys/dir.h>
+ # include       <ctlmod.h>
  
  SCCSID(@(#)creatdb.c	8.7	10/7/86)
  
+ void rubproc();
+ int  readdbtemp();
+ int  getstat();
+ int  roctal();
+ int  getname();
+ int  makedb();
+ int  makeadmin();
+ int  makefile();
+ int  makereln();
+ int  check();
+ int  *flaglkup();
+ int  flagval();
+ int  changedb();
+ int  readadmin();
+ int  readdbtemp();
+ 
+ extern	char	*ztack();
+ extern  int     initucode();
+ extern  int     acc_init();
+ extern  int     getequal();
+ extern  int     bequal();
+ extern  int     sequal();
+ extern  int     closer();
+ extern  int     ingresname();
+ extern  int     create();
+ extern  int     opencatalog();
+ extern  int     clearkeys();
+ extern  int     setkey();
+ extern  int     checkadmin();
+ extern  int     replace();
+ 
+ 
  /*
  **  CREATDB -- create database (or modify database status)
  **
***************
*** 133,146 ****
  */
  
  
  
- 
  # define	MAXRELNS	20
  # define	MAXDBTEMP	2000
  
  /* relation & attribute reln descriptors used in access methods */
! extern DESC	Reldes;
! extern DESC	Attdes;
  
  extern int	Status;		/* user status, set by initucode */
  DESC		Btreesec;	/* desc for btree sec. structure */
--- 165,193 ----
  */
  
  
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+   jmp_buf		CmReset;	/* restart addr on interrupt */
+ 
+ # ifdef xMONITOR
+  struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
  
  # define	MAXRELNS	20
  # define	MAXDBTEMP	2000
  
  /* relation & attribute reln descriptors used in access methods */
! /*  extern DESC	Reldes;        */
! DESC Reldes;
! /*  extern DESC	Attdes;        */
! DESC Attdes;
! /*   extern struct admin	Admin;      */
! extern int		errno;
! extern char		*Parmvect[];
! extern char		*Flagvect[];
  
  extern int	Status;		/* user status, set by initucode */
  DESC		Btreesec;	/* desc for btree sec. structure */
***************
*** 148,153 ****
--- 195,201 ----
  int		Btree_fd;	/* btree file */
  int		Dbstat;		/* database status */
  int		Dbson, Dbsoff;	/* same: bits turned on, bits turned off */
+ 
  typedef struct reldes
  {
  	int	bitson;
***************
*** 154,159 ****
--- 202,208 ----
  	int	bitsoff;
  	PARM	parmv[PV_MAXPC];
  } RELDES;
+ 
  RELDES	Rellist[MAXRELNS];
  char		Delim;
  extern char	*Dbpath;
***************
*** 160,166 ****
  short		tTdbu[100];
  
  
- 
  main(argc, argv)
  int	argc;
  char	*argv[];
--- 209,214 ----
***************
*** 168,175 ****
  	register int		i;
  	int			admin;
  	char			adminbuf[100];
- 	extern struct admin	Admin;
- 	extern int		errno;
  	auto int		code;
  	struct relation		relk;
  	char			*database;
--- 216,221 ----
***************
*** 179,197 ****
  	int			faterr;
  	register int		*flagv;
  	char			*dbtmpfile;
- 	extern char		*Parmvect[];
- 	extern char		*Flagvect[];
  	int			exists;
! 	int			*flaglkup();
! 	char			*ztack();
! 	extern char		*rindex();
! # ifdef	rewinddir
  	DIR			*dir_ptr;		/* pointer to '.' */
  	struct	direct		*dir;			/* directory entry */
- # else	rewinddir
- 	struct	dir		direct;
- # endif	rewinddir
- 
  	argv[argc] = NULL;
  
  #	ifdef xSTR1
--- 225,234 ----
  	int			faterr;
  	register int		*flagv;
  	char			*dbtmpfile;
  	int			exists;
! 
  	DIR			*dir_ptr;		/* pointer to '.' */
  	struct	direct		*dir;			/* directory entry */
  	argv[argc] = NULL;
  
  #	ifdef xSTR1
***************
*** 211,216 ****
--- 248,255 ----
  	switch (i)
  	{
  	  case 0:
+ 	        break;
+ 
  	  case 5:
  		exists = 1;
  		break;
***************
*** 313,323 ****
  #		endif
  		if (chdir(Dbpath) < 0)
  			syserr("chdir %s", Dbpath);
- 
  		if (!flagval('e'))
  		{
- # ifdef	rewinddir
- 
  			/* make certain that it is empty */
  			if ( (dir_ptr = opendir(".")) == NULL )
  				syserr(0,"Can't open '.'");
--- 352,359 ----
***************
*** 327,345 ****
  					syserr(0, "%s is not empty", database);
  			}
  			closedir(dir_ptr);
- 
- # else	rewinddir
- 			/* make certain that it is empty */
- 			freopen(".", "r", stdin);
- 			/* Skip "." and ".." entries */
- 			fread(&direct, sizeof (struct dir), 1, stdin);
- 			fread(&direct, sizeof (struct dir), 1, stdin);
- 			while ( fread(&direct, sizeof (struct dir), 1, stdin) != EOF)
- 			{
- 				if ( direct.d_ino != 0)
- 					syserr(0, "%s is not empty", database);
- 			}
- # endif	rewinddir
  		}
  		else
  		{
--- 363,368 ----
***************
*** 364,370 ****
  		if (i == 0)
  		{
  			/* split off directory */
! 			*(p = rindex(Dbpath, '/')) = '\0';
  			chdir(Dbpath);
  			if (setuid(getuid()))
  				syserr("setuid");
--- 387,393 ----
  		if (i == 0)
  		{
  			/* split off directory */
! 			*(p = (char *)rindex(Dbpath, '/')) = '\0';
  			chdir(Dbpath);
  			if (setuid(getuid()))
  				syserr("setuid");
***************
*** 465,471 ****
  /*
  **  Rubout processing.
  */
! 
  rubproc()
  {
  	exit(-2);
--- 488,494 ----
  /*
  **  Rubout processing.
  */
! void
  rubproc()
  {
  	exit(-2);
***************
*** 526,532 ****
  **	Trace Flags:
  **		none
  */
! 
  readdbtemp()
  {
  	static char	buf[MAXDBTEMP];
--- 549,555 ----
  **	Trace Flags:
  **		none
  */
! int
  readdbtemp()
  {
  	static char	buf[MAXDBTEMP];
***************
*** 666,672 ****
  **	Trace Flags:
  **		none
  */
! 
  getstat(def, bitson, bitsoff)
  int	def;
  int	*bitson;
--- 689,695 ----
  **	Trace Flags:
  **		none
  */
! int
  getstat(def, bitson, bitsoff)
  int	def;
  int	*bitson;
***************
*** 787,793 ****
  **	Trace Flags:
  **		none
  */
! 
  roctal()
  {
  	register int	c;
--- 810,816 ----
  **	Trace Flags:
  **		none
  */
! int
  roctal()
  {
  	register int	c;
***************
*** 839,845 ****
  **	Trace Flags:
  **		none
  */
! 
  getname(ptr)
  char	*ptr;
  {
--- 862,868 ----
  **	Trace Flags:
  **		none
  */
! int
  getname(ptr)
  char	*ptr;
  {
***************
*** 912,918 ****
  **	Trace Flags:
  **		20
  */
! 
  makedb()
  {
  	DESC		d;
--- 935,941 ----
  **	Trace Flags:
  **		20
  */
! int
  makedb()
  {
  	DESC		d;
***************
*** 975,983 ****
  **	Trace Flags:
  **		10
  */
! 
! 
! 
  makeadmin(d, pv)
  DESC	*d;
  PARM	pv[];
--- 998,1004 ----
  **	Trace Flags:
  **		10
  */
! int
  makeadmin(d, pv)
  DESC	*d;
  PARM	pv[];
***************
*** 1053,1060 ****
  **
  **	Trace Flags:
  **		12
! */
! 
  makefile(r)
  register RELDES	*r;
  {
--- 1074,1081 ----
  **
  **	Trace Flags:
  **		12
! v*/
! int
  makefile(r)
  register RELDES	*r;
  {
***************
*** 1098,1104 ****
  **	Trace Flags:
  **		1
  */
! 
  makereln(r)
  register RELDES	*r;
  {
--- 1119,1125 ----
  **	Trace Flags:
  **		1
  */
! int
  makereln(r)
  register RELDES	*r;
  {
***************
*** 1138,1144 ****
  **	Trace Flags:
  **		none
  */
! 
  check(p)
  char	*p;
  {
--- 1159,1165 ----
  **	Trace Flags:
  **		none
  */
! int
  check(p)
  char	*p;
  {
***************
*** 1278,1284 ****
  **	Trace Flags:
  **		none
  */
! 
  flagval(f)
  register char	f;
  {
--- 1299,1305 ----
  **	Trace Flags:
  **		none
  */
! int
  flagval(f)
  register char	f;
  {
***************
*** 1367,1373 ****
  **	Trace Flags:
  **		40
  */
! 
  changedb()
  {
  	register RELDES	*r;
--- 1388,1394 ----
  **	Trace Flags:
  **		40
  */
! int
  changedb()
  {
  	register RELDES	*r;
***************
*** 1474,1480 ****
  **	Trace Flags:
  **		none
  */
! 
  readadmin()
  {
  	register int	i;
--- 1495,1501 ----
  **	Trace Flags:
  **		none
  */
! int
  readadmin()
  {
  	register int	i;
Only in source/support: demo
diff -r -c ../ingres.ptf/source/support/destroydb.c source/support/destroydb.c
*** ../ingres.ptf/source/support/destroydb.c	Mon Nov 16 14:39:00 1992
--- source/support/destroydb.c	Tue Sep 29 15:04:54 1992
***************
*** 4,9 ****
--- 4,10 ----
  # include	<ingres.h>
  # include	<aux.h>
  # include	<access.h>
+ # include       <ctlmod.h>
  # include	<sccs.h>
  
  SCCSID(@(#)destroydb.c	8.3	1/31/86)
***************
*** 22,27 ****
--- 23,41 ----
  **	This is useful if the directory is a mounted file system.
  */
  
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+ 
+ jmp_buf		CmReset;	/* restart addr on interrupt */
+ 
+ # ifdef xMONITOR
+ struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
+ 
+ 
  extern char	*Usercode;
  extern int	Status;
  extern char	*Pathname;
***************
*** 41,51 ****
  	char		**av;
  	register char	*p;
  	char		*q;
- # ifdef	rewinddir
  	DIR		*dirp;
- # else	rewinddir
- 	FILE		*iop;
- # endif	rewinddir
  
  	argv[argc] = NULL;
  #	ifdef xSTR1
--- 55,61 ----
***************
*** 141,158 ****
  	if (chdir(Dbpath) < 0)
  		syserr("chdir %s", Dbpath);
  
- # ifdef	rewinddir
  	if ( (dirp = opendir(".")) == NULL )
  		syserr("Can't open . in %s",Dbpath);
  	clean(dirp);
  	closedir(dirp);
- # else	rewinddir
- 	iop = fopen(".", "r");
- 	if (iop == NULL)
- 		syserr("Cannot open dot in %s", Dbpath);
- 	clean(iop);
- 	fclose(iop);
- # endif	rewinddir
  
  	if (!mounted)
  	{
--- 151,160 ----
***************
*** 172,179 ****
  }
  
  
! 
! # ifdef	rewinddir
  clean(dirp)
  register DIR	*dirp;
  {
--- 174,180 ----
  }
  
  
! int
  clean(dirp)
  register DIR	*dirp;
  {
***************
*** 196,247 ****
  	}
  }/* clean */
  		
- # else	rewinddir
- 
- clean(f)
- register FILE	*f;
- {
- 	struct direc
- 	{
- 		struct direct	d;
- 		char		null;
- 	};
- 	struct direc	cur;
- 
- #	ifdef xSTR1
- 	if (tTf(2, 0))
- 		printf("clean: ");
- #	endif
  
- 	cur.null = 0;
- 
- 	/* skip "." and ".." entries */
- 	fread(&cur, sizeof cur.d, 1, f);
- 	fread(&cur, sizeof cur.d, 1, f);
- 
- 	/* scan directory */
- 	while (fread(&cur, sizeof cur.d, 1, f) > 0)
- 	{
- 		/* skip null entries */
- 		if (cur.d.d_ino == 0)
- 			continue;
- 
- #		ifdef xSTR1
- 		if (tTf(2, 1))
- 			printf("unlinking %s\n", cur.d.d_name);
- #		endif
- 		unlink(cur.d.d_name);
- 	}
- }
- # endif	rewinddir
- 
- 
- 
  /*
  **  Rubout processing.
  */
  
  rubproc()
  {
  	exit(-2);
  }
--- 197,210 ----
  	}
  }/* clean */
  		
  
  /*
  **  Rubout processing.
  */
  
+ void
  rubproc()
  {
  	exit(-2);
  }
+ 
diff -r -c ../ingres.ptf/source/support/externs.c source/support/externs.c
*** ../ingres.ptf/source/support/externs.c	Mon Nov 16 14:39:00 1992
--- source/support/externs.c	Fri Jun  5 10:59:45 1992
***************
*** 9,14 ****
--- 9,15 ----
  	return ((map[n/BITS] & (1<<(n%BITS))) != 0);
  }
  char	Qbuf[1000];
+ int     QbufSize = sizeof Qbuf;
  
  extern struct fn_def	CopyFn;
  extern struct fn_def	CreateFn;
diff -r -c ../ingres.ptf/source/support/helpr.c source/support/helpr.c
*** ../ingres.ptf/source/support/helpr.c	Mon Nov 16 14:39:01 1992
--- source/support/helpr.c	Tue Sep 29 15:05:14 1992
***************
*** 4,14 ****
--- 4,27 ----
  # include	<access.h>
  # include	<lock.h>
  # include	<pv.h>
+ # include       <ctlmod.h>
  # include	<sccs.h>
  
  SCCSID(@(#)helpr.c	8.2	2/8/85)
  
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+ jmp_buf		CmReset;	/* restart addr on interrupt */
+ 
+ # ifdef xMONITOR
+ struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
  
+ 
+ 
  extern int	Status;
  short		tTdbu[100];
  DESC		Btreesec;
***************
*** 198,205 ****
  		return (NULL);
  }
  
! 
  rubproc()
  {
  	exit(1);
  }
--- 211,219 ----
  		return (NULL);
  }
  
! void
  rubproc()
  {
  	exit(1);
  }
+ 
diff -r -c ../ingres.ptf/source/support/ildr.c source/support/ildr.c
*** ../ingres.ptf/source/support/ildr.c	Mon Nov 16 14:39:01 1992
--- source/support/ildr.c	Fri Sep 25 18:39:55 1992
***************
*** 29,34 ****
--- 29,51 ----
  
  SCCSID(@(#)ildr.c	8.2	6/12/88)
  
+ extern  int     init_sokeet();
+ int             new_proc();
+ int             ilwrite();
+ int             ilrma();
+ int             set_lock();
+ int             send_info();
+ int             wait_on();
+ int             wakeup();
+ int             close_up();
+ void            abnormal();
+ static  int     ilunique();
+ static  int     ilfind();
+ static  int     ilrm();
+ static  int     ilenter();
+ static  int     ilcomp();
+ static  int     ilclose();
+ 
  int	From_server;		/* read connection from socket server */
  long	Read_fmt;		/* bit mask for select */
  char	*Prog_name;		/* program name for abnormal errors */
***************
*** 45,53 ****
  {
  	long		read_fd,		/* bit mask of useable descriptors*/
  			num_des;		/* number of readable descriptors */
! 	int		abnormal();		/* error function */
  	register	int	i;		/* index */
! 
  
  	/*
  	** close all the files descriptors, so we can have more INGRES
--- 62,70 ----
  {
  	long		read_fd,		/* bit mask of useable descriptors*/
  			num_des;		/* number of readable descriptors */
! 	void		abnormal();		/* error function */
  	register	int	i;		/* index */
!         struct timeval        tv;               /* added by K.Okamoto  */
  
  	/*
  	** close all the files descriptors, so we can have more INGRES
***************
*** 67,75 ****
  	** is an error. We do a "warm start" in this condition
  	*/
  	for ( i = 0 ; i < NSIG ; i++ )
! 		signal(i,abnormal);
! 	signal(SIGPIPE,SIG_IGN);	/* ignore this one, in case a process simply dies in mid stride */
! 	Prog_name = *av;
  	/*
  	** if ac == 2, then we are restarted from the the lock driver
  	** itself, and we don't have to reattach ourselves to the magic
--- 84,92 ----
  	** is an error. We do a "warm start" in this condition
  	*/
  	for ( i = 0 ; i < NSIG ; i++ )
! 		signal(i, abnormal);
!        	signal(SIGPIPE,SIG_IGN);	/* ignore this one, in case a process simply dies in mid stride */
!         Prog_name = *av;
  	/*
  	** if ac == 2, then we are restarted from the the lock driver
  	** itself, and we don't have to reattach ourselves to the magic
***************
*** 83,88 ****
--- 100,107 ----
  		From_server = init_socket();
  	}
  	Read_fmt = (1<<From_server);
+         tv.tv_sec = 0;
+         tv.tv_usec = 0; 
  
  	/*
  	** infinite loop waiting for something to happen
***************
*** 94,100 ****
--- 113,125 ----
  		/*
  		** wake up whenever something happens
  		*/
+ 
+ 		num_des = select(NOFILE,&read_fd,0,0,0);
+ 
  		while ( (num_des = select(NOFILE,&read_fd,0,0,0)) == 0 )
+ /*
+ 		while ( (num_des = select(NOFILE,&read_fd,NULL,NULL,&tv)) == 0 )
+ */
  		{
  # ifdef	DEBUG
  		printf("select returns 0 (%o)\n",read_fd);
***************
*** 104,109 ****
--- 129,136 ----
  # ifdef	DEBUG
  		printf("select returns %d (%o)\n",num_des,read_fd);
  # endif	DEBUG
+ 
+ 
  		if ( num_des == -1 )
  		{
  # ifdef	DEBUG
***************
*** 113,119 ****
  			** a bit of defensive programming.
  			** If there is an EBADF (bad file descriptor) error 
  			** then we assume that a file descriptor has shut down,
! 			** with out tellng us. We go to a function to figure
  			** out what has died.
  			*/
  			if ( errno == EBADF )
--- 140,146 ----
  			** a bit of defensive programming.
  			** If there is an EBADF (bad file descriptor) error 
  			** then we assume that a file descriptor has shut down,
! 			** without tellng us. We go to a function to figure
  			** out what has died.
  			*/
  			if ( errno == EBADF )
***************
*** 140,145 ****
--- 167,173 ----
  ** new_proc
  ** start up a new connection to an Ingres process
  */
+ int
  new_proc()
  {
  	register	int	fd;
***************
*** 148,157 ****
  	auto		int	len;
  
  	len = sizeof (addr);
! 	if ( (fd = accept(From_server,&addr,&len)) != -1 )
  	{
  		Read_fmt |= (1<<fd);
! 		ioctl(fd,FIONBIO,&to_ioctl);
  	}
  # ifdef	DEBUG
  	else
--- 176,185 ----
  	auto		int	len;
  
  	len = sizeof (addr);
! 	if ( (fd = accept(From_server,(struct sockaddr *)&addr,&len)) != -1 )
  	{
  		Read_fmt |= (1<<fd);
! 		ioctl(fd,FIONBIO,&to_ioctl);   /* set sockets to nonblocking */
  	}
  # ifdef	DEBUG
  	else
***************
*** 164,170 ****
  }/* new_proc */
  
  
! 
  ilwrite(read_desc)
  register	int	read_desc;
  {
--- 192,198 ----
  }/* new_proc */
  
  
! int
  ilwrite(read_desc)
  register	int	read_desc;
  {
***************
*** 308,313 ****
--- 336,342 ----
  	}
  	send_info(read_desc,0);
  }
+ 
  /*
   *	ilunique- check for match on key
   *	
***************
*** 314,320 ****
   *	return index of Locktab if match found
   *	else return -1
   */
! static
  ilunique(ll)
  register struct Lockreq *ll;
  {
--- 343,350 ----
   *	return index of Locktab if match found
   *	else return -1
   */
! 
! static int
  ilunique(ll)
  register struct Lockreq *ll;
  {
***************
*** 345,351 ****
  	return(-1);
  }
  
! static
  ilfind(ll,key)
  register struct Lockreq *ll;
  int	key;
--- 375,381 ----
  	return(-1);
  }
  
! static int
  ilfind(ll,key)
  register struct Lockreq *ll;
  int	key;
***************
*** 370,376 ****
   *	remove the lth Lock
   *		if the correct user is requesting the move.
   */
! static
  ilrm(l,key,remove_all)
  int l;
  int	key;
--- 400,407 ----
   *	remove the lth Lock
   *		if the correct user is requesting the move.
   */
! 
! static int
  ilrm(l,key,remove_all)
  int l;
  int	key;
***************
*** 405,410 ****
--- 436,442 ----
   *	ilrma releases all locks for a given process id(pd)
   *	-- called from sys1.c$exit() code.
   */
+ int
  ilrma(key,remove_all)
  int key;
  int	remove_all;
***************
*** 423,429 ****
   *	return position in Locktable
   *	error return of -1
   */
! static
  ilenter(ll,key)
  register struct Lockreq *ll;
  int key;
--- 455,462 ----
   *	return position in Locktable
   *	error return of -1
   */
! 
! static int
  ilenter(ll,key)
  register struct Lockreq *ll;
  int key;
***************
*** 465,471 ****
   *	  	returns 0 if strings match
   *		returns -1 otherwise
   */
! static
  ilcomp(s1,s2)
  register char *s1,*s2;
  {
--- 498,505 ----
   *	  	returns 0 if strings match
   *		returns -1 otherwise
   */
! 
! static int
  ilcomp(s1,s2)
  register char *s1,*s2;
  {
***************
*** 488,494 ****
  /*
   *	ilclose- releases all locks
   */
! static
  ilclose()
  {
  	register int	k;
--- 522,529 ----
  /*
   *	ilclose- releases all locks
   */
! 
! static int
  ilclose()
  {
  	register int	k;
***************
*** 514,519 ****
--- 549,556 ----
  ** attempt to set a lock. If we can't, block the process and
  ** return -1, if we can than set the lock and return 0.
  */
+ 
+ int
  set_lock(read_desc,lockbuf)
  register	int	read_desc;
  struct	Lockreq	lockbuf;
***************
*** 560,565 ****
--- 597,604 ----
  ** Send the data down the socket. Don't do it if it would cause the driver
  ** to block.
  */
+ 
+ int
  send_info(fd,data)
  register	int	fd;
  int	data;
***************
*** 571,577 ****
  	time.tv_sec = 10;
  	time.tv_usec = 0;
  
! 	if ( select(NOFILE,0,&wdes,0,&time) != 1 )
  	{
  		Read_fmt &= ~(1<<fd);
  		ilrma(fd,TRUE);
--- 610,616 ----
  	time.tv_sec = 10;
  	time.tv_usec = 0;
  
! 	if ( select(NOFILE,NULL,&wdes,NULL,&time) != 1 )
  	{
  		Read_fmt &= ~(1<<fd);
  		ilrma(fd,TRUE);
***************
*** 600,605 ****
--- 639,646 ----
  ** wait_on
  ** Set up to wait for a free lock.
  */
+ 
+ int
  wait_on(fd,lock,req)
  register	int	fd, lock;
  struct		Lockreq	req;
***************
*** 620,625 ****
--- 661,668 ----
  ** See if there is anythng waiting on the newly freed lock. If there is,
  ** tell it it can have the lock now.
  */
+ 
+ int
  wakeup(lock)
  register	int	lock;
  {
***************
*** 648,653 ****
--- 691,698 ----
  ** a signal has come down and hit us. We restart the entire
  ** program, and hope it goes away
  */
+ 
+ void
  abnormal(sig)
  int	sig;
  {
***************
*** 654,665 ****
  	extern	int	errno;
  
  # ifdef	DEBUG
! 	printf("DRIVER: error %d, restarting\n",sig);
  # endif
  
! 	execl("/etc/lock_driver","lock_driver","restart",0);
  	execl(Prog_name,Prog_name,"restart",0);
! 	execlp("lock_driver","lock_driver","restart",0);
  	exit(4);
  }/* abnormal */
  
--- 699,711 ----
  	extern	int	errno;
  
  # ifdef	DEBUG
! 	printf("DRIVER: error Signal No. = %d, restarting\n",sig);
  # endif
  
! /*	execl("/etc/lock_driver","lock_driver","restart",0);   */
! 	execl("/etc/ingreslock","lock_driver","restart",0);
  	execl(Prog_name,Prog_name,"restart",0);
! 	execlp("ingreslock","lock_driver","restart",0);
  	exit(4);
  }/* abnormal */
  
***************
*** 667,672 ****
--- 713,720 ----
  ** close_up
  ** try and find a closed up file descriptor.
  */
+ 
+ int
  close_up(fmt)
  long	fmt;
  {
diff -r -c ../ingres.ptf/source/support/ingres.y source/support/ingres.y
*** ../ingres.ptf/source/support/ingres.y	Mon Nov 16 14:39:01 1992
--- source/support/ingres.y	Tue Oct  6 14:48:27 1992
***************
*** 160,166 ****
  int		No_exec;		/* if set, don't execute */
  int		NumProcs;		/* number of processes this system */
  
- 
  /*
  **  Internal form of process descriptions.
  */
--- 160,165 ----
***************
*** 665,671 ****
  			doflag(str,-1);
  			sprintf(str2,"-W%d",Wait_action);
  			doflag(str2,-1);
! 			close(Alockdes);
  		}
  	}
  
--- 664,671 ----
  			doflag(str,-1);
  			sprintf(str2,"-W%d",Wait_action);
  			doflag(str2,-1);
! 			if(Alockdes >= 3)      /*  added by  K.Okamoto   */
! 				close(Alockdes);
  		}
  	}
  
***************
*** 678,688 ****
  /*
  **  Process rubouts (just exit)
  */
- 
  rubproc()
  {
  	exit(2);
  }
  /*
  **  DOFLAG -- process flag
  **
--- 678,688 ----
  /*
  **  Process rubouts (just exit)
  */
  rubproc()
  {
  	exit(2);
  }
+ 
  /*
  **  DOFLAG -- process flag
  **
***************
*** 1060,1066 ****
  int	callsysmod;
  {
  	register struct proc	*pr;
! 	register proc_t		*pp;
  	register int		i;
  	int			procno;
  	register int		pip;
--- 1060,1066 ----
  int	callsysmod;
  {
  	register struct proc	*pr;
! 	register proc_t  	*pp;
  	register int		i;
  	int			procno;
  	register int		pip;
***************
*** 1154,1159 ****
--- 1154,1160 ----
  char 	*flag;
  {
  	register char 	*p;
+ 	extern int  Status;
  
  	p = flag;
  
***************
*** 1270,1276 ****
  register int	fd;
  {
  	register struct proc	*pr;
! 	register proc_t		*pp;
  	register int		i;
  
  	for (pr = proc; pr < &ProcTab[CM_MAXPROC]; pr++)
--- 1271,1277 ----
  register int	fd;
  {
  	register struct proc	*pr;
! 	register proc_t 	*pp;
  	register int		i;
  
  	for (pr = proc; pr < &ProcTab[CM_MAXPROC]; pr++)
***************
*** 1345,1351 ****
  	char			**opt;
  	int			i;
  	register struct proc	*pr;
! 	register proc_t		*pp;
  	register char		*p;
  	int			outfd;
  	char			closeit[NOFILE];
--- 1346,1352 ----
  	char			**opt;
  	int			i;
  	register struct proc	*pr;
! 	register proc_t 	*pp;
  	register char		*p;
  	int			outfd;
  	char			closeit[NOFILE];
diff -r -c ../ingres.ptf/source/support/initsocket.c source/support/initsocket.c
*** ../ingres.ptf/source/support/initsocket.c	Mon Nov 16 14:39:01 1992
--- source/support/initsocket.c	Thu Sep 24 12:13:06 1992
***************
*** 10,24 ****
--- 10,31 ----
  
  SCCSID(@(#)initsocket.c	8.2	6/12/88)
  
+ int    init_socket();
+ 
  /*
  ** init_socket
  ** initilize the socket to the socket server
  */
+ int
  init_socket()
  {
  	register	int	from_socket;	/* file descriptor to attach to socket server */
  	int	to_ioctl = 1;			/* used in ioctl call */
  	struct	sockaddr_in	addr;		/* address where socket server is */
+ 
+ 
+ #define notdef
+ 
  #ifdef notdef
  	char	hostname[BUFSIZ];		/* hostname */
  #endif
***************
*** 27,33 ****
  	auto	int		len;
  	extern	int		errno;
  
! #ifndef	DEBUG
  	if ( (len = fork()) != 0 )
  	{
  # ifdef	DEBUG
--- 34,40 ----
  	auto	int		len;
  	extern	int		errno;
  
! #ifndef  DEBUG
  	if ( (len = fork()) != 0 )
  	{
  # ifdef	DEBUG
***************
*** 59,70 ****
  	if ( (myhost = gethostbyname(hostname)) == 0 )
  		exit(errno);
  	bzero((char *) &addr,sizeof (addr));
! 	bcopy(myhost->h_addr,(char *)&addr.sin_addr,myhost->h_length);
  #endif
  	addr.sin_family = AF_INET;
  	addr.sin_port = server ? server->s_port : htons(1524);
  	len = sizeof (addr);
! 	if ( bind(from_socket,&addr,len) == -1 )
  	{
  # ifdef	DEBUG
  		perror("INIT_S bind, assuming driver already running");
--- 66,79 ----
  	if ( (myhost = gethostbyname(hostname)) == 0 )
  		exit(errno);
  	bzero((char *) &addr,sizeof (addr));
! /*	bcopy(myhost->h_addr,(char *)&addr.sin_addr,myhost->h_length);    */
! 	bcopy(myhost->h_addr,(char *)&addr.sin_addr.s_addr,myhost->h_length);
! 
  #endif
  	addr.sin_family = AF_INET;
  	addr.sin_port = server ? server->s_port : htons(1524);
  	len = sizeof (addr);
! 	if ( bind(from_socket,(struct sockaddr_in *)&addr,len) == -1 )
  	{
  # ifdef	DEBUG
  		perror("INIT_S bind, assuming driver already running");
***************
*** 71,82 ****
  # endif	DEBUG
  		exit(0);
  	}
- 
  	if ( listen(from_socket,10) == -1 )
  	{
  		perror("Ingres lock, can't listen on port");
  		exit(errno);
  	}
! 	ioctl(from_socket,FIONBIO,&to_ioctl);
  	return ( from_socket );
  }/* init_socket */
--- 80,95 ----
  # endif	DEBUG
  		exit(0);
  	}
  	if ( listen(from_socket,10) == -1 )
  	{
  		perror("Ingres lock, can't listen on port");
  		exit(errno);
  	}
!         ioctl(from_socket,FIONBIO,&to_ioctl);   /* set socket to nonblocking */
  	return ( from_socket );
  }/* init_socket */
+ 
+ 
+ 
+ 
+ 
diff -r -c ../ingres.ptf/source/support/printadmin.c source/support/printadmin.c
*** ../ingres.ptf/source/support/printadmin.c	Mon Nov 16 14:39:00 1992
--- source/support/printadmin.c	Mon Sep 14 19:17:22 1992
***************
*** 81,88 ****
  	printdesc(&Admin.adattd);
  }
  
! 
  rubproc()
  {
  	exit(1);
  }
--- 81,89 ----
  	printdesc(&Admin.adattd);
  }
  
! void
  rubproc()
  {
  	exit(1);
  }
+ 
diff -r -c ../ingres.ptf/source/support/printr.c source/support/printr.c
*** ../ingres.ptf/source/support/printr.c	Mon Nov 16 14:39:01 1992
--- source/support/printr.c	Wed Oct  7 10:54:14 1992
***************
*** 4,14 ****
--- 4,33 ----
  # include	<access.h>
  # include	<lock.h>
  # include	<pv.h>
+ # include       <ctlmod.h>
  # include	<sccs.h>
  
  SCCSID(@(#)printr.c	8.2	2/8/85)
  
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+ char		*Proc_name;	/* the 'name' of the currently running proc */
+ char		*Fileset;	/* a unique string to make filenames from */
+ char		*Database;	/* the name of the current database */
+ char		*Usercode;	/* the code of the current user */
+ char		*Pathname;	/* the pathname of the root of INGRES */
+ int		Equel;		/* set if running an Equel program */
+ int		RubLevel;	/* rubout level, -1 if ignored */
+ jmp_buf		CmReset;	/* restart addr on interrupt */
+ extern struct out_arg	Out_arg;	/* output arguments */
+ # ifdef xMONITOR
+ struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
  
+ 
  extern int	Status;
  short		tTdbu[100];
  DESC		Btreesec;
***************
*** 18,24 ****
  int	argc;
  char 	*argv[];
  {
- 	extern struct out_arg	Out_arg;
  	register char		**av;
  	register char		*q;
  	register char		*p;
--- 37,42 ----
***************
*** 230,237 ****
  	exit(0);
  }
  
! 
! 
  rubproc()
  {
  	fflush(stdout);
--- 248,254 ----
  	exit(0);
  }
  
! void
  rubproc()
  {
  	fflush(stdout);
diff -r -c ../ingres.ptf/source/support/prvect.c source/support/prvect.c
*** ../ingres.ptf/source/support/prvect.c	Mon Nov 16 14:39:01 1992
--- source/support/prvect.c	Sat Sep 12 11:20:43 1992
***************
*** 71,77 ****
  	  case PV_TUPLE:
  		p = pv->pv_val.pv_tuple;
  		for (i = pv->pv_len; i > 0; i--)
! 			printf("\%o", *p++);
  		printf("\n");
  		break;
  
--- 71,78 ----
  	  case PV_TUPLE:
  		p = pv->pv_val.pv_tuple;
  		for (i = pv->pv_len; i > 0; i--)
! /*			printf("\%o", *p++);        modified by K.O.   */
! 			printf("%o", *p++);
  		printf("\n");
  		break;
  
diff -r -c ../ingres.ptf/source/support/purge.c source/support/purge.c
*** ../ingres.ptf/source/support/purge.c	Mon Nov 16 14:39:00 1992
--- source/support/purge.c	Wed Sep 30 14:44:27 1992
***************
*** 6,11 ****
--- 6,12 ----
  # include	<sccs.h>
  # include	<opsys.h>
  # include	<sys/dir.h>
+ # include       <ctlmod.h>
  
  SCCSID(@(#)purge.c	8.3	1/31/86)
  
***************
*** 44,49 ****
--- 45,60 ----
  **		folded in new directory rootines for 4.1c-bsd
  */
  
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+ jmp_buf		CmReset;	/* restart addr on interrupt */
+ 
+ # ifdef xMONITOR
+ struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
  
  char		All;
  char		Superuser;
***************
*** 50,61 ****
  char		Ask;
  char		Purge;
  char		Clean;
  extern int	Wait_action;
  extern int	Status;
  extern char	*Usercode;
! long		Today;
! short		tTdbu[100];
! extern int	(*ExitFn)();
  
  main(argc, argv)
  int	argc;
--- 61,75 ----
  char		Ask;
  char		Purge;
  char		Clean;
+ long		Today;
+ short		tTdbu[100];
  extern int	Wait_action;
  extern int	Status;
  extern char	*Usercode;
! extern void	(*ExitFn)();
! extern char	*getnxtdb();
! extern void	null_fn();
! 
  
  main(argc, argv)
  int	argc;
***************
*** 64,71 ****
  	register char	*db;
  	register int	i;
  	char		fake[256];
- 	extern char	*getnxtdb();
- 	extern int	null_fn();
  
  	argv[argc] = NULL;
  #	ifdef xTTR1
--- 78,83 ----
***************
*** 89,95 ****
  	printf("\npurge completed\n");
  }
  
! 
  rubproc()
  {
  	unldb();
--- 101,107 ----
  	printf("\npurge completed\n");
  }
  
! void
  rubproc()
  {
  	unldb();
***************
*** 96,103 ****
  	exit(-1);
  }
  
- 
- 
  /*
  **  PURGE DATABASE
  **
--- 108,113 ----
***************
*** 110,118 ****
  int		Btree_fd;
  char		*Fileset;
  
- #ifndef rewinddir
- typedef	DIR	FILE;
- #endif
  extern DIR *opendir();
  extern struct direct *readdir();
  
--- 120,125 ----
***************
*** 131,139 ****
  	PARM			pv[2];
  	char			pbuff[MAXNAME + 1];
  	char			*fname;
- #ifndef rewinddir
- 	char			fnambuf[DIRSIZ + 1];
- #endif
  
  #	ifdef	xTTR2
  	tTfp(11, 0, "entered purgedb(%s)\n", db);
--- 138,143 ----
***************
*** 225,243 ****
  
  	/* scan the directory */
  	for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- 
- #ifdef rewinddir
  		fname = dp->d_name;
  		if (dp->d_namlen <= 2)
  			continue;
- #else rewinddir
- 		strncpy(fnambuf, dp->d_name, DIRSIZ);
- 		fnambuf[DIRSIZ] = '\0';
- 		fname = fnambuf;
- 		if (!strcmp(fname, ".") || !strcmp(fname, ".."))
- 			continue;
- #endif rewinddir
- 
  		/* throw out legitimate files */
  		if (sequal(fname, "admin"))
  			continue;
--- 229,237 ----
diff -r -c ../ingres.ptf/source/support/restore.c source/support/restore.c
*** ../ingres.ptf/source/support/restore.c	Mon Nov 16 14:39:00 1992
--- source/support/restore.c	Tue Sep 29 15:06:12 1992
***************
*** 12,17 ****
--- 12,18 ----
  # include	<sccs.h>
  # include	<signal.h>
  # include	<setjmp.h>
+ # include       <ctlmod.h>
  
  SCCSID(@(#)restore.c	8.5	1/31/86)
  
***************
*** 22,27 ****
--- 23,42 ----
  **	database.  After finishing all the batch files it calls PURGE.
  */
  
+ 
+ struct _cm_t	Cm;		/* the system topography map */
+ struct _ctx_t	Ctx;		/* the current context */
+ int		Syncs[CM_MAXPROC];/* expected SYNC's from each proc */
+ 
+ /* General System Information */
+ jmp_buf		CmReset;	/* restart addr on interrupt */
+ 
+ # ifdef xMONITOR
+ struct monitor	CmMonBuf;	/* monitor buffer for CM overhead */
+ # endif xMONITOR
+ 
+ 
+ 
  # ifndef PURGE
  # ifdef xV7_UNIX
  # define	PURGE		"purge"
***************
*** 52,61 ****
  int		Btree_fd;
  jmp_buf		Jmpbuffer;	/* buffer for nonlocal goto's on an error condition */
  
- 
- #ifndef rewinddir
- typedef	DIR	FILE;
- #endif
  extern DIR *opendir();
  extern struct direct *readdir();
  
--- 67,72 ----
***************
*** 68,75 ****
  	register char	*dbname;
  	extern char	*Proc_name;
  	auto int	stat;
! 	extern		(*ExitFn)();
! 	extern          rubproc(), exit();
  	char		*nargv[20];
  	char		**avp;
  	char		**fvp;
--- 79,86 ----
  	register char	*dbname;
  	extern char	*Proc_name;
  	auto int	stat;
! 	extern	void	(*ExitFn)();
! 	extern  void    rubproc(), exit();
  	char		*nargv[20];
  	char		**avp;
  	char		**fvp;
***************
*** 209,221 ****
  	register struct	direct  *dp;
  	register int		i;
  	extern char		*Fileset;
! 	extern 			uperr(), (*ExitFn)();
! 	int			(*tmpfn)();
  	char			*lookucode();
  	char			*fname;
- # ifndef rewinddir
- 	char			fnambuf[DIRSIZ+1];
- # endif
  
  	if ( (dirp = opendir(".")) == NULL )
  		syserr("Can't open data base directory");
--- 220,229 ----
  	register struct	direct  *dp;
  	register int		i;
  	extern char		*Fileset;
! 	extern 	void		uperr(), (*ExitFn)();
! 	void			(*tmpfn)();
  	char			*lookucode();
  	char			*fname;
  
  	if ( (dirp = opendir(".")) == NULL )
  		syserr("Can't open data base directory");
***************
*** 228,240 ****
  	setjmp(Jmpbuffer);
  	for ( dp = readdir(dirp) ; dp != NULL ; dp = readdir(dirp) )
  	{
- # ifdef rewinddir
  		fname = dp->d_name;
- # else
- 		strncpy(fnambuf, dp->d_name, DIRSIZ);
- 		fnamebuf[DIRSIZ] = '\0';
- 		fname = fnamebuf;
- # endif
  		if ( !strcmp(".",fname) || !strcmp("..",fname) )
  			continue;
  		if (bequal("_SYSbatch", fname, 9))
--- 236,242 ----
***************
*** 275,280 ****
--- 277,283 ----
  /*
  ** handles syserr's in the update processor
  */
+ void
  uperr()
  {
  
***************
*** 289,294 ****
--- 292,298 ----
  /*
  ** Catch errors in other places
  */
+ void
  rubproc()
  {
  	register int		i;
diff -r -c ../ingres.ptf/source/support/subs.c source/support/subs.c
*** ../ingres.ptf/source/support/subs.c	Mon Nov 16 14:39:01 1992
--- source/support/subs.c	Thu Sep 17 18:18:48 1992
***************
*** 13,51 ****
  ** These are subroutines common to RESTORE and PURGE.
  */
  
- #ifndef rewinddir
- typedef	DIR	FILE;
- 
- DIR *
- opendir(d)
- char *d;
- {
- 	return(fopen(d, "r"));
- }
- 
- closedir(d);
- DIR *d;
- {
- 	return(fclose(d));
- }
- 
- struct direct *
- readdir(dirp)
- DIR *dirp;
- {
- 	static struct direct direc;
- 	struct direct *d = &direc;
- 	int n;
- 
- 	n = fread(&direc, sizeof(struct direct), 1, dirp);
- 	if (n <= 0)
- 		d = NULL;
- 	return(d);
- }
- 
- #endif rewinddir
- 
- 
  char		All;
  char		Qrymod;
  char		Superuser;
--- 13,18 ----
***************
*** 193,201 ****
  getnxtdb()
  {
  	struct direct		*dp;
- #ifndef rewinddir
- 	static char		dbname[DIRSIZ+1];
- #endif
  	register char		*db;
  	register FILE		*fd;
  	register int		i;
--- 160,165 ----
***************
*** 219,231 ****
  				{
  					continue;
  				}
- #ifdef rewinddir
  				db = dp->d_name;
- #else
- 				strncpy(dbname, dp->d_name, DIRSIZ);
- 				dbname[DIRSIZ] = '\0';
- 				db = dbname;
- #endif
  			}
  		}
  		else
--- 183,189 ----
diff -r -c ../ingres.ptf/source/support/usersetup.c source/support/usersetup.c
*** ../ingres.ptf/source/support/usersetup.c	Mon Nov 16 14:39:02 1992
--- source/support/usersetup.c	Wed Sep 23 14:53:05 1992
***************
*** 32,44 ****
  	register int	i;
  	char		buf[MAXLINE + 1];
  	char		*pathname;
! 	register char	*code;
  	char		*field[UF_NFIELDS];
! 	register int	iop;
  	extern char	*Proc_name;
  	char		*stat = "000001";
! 	extern	int	(*ExitFn)();
! 	extern	int	sysexit();
  
  	Proc_name = "USERSETUP";
  	ExitFn = sysexit;
--- 32,44 ----
  	register int	i;
  	char		buf[MAXLINE + 1];
  	char		*pathname;
!         char            code[2];
  	char		*field[UF_NFIELDS];
! 	FILE	*iop;
  	extern char	*Proc_name;
  	char		*stat = "000001";
! 	extern	void	(*ExitFn)();
! 	void	sysexit();
  
  	Proc_name = "USERSETUP";
  	ExitFn = sysexit;
***************
*** 49,56 ****
  		stat = *++argv;
  	}
  
! 	code = "aa";
! 	if ((iop = (int) fopen("/etc/passwd", "r")) == NULL)
  		syserr(0, "cannot open /etc/passwd for reading");
  
  	/* scan for INGRES in /etc/passwd */
--- 49,57 ----
  		stat = *++argv;
  	}
  
!         code[0] = 'a';
!         code[1] = 'a';
! 	if ((iop = fopen("/etc/passwd", "r")) == NULL)
  		syserr(0, "cannot open /etc/passwd for reading");
  
  	/* scan for INGRES in /etc/passwd */
***************
*** 75,81 ****
  	/* rewind passwd file */
  	if (fclose(iop))
  		syserr("fclose");
! 	if ((iop = (int) fopen("/etc/passwd", "r")) == NULL)
  		syserr("open /etc/passwd 2");
  
  	/* open output file as needed */
--- 76,82 ----
  	/* rewind passwd file */
  	if (fclose(iop))
  		syserr("fclose");
! 	if ((iop = fopen("/etc/passwd", "r")) == NULL)
  		syserr("open /etc/passwd 2");
  
  	/* open output file as needed */
***************
*** 89,94 ****
--- 90,96 ----
  		close(i);
  		if (freopen(buf, "w", stdout) == NULL)
  			syserr("cannot open %s", buf);
+ 
  	}
  
  	while (fgets(buf, MAXLINE, iop))
***************
*** 137,144 ****
  next(code)
  char	code[2];
  {
! 	register char	*c;
! 	register char	a, b;
  
  	c = code;
  	a = c[0];
--- 139,146 ----
  next(code)
  char	code[2];
  {
! 	char	*c;
! 	char	a, b;
  
  	c = code;
  	a = c[0];
***************
*** 171,176 ****
--- 173,180 ----
  **	A simple function that just exits, this is for the benefit
  **	of syserr, so it does not core dump.
  */
+ 
+ void
  sysexit(value)
  int	value;
  {
Only in source/support: y.tab.h
