File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / entry.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* entry.c - */

#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/entry.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/entry.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: entry.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.0  89/11/23  22:17:30  mrose
 * Release 6.0
 * 
 */

/*
 *                                NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


#include "quipu/util.h"
#include "quipu/entry.h"

oid_table_attr * tab_objectclass;
oid_table_attr * tab_alias;
AttributeType at_objectclass;

directory_free (directory)
Entry directory;
{
Entry ptr;
Entry next;

	if (directory !=  NULLENTRY)
		for ( ptr = directory; ptr !=  NULLENTRY; ptr = next ) {
			next = ptr->e_sibling;
			directory_free (ptr->e_child);
			entry_free (ptr);
		}
}

entry_free (entryptr)
Entry entryptr;
{
	rdn_free (entryptr->e_name);
	as_free (entryptr->e_attributes);

	if (entryptr->e_edbversion !=  NULLCP )
		free (entryptr->e_edbversion);

	if (entryptr->e_dsainfo != NULLDSA)
		free ((char *) entryptr->e_dsainfo);

	free ((char *) entryptr);
}


Entry entry_cpy (entryptr)
register Entry entryptr;
{
register Entry ptr;

	if (entryptr == NULLENTRY)
		return (NULLENTRY);

	ptr = get_default_entry (entryptr->e_parent);
	ptr->e_name = rdn_cpy (entryptr->e_name);
	ptr->e_attributes = as_cpy (entryptr->e_attributes);
	if (entryptr->e_edbversion != NULLCP)
		ptr->e_edbversion = strdup (entryptr->e_edbversion);
	else
		ptr->e_edbversion = NULLCP;
	ptr->e_sibling = entryptr->e_sibling;
	ptr->e_child = entryptr->e_child;
	ptr->e_leaf  = entryptr->e_leaf;
	ptr->e_complete = entryptr->e_complete;
	ptr->e_data = entryptr->e_data;
	ptr->e_lock = entryptr->e_lock;
	ptr->e_allchildrenpresent = entryptr->e_allchildrenpresent;

	/* rest must be set by calling unravel_attributes */
	return (ptr);
}


Entry get_default_entry (parent)
Entry parent;
{
register Entry eptr;

	eptr = entry_alloc();
	eptr->e_leaf = TRUE;
	eptr->e_complete = TRUE;
	eptr->e_data = E_DATA_MASTER;
	eptr->e_parent  = parent;
	return (eptr);
}


check_known_oids ()
{
	/* for efficiency yacc has knowledge of certain oid built in
		   check these are in current table  */

	at_objectclass = AttrT_new (OBJECTCLASS_OID);
	if (at_objectclass == NULLAttrT)
		fatal (-29,"objectClass attribute type missing - check oidtables");
	tab_objectclass = at_objectclass;

	if ( (tab_alias = name2attr (ALIAS_OID)) == NULLTABLE_ATTR)
		fatal (-30,"alias attribute type missing - check oidtables");

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.