STATUS ADFmo_attach_adg(void) { STATUS status; status = MOclassdef(MAXI2, ADFmo_adg_dt_classes); if (status == OK) status = MOclassdef(MAXI2, ADFmo_adg_op_classes); if (status == OK) status = MOclassdef(MAXI2, ADFmo_adg_fi_classes); if (status == OK) status = MOclassdef(MAXI2, ADFmo_adu_pat_control); return (status); }
static VOID gcb_init_mib( VOID ) { MO_CLASS_DEF *class_def; for( class_def = &gcb_classes[0]; class_def->classid; class_def++ ) if( class_def->cdata == (PTR)-1 ) class_def->cdata = (PTR)IIGCc_global; MOclassdef( MAXI2, gcb_classes ); return; }
VOID MO_once(void) { i4 state; if( MO_classes == NULL ) { /* tricky recursion problem here -- i_sem wants to do an attach, but we aren't ready. This means no monitoring of MO_sem, sigh. FIXME. */ state = MO_disabled; MO_disabled = MO_DISABLE; (VOID) MUi_semaphore( &MO_sem ); MUn_semaphore( &MO_sem, "MO" ); MO_semcnt = 0; MO_disabled = (state) ? TRUE : FALSE; (VOID) MO_mutex(); MUn_semaphore( &MO_sem, "MO" ); MO_classes = SPinit( &MOclass_tree, STcompare ); MO_instances = SPinit( &MOinstance_tree, MO_instance_compare ); MO_strings = SPinit( &MOstring_tree, STcompare ); MO_monitors = SPinit( &MOmonitor_tree, MO_mon_compare ); (VOID) MO_unmutex(); /* MO classes */ (void) MOclassdef( MAXI2, MO_cdefs ); (void) MOclassdef( MAXI2, MO_mem_classes ); (void) MOclassdef( MAXI2, MO_meta_classes ); (void) MOclassdef( MAXI2, MO_mon_classes ); (void) MOclassdef( MAXI2, MO_str_classes ); (void) MOclassdef( MAXI4, MO_tree_classes ); /* tables */ MO_classes->name = "mo_classes"; MO_instances->name = "mo_instances"; MO_strings->name = "mo_strings"; MO_monitors->name = "mo_monitors"; (void) MOsptree_attach( MO_classes ); (void) MOsptree_attach( MO_instances ); (void) MOsptree_attach( MO_strings ); (void) MOsptree_attach( MO_monitors ); } }
static void addusertables(void) { i4 i; char inststr[ 10 ]; MO_INSTANCE_DEF *idp; STATUS ret_stat; (VOID) MOclassdef( MAXI2, mib_cdefs ); for( idp = mib_idefs; idp->classid != NULL; idp++ ) idp->instance = inststr; for( i = 1; i < MAXUSERS ; i++ ) { CVlx( i * 64, inststr ); ret_stat = tbl_attach( MAXI2, mib_idefs ); SIprintf("stat attaching user %s: %s\n", inststr, er_decode( ret_stat ) ); } }
/*{ ** Name: GM_pmib_init - initialize global place MIB ** ** Description: ** Defines the classes for the place (GCN) mib. Should ** only need to call this once. ** ** Re-entrancy: ** yes. ** ** Inputs: ** none. ** ** Outputs: ** none. ** ** Returns: ** OK ** ** History: ** 9-oct-92 (daveb) ** documented. */ STATUS GM_pmib_init(void) { return( MOclassdef( MAXI2, GM_pmib_classes ) ); }
VOID gcd_init_mib( VOID ) { MOclassdef( gcd_class_cnt, gcd_classes ); return; }
STATUS GM_scb_startup(void) { return( MOclassdef( MAXI2, GM_scb_classes ) ); }
STATUS MO_oid_set(i4 offset, i4 luserbuf, char *userbuf, i4 objsize, PTR object ) { STATUS cl_stat = OK; MO_CLASS *cp = (MO_CLASS *)object; MO_CLASS *twin_cp; MO_INSTANCE *ip; MO_INSTANCE *next_ip; MO_CLASS_DEF mo_class; do { /* if it has a twin already, error */ if( cp->twin != NULL ) { cl_stat = MO_NO_WRITE; break; } mo_class.flags = MO_CLASSID_VAR | cp->cflags; mo_class.classid = userbuf; mo_class.size = cp->size; mo_class.perms = cp->perms; mo_class.index = cp->index; mo_class.get = cp->get; mo_class.set = cp->set; mo_class.cdata = cp->cdata; mo_class.idx = cp->idx; if( OK != (cl_stat = MOclassdef( 1, &mo_class ) ) ) break; if( OK != (cl_stat = MO_getclass( userbuf, &twin_cp ) ) ) break; cp->twin = twin_cp; twin_cp->twin = cp; twin_cp->monitor = cp->monitor; /* now attach all objects of the class as twins */ for( ip = (MO_INSTANCE *)SPfhead( MO_instances ); ip != NULL ; ip = next_ip ) { next_ip = (MO_INSTANCE *)SPfnext( (SPBLK *)ip ); if( ip->classdef == cp ) { /* create one for the twin. */ cl_stat = MOattach( 0, twin_cp->node.key, ip->instance, ip->idata ); if( cl_stat != OK ) break; if( next_ip->classdef != cp ) break; } } } while( FALSE ); return( cl_stat ); }
/* ** Name: ddc_define ** ** Description: ** Define the MO class for wsm active sessions. ** ** ** Inputs: ** None. ** ** Outputs: ** None. ** ** Returns: ** OK successfully completed ** MO_NO_MEMORY MO_MEM_LIMIT exceeded ** MO_NULL_METHOD null get/set methods supplied when permission state ** they are allowed ** !OK system specific error ** ** History: ** 13-Jul-98 (fanra01) ** Created. ** */ STATUS ddc_define (void) { return(MOclassdef (MAXI2, db_classes)); }