/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "libtnf.h"
/*
* Initiate a reader session
*/
{
int native;
/*
* Check magic number
*/
/* LINTED pointer cast may result in improper alignment */
else if (magic == TNF_MAGIC_1)
native = 0; /* other endian */
else
return (TNF_ERR_NOTTNF);
/*
* Allocate TNF struct, initialize members
*/
return (TNF_ERR_ALLOCFAIL);
/*
* Examine file header
*/
/* LINTED pointer cast may result in improper alignment */
/* Block size */
/* LINTED pointer cast may result in improper alignment */
/* Directory size */
/* LINTED pointer cast may result in improper alignment */
/* Block count */
/* LINTED pointer cast may result in improper alignment */
/*
* This member tracks data block count, not total block count
* (unlike the TNF file header). Discount directory blocks.
*/
/*
* 1196886: Clients may supply file_size information obtained
* by fstat() which is incorrect. Check it now and revise
* downwards if we have to.
*/
/* missing data? */
return (TNF_ERR_BADTNF);
else {
}
}
/* Calculate block shift */
tmpsz = 1;
tmpsz <<= 1;
tnf->block_shift++;
}
/* Calculate block mask */
/* Generation shift */
/* LINTED pointer cast may result in improper alignment */
/* Calculate the address mask */
/*
* Following lint complaint is unwarranted, probably an
* uninitialized variable in lint or something ...
*/
/* LINTED constant truncated by assignment */
/*
* Examine first block header in data area
*/
/* LINTED pointer cast may result in improper alignment */
/* Block generation offset */
/* Block bytes valid offset */
/*
* Bootstrap taginfo system and cache important taginfo
*/
return (err);
/*
* Return TNF handle and error status
*/
return (TNF_ERR_NONE);
}
/*
* Terminate a reader session
*/
{
/* Deallocate all taginfo */
return (err);
/* Deallocate TNF */
return (TNF_ERR_NONE);
}