/*
* 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 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include "bart.h"
int buf_size);
int
{
int c;
switch (c) {
case 'p':
break;
case 'r':
usage();
else
usage();
}
break;
case 'i':
break;
case '?':
default:
usage();
}
}
/* Make sure we have the right number of args */
usage();
control_fname = argv[0];
/* At this point, the filenames are sane, so do the comparison */
prog_fmt, glob_flags));
}
static int
{
if (control_fd == NULL) {
return (FATAL_EXIT);
}
return (FATAL_EXIT);
}
if (ret == 0) {
/* Lines compare OK, just read the next lines.... */
control);
continue;
}
/*
* Something didn't compare properly.
*/
if (fname_cmp == 0) {
/*
* Filenames were the same, see what was
* different and continue.
*/
control);
} else if (fname_cmp > 0) {
/* Filenames were different, a files was ADDED */
}
} else if (fname_cmp < 0) {
/* Filenames were different, a files was DELETED */
}
control);
}
}
/*
* Entering this while loop means files were DELETED from the test
* manifest.
*/
while (control_pos != -1) {
}
}
/*
* Entering this while loop means files were ADDED to the test
* manifest.
*/
while (test_pos != -1) {
}
}
(void) fclose(control_fd);
/* For programmatic mode, add a newline for cosmetic reasons */
if (prog_fmt && (return_status != 0))
(void) printf("\n");
return (return_status);
}
static void
char *dest)
{
pos = 0;
/* Reset these fields... */
*devnode = '\0';
*dest = '\0';
/* Handle filetypes which have a last field..... */
if (type[0] == 'F')
else if (type[0] == 'L')
}
static void
{
int cnt = 0;
(*curr_pos)++;
(*curr_pos)++;
cnt++;
}
}
/*
* Utility function: extract fname and type from this line
*/
static void
{
pos = 0;
}
/*
* Utility function: tells us whether or not this addition should be reported
*
* Returns 0 if the discrepancy is ignored, non-zero if the discrepancy is
* reported.
*/
static int
{
return (1);
else
return (0);
}
/*
* Utility function: tells us whether or not this deletion should be reported
*
* Returns 0 if the discrepancy is ignored, non-zero if the discrepancy is
* reported.
*/
static int
{
return (1);
else
return (0);
}
/*
* This function takes in the two entries, which have been flagged as
* different, breaks them up and reports discrepancies. Note, discrepancies
* are affected by the 'CHECK' and 'IGNORE' stanzas which may apply to
* these entries.
*
* Returns the number of discrepancies reported.
*/
static int
{
*tag;
int ret_val;
ret_val = 0;
/*
* Now we know the fname and type, let's get the rule that matches this
* manifest entry. If there is a match, make sure to setup the
* correct reporting flags.
*/
/*
* Report the errors based upon which keywords have been set by
* the user.
*/
ret_val++;
}
ret_val++;
}
ret_val++;
}
ret_val++;
}
switch (ctrl_type[0]) {
case 'D':
tag = "dirmtime";
break;
case 'L':
tag = "lnmtime";
break;
default:
tag = "mtime";
break;
}
if (flags == 0) {
ret_val++;
}
}
prog_fmt);
ret_val++;
}
ret_val++;
}
ret_val++;
}
} else if ((flags & ATTR_MTIME) &&
ret_val++;
}
ret_val++;
}
ret_val++;
}
if ((flags & ATTR_DEVNODE) &&
ret_val++;
}
ret_val++;
}
if ((flags & ATTR_CONTENTS) &&
ret_val++;
}
return (ret_val);
}
/*
* Function responsible for reporting errors.
*/
static void
{
if (!prog_fmt) {
/* Verbose mode */
}
else
} else {
/* Programmatic mode */
/* Ensure a line is not printed for the initial case */
if (strlen(last_fname) != 0)
(void) printf("\n");
}
}
}
}
/*
* Function responsible for reading in a line from the manifest.
* Takes in the file ptr and a buffer, parses the buffer and sets the 'line'
* ptr correctly. In the case when the buffer is fully parsed, this function
* reads more data from the file ptr and refills the buffer.
*/
static int
{
/*
* Initialization case: make sure the manifest version is OK
*/
if (start_pos == 0) {
end_pos = 0;
buf[0] = '\0';
if (filepos == 0) {
strlen(MANIFEST_VER)) != 0)
iscomment++;
while (iscomment) {
end_pos++;
return (-1);
end_pos++;
iscomment = 0;
iscomment++;
}
}
end_pos++;
return (end_pos);
}
return (-1);
}
}
/* Read the buffer until EOL or the buffer is empty */
end_pos++;
/* Found the end of the line, normal exit */
return (end_pos);
}
/* No more input to read */
return (-1);
}
/*
* The following code takes the remainder of the buffer and
* puts it at the beginning. The space after the remainder, which
* is now at the beginning, is blanked.
* At this point, read in more data and continue to find the EOL....
*/
/* Read the buffer until EOL or the buffer is empty */
end_pos++;
/* Found the end of the line, normal exit */
return (end_pos);
}
/* No more input to read */
return (-1);
}
/* NOTREACHED */
}
static void
{
/* Default behavior: everything is checked *except* dirmtime */
}