extern oid_table OIDTable
[];
extern objectclass ocOIDTable
[];
extern oid_table_attr attrOIDTable
[];
extern int attrNumEntries
;
static table_seq
table_seq_new ();
struct mac_buf
{ /* for handling macros */
oc_macro_add
= add_oc_macro
;
load_obj_hier (sep
,newname
)
LLOG (log_dsap
,LLOG_FATAL
,("hierarchy missing %s",newname
));
if (get_oc_bits (sep
) != OK
) {
LLOG (log_dsap
,LLOG_FATAL
,("(%s)",newname
));
static struct oc_seq
*oc_seq_merge (a
,b
)
register struct oc_seq
*aptr
, *bptr
, *result
, *trail
;
/* start sequence off, make sure 'a' is the first */
switch (objclass_cmp (a
,b
)) {
while ( (aptr
!= NULLOCSEQ
) && (bptr
!= NULLOCSEQ
) ) {
switch (objclass_cmp (aptr
,bptr
)) {
struct oc_seq
* oidseq
= NULLOCSEQ
, *oidseqptr
= oidseq
;
if ((ptr
= index (str
,SEPERATOR
)) == 0) {
LLOG (log_dsap
,LLOG_FATAL
,("must missing"));
while (( ptr2
= index (str
,COMMA
)) != 0) {
oidseqptr
= (struct oc_seq
*) smalloc (sizeof (struct oc_seq
));
if ((oc
= name2oc(str
)) == NULLOBJECTCLASS
) {
LLOG (log_dsap
,LLOG_FATAL
,("unknown objectclass in hierachy %s",str
));
oidseqptr
->os_next
= NULLOCSEQ
;
oidseq
= oc_seq_merge (oidseq
,oidseqptr
);
oidseqptr
= (struct oc_seq
*) smalloc (sizeof (struct oc_seq
));
/* no logging -> never freed */
if ((oc
= name2oc(str
)) == NULLOBJECTCLASS
) {
LLOG (log_dsap
,LLOG_FATAL
,("unknown objectclass in hierachy %s",str
));
oidseqptr
->os_next
= NULLOCSEQ
;
oidseq
= oc_seq_merge (oidseq
,oidseqptr
);
ocOIDTable
[ocNumEntries
].oc_hierachy
= oidseq
;
ocOIDTable
[ocNumEntries
].oc_hierachy
= NULLOCSEQ
;
if ((ptr
= index (str
,SEPERATOR
)) == 0) {
LLOG (log_dsap
,LLOG_FATAL
,("may element missing"));
ocOIDTable
[ocNumEntries
].oc_may
= table_seq_new (ptr
);
ocOIDTable
[ocNumEntries
].oc_must
= table_seq_new (str
);
static table_seq
undo_macro (top
,ptr
)
table_seq trail
= NULLTABLE_SEQ
;
for (i
=0; i
<NumMacro
; i
++)
if (lexequ (macro
[i
].name
,ptr
) == 0) {
tab_top
= table_seq_new (macro
[i
].value
);
for (tab
=tab_top
; tab
!=NULLTABLE_SEQ
; tab
=tab
->ts_next
)
if (trail
!= NULLTABLE_SEQ
) {
LLOG (log_dsap
,LLOG_FATAL
,("can't interpret %s in must/may field",ptr
));
static table_seq
table_seq_new (str
)
table_seq top
= NULLTABLE_SEQ
;
while ((ptr
= index (str
,COMMA
)) != 0) {
if ((at
= name2attr (str
)) == NULLTABLE_ATTR
)
top
= undo_macro (top
,str
);
tptr
= (table_seq
) smalloc (sizeof (*tptr
));
/* no logging -> never freed */
if ((at
= name2attr (str
)) == NULLTABLE_ATTR
)
return (undo_macro (top
,str
));
tptr
= (table_seq
) smalloc (sizeof (*tptr
));
/* no logging -> never freed */
register objectclass
* oc
= &ocOIDTable
[0];
register oid_table_attr
* at
= &attrOIDTable
[0];
register oid_table
* oi
= &OIDTable
[0];
for (i
=0;i
<ocNumEntries
;i
++,oc
++)
(void) printf("\"%s\"\t\t%s\n", oc
->oc_ot
.ot_name
, oc
->oc_ot
.ot_stroid
);
for (i
=0;i
<attrNumEntries
;i
++,at
++)
(void) printf("\"%s\"\t\t%s\n", at
->oa_ot
.ot_name
, at
->oa_ot
.ot_stroid
);
for (i
=0;i
<NumEntries
;i
++,oi
++)
(void) printf("\"%s\"\t\t%s\n", oi
->ot_name
, oi
->ot_stroid
);
(void) strcpy(macro
[NumMacro
].name
,buf
);
(void) strcpy(macro
[NumMacro
++].value
,ptr
);