2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
24 //%% (c) Copyright 1993, 1994 International Business Machines Corp.
25 //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
26 //%% (c) Copyright 1993, 1994 Novell, Inc.
27 //%% $XConsortium: tt_isam_key_descriptor.C /main/3 1995/10/20 16:44:18 rswiston $
29 * tt_isam_key_descriptor.cc - Defines the TT ISAM key descriptor class.
30 * This class is used to hold the information required
31 * to create a NetISAM key descriptor. It also makes
32 * it very easy to construct the descriptor.
34 * Copyright (c) 1992 by Sun Microsystems, Inc.
37 #include "tt_isam_key_descriptor.h"
39 _Tt_isam_key_descriptor::_Tt_isam_key_descriptor ()
41 keyDescriptor.k_flags = 0;
42 keyDescriptor.k_nparts = 0;
45 _Tt_isam_key_descriptor::~_Tt_isam_key_descriptor ()
49 short _Tt_isam_key_descriptor::addKeyPart (short start, short length, short type)
53 if (keyDescriptor.k_nparts < NPARTS-1) {
54 index = keyDescriptor.k_nparts;
56 keyDescriptor.k_part [index].kp_start = start;
57 keyDescriptor.k_part [index].kp_leng = length;
58 keyDescriptor.k_part [index].kp_type = type;
60 keyDescriptor.k_nparts++;
66 short _Tt_isam_key_descriptor::setKeyPart (short index,
73 if ((index > -1) && (index < keyDescriptor.k_nparts)) {
74 keyDescriptor.k_part [index].kp_start = start;
75 keyDescriptor.k_part [index].kp_leng = length;
76 keyDescriptor.k_part [index].kp_type = type;
85 short _Tt_isam_key_descriptor::getKeyPart (short index,
92 if ((index > -1) && (index < keyDescriptor.k_nparts)) {
95 start = keyDescriptor.k_part [index].kp_start;
96 length = keyDescriptor.k_part [index].kp_leng;
97 type = keyDescriptor.k_part [index].kp_type;