Esempio n. 1
0
/** return ref'd entities */
Linked_List SCHEMAget_entities_ref( Scope scope ) {
    Linked_List result = LISTcreate();

    __SCOPE_search_id++;
    ENTITY_MARK++;

    result = LISTcreate();
    SCHEMA_get_entities_ref( scope, result );
    return( result );
}
Linked_List LISTcopy( Linked_List src ) {
    Linked_List dst = LISTcreate();
    LISTdo( src, x, Generic )
    LISTadd( dst, x );
    LISTod
    return dst;
}
void SCHEMAadd_use( Schema cur_schema, Symbol * ref_schema, Symbol * old, Symbol * nnew ) {
    Rename * r = REN_new();
    r->schema_sym = ref_schema;
    r->old = old;
    r->nnew = nnew;
    r->rename_type = use;

    if( !cur_schema->u.schema->uselist ) {
        cur_schema->u.schema->uselist = LISTcreate();
    }
    LISTadd( cur_schema->u.schema->uselist, ( Generic )r );
}
Esempio n. 4
0
void SCHEMAadd_reference( Schema cur_schema, Symbol * ref_schema, Symbol * old, Symbol * snnew ) {
    Rename * r = REN_new();
    r->schema_sym = ref_schema;
    r->old = old;
    r->nnew = snnew;
    r->rename_type = ref;

    if( !cur_schema->u.schema->reflist ) {
        cur_schema->u.schema->reflist = LISTcreate();
    }
    LISTadd_last( cur_schema->u.schema->reflist, ( Generic )r );
}
Esempio n. 5
0
Linked_List
SELgetnew_dmlist( const Type type ) {
    Linked_List complete = SEL_TYPEget_items( type );
    Linked_List newlist = LISTcreate();

    LISTdo( complete, t, Type )

    /*     if t\'s underlying type is not already in newlist, */
    if( ! utype_member( newlist, t, 0 ) ) {
        LISTadd_last( newlist, t );
    }

    LISTod;

    return newlist;

}
Esempio n. 6
0
static void EXPRESS_PATHinit() {
    char * p;
    Dir * dir;
    int done = 0;

    EXPRESS_path = LISTcreate();
    p = getenv( "EXPRESS_PATH" );
    if( !p ) {
        /* if no EXPRESS_PATH, search current directory anyway */
        dir = ( Dir * )scl_malloc( sizeof( Dir ) );
        dir->leaf = dir->full;
        LISTadd( EXPRESS_path, ( Generic )dir );
    } else {
        while( !done ) {
            char * start;   /* start of current dir */
            int length; /* length of dir */
            char * slash;   /* last slash in dir */
            char save;  /* place to character from where we */
            /* temporarily null terminate */

            /* get next directory */
            while( isspace( *p ) ) {
                p++;
            }
            if( *p == '\0' ) {
                break;
            }
            start = p;

            /* find the end of the directory */
            while( *p != '\0' && !isspace( *p ) ) {
                p++;
            }
            save = *p;
            if( *p == 0 ) {
                done = 1;
            } else {
                *p = '\0';
            }
            p++;    /* leave p after terminating null */

            dir = ( Dir * )scl_malloc( sizeof( Dir ) );

            /* if it's just ".", make it as if it was */
            /* just "" to make error messages cleaner */
            if( streq( ".", start ) ) {
                dir->leaf = dir->full;
                LISTadd( EXPRESS_path, ( Generic )dir );
                *( p - 1 ) = save; /* put char back where */
                /* temp null was */
                continue;
            }

            //removed tilde logic; below line is all that's left
            length = ( p - 1 ) - start;

            /* if slash present at end, don't add another */
            slash = strrchr( start, '/' );
            if( slash && ( slash[1] == '\0' ) ) {
                strcpy( dir->full, start );
                dir->leaf = dir->full + length;
            } else {
                sprintf( dir->full, "%s/", start );
                dir->leaf = dir->full + length + 1;
            }
            LISTadd( EXPRESS_path, ( Generic )dir );

            *( p - 1 ) = save; /* put char back where temp null was */
        }
    }
}
Esempio n. 7
0
/**
 * \sa SCOPE_get_functions()
 */
Linked_List SCOPEget_functions( Scope scope ) {
    Linked_List result = LISTcreate();
    SCOPE_get_functions( scope, result );
    return( result );
}
Esempio n. 8
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 );
}