[comp.sources.d] Xenix patches to mbase distribution

kreed@telesys.cts.com (Kevin W. Reed) (01/12/91)

Submitted-by: kreed@telesys.cts.com
Archive-name: Patches for mbase3.1 SCO Xenix/part01

	Below are the changes I had to make to get MetalBase 3.1 
	to compile and execute properly under SCO Xenix 386

---- Cut Here and unpack ----
#!/bin/sh
# This is Patches for mbase3.1 SCO Xenix, a shell archive (shar 3.20-a)
# made 01/09/1991 18:47 UTC by kreed@telesys.cts.com
# Source directory /u/kreed/mbase.orig
#
# existing files WILL be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   7012 -rw-r--r-- mbaseXEN.pat01
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= mbaseXEN.pat01 ==============
echo "x - extracting mbaseXEN.pat01 (Text)"
sed 's/^X//' << 'SHAR_EOF' > mbaseXEN.pat01 &&
X*** Makefile	Wed Jan  9 09:55:59 1991
X--- new/Makefile	Wed Jan  9 10:13:45 1991
X***************
X*** 1,3
X  # NOT FOR USE WITH AMIGA SYSTEMS!  This Makefile is for, obviously,
X  # Unix only.  See the ReadMe for instructions on installing/
X  # compiling on an Amiga.
X
X--- 1,6 -----
X+ # Modified for use with SCO Xenix 386 
X+ # by kreed@telesys Wed Jan 9 1991
X+ #
X  # NOT FOR USE WITH AMIGA SYSTEMS!  This Makefile is for, obviously,
X  # Unix only.  See the ReadMe for instructions on installing/
X  # compiling on an Amiga.
X***************
X*** 2,8
X  # Unix only.  See the ReadMe for instructions on installing/
X  # compiling on an Amiga.
X  
X! # Replace LIBDIR with a period to put libmb.a in the current directory,
X  # or make it /usr/lib/ or wherever it is you'd like your new library.
X  
X  LIBDIR = .
X
X--- 5,11 -----
X  # Unix only.  See the ReadMe for instructions on installing/
X  # compiling on an Amiga.
X  
X! # Replace LIBDIR with a period to put Slibmbase.a in the current directory,
X  # or make it /usr/lib/ or wherever it is you'd like your new library.
X  
X  LIBDIR = /lib/386/.
X***************
X*** 5,11
X  # Replace LIBDIR with a period to put libmb.a in the current directory,
X  # or make it /usr/lib/ or wherever it is you'd like your new library.
X  
X! LIBDIR = .
X  
X  all:	libmb.a		build		sample		enctest
X  build:	build.c		stdinc.h
X
X--- 8,14 -----
X  # Replace LIBDIR with a period to put Slibmbase.a in the current directory,
X  # or make it /usr/lib/ or wherever it is you'd like your new library.
X  
X! LIBDIR = /lib/386/.
X  
X  all:	Slibmbase.a		build		sample
X  
X***************
X*** 7,13
X  
X  LIBDIR = .
X  
X! all:	libmb.a		build		sample		enctest
X  build:	build.c		stdinc.h
X  	cc -o build -O build.c
X  libmb.a:	mbase.c		stdinc.h	mbase.h
X
X--- 10,17 -----
X  
X  LIBDIR = /lib/386/.
X  
X! all:	Slibmbase.a		build		sample
X! 
X  build:	build.c		stdinc.h
X  	cc -o build -O build.c
X  
X***************
X*** 10,16
X  all:	libmb.a		build		sample		enctest
X  build:	build.c		stdinc.h
X  	cc -o build -O build.c
X! libmb.a:	mbase.c		stdinc.h	mbase.h
X  	cc -c -O mbase.c
X  	ar r ${LIBDIR}/libmb.a mbase.o
X  	ranlib ${LIBDIR}/libmb.a
X
X--- 14,21 -----
X  
X  build:	build.c		stdinc.h
X  	cc -o build -O build.c
X! 
X! Slibmbase.a:	mbase.c		stdinc.h	mbase.h
X  	cc -c -O mbase.c
X  	ar r Slibmbase.a mbase.o
X  	ranlib Slibmbase.a
X***************
X*** 12,20
X  	cc -o build -O build.c
X  libmb.a:	mbase.c		stdinc.h	mbase.h
X  	cc -c -O mbase.c
X! 	ar r ${LIBDIR}/libmb.a mbase.o
X! 	ranlib ${LIBDIR}/libmb.a
X! sample:	stdinc.h	mbase.h		sample.c  	libmb.a
X! 	cc -L ${LIBDIR} -o sample sample.c -lmb
X! enctest:	enctest.c
X! 	cc -o enctest enctest.c
X
X--- 17,29 -----
X  
X  Slibmbase.a:	mbase.c		stdinc.h	mbase.h
X  	cc -c -O mbase.c
X! 	ar r Slibmbase.a mbase.o
X! 	ranlib Slibmbase.a
X! 	cp Slibmbase.a ${LIBDIR}
X! 
X! sample:	stdinc.h	mbase.h		sample.c  	Slibmbase.a
X! 	cc -o sample sample.c -lmbase
X! 
X! install: Slibmbase.a
X! 	cp Slibmbase.a ${LIBDIR}
X! 
X*** build.c	Wed Jan  9 09:56:03 1991
X--- new/build.c	Wed Jan  9 10:08:34 1991
X***************
X*** 1,3
X  #include "stdinc.h"
X  
X  #define cr(x) ((x) == 0) ? "\n\n" : "\n"
X
X--- 1,6 -----
X+ /* Modified for use with SCO Xenix 386 
X+    by kreed@telesys Wed Jan 9 1991 */
X+ 
X  #include "stdinc.h"
X  
X  #define cr(x) ((x) == 0) ? "\n\n" : "\n"
X***************
X*** 31,37
X  char *repeat (ch, nm)
X  int           ch, nm;
X  {
X!    char  buf [MAX_RPT];
X  
X     buf[(nm = (nm < 0) ? 0 : nm)] = 0;
X  
X
X--- 34,40 -----
X  char *repeat (ch, nm)
X  int           ch, nm;
X  {
X!    static char  buf [MAX_RPT];
X  
X     buf[(nm = (nm < 0) ? 0 : nm)] = 0;
X  
X***************
X*** 343,348
X  
X     if (i == 'n' || i == 'N' || i == 'q' || i == 'Q')  exit (0);
X  
X     remove (rel);
X  
X     if ((R = open (rel, O_RDWR | O_CREAT)) == -1)
X
X--- 346,358 -----
X  
X     if (i == 'n' || i == 'N' || i == 'q' || i == 'Q')  exit (0);
X  
X+ #ifdef UNIX
X+    unlink (rel);
X+    if ((R = open (rel, O_RDWR | O_CREAT,0755)) == -1)
X+     { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X+       exit    (-1);
X+     };
X+ #else
X     remove (rel);
X     if ((R = open (rel, O_RDWR | O_CREAT)) == -1)
X      { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X***************
X*** 344,350
X     if (i == 'n' || i == 'N' || i == 'q' || i == 'Q')  exit (0);
X  
X     remove (rel);
X- 
X     if ((R = open (rel, O_RDWR | O_CREAT)) == -1)
X      { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X        exit    (-1);
X
X--- 354,359 -----
X      };
X  #else
X     remove (rel);
X     if ((R = open (rel, O_RDWR | O_CREAT)) == -1)
X      { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X        exit    (-1);
X***************
X*** 349,358
X      { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X        exit    (-1);
X      };
X- 
X- #ifdef UNIX
X-    sprintf (temp, "chmod 755 %s", rel);
X-    system  (temp);
X  #endif
X  
X     write (R, _encode (0,     1), 1);
X
X--- 358,363 -----
X      { fprintf (stderr, "\n\nCannot open relation -- Aborted\n");
X        exit    (-1);
X      };
X  #endif
X  
X     write (R, _encode (0,     1), 1);
X*** mbase.c	Wed Jan  9 09:56:04 1991
X--- new/mbase.c	Wed Jan  9 10:10:31 1991
X***************
X*** 355,360
X     return j;
X  }
X  
X  char *_encode (num, len)
X  long int       num;
X  int                 len;
X
X--- 355,371 -----
X     return j;
X  }
X  
X+ long _find_top (file, index)
X+ int             file, index;
X+ {
X+    char   temp [5];
X+ 
X+    lseek (_list[file].relcode, _t_top (file, index), 0);
X+    read  (_list[file].relcode, temp,                 4);
X+ 
X+    return (_eval (temp, 4));
X+ }
X+ 
X  char *_encode (num, len)
X  long int       num;
X  int                 len;
X***************
X*** 645,661
X     _clr_lck (acc);
X  
X     return OKAY;
X- }
X- 
X- long _find_top (file, index)
X- int             file, index;
X- {
X-    char   temp [5];
X- 
X-    lseek (_list[file].relcode, _t_top (file, index), 0);
X-    read  (_list[file].relcode, temp,                 4);
X- 
X-    return (_eval (temp, 4));
X  }
X  
X  _drop (file, index, rec)
X
X--- 656,661 -----
X     _clr_lck (acc);
X  
X     return OKAY;
X  }
X  
X  _drop (file, index, rec)
X*** sample.c	Wed Jan  9 09:56:05 1991
X--- new/sample.c	Wed Jan  9 10:08:37 1991
X***************
X*** 1,3
X  #include "stdinc.h"
X  #include "mbase.h"
X  
X
X--- 1,6 -----
X+ /* Modified for use with SCO Xenix 386 
X+    by kreed@telesys Wed Jan 9 1991 */
X+ 
X  #include "stdinc.h"
X  #include "mbase.h"
X  
X*** stdinc.h	Wed Jan  9 09:56:07 1991
X--- new/stdinc.h	Wed Jan  9 10:08:07 1991
X***************
X*** 1,3
X  #ifndef STDINC_H
X  #define STDINC_H
X  
X
X--- 1,6 -----
X+ /* Modified for use with SCO Xenix 386 
X+    by kreed@telesys Wed Jan 9 1991 */
X+ 
X  #ifndef STDINC_H
X  #define STDINC_H
X  
X***************
X*** 14,20
X  #define ANSI "\033["
X  #define NORM "\033[0m"
X  #define BOLD "\033[1m"
X! #define SUBD "\033[2m"
X  #define ITAL "\033[3m"
X  #define UNDR "\033[4m"
X  #define INVR "\033[7m"
X
X--- 17,23 -----
X  #define ANSI "\033["
X  #define NORM "\033[0m"
X  #define BOLD "\033[1m"
X! #define SUBD ""
X  #define ITAL "\033[3m"
X  #define UNDR "\033[4m"
X  #define INVR "\033[7m"
SHAR_EOF
$TOUCH -am 0109104691 mbaseXEN.pat01 &&
chmod 0644 mbaseXEN.pat01 ||
echo "restore of mbaseXEN.pat01 failed"
set `wc -c mbaseXEN.pat01`;Wc_c=$1
if test "$Wc_c" != "7012"; then
	echo original size 7012, current size $Wc_c
fi
exit 0

-- 
Kevin W. Reed --- TeleSys Development Systems -- PO 17821, San Diego, CA 92177
TeleSys-II BBS & telesys.UUCP 619-483-3890 ----- Telebit PEP Line 619 483 0965
UUCP: {nosc,ucsd}!crash!telesys!kreed -------- Internet: kreed@telesys.cts.com