Changeset 538 for trunk/thune/urlan.c

Show
Ignore:
Timestamp:
06/14/08 16:30:57 (6 months ago)
Author:
krobillard
Message:

Added get/words, isGlobalIndex(), and 10 reserved atoms.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/urlan.c

    r511 r538  
    308308    FIXED_ATOM( "case",   4, UR_ATOM_CASE ) 
    309309    FIXED_ATOM( "reader-macros", 13, UR_ATOM_READER_MACROS ) 
     310    FIXED_ATOM( "words",  5, UR_ATOM_WORDS ) 
     311    //FIXED_ATOM( "key-values", 10, UR_ATOM_KEY_VALUES ) 
     312 
     313    // ^^ Add new fixed atoms here ^^ 
     314    // Reduce ATOMS_RESERVED for each new FIXED_ATOM to keep the number of 
     315    // atoms constant.  When it drops below zero then it should be reset to 
     316    // 10 and all library users who have their own fixed atoms must recompile. 
     317 
     318#define ATOMS_RESERVED  10 
     319    { 
     320        static char resFixed[13] = "_res-fixed-0"; 
     321        int i; 
     322        for( i = 0; i < ATOMS_RESERVED; ++i ) 
     323        { 
     324            resFixed[11] = i + '0'; 
     325            ur_intern( resFixed, 12 ); 
     326        } 
     327    } 
    310328 
    311329#if MAKE_ATOM_HEADER 
     
    826844UBlock* ur_blockPtrT( UThread* ut, UIndex n) 
    827845{ 
    828    if( n < 0 ) 
     846   if( isGlobalIndex(n) ) 
    829847        return (((UBlock*) ut->env->blocks.arr.ptr.v) - n); 
    830848    return (((UBlock*) ut->blocks.arr.ptr.v) + n); 
     
    834852UArray* ur_binPtrT( UThread* ut, UIndex n ) 
    835853{ 
    836    if( n < 0 ) 
     854   if( isGlobalIndex(n) ) 
    837855        return (((UArray*) ut->env->bin.arr.ptr.v) - n); 
    838856    return (((UArray*) ut->bin.arr.ptr.v) + n); 
     
    842860UResource* ur_resPtrT( UThread* ut, UIndex n ) 
    843861{ 
    844    if( n < 0 ) 
     862   if( isGlobalIndex(n) ) 
    845863        return (((UResource*) ut->env->resources.arr.ptr.v) - n); 
    846864    return (((UResource*) ut->resources.arr.ptr.v) + n);