/** return ref'd entities */
static void SCHEMA_get_entities_ref( Scope scope, Linked_List result ) {
    Rename * rename;
    DictionaryEntry de;

    if( scope->search_id == __SCOPE_search_id ) {
        return;
    }
    scope->search_id = __SCOPE_search_id;

    ENTITY_MARK++;

    /* fully REF'd schema */
    LISTdo( scope->u.schema->ref_schemas, schema, Schema )
    SCOPE_get_entities( schema, result );
    /* don't go down remote schema's ref_schemas */
    LISTod

    /* partially REF'd schema */
    DICTdo_init( scope->u.schema->refdict, &de );
    while( 0 != ( rename = ( Rename * )DICTdo( &de ) ) ) {
        if( DICT_type == OBJ_ENTITY ) {
            LISTadd( result, rename->object );
        }
    }
}
static void SCHEMA_get_entities_use( Scope scope, Linked_List result ) {
    DictionaryEntry de;
    Rename * rename;

    if( scope->search_id == __SCOPE_search_id ) {
        return;
    }
    scope->search_id = __SCOPE_search_id;

    /* fully USE'd schema */
    LISTdo( scope->u.schema->use_schemas, schema, Schema )
    SCOPE_get_entities( schema, result );
    SCHEMA_get_entities_use( schema, result );
    LISTod

    /* partially USE'd schema */
    if( scope->u.schema->usedict ) {
        DICTdo_init( scope->u.schema->usedict, &de );
        while( 0 != ( rename = ( Rename * )DICTdo( &de ) ) ) {
            LISTadd( result, rename->object );
        }
    }
}
Example #3
0
/**
 ** \param scope scope to examine
 ** \return entities defined locally
 **
 ** Retrieve a list of the entities defined locally in a scope.
 **
 ** \note This function is considerably faster than
 **  SCOPEget_entities_superclass_order(), and should be used whenever
 **  the order of the entities on the list is not important.
 */
Linked_List SCOPEget_entities( Scope scope ) {
    Linked_List result = LISTcreate();
    SCOPE_get_entities( scope, result );
    return( result );
}