| | 4631 | | pvm_getmboxinfo(pattern, nclasses, classes) |
| | 4632 | | char *pattern; |
| | 4633 | | int *nclasses; |
| | 4634 | | struct pvmmboxinfo **classes; |
| | 4635 | | { |
| | 4636 | | static struct pvmmboxinfo *clist = (struct pvmmboxinfo *) NULL;
|
| | 4637 | | static int nclist = 0; |
| | 4638 | | |
| | 4639 | | int sbf, rbf, cc; |
| | 4640 | | int i, j; |
| | 4641 | | TEV_DECLS
|
| | 4642 | | |
| | 4643 | | if (TEV_EXCLUSIVE) {
|
| | 4644 | | if (TEV_DO_TRACE(TEV_GETMBOXINFO,TEV_EVENT_ENTRY)) {
|
| | 4645 | | TEV_PACK_STRING( TEV_DID_CN, TEV_DATA_SCALAR,
|
| | 4646 | | pattern ? pattern : "", 1, 1 ); |
| | 4647 | | TEV_FIN;
|
| | 4648 | | } |
| | 4649 | | } |
| | 4650 | | |
| | 4651 | | if ( !pattern ) |
| | 4652 | | pattern = ""; |
| | 4653 | | |
| | 4654 | | if ( clist ) { |
| | 4655 | | for ( i=0 ; i < nclist ; i++ ) { |
| | 4656 | | if ( clist[i].mi_name ) |
| | 4657 | | PVM_FREE( clist[i].mi_name );
|
| | 4658 | | if ( clist[i].mi_indices ) |
| | 4659 | | PVM_FREE( clist[i].mi_indices );
|
| | 4660 | | if ( clist[i].mi_owners ) |
| | 4661 | | PVM_FREE( clist[i].mi_owners );
|
| | 4662 | | if ( clist[i].mi_flags ) |
| | 4663 | | PVM_FREE( clist[i].mi_flags );
|
| | 4664 | | } |
| | 4665 | | PVM_FREE( clist );
|
| | 4666 | | clist = (struct pvmmboxinfo *) NULL;
|
| | 4667 | | nclist = 0; |
| | 4668 | | } |
| | 4669 | | |
| | 4670 | | if ( !(cc = BEATASK) )
|
| | 4671 | | { |
| | 4672 | | sbf = pvm_setsbuf( pvm_mkbuf( PvmDataFoo ) );
|
| | 4673 | | rbf = pvm_setrbuf( 0 ); |
| | 4674 | | cc = TMDB_NAMES;
|
| | 4675 | | pvm_pkint( &cc, 1, 1 ); |
| | 4676 | | pvm_pkint( &pvmmytid, 1, 1 ); |
| | 4677 | | pvm_pkstr( pattern ); |
| | 4678 | | cc = 0; |
| | 4679 | | pvm_pkint( &cc, 1, 1 ); |
| | 4680 | | pvm_pkint( &cc, 1, 1 ); |
| | 4681 | | if ( (cc = msendrecv( TIDPVMD, TM_DB, SYSCTX_TM )) > 0 ) {
|
| | 4682 | | pvm_upkint( &cc, 1, 1 ); |
| | 4683 | | if ( cc >= 0 ) { |
| | 4684 | | pvm_upkint( &nclist, 1, 1 ); |
| | 4685 | | clist = TALLOC( nclist, struct pvmmboxinfo, "classes" );
|
| | 4686 | | for ( i=0 ; i < nclist ; i++ ) { |
| | 4687 | | pvmupkstralloc( &(clist[i].mi_name) ); |
| | 4688 | | pvm_upkint( &(clist[i].mi_nentries), 1, 1 ); |
| | 4689 | | clist[i].mi_indices = TALLOC( clist[i].mi_nentries,
|
| | 4690 | | int, "class_indices" ); |
| | 4691 | | clist[i].mi_owners = TALLOC( clist[i].mi_nentries,
|
| | 4692 | | int, "class_owners" ); |
| | 4693 | | clist[i].mi_flags = TALLOC( clist[i].mi_nentries,
|
| true | 4694 | | int, "class_flags" ); |