1 //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
2 //%% (c) Copyright 1993, 1994 International Business Machines Corp.
3 //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
4 //%% (c) Copyright 1993, 1994 Novell, Inc.
5 //%% $XConsortium: tt_client_isam_key_descriptor.C /main/3 1995/10/23 09:59:42 rswiston $
7 * tt_client_isam_key_descriptor.cc - Defines the TT ISAM key descriptor class.
8 * This class is used to hold the information required
9 * to create a NetISAM key descriptor. It also makes
10 * it very easy to construct the descriptor.
12 * Copyright (c) 1992 by Sun Microsystems, Inc.
15 #include "db/tt_client_isam_key_descriptor.h"
17 _Tt_client_isam_key_descriptor::_Tt_client_isam_key_descriptor ()
19 keyDescriptor.k_flags = 0;
20 keyDescriptor.k_nparts = 0;
23 _Tt_client_isam_key_descriptor::~_Tt_client_isam_key_descriptor ()
27 short _Tt_client_isam_key_descriptor::addKeyPart (short start, short length, short type)
31 if (keyDescriptor.k_nparts < NPARTS-1) {
32 index = keyDescriptor.k_nparts;
34 (&keyDescriptor.k_part_0 + index)->kp_start = start;
35 (&keyDescriptor.k_part_0 + index)->kp_leng = length;
36 (&keyDescriptor.k_part_0 + index)->kp_type = type;
38 keyDescriptor.k_nparts++;
44 short _Tt_client_isam_key_descriptor::setKeyPart (short index,
51 if ((index > -1) && (index < keyDescriptor.k_nparts)) {
52 (&keyDescriptor.k_part_0 + index)->kp_start = start;
53 (&keyDescriptor.k_part_0 + index)->kp_leng = length;
54 (&keyDescriptor.k_part_0 + index)->kp_type = type;
63 short _Tt_client_isam_key_descriptor::getKeyPart (short index,
70 if ((index > -1) && (index < keyDescriptor.k_nparts)) {
73 start = (&keyDescriptor.k_part_0 + index)->kp_start;
74 length = (&keyDescriptor.k_part_0 + index)->kp_leng;
75 type = (&keyDescriptor.k_part_0 + index)->kp_type;