void iMesh_getNumOfType(iMesh_Instance instance, /*in*/ const iBase_EntitySetHandle entity_set_handle, /*in*/ const int entity_type, int *num_type, int *err) { *err = iBase_SUCCESS; // Get an actual instance pointer iMesh_GRUMMP *pMG = reinterpret_cast(instance); CHECK_FOR_MESH_DATA(pMG, err); // Confirm that the entity_set_handle is valid. This macro will have // to be extended to check part handles, too. CHECK_ENTITY_SET(pMG, entity_set_handle, err); // End additional code if (entity_set_handle == &(pMG->pVM)) { // The case for the entire mesh // Code to do the actual work deleted. Case statement involved. } else { // Have a part handle or set handle // The following block will have to be added compared with existing // code iBase_EntitySetHandle actual_set_handle = entity_set_handle; if (entity_set_handle & 1) { // Part handle actual_set_handle = // look it up; probably an inline micro // function for maintainability. } // End of additional code. // Have an actual entity set argument // Code to do the actual work deleted. Case statement again. } }