const char * AccessType( Type t ) { Class_Of_Type class; static char nm [BUFSIZ]; strncpy( nm, TypeName( t ), BUFSIZ - 4 ); if( TYPEis_entity( t ) ) { strcat( nm, "_ptr" ); return nm; } else if( TYPEis_select( t ) || TYPEis_aggregate( t ) ) { strcat( nm, "_ptr" ); return nm; } class = TYPEget_type( t ); if( class == enumeration_ ) { strncpy( nm, TypeName( t ), BUFSIZ - 2 ); strcat( nm, "_var" ); return nm; } if( class == logical_ ) { strncpy( nm, "Logical", BUFSIZ - 2 ); } /* case TYPE_BOOLEAN: */ if( class == boolean_ ) { strncpy( nm, "Boolean", BUFSIZ - 2 ); } return nm; }
/******************* duplicate_in_express_list determines if the given "link's" underlying type is a multiple member of the list. RETURNS 1 if true, else 0. *******************/ int duplicate_in_express_list( const Linked_List list, const Type check ) { if( TYPEis_entity( check ) ) { return FALSE; } /* entities are never the same */ LISTdo( list, t, Type ) if( t == check ) { ; /* don\'t compare check to itself */ } else { return TRUE; /* other things in the list conflict */ } LISTod; return FALSE; }