void scs_scan_scbs( SCS_SCAN_FUNC *func, PTR arg ) { char classbuf[ 80 ]; char instbuf[ 80 ]; char valbuf[ 80 ]; i4 lval; PTR ptr; SCD_SCB *scb; i4 operms; instbuf[0] = EOS; STcopy( "exp.scf.scs.scb_ptr", classbuf ); for( lval = sizeof(valbuf); OK == MOgetnext( ~0, sizeof(classbuf), sizeof(instbuf), classbuf, instbuf, &lval, valbuf, &operms ) && STequal( "exp.scf.scs.scb_ptr", classbuf ); lval = sizeof(valbuf) ) { CVaptr( instbuf, &ptr ); scb = (SCD_SCB *)ptr; if( OK != (*func)( scb, arg ) ) break; } }
static void showall(void) { i4 lsbuf; char classid[ MAXCLASSID ]; char instance[ MAXINSTANCE ]; char sbuf[ MAXVAL ]; i4 perms; classid[0] = EOS; instance[0] = EOS; for( lsbuf = sizeof(sbuf); ; lsbuf = sizeof( sbuf ) ) { if( OK != MOgetnext( ~0, sizeof(classid), sizeof(instance), classid, instance, &lsbuf, sbuf, &perms ) ) break; show( classid, instance, sbuf, perms, (PTR)NULL ); } SIprintf("\n"); }
static void drivecol( char *colclassid, DRIVE_FUNC *func, PTR arg ) { STATUS stat; i4 lsbuf; char classid[ MAXCLASSID ]; char instance[ MAXINSTANCE ]; char sbuf[ MAXVAL ]; i4 perms; STcopy( colclassid, classid ); instance[0] = EOS; for( lsbuf = sizeof( sbuf ); (stat = MOgetnext( ~0, sizeof(classid), sizeof(instance), classid, instance, &lsbuf, sbuf, &perms ) ) == OK && STequal( colclassid, classid ) ; lsbuf = sizeof( sbuf ) ) { (*func)( classid, instance, sbuf, perms, arg ); } }
static void driverow( char *instance, char **cols, DRIVE_FUNC *func, PTR arg ) { STATUS stat; char classid[ MAXCLASSID ]; char rinstance[ MAXINSTANCE ]; char sbuf[ MAXVAL ]; i4 lsbuf; i4 perms; if( cols != NULL ) /* get exact columns */ { for( lsbuf = sizeof(sbuf); *cols != NULL && OK == (stat = MOget( ~0, *cols, instance, &lsbuf, sbuf, &perms ) ); cols++, lsbuf = sizeof( sbuf ) ) { (*func)( *cols, instance, sbuf, perms, arg ); } } else /* stupid scan for instance match */ { classid[0] = EOS; rinstance[0] = EOS; for( lsbuf = sizeof(sbuf); OK == MOgetnext( ~0, sizeof(classid), sizeof(rinstance), classid, rinstance, &lsbuf, sbuf, &perms ); lsbuf = sizeof( sbuf ) ) { if( STequal( instance, rinstance ) ) (*func)( classid, rinstance, sbuf, perms, (PTR) NULL ); } } }