*BSD News Article 57136


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.ecn.uoknor.edu!paladin.american.edu!europa.chnt.gtegsc.com!news.kreonet.re.kr!usenet.kornet.nm.kr!agate!howland.reston.ans.net!nntp.coast.net!news.kei.com!newsstand.cit.cornell.edu!newsfeed.cit.cornell.edu!newstand.syr.edu!news.corpcomm.net!newspeak.ultratech.net!worldlinx.com!news.hcl.com!bsd!patrick
From: patrick@bsd.hcl.com (Patrick Wong)
Newsgroups: comp.unix.bsd.386bsd.misc
Subject: Problems including <sys/tape.h>
Date: 6 Dec 1995 04:58:39 GMT
Organization: Hummingbird Communications Ltd.
Lines: 73
Message-ID: <4a37tv$8rq@mailhub.hcl.com>
NNTP-Posting-Host: bsdoutside.hcl.com
X-Newsreader: TIN [version 1.2 PL2]

I have problems include the c header <sys/tape.h> in a simple C program. 
Below is the problems I get. Does anyone have any ideas:


bsd:patrick $ gcc hello.c
In file included from hello.c:2:
/usr/include/sys/tape.h:13: field `tp_dev' has incomplete type
/usr/include/sys/tape.h:15: syntax error before `u_long'
/usr/include/sys/tape.h:22: warning: `struct buf' declared inside parameter list
/usr/include/sys/tape.h:22: warning: its scope is only this definition or declar
ation,
/usr/include/sys/tape.h:22: warning: which is probably not what you want.

bsd:patrick $ cat hello.c
#include <stdio.h>
#include <sys/tape.h>

main()
{
        printf ("hello,world\n");

}

bsd:patrick $ cat /usr/include/sys/tape.h
/*-
 * Copyright (c) 1992 Berkeley Software Design, Inc. All rights reserved.
 * The Berkeley Software Design Inc. software License Agreement specifies
 * the terms and conditions for redistribution.
 *
 *      BSDI $Id: tape.h,v 1.5 1992/09/22 20:01:26 karels Exp $
 */

/*
 * Common definitions for tape devices.
 */
struct tpdevice {
        struct  device tp_dev;
        struct  tpdriver *tp_driver;
        u_long  tp_reclen;
        u_long  tp_fileno;
        u_short tp_flags;
        tpr_t   tp_ctty;
};

struct tpdriver {
        void    (*t_strategy) __P((struct buf *));
#ifdef notyet
        int     (*t_open) __P((dev_t, int, int, struct proc *));
        int     (*t_close) __P((dev_t, int, int, struct proc *));
        int     (*t_ioctl) __P((dev_t, int, caddr_t, int, struct proc *));
        int     (*t_dump) __P((int));
#endif
};

/*
 * Flags
 */
#define TP_OPEN         0x0001  /* block multiple opens */
#define TP_MOVED        0x0002  /* we're past BOT */
#define TP_WRITING      0x0004  /* do we need to write filemarks on close? */
#define TP_STREAMER     0x0008  /* use fixed length records */
#define TP_DOUBLEEOF    0x0010  /* write two filemarks at end of tape */
#define TP_SHORTEOF     0x0020  /* use 'short' filemarks (exabyte) */
#define TP_SEENEOF      0x0040  /* report EOF on the next read */
#define TP_8MMVIDEO     0x0080  /* special handling for 8mm videotapes */
#define TP_NODENS       0x0100  /* drive with no density selection */
#define TP_PHYS_ADDR    0x0200  /* drive can retrieve physical block address */

#define tpunit(dev)     ((dev) & 0x3)
#define tpnorew(dev)    ((dev) & 0x4)

bsd:patrick $