2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * db_item_c.x
2N/A *
2N/A * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A%#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A%
2N/A% /* A 'counted' string. */
2N/A%
2N/A
2N/A#if RPC_HDR
2N/A%#ifndef _DB_ITEM_H
2N/A%#define _DB_ITEM_H
2N/A#endif /* RPC_HDR */
2N/A
2N/A#if RPC_HDR || RPC_XDR
2N/A#ifdef USINGC
2N/Astruct item{
2N/A char itemvalue<>;
2N/A};
2N/A#endif /* USINGC */
2N/A#endif /* RPC_HDR */
2N/A
2N/A#ifndef USINGC
2N/A#ifdef RPC_HDR
2N/A%class item {
2N/A% int len;
2N/A% char *value;
2N/A% public:
2N/A%/* Constructor: creates item using given character sequence and length */
2N/A% item( char* str, int len);
2N/A%
2N/A%/* Constructor: creates item by copying given item */
2N/A% item( item* );
2N/A%
2N/A%/* Constructor: creates empty item (zero length and null value). */
2N/A% item() {len = 0; value = NULL;}
2N/A%
2N/A%/* Destructor: recover space occupied by characters and delete item. */
2N/A% ~item() {delete value;}
2N/A%
2N/A%/* Equality test. 'casein' TRUE means case insensitive test. */
2N/A% bool_t equal( item *, bool_t casein = FALSE );
2N/A%
2N/A%/* Equality test. 'casein' TRUE means case insensitive test. */
2N/A% bool_t equal( char *, int, bool_t casein = FALSE );
2N/A%
2N/A%/* Assignment: update item by setting pointers. No space is allocated. */
2N/A% void update( char* str, int n) {len = n; value = str;}
2N/A%
2N/A%/* Return contents of item. */
2N/A% void get_value( char** s, int * n ) { *s = value; *n=len;}
2N/A%
2N/A%/* Prints contents of item to stdout */
2N/A% void print();
2N/A%
2N/A%/* Return hash value. 'casein' TRUE means case insensitive test. */
2N/A% unsigned int get_hashval( bool_t casein = FALSE );
2N/A%};
2N/A#endif /* RPC_HDR */
2N/A#endif /* USINGC */
2N/A
2N/A#if RPC_HDR
2N/A%#endif /* _DB_ITEM_H */
2N/A#endif /* RPC_HDR */