Changeset 274 for trunk/thune/encoding.c

Show
Ignore:
Timestamp:
09/11/06 16:04:02 (2 years ago)
Author:
krobillard
Message:

Thune - Added UDS sub-project.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/thune/encoding.c

    r184 r274  
    1919 
    2020 
     21#include <urlan.h> 
    2122/* 
    22 #include <urlan.h> 
    2323#include <urlan_atoms.h> 
    2424*/ 
     
    2626 
    2727int ur_encodingCharSize[ UR_ENC_COUNT ] = { 1, 1, 2 }; 
    28  
    29  
    30 // (str -- enc) 
    31 UR_CALL( uc_encodingQ ) 
    32 { 
    33     UR_CALL_UNUSED_TH 
    34  
    35     if( ur_is(tos, UT_STRING) ) 
    36     { 
    37         UAtom atom = UR_ATOM_ASCII; 
    38  
    39         switch( ur_encoding(tos) ) 
    40         { 
    41             //case UR_ENC_ASCII: atom = UR_ATOM_ASCII; break; 
    42             case UR_ENC_UTF8:  atom = UR_ATOM_UTF8;  break; 
    43             case UR_ENC_UTF16: atom = UR_ATOM_UTF16; break; 
    44         } 
    45  
    46         ur_initType(tos, UT_WORD); 
    47         ur_setUnbound(tos, atom); 
    48     } 
    49     else 
    50     { 
    51         ur_initType(tos, UT_NONE); 
    52     } 
    53 } 
    5428 
    5529 
     
    7549 
    7650 
     51#ifndef UR_CONFIG_UDS 
    7752/* 
    7853   Returns number of characters copied. 
     
    159134 
    160135 
     136// (str -- enc) 
     137UR_CALL( uc_encodingQ ) 
     138{ 
     139    UR_CALL_UNUSED_TH 
     140 
     141    if( ur_is(tos, UT_STRING) ) 
     142    { 
     143        UAtom atom = UR_ATOM_ASCII; 
     144 
     145        switch( ur_encoding(tos) ) 
     146        { 
     147            //case UR_ENC_ASCII: atom = UR_ATOM_ASCII; break; 
     148            case UR_ENC_UTF8:  atom = UR_ATOM_UTF8;  break; 
     149            case UR_ENC_UTF16: atom = UR_ATOM_UTF16; break; 
     150        } 
     151 
     152        ur_initType(tos, UT_WORD); 
     153        ur_setUnbound(tos, atom); 
     154    } 
     155    else 
     156    { 
     157        ur_initType(tos, UT_NONE); 
     158    } 
     159} 
     160#endif 
     161 
     162 
    161163/* EOF */