/*
* 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) 1996 Sun Microsystems, Inc. All Rights Reserved
*
* module:
*
* purpose:
* definition of the baseline and rules data structures
*/
#ifndef _DATABASE_H
#define _DATABASE_H
#pragma ident "%W% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* flag bits describing what we know about an individual file, or in
* some cases an entire base pair. These flags are found in the
* base and file stuctures.
*/
/*
* a base is a pair of directories to be kept in sync
* all rules and baseline data is stored beneath some base
*/
struct base {
/* statistics for wrap-up summary */
};
/*
* flag bits describing what we know about a particular rule.
* These flags are found in the rule structure
*/
/*
* a rule describes files to be included or excluded
* they are stored under bases
*/
struct rule {
};
/*
* this is the information we keep track of for a file
*/
struct fileinfo {
};
/*
* flag bits describing the differences we have detected between a file
* and the last time it was in sync (based on the baseline).
* These flags are used in the srcdiffs and dstdiffs fields of the
* file structure
*/
/*
* these masks are used to determine how important potential changes are.
*
* D_CONTENTS there may be changes to the file's contents
* D_ADMIN there may be changes to the ownership and protection
* D_IMPORTANT there may be changes that should block a deletion
*
* Note:
* I am torn on whether or not to include modtime in D_IMPORTANT.
* Experience suggests that deleting one of many links affects the
* file modification time.
*/
/*
* a file is an instance that follows (under a base) from a rule
* (for that base). A file structure may exist because of any
* combination of a file under the source, destination, in a
* baseline for historical reasons, or merely because a rule
* calls it out (whether it exists or not).
*/
struct file {
/*
* these fields capture information, gleaned from the baseline
* that is side-specific, and should not be expected to be in
* agreement between the two sides. As a result, this info can
* not be properly captured in f_info[OPT_BASE] and needs to
* be kept somewhere else.
*/
/* stat information from baseline file and evaluation */
/* summary of changes discovered in analysis */
/* this field is only valid for a renamed file */
/*
* these fields are only valid for a file that has been added
* to the reconciliation list
*/
/* this field is only valid for a file with a hard conflict */
};
/*
* globals
*/
extern int inum_changes; /* LISTed dirs with i# changes */
/* routines to manage base nodes, file nodes, and file infor */
errmask_t read_baseline(char *);
errmask_t write_baseline(char *);
/* routines to manage rules */
errmask_t read_rules(char *);
errmask_t write_rules(char *);
/* routines to manage and querry restriction lists */
/* routines for dealing with ignore lists */
void ignore_reset();
void ignore_pgm(const char *);
void ignore_expr(const char *);
void ignore_file(const char *);
bool_t ignore_check(const char *);
/* database processing routines for the primary passes */
int prune(void);
void summary(void);
/* routines in action.c to carry out reconciliation */
/* routines to deal with links in the reconciliation list */
/* maintain a name stack during directory tree traversal */
void push_name(const char *);
void pop_name();
/* acl manipulation functions */
#ifdef __cplusplus
}
#endif
#endif /* _DATABASE_H */