843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License, Version 1.0 only
843e19887f64dde75055cf8842fc4db2171eff45johnlev * (the "License"). You may not use this file except in compliance
843e19887f64dde75055cf8842fc4db2171eff45johnlev * with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev#pragma ident "%Z%%M% %I% %E% SMI"
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 'pickle' is the package for storing data structures into files.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 'pickle_file' is the base class. Classes that inherit this base
843e19887f64dde75055cf8842fc4db2171eff45johnlev * class need to instantiate the virtual function 'dump'.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* Constructor. Creates pickle_file with given name and mode. */
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson ~pickle_file() { delete filename; DESTROYRW(pickle); }
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * Opens pickle_file with mode specified with constructor.
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * Returns TRUE if open was successful; FALSE otherwise.
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson /* Closes pickle_file. Returns 0 if successful; -1 otherwise. */
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * dump or load data structure to/from 'filename' using function 'f'.
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * dump/load is determined by 'mode' with which pickle_file was created.
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * Returns 0 if successful; 1 if file cannot be opened in mode
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson * specified; -1 if transfer failed do to encoding/decoding errors.
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson /* Exclusive access */
7eea693d6b672899726e75993fddc4e95b52647fMark Johnson#endif /* PICKLE_H */