/* tree_struct.c - Tree Structure utility routines */
static char *rcsid
= "$Header: /f/osi/dsap/common/RCS/tree_struct.c,v 7.2 91/02/22 09:20:34 mrose Interim $";
* $Header: /f/osi/dsap/common/RCS/tree_struct.c,v 7.2 91/02/22 09:20:34 mrose Interim $
* $Log: tree_struct.c,v $
* Revision 7.2 91/02/22 09:20:34 mrose
* Revision 7.1 90/03/15 11:17:42 mrose
* Revision 7.0 89/11/23 21:44:39 mrose
* 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
#include "quipu/syntaxes.h"
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
* result
;
result
= tree_struct_alloc ();
result
->tree_object
= a
->tree_object
;
static tree_struct_cmp (a
,b
)
struct tree_struct
* a
, *b
;
return (b
==NULLTREE
? 0 : -1 );
return ( objclass_cmp(a
->tree_object
,b
->tree_object
));
static tree_struct_print (ps
,tree
,format
)
struct tree_struct
* tree
;
ps_printf (ps
,"%s",oc2name(tree
->tree_object
,oidformat
));
static struct tree_struct
* str2schema (str
)
ts
= tree_struct_alloc ();
if ((ts
->tree_object
= str2oc(str
)) == NULLOBJECTCLASS
) {
parse_error ("invalid oid in schema '%s'",str
);
(void) encode_Quipu_TreeStructureSyntax(&ret_pe
,0,0,NULLCP
,ts
);
static struct tree_struct
* ts_dec (pe
)
if (decode_Quipu_TreeStructureSyntax(pe
,1,NULLIP
,NULLVP
,&ts
) == NOTOK
)
return (struct tree_struct
*)NULL
;
(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
,