/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* Copyright (c) 1988-2000 Sun Microsystems, Inc.
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <string.h>
#include "db_headers.h"
#include "db_scheme.h"
#include "nisdb_mt.h"
/*
* Constructor: create new scheme by making copy of 'orig'.
* All items within old scheme are also copied (i.e. no shared pointers).
*/
{
int numkeys, i;
WARNING("db_scheme::db_scheme: null original db_scheme");
return;
}
clear_columns(0);
FATAL("db_scheme::db_scheme: cannot allocate space for columns",
}
for (i = 0; i < numkeys; i++) {
clear_columns(i);
WARNING("db_scheme::db_scheme: null column name");
return;
}
clear_columns(i);
"db_scheme::db_scheme: cannot allocate space for column names",
}
}
}
/* Constructor: create new sheme by using information in 'zdesc'. */
{
WARNING("db_scheme::db_scheme: null table obj");
return;
}
/* find out how many searchable columns */
int count = 0, i;
WARNING("db_scheme::db_scheme: no columns in nis table obj");
return;
}
/* find out number of indices */
for (i = 0; i < total_cols; i++) {
++count;
}
if (count == 0) {
"db_scheme::db_scheme: no searchable columns in nis table obj");
return;
}
clear_columns(0);
FATAL("db_scheme::db_scheme: cannot allocate space for keys",
}
int keynum = 0;
for (i = 0; i < total_cols; i++) {
"db_scheme::db_scheme: searchable column cannot have null name");
return;
}
"db_scheme::db_scheme: cannot allocate space for key names",
}
/* don't care about position information for now */
++keynum; /* advance to next key number */
}
}
"db_scheme::db_scheme: incorrect number of searchable columns");
}
}
void
{
int j;
WRITELOCKV(this, "w db_scheme::clear_columns");
if (cols) {
for (j = 0; j < numkeys; j++) {
}
delete cols;
}
WRITEUNLOCKV(this, "wu db_scheme::clear_columns");
}
/* Destructor: delete all keys associated with scheme and scheme itself. */
{
WRITELOCKV(this, "w db_scheme::~db_scheme");
}
/*
* Predicate: return whether given string is one of the index names
* this scheme. If so, return in 'result' the index's number.
*/
{
if (purportedname) {
int i;
int plen;
READUNLOCK(this, TRUE,
"ru db_scheme::find_index");
return (TRUE);
}
}
}
return (FALSE);
}
/* Print out description of table. */
void
{
int i;
READLOCKV(this, "r db_scheme::print");
"\tcolumn=%d, flags=0x%x, key record position=%d, max length=%d\n",
printf("\tdata record position=%d, max length=%d\n",
}
READUNLOCKV(this, "ru db_scheme::print");
}