*BSD News Article 6477


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!uwm.edu!caen!sol.ctr.columbia.edu!hamblin.math.byu.edu!news.byu.edu!ux1!fcom.cc.utah.edu!cs.weber.edu!terry
From: terry@cs.weber.edu (A Wizard of Earth C)
Subject: PATCHKIT/GAMES/LIBCOMPAT
Message-ID: <1992Oct13.200936.22262@fcom.cc.utah.edu>
Sender: news@fcom.cc.utah.edu
Reply-To: terry@icarus.weber.edu
Organization: Weber State University  (Ogden, UT)
Date: Tue, 13 Oct 92 20:09:36 GMT
Lines: 165

>I just installed your patchkit, and everything went very well, but I
>have a question.  One of the patches states that all games should
>compile, but almost all of them complain that I am missing libcompat.
>When I look at the list of files, there is no libcompat.a there, so I am
>wondering if I am missing something.  I have the full bin01, etc01, and
>src01 installed.  The only thing I see that might be close is a
>directory of files called compat-43, which it looks like is part of
>libc.  So, my question is, am I missing something, or should I just
>create a dummy libcompat.a, so the compiler has something to open?

I messed up on this.  I should have included my libcompat.a; I am going
to be making a patch for it as soon as I get re_comp and re_exec working.

Meanwhile, for the games, libcompat.a should probably contain the following
files:

sgtty.c=============================================================
/* 29 Sep 92*/
/*
 * sgtty.c
 *
 * Part of the compatability library.
 *
 * This module defines gtty() and stty() as functions.
 *
 * 29 Sep 92    Terry Lambert           Original
 */
#define USE_OLD_TTY             /* Magic incantation*/
#include <sys/ioctl.h>

int
gtty( fd, argp)
int     fd;
char    *argp;
{
        return( ioctl( fd, TIOCSETP, argp));
}

int
stty( fd, argp)
int     fd;
char    *argp;
{
        return( ioctl( fd, TIOCGETP, argp));
}

/*
 * EOF -- This file has not been truncated
 */

strdup.c==============================================================
/*
 * Copyright (c) 1988 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by the University of
 *      California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)strdup.c    5.4 (Berkeley) 2/24/91";
#endif /* LIBC_SCCS and not lint */

#include <stddef.h>
#include <stdlib.h>
#include <string.h>

char *
strdup(str)
        const char *str;
{
        int len;
        char *copy;

        len = strlen(str) + 1;
        if (!(copy = malloc((u_int)len)))
                return((char *)NULL);
        bcopy(str, copy, len);
        return(copy);
}

strtod.c==================================================================
/* 19 Sep 92*/
/*
 * strtod.c
 *
 * A quick-and-dirty strtod() function, using the scanf internal routines.
 *
 * 19 Sep 92    Peng-Toh Sim            Original
 *
 * Peng-Toh Sim         =       sim@cory.Berkeley.EDU
 */
#include <stdio.h>
#include <string.h>

/* ARGSUSED */
static int
        eofread(cookie, buf, len)
        void *cookie;
        char *buf;
        int len;
{
        return (0);
}

double strtod(const char *str, char **endp)
{
        int ret;
        FILE f;
        double val;
        int l;

        f._flags = __SRD;
        f._bf._base = f._p = (unsigned char *)str;
        f._bf._size = f._r = l = strlen(str);
        f._read = eofread;
        f._ub._base = NULL;
        f._lb._base = NULL;
        ret = fscanf(&f, "%lg", &val);
        if (ret == 0) {
                *endp = (char *) str;
                return 0.0;
        }
        *endp = (char *) &(str[l - f._r]);
        return val;
}

/*
 * EOF -- This file has not been truncated.
 */
==========================================================================

						Regards,
						Terry

-- 
-------------------------------------------------------------------------------
                                        "I have an 8 user poetic license" - me
 Get the 386bsd FAQ from agate.berkeley.edu:/pub/386BSD/386bsd-0.1/unofficial
-------------------------------------------------------------------------------