/*
* 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
*/
/*
* db_scheme_c.x
*
* Copyright 2015 Gary Mills
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#if RPC_XDR
%#include "ldap_xdr.h"
#endif /* RPC_XDR */
#if RPC_HDR
%#ifndef _DB_SCHEMA_H
%#define _DB_SCHEMA_H
#ifdef USINGC
%#include "db_item_c.h"
%#include "db_entry_c.h"
#else
%#include "db_item.h"
%#include "db_entry.h"
#endif /* USINGC */
const DB_KEY_CASE = TA_CASE;
#endif /* RPC_HDR */
%
%#include "nisdb_rw.h"
%
%/* Positional information of where field starts within record
% and its maximum length in terms of bytes. */
struct db_posn_info {
short int start_column;
short int max_len;
};
%/* Description of a key */
struct db_key_desc {
unsigned long key_flags; /* corresponds to tc_flags in table_col defn */
int column_number; /* column within data structure */
short int store_type; /* ISAM or SS ? maybe useless */
};
%/* Description of the data field. */
struct db_data_desc {
short int store_type; /* ISAM or SS ? maybe useless */
};
%/* A scheme is a description of the fields of a table. */
#ifdef USINGC
struct db_scheme {
db_key_desc keys<>;
short int max_columns; /* applies to data only ? */
};
typedef struct db_scheme * db_scheme_p;
#endif /* USINGC */
#endif /* RPC_HDR */
#ifndef USINGC
#ifdef RPC_HDR
%
% protected:
% struct {
% int keys_len;
% db_key_desc *keys_val;
% } keys;
% short int max_columns; /* applies to data only ? */
% db_data_desc data;
% STRUCTRWLOCK(scheme);
%
% public:
%/* Accessor: return number of keys in scheme. */
%
%/* Accessor: return location of array of key_desc's. */
%
%/* Constructor: create empty scheme */
% db_scheme() {
% (void) __nisdb_rwinit(&scheme_rwlock);
% }
%
%/* Constructor: create new scheme by making copy of 'orig'.
% All items within old scheme are also copied (i.e. no shared pointers). */
%
%/* Constructor: create new sheme by using information in 'zdesc'. */
%
%/* Destructor: delete all keys associated with scheme and scheme itself. */
% ~db_scheme();
%
%/* Free space occupied by columns. */
% void clear_columns( int );
%
%/* Predicate: return whether given string is one of the index names
% of this scheme. If so, return in 'result' the index's number. */
% bool_t find_index( char*, int* );
%
%/* Print out description of table. */
% void print();
%
% ulong_t oldstructsize(void) {
% }
%
%/* Locking methods */
%
% int acqexcl(void) {
% }
%
% int relexcl(void) {
% }
%
% int acqnonexcl(void) {
% }
%
% int relnonexcl(void) {
% }
%};
#endif /* RPC_HDR */
#endif /* USINGC */
#if RPC_HDR
%#endif /* _DB_SCHEMA_H */
#endif /* RPC_HDR */