|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T t
Length: 2328 (0x918)
Types: TextFile
Names: »tree_struct.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
└─⟦35176feda⟧ »EurOpenD22/isode/isode-6.tar.Z«
└─⟦de7628f85⟧
└─⟦this⟧ »isode-6.0/dsap/common/tree_struct.c«
/* tree_struct.c - Tree Structure utility routines */
#ifndef lint
static char *rcsid = "$Header: /f/osi/dsap/common/RCS/tree_struct.c,v 7.0 89/11/23 21:44:39 mrose Rel $";
#endif
/*
* $Header: /f/osi/dsap/common/RCS/tree_struct.c,v 7.0 89/11/23 21:44:39 mrose Rel $
*
*
* $Log: tree_struct.c,v $
* Revision 7.0 89/11/23 21:44:39 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.
*
*/
/* LINTLIBRARY */
#include "quipu/util.h"
#include "quipu/entry.h"
extern int oidformat;
/* ARGSUSED */
static tree_struct_free (ptr)
struct tree_struct * ptr;
{
/* don't free objectclass - in static table */
;
}
static struct tree_struct * tree_struct_cpy (a)
struct tree_struct * a;
{
struct tree_struct * result;
result = tree_struct_alloc ();
result->tree_object = a->tree_object;
return (result);
}
static tree_struct_cmp (a,b)
struct tree_struct * a, *b;
{
if (a == NULLTREE)
return (b==NULLTREE ? 0 : -1 );
if (b == NULLTREE)
return (1);
return ( objclass_cmp(a->tree_object,b->tree_object));
}
/* ARGSUSED */
static tree_struct_print (ps,tree,format)
register PS ps;
struct tree_struct * tree;
int format;
{
ps_printf (ps,"%s",oc2name(tree->tree_object,oidformat));
}
static struct tree_struct * str2schema (str)
char * str;
{
struct tree_struct * ts;
ts = tree_struct_alloc ();
if ((ts->tree_object = name2oc(str)) == NULLOBJECTCLASS) {
parse_error ("invalid oid in schema '%s'",str);
free ((char *) ts);
return (NULLTREE);
}
return (ts);
}
static PE ts_enc (ts)
struct tree_struct * ts;
{
PE ret_pe;
(void) encode_Quipu_TreeStructureSyntax(&ret_pe,0,0,NULLCP,ts);
return (ret_pe);
}
static struct tree_struct * ts_dec (pe)
PE pe;
{
struct tree_struct * ts;
if (decode_Quipu_TreeStructureSyntax(pe,1,NULLIP,NULLVP,&ts) == NOTOK)
return (struct tree_struct *)NULL;
return (ts);
}
schema_syntax ()
{
(void) add_attribute_syntax ("schema",
(IFP) ts_enc, (IFP) ts_dec,
(IFP) str2schema, tree_struct_print,
(IFP) tree_struct_cpy, tree_struct_cmp,
tree_struct_free, NULLCP,
NULLIFP, FALSE );
}