home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1999 March B
/
SCO_CASTOR4RRT.iso
/
vxvm
/
root.2
/
usr
/
include
/
volscnprnt.h
/
volscnprnt
Wrap
Text File
|
1998-08-19
|
23KB
|
630 lines
/*
* Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
*
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
* SANTA CRUZ OPERATION INC.
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*/
/* @(#)lib.vxvm:libvxvm/common/libvxvm/volscnprnt.h 1.1 1/24/97 21:50:17 - lib.vxvm:libvxvm/common/libvxvm/volscnprnt.h */
#ident "@(#)lib.vxvm:libvxvm/common/libvxvm/volscnprnt.h 1.1"
/*
* Copyright(C)1996 VERITAS Software Corporation. ALL RIGHTS RESERVED.
* UNPUBLISHED -- RIGHTS RESERVED UNDER THE COPYRIGHT
* LAWS OF THE UNITED STATES. USE OF A COPYRIGHT NOTICE
* IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
* OR DISCLOSURE.
*
* THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND
* TRADE SECRETS OF VERITAS SOFTWARE. USE, DISCLOSURE,
* OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
* EXPRESS WRITTEN PERMISSION OF VERITAS SOFTWARE.
*
* RESTRICTED RIGHTS LEGEND
* USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT IS
* SUBJECT TO RESTRICTIONS AS SET FORTH IN SUBPARAGRAPH
* (C) (1) (ii) OF THE RIGHTS IN TECHNICAL DATA AND
* COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013.
* VERITAS SOFTWARE
* 1600 PLYMOUTH STREET, MOUNTAIN VIEW, CA 94043
*/
#ifndef _VOLSCNPRNT_H
#define _VOLSCNPRNT_H
/*
* Interface file for volmake field and record scanning and printing
* functions
*/
/* names for parts of a volume structure */
enum volrec_tag {
MIN_VOLREC_TAG, /* sentinal value, must be first */
VR_EXISTS, /* pseudo variable, volume already exists */
VR_IMPLICIT, /* pseudo variable, implicit volume */
VR_CHANGED, /* pseudo variable, changed volume */
VR_TUTIL0, /* v_tutil[0] */
VR_TUTIL1, /* v_tutil[1] */
VR_TUTIL2, /* v_tutil[2] */
VR_REC_LOCK, /* v_rec_lock */
VR_DATA_LOCK, /* v_data_lock */
VR_KSTATE, /* v_kstate */
VR_R_ALL, /* v_r_all */
VR_R_SOME, /* v_r_some */
VR_W_ALL, /* v_w_all */
VR_W_SOME, /* v_w_some */
VR_LASTERR, /* v_lasterr */
VR_NAME, /* v_name */
VR_CONFIG_ID, /* v_config_id */
VR_CONFIG_EPOCH, /* v_config_epoch */
VR_USE_TYPE, /* v_use_type */
VR_FSTYPE, /* v_fstype */
VR_COMMENT, /* v_comment */
VR_PUTIL0, /* v_putil[0] */
VR_PUTIL1, /* v_putil[1] */
VR_PUTIL2, /* v_putil[2] */
VR_STATE, /* v_state */
VR_WRITEBACK, /* v_pflag & V_PFLAG_WRITEBACK */
VR_PL_NUM, /* v_pl_num */
VR_PLEXLIST, /* pseudo variable for plex associations */
VR_PREF_NAME, /* v_pref_name */
VR_READ_POL, /* v_read_pol */
VR_CURRENT_READ_POL, /* v_current_read_pol */
VR_MINOR, /* v_minor */
VR_UID, /* v_uid */
VR_GID, /* v_gid */
VR_MODE, /* v_mode */
VR_LEN, /* v_len */
VR_DEVOPEN, /* v_tflag & V_TFLAG_DEVOPEN */
VR_LOG_LEN, /* v_log_len */
VR_LOG_TYPE, /* v_pflag & V_TFLAG_LOGTYPE */
VR_LOGGING, /* v_pflag & V_TFLAG_LOGGING */
VR_LOG_SERIAL_LO, /* v_log_serial_lo */
VR_LOG_SERIAL_HI, /* v_log_serial_hi */
VR_START_OPTS, /* v_start_opts */
VR_WRITECOPY, /* v_pflag & V_PFLAG_WRITECOPY */
VR_NODE_BDEV, /* v_node_bdev */
VR_NODE_CDEV, /* v_node_cdev */
VR_IOSIZE, /* v_iosize */
VR_UPDATE_TID, /* v_update_tid */
VR_RID, /* v_rid */
VR_PREF_PLEX_RID, /* v_pref_plex_rid */
VR_DETACH_TID, /* v_detach_tid */
VR_ACTIVE, /* v_pflag & V_PFLAG_ACTIVE */
VR_RECOVER, /* v_tflag & V_TFLAG_RECOVER */
VR_KRECOVER, /* v_tflag & V_TFLAG_KRECOVER */
VR_INVALID, /* v_tflag & V_TFLAG_INVALID */
VR_RECOVER_OFFSET, /* v_recover_offset */
VR_FORCEMINOR, /* v_pflag & V_PFLAG_FORCEMINOR */
VR_BADLOG, /* v_pflag & V_PFLAG_BADLOG */
VR_SPECIFY_WRITECOPY, /* v_pflag & V_PFLAG_SPECIFY_WRITECOPY */
VR_LASTERR_TID, /* v_lasterr_tid */
VR_RECOVER_CHECKPOINT, /* v_recover_checkpoint */
VR_DIRTY, /* v_tflag & V_TFLAG_DIRTY */
VR_BUSY, /* v_tflag & V_TFLAG_BUSY */
VR_KDETACH, /* v_pflag & V_PFLAG_KDETACH */
VR_STORAGE, /* v_pflag & V_PFLAG_STORAGE */
VR_SD_NUM, /* v_sd_num */
VR_DEGRADED, /* v_tflag & V_TFLAG_DEGRADED */
VR_UNUSABLE, /* v_tflag & V_TFLAG_UNUSABLE */
VR_HAS_LOGS, /* v_tflag & V_TFLAG_HAS_LOGS */
VR_LOG_RID, /* v_log_rid */
VR_APP_RECOVER, /* v_pflag & V_PFLAG_APP_RECOVER */
VR_RECOV_SEQNO, /* v_recov_seqno */
VR_APP_DIRTY, /* v_tflag & V_TFLAG_APP_DIRTY */
MAX_VOLREC_TAG, /* sentinel value, must be last */
VR_FAIL = -1, /* failure from vol_sscan_field */
VR_EOF = 0 /* EOF from vol_sscan_field */
};
typedef enum volrec_tag volrec_tag_t;
/* source compatibility with VxVM 1.2 */
#define VR_BDEV VR_NODE_BDEV
#define VR_CDEV VR_NODE_CDEV
#define VR_K_OPEN VR_DEVOPEN
/* names for parts of a plex structure */
enum plexrec_tag {
MIN_PLEXREC_TAG, /* sentinal value, must be last */
PR_EXISTS, /* pseudo variable, plex already exists */
PR_IMPLICIT, /* pseudo variable, implicit plex */
PR_CHANGED, /* pseudo variable, changed plex */
PR_TUTIL0, /* pl_tutil[0] */
PR_TUTIL1, /* pl_tutil[1] */
PR_TUTIL2, /* pl_tutil[2] */
PR_LOCK, /* pl_lock */
PR_COMPACT, /* pl_compact */
PR_IOMODE, /* pl_tflag & (PL_TFLAG_READ|PL_TFLAG_WRITE) */
PR_VOLATILE, /* pl_tflag & PL_TFLAG_VOLATILE */
PR_KSTATE, /* pl_kstate */
PR_LASTERR, /* pl_lasterr */
PR_LEN, /* pl_len */
PR_MINOR, /* pl_minor */
PR_NAME, /* pl_name */
PR_CONFIG_ID, /* pl_config_id */
PR_CONFIG_EPOCH, /* pl_config_epoch */
PR_COMMENT, /* pl_comment */
PR_PUTIL0, /* pl_putil[0] */
PR_PUTIL1, /* pl_putil[1] */
PR_PUTIL2, /* pl_putil[2] */
PR_NOERROR, /* pl_pflag & PL_PFLAG_NOERROR */
PR_V_NAME, /* pl_v_name */
PR_SD_NUM, /* pl_sd_num */
PR_SD_LIST, /* psuedo variable for subdisk associations */
PR_STATE, /* pl_state */
PR_LAYOUT, /* pl_layout */
PR_ST_WIDTH, /* pl_st_width */
PR_DEVOPEN, /* pl_tflag & PL_TFLAG_DEVOPEN */
PR_LOG_SD, /* pl_log_sd */
PR_LOG, /* pl_tflag & PL_TFLAG_LOG */
PR_COMPLETE, /* pl_tflag & PL_TFLAG_COMPLETE */
PR_CONTIG_LEN, /* pl_contig_len */
PR_DEV, /* pl_dev */
PR_UPDATE_TID, /* pl_update_tid */
PR_RID, /* pl_rid */
PR_VOL_RID, /* pl_vol_rid */
PR_DETACH_TID, /* pl_detach_tid */
PR_LOG_SD_RID, /* pl_log_sd_rid */
PR_REMOVED, /* pl_tflag & PL_TFLAG_REMOVED */
PR_NODAREC, /* pl_tflag & PL_TFLAG_NODAREC */
PR_STALE, /* pl_pflag & PL_PFLAG_STALE */
PR_KDETACH, /* pl_pflag & PL_PFLAG_KDETACH */
PR_LASTERR_TID, /* pl_lasterr_tid */
PR_NCOLUMN, /* pl_ncolumn */
PR_DIRTY, /* pl_tflag & PL_TFLAG_DIRTY */
PR_BUSY, /* pl_tflag & PL_TFLAG_BUSY */
PR_RAIDLOG, /* pl_tflag & PL_TFLAG_RAIDLOG */
MAX_PLEXREC_TAG, /* sentinal value, must be last */
PR_FAIL = -1, /* failure from plex_sscan_field */
PR_EOF = 0 /* EOF from plex_sscan_field */
};
typedef enum plexrec_tag plexrec_tag_t;
/* source compatibility with VxVM 1.2 */
#define PR_K_OPEN PR_DEVOPEN
/* names for parts of a subdisk structure */
enum sdrec_tag {
MIN_SDREC_TAG, /* sentinel value, must be first */
SR_EXISTS, /* pseudo variable, subdisk already exists */
SR_IMPLICIT, /* pseudo variable, implicit subdisk */
SR_CHANGED, /* pseudo variable, changed subdisk */
SR_TUTIL0, /* sd_tutil[0] */
SR_TUTIL1, /* sd_tutil[1] */
SR_TUTIL2, /* sd_tutil[2] */
SR_LOCK, /* sd_lock */
SR_DEV, /* sd_dev */
SR_NAME, /* sd_name */
SR_CONFIG_ID, /* sd_config_id */
SR_CONFIG_EPOCH, /* sd_config_epoch */
SR_PATH, /* sd_path */
SR_PL_NAME, /* sd_pl_name */
SR_COMMENT, /* sd_comment */
SR_PUTIL0, /* sd_putil[0] */
SR_PUTIL1, /* sd_putil[1] */
SR_PUTIL2, /* sd_putil[2] */
SR_VOLATILE, /* sd_pflag & SD_PFLAG_VOLATILE */
SR_DM_OFFSET, /* sd_offset */
SR_PL_OFFSET, /* sd_pl_offset */
SR_LEN, /* sd_len */
SR_BUSY, /* sd_tflag & SD_TFLAG_BUSY */
SR_IS_LOG, /* sd_tflag & SD_TFLAG_IS_LOG */
SR_DEV_OFFSET, /* sd_offset */
SR_DA_NAME, /* sd_da_name */
SR_DM_NAME, /* sd_dm_name */
SR_UPDATE_TID, /* sd_update_tid */
SR_RID, /* sd_rid */
SR_PLEX_RID, /* sd_plex_rid */
SR_DM_RID, /* sd_dm_rid */
SR_LASTERR_TID, /* sd_lasterr_tid */
SR_NODE_BDEV, /* sd_node_bdev */
SR_NODE_CDEV, /* sd_node_cdev */
SR_MINOR, /* sd_minor */
SR_DETACH_TID, /* sd_detach_tid */
SR_COLUMN, /* sd_column */
SR_DIRTY, /* sd_tflag & SD_TFLAG_DIRTY */
SR_DEVOPEN, /* sd_tflag & SD_TFLAG_DEVOPEN */
SR_ENABLED, /* sd_tflag & SD_TFLAG_ENABLED */
SR_DETACH, /* sd_tflag & SD_TFLAG_DETACH */
SR_NODAREC, /* sd_tflag & SD_TFLAG_NODAREC */
SR_REMOVED, /* sd_tflag & SD_TFLAG_REMOVED */
SR_MKDEVICE, /* sd_pflag & SD_PFLAG_MKDEVICE */
SR_SUBVOLUME, /* sd_pflag & SD_PFLAG_SUBVOLUME */
SR_STALE, /* sd_pflag & SD_PFLAG_STALE */
SR_KDETACH, /* sd_pflag & SD_PFLAG_KDETACH */
SR_WRITEONLY, /* sd_tflag & SD_TFLAG_WRITEONLY */
SR_DEVICE_TAG, /* sd_device_tag */
MAX_SDREC_TAG, /* sentinel value, must be last */
SR_FAIL = -1, /* failure from sd_sscan_field */
SR_EOF = 0, /* EOF from sd_sscan_field */
SR_RELOCATE /* sd_pflag & SD_PFLAG_RELOCATE */
};
typedef enum sdrec_tag sdrec_tag_t;
/* source compatibility with VxVM 1.1 and 1.2 */
#define SR_OFFSET SR_DM_OFFSET
#define SR_K_OPEN SR_BUSY
/* names for parts of a disk media structure */
enum dmrec_tag {
MIN_DISKREC_TAG, /* sentinel value, must be first */
MR_EXISTS, /* pseudo variable, disk already exists */
MR_IMPLICIT, /* pseudo variable, implicit disk */
MR_CHANGED, /* pseudo variable, changed disk */
MR_TUTIL0, /* dm_tutil[0] */
MR_TUTIL1, /* dm_tutil[1] */
MR_TUTIL2, /* dm_tutil[2] */
MR_DA_NAME, /* dm_da_name */
MR_DEVICE_TAG, /* dm_device_tag */
MR_DA_TYPE, /* dm_da_type */
MR_PUB_BPATH, /* dm_pub_bpath */
MR_PRIV_BPATH, /* dm_priv_bpath */
MR_PUB_CPATH, /* dm_pub_cpath */
MR_PRIV_CPATH, /* dm_priv_cpath */
MR_PUB_BDEV, /* dm_pub_bdev */
MR_PRIV_BDEV, /* dm_priv_bdev */
MR_PUB_OFFSET, /* dm_pub_offset */
MR_PRIV_OFFSET, /* dm_priv_offset */
MR_PUB_LEN, /* dm_pub_len */
MR_PRIV_LEN, /* dm_priv_len */
MR_ATOMIC_IOSIZE, /* dm_atomic_iosize */
MR_PRIVATE, /* dm_tflag & DM_TFLAG_PRIVATE */
MR_COMPONENT, /* dm_tflag & DM_TFLAG_COMPONENT */
MR_VOLATILE, /* dm_tflag & DM_TFLAG_VOLATILE */
MR_NODAREC, /* dm_tflag & DM_TFLAG_NODAREC */
MR_AUTOCONFIG, /* dm_tflag & DM_TFLAG_AUTOCONFIG */
MR_LOCK, /* dm_lock */
MR_NAME, /* dm_name */
MR_COMMENT, /* dm_comment */
MR_PUTIL0, /* dm_putil[0] */
MR_PUTIL1, /* dm_putil[1] */
MR_PUTIL2, /* dm_putil[2] */
MR_DISKID, /* dm_diskid */
MR_LAST_DA_NAME, /* dm_last_da_name */
MR_RID, /* dm_rid */
MR_RESERVE, /* dm_pflag & DM_PFLAG_RESERVE */
MR_REMOVED, /* dm_pflag & DM_PFLAG_REMOVED */
MR_UPDATE_TID, /* dm_update_tid */
MR_SD_NUM, /* dm_sd_num */
MR_BUSY, /* dm_tflag & DM_TFLAG_DEVOPEN */
MR_SPARE, /* dm_pflag & DM_PFLAG_SPARE */
MR_FAILING, /* dm_pflag & DM_PFLAG_FAILING */
MAX_DISKREC_TAG, /* sentinel value, must be last */
MR_FAIL = -1, /* failure from disk_sscan_field */
MR_EOF = 0 /* EOF from disk_sscan_field */
};
typedef enum dmrec_tag dmrec_tag_t;
/* names for parts of a disk group structure */
enum dgrec_tag {
MIN_DGREC_TAG, /* sentinel value, must be first */
GR_EXISTS, /* pseudo variable, disk group already exists */
GR_IMPLICIT, /* pseudo variable, implicit disk group */
GR_CHANGED, /* pseudo variable, changed disk group */
GR_TUTIL0, /* dg_tutil[0] */
GR_TUTIL1, /* dg_tutil[1] */
GR_TUTIL2, /* dg_tutil[2] */
GR_LOCK, /* dg_lock */
GR_IMPORT_ID, /* dg_import_id */
GR_NAME, /* dg_name */
GR_REAL_NAME, /* dg_real_name */
GR_COMMENT, /* dg_comment */
GR_PUTIL0, /* dg_putil[0] */
GR_PUTIL1, /* dg_putil[1] */
GR_PUTIL2, /* dg_putil[2] */
GR_DGID, /* dg_dgid */
GR_RID, /* dg_rid */
GR_UPDATE_TID, /* dg_update_tid */
GR_DISABLED, /* dg_tflag & DG_TFLAG_DISABLED */
GR_NCONFIG, /* dg_nconfig */
GR_NLOG, /* dg_nlog */
GR_BASE_MINOR, /* dg_base_minor */
GR_NO_AUTOIMPORT, /* dg_tflag & DG_TFLAG_NO_AUTOIMPORT */
MAX_DGREC_TAG, /* sentinel value, must be last */
GR_FAIL = -1, /* failure from dg_sscan_field */
GR_EOF = 0 /* EOF from dg_sscan_field */
};
typedef enum dgrec_tag dgrec_tag_t;
/* names for parts of a disk device structure */
enum darec_tag {
MIN_DAREC_TAG, /* sentinel value, must be first */
AR_EXISTS, /* pseudo variable, darec already exists */
AR_IMPLICIT, /* pseudo variable, implicit disk device */
AR_CHANGED, /* pseudo variable, changed disk device */
AR_DM_NAME, /* da_dm_name */
AR_DG_NAME, /* da_dg_name */
AR_DEVICE_TAG, /* da_device_tag */
AR_PUB_BPATH, /* da_pub_bpath */
AR_PRIV_BPATH, /* da_priv_bpath */
AR_PUB_CPATH, /* da_pub_cpath */
AR_PRIV_CPATH, /* da_priv_cpath */
AR_DG_IMPORT_ID, /* da_dg_import_id */
AR_DM_RID, /* da_dm_rid */
AR_PUB_BDEV, /* da_pub_bdev */
AR_PRIV_BDEV, /* da_priv_bdev */
AR_FAIL_CODE, /* da_fail_code */
AR_FAIL_ERRNO, /* da_fail_errno */
AR_PRIVATE, /* da_tflag & DA_TFLAG_PRIVATE */
AR_COMPONENT, /* da_tflag & DA_TFLAG_COMPONENT */
AR_VOLATILE, /* da_tflag & DA_TFLAG_VOLATILE */
AR_BADTYPE, /* da_tflag & DA_TFLAG_BADTYPE */
AR_READY, /* da_tflag & DA_TFLAG_READY */
AR_INVALID, /* da_tflag & DA_TFLAG_INVALID */
AR_AUTOCONFIG, /* da_tflag & DA_TFLAG_AUTOCONFIG */
AR_MPTH_DISABLE, /* da_tflag & DA_TFLAG_MPTH_DISABLE */
AR_RESERVE, /* da_tflag & DA_TFLAG_RESERVE */
AR_LOCK, /* da_lock */
AR_NAME, /* da_name */
AR_COMMENT, /* da_comment */
AR_TYPE, /* da_type */
AR_INFO, /* da_info */
AR_RID, /* da_rid */
AR_ONLINE, /* da_pflag & DA_PFLAG_ONLINE */
AR_UPDATE_TID, /* da_update_tid */
AR_SPARE, /* da_tflag & DA_TFLAG_SPARE */
AR_FAILING, /* da_tflag & DA_TFLAG_FAILING */
AR_MAXIOSIZE, /* da_maxiosize */
MAX_DAREC_TAG, /* sentinel value, must be last */
AR_FAIL = -1, /* failure from da_sscan_field */
AR_EOF = 0 /* EOF from da_sscan_field */
};
typedef enum darec_tag darec_tag_t;
/*
* plexvec - a vector of plex names
*
* This is used with vol_sscan_field() to represent one of the plexes
* defined by the "plex" variable. An array of these structures can be
* returned.
*/
struct plexvec {
char pv_name[NAME_SZ]; /* plex association */
};
/*
* sdvec - a vector of subdisk names and plex offsets
*
* This is used with plex_sscan_field() to represent one of the subdisks
* defined by the "sd" variable. An array of these structures can be
* returned. A subdisk whose offset is not specified explicitly will
* have an sv_offset of (voff_t)(-1). A subdisk whose column is not
* specified will have an sv_column of (long)(-1).
*/
struct sdvec {
char sv_name[NAME_SZ]; /* subdisk association */
voff_t sv_offset; /* offset of subdisk within plex */
long sv_column; /* column number */
};
/*
* types of variables that can occur in sdrec, plexrec and volrec structures
*/
enum vxvm_tagtype {
TAG_NAME, /* string of length NAME_LEN */
TAG_COMMNT, /* string of length COMMENT_LEN */
TAG_LONG, /* long */
TAG_EPOCH, /* time_t */
TAG_FLAG, /* flag within a char field */
TAG_LEN, /* voff_t used for length */
TAG_OFFSET, /* voff_t used for offset */
TAG_VKSTATE, /* enum vol_kstate */
TAG_EXCEPT, /* enum vol_except */
TAG_PREF, /* preferred plex, length NAME_LEN */
TAG_R_POL, /* enum vol_r_pol */
TAG_MINOR, /* minor_t */
TAG_MODE, /* mode_t, can be given symbolically */
TAG_UID, /* uid_t, can be given as user name */
TAG_GID, /* gid_t, can be given as group name */
TAG_PKSTATE, /* enum plex_kstate */
TAG_PIOMODE, /* plex I/O mode through char field */
TAG_LAYOUT, /* plex_layout */
TAG_STWIDTH, /* stripe width, conditional voff_t */
TAG_DEV, /* dev_t */
TAG_PLEXLST, /* list of associated plexes */
TAG_SDLST, /* list of associated subdisks */
TAG_NOOP, /* field value is not used */
TAG_LOG_TYPE, /* volume log_type field */
TAG_ULONG, /* unsigned long */
TAG_SEQNO, /* 64-bit sequence number */
TAG_RID, /* 64-bit record ID */
TAG_SIZE, /* size_t */
TAG_NCOPY /* diskgroup nconfig/nlog */
};
/*
* tag description structure for any record type
*/
struct voltagdesc {
int tag; /* tag number in rec_set_t */
char *name; /* name for variable */
enum vxvm_tagtype type; /* variable type */
size_t offs; /* offset within structure */
long info; /* auxiliary info */
};
/*
* vtagdesc, ptagdesc, and stagdesc - preserved for source compatibility
*/
struct vtagdesc {
volrec_tag_t tag; /* tag number in rec_set_t */
char *name; /* name for variable */
enum vxvm_tagtype type; /* variable type */
int offs; /* offset within structure */
long info; /* auxiliary info */
};
struct ptagdesc {
plexrec_tag_t tag; /* tag number in rec_set_t */
char *name; /* name for variable */
enum vxvm_tagtype type; /* variable type */
int offs; /* offset within structure */
long info; /* auxiliary info */
};
struct stagdesc {
sdrec_tag_t tag; /* tag number in rec_set_t */
char *name; /* name for variable */
enum vxvm_tagtype type; /* variable type */
int offs; /* offset within structure */
long info; /* auxiliary info */
};
/*
* Set manipulation macros for record element tags, ala POSIX sigset_t
*/
/*
* Sets contain up to 64 bits, allowing for future expansion. The
* bits are stored in an array of integers. The first tag number,
* corresponding to bit 0 of the first integer, is tag number 1.
*/
/* number of bits in an int */
#define _VOL_BPI (sizeof(uint_t) * 8)
/* which integer in an array contains a specific tag */
#define _VOL_WHINT(tag) (((uint_t)(tag) - 1) / _VOL_BPI)
/* which bit in an integer corresponds to a specific tag */
#define _VOL_WHBIT(tag) ((uint_t)1 << (((uint_t)(tag) - 1) % _VOL_BPI))
/*
* define structures that contain enough bits to represent each
* interesting part of volume, plex and subdisk structures.
* Add plenty of extra bits to allow for future expansion.
*/
typedef struct rec_set {
uint_t bits[128 / _VOL_BPI]; /* allow for expansion to 128 tags */
} rec_set_t;
/*
* vol_emptyset - clear all bits in a rec_set_t structure
* vol_fillset - set all bits in a rec_set_t structure
* vol_addset(s, t) - set the bit for tag t in the set s
* vol_delset(s, t) - clear the bit for tag t in the set s
* vol_ismember(s, t) - test whether the bit for tag t is set in set s
*/
#define vol_emptyset(s) \
((void) memset((char *)(s)->bits, 0, sizeof(struct rec_set)))
#define vol_fillset(s) \
((void) memset((char *)(s)->bits, 0xffff, sizeof(struct rec_set)))
#define vol_addset(s,t) ((s)->bits[_VOL_WHINT((t))] |= _VOL_WHBIT((t)))
#define vol_delset(s,t) ((s)->bits[_VOL_WHINT((t))] &= ~_VOL_WHBIT((t)))
#define vol_ismember(s,t) (((s)->bits[_VOL_WHINT((t))] & _VOL_WHBIT((t))) != 0)
/*
* table of all accessible volrec structure variables
*/
extern CONST struct voltagdesc vtagdesc[];
extern CONST struct voltagdesc ptagdesc[];
extern CONST struct voltagdesc stagdesc[];
extern CONST struct voltagdesc mtagdesc[];
extern CONST struct voltagdesc gtagdesc[];
extern CONST struct voltagdesc atagdesc[];
extern CONST struct voltagdesc *CONST endvtagdesc;
extern CONST struct voltagdesc *CONST endptagdesc;
extern CONST struct voltagdesc *CONST endstagdesc;
extern CONST struct voltagdesc *CONST endmtagdesc;
extern CONST struct voltagdesc *CONST endgtagdesc;
extern CONST struct voltagdesc *CONST endatagdesc;
#if defined(__STDC__)
extern int vol_print(const struct volrec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int plex_print(const struct plexrec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int sd_print(const struct sdrec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int dm_print(const struct dmrec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int dg_print(const struct dgrec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int da_print(const struct darec *, const rec_set_t *, const char *,
const char *, FILE *);
extern int vol_print_field(const struct volrec *, volrec_tag_t, FILE *);
extern int plex_print_field(const struct plexrec *, plexrec_tag_t, FILE *);
extern int sd_print_field(const struct sdrec *, sdrec_tag_t, FILE *);
extern int dm_print_field(const struct dmrec *, dmrec_tag_t, FILE *);
extern int dg_print_field(const struct dgrec *, dgrec_tag_t, FILE *);
extern int da_print_field(const struct darec *, darec_tag_t, FILE *);
extern char *vol_sprint_field(const struct volrec *, const char *);
extern char *plex_sprint_field(const struct plexrec *, const char *);
extern char *sd_sprint_field(const struct sdrec *, const char *);
extern char *dm_sprint_field(const struct dmrec *, const char *);
extern char *dg_sprint_field(const struct dgrec *, const char *);
extern char *da_sprint_field(const struct darec *, const char *);
extern int vol_sscan(struct volrec *, struct plexvec **, int *,
const rec_set_t *, rec_set_t *, char **);
extern int plex_sscan(struct plexrec *, struct sdvec **, int *,
const rec_set_t *, rec_set_t *, char **);
extern int sd_sscan(struct sdrec *, const rec_set_t *, rec_set_t *, char **);
extern int dm_sscan(struct dmrec *, const rec_set_t *, rec_set_t *, char **);
extern int dg_sscan(struct dgrec *, const rec_set_t *, rec_set_t *, char **);
extern int da_sscan(struct darec *, const rec_set_t *, rec_set_t *, char **);
extern volrec_tag_t vol_sscan_field(struct volrec *, struct plexvec **,
int *, const rec_set_t *, char **, int);
extern plexrec_tag_t plex_sscan_field(struct plexrec *, struct sdvec **,
int *, const rec_set_t *, char **, int);
extern sdrec_tag_t sd_sscan_field(struct sdrec *, const rec_set_t *,
char **, int);
extern dmrec_tag_t dm_sscan_field(struct dmrec *, const rec_set_t *,
char **, int);
extern dgrec_tag_t dg_sscan_field(struct dgrec *, const rec_set_t *,
char **, int);
extern darec_tag_t da_sscan_field(struct darec *, const rec_set_t *,
char **, int);
extern char *vol_readrec(vol_object_t *, FILE *);
extern int vol_isempty(const rec_set_t *);
#else /* not __SDC__ */
extern int vol_print();
extern int plex_print();
extern int sd_print();
extern int dm_print();
extern int dg_print();
extern int da_print();
extern int vol_print_field();
extern int plex_print_field();
extern int sd_print_field();
extern int dm_print_field();
extern int dg_print_field();
extern int da_print_field();
extern char *vol_sprint_field();
extern char *plex_sprint_field();
extern char *sd_sprint_field();
extern char *dm_sprint_field();
extern char *dg_sprint_field();
extern char *da_sprint_field();
extern int vol_sscan();
extern int plex_sscan();
extern int sd_sscan();
extern int dm_sscan();
extern int dg_sscan();
extern int da_sscan();
extern volrec_tag_t vol_sscan_field();
extern plexrec_tag_t plex_sscan_field();
extern sdrec_tag_t sd_sscan_field();
extern dmrec_tag_t dm_sscan_field();
extern dgrec_tag_t dg_sscan_field();
extern darec_tag_t da_sscan_field();
extern char *vol_readrec();
extern int vol_isempty();
#endif /* __STD__ */
#endif /* _VOLSCNPRNT_H */