Changeset 162 for trunk/thune/make.c
- Timestamp:
- 05/27/06 21:22:22 (3 years ago)
- Files:
-
- 1 modified
-
trunk/thune/make.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/make.c
r157 r162 128 128 ur_arrayInit( ptr, sizeof(char), size ); 129 129 return ur_binN( ptr ); 130 } 131 132 133 /* 134 Returns zero if cell can not be converted. 135 */ 136 UIndex ur_makeBinaryFrom( const UCell* cell ) 137 { 138 char* cpA; 139 char* cpB; 140 UIndex binN = 0; 141 142 if( ur_stringSlice( cell, &cpA, &cpB ) ) 143 { 144 int count; 145 int size; 146 UBinary* bin; 147 148 count = cpB - cpA; 149 size = count * ur_encCharSize( cell ); 150 binN = ur_makeBinary( size ); 151 if( size ) 152 { 153 bin = ur_binPtr( binN ); 154 memCpy( bin->ptr.b, cpA, size ); 155 bin->used = count; 156 } 157 } 158 159 return binN; 130 160 } 131 161 … … 200 230 Returns non-zero if identical up to end of either string. 201 231 */ 202 static int strEqual( const char* a, const char* b, int len )232 int memEqual( const char* a, const char* b, int len ) 203 233 { 204 234 const char* end = a + len; … … 231 261 else if( len == 3 ) 232 262 { 233 if( strEqual( cp, "tab", 3 ) )263 if( memEqual( cp, "tab", 3 ) ) 234 264 return '\t'; 235 if( strEqual( cp, "esc", 3 ) )265 if( memEqual( cp, "esc", 3 ) ) 236 266 return 27; 237 267 } 238 268 else if( len == 4 ) 239 269 { 240 if( strEqual( cp, "line", 4 ) )270 if( memEqual( cp, "line", 4 ) ) 241 271 return '\n'; 242 if( strEqual( cp, "page", 4 ) )272 if( memEqual( cp, "page", 4 ) ) 243 273 return '\f'; 244 if( strEqual( cp, "back", 4 ) )274 if( memEqual( cp, "back", 4 ) ) 245 275 return '\b'; 246 if( strEqual( cp, "bell", 4 ) )276 if( memEqual( cp, "bell", 4 ) ) 247 277 return '\a'; 248 if( strEqual( cp, "null", 4 ) )278 if( memEqual( cp, "null", 4 ) ) 249 279 return '\0'; 250 280 } … … 376 406 static void _setBitsetStr( uint8_t* bits, const UCell* from ) 377 407 { 378 UChar* it;379 UChar* end;408 char* it; 409 char* end; 380 410 UBinary* src = ur_bin(from); 381 411 … … 630 660 UR_CALL_PUB( uc_make ) 631 661 { 632 UChar* spA;633 UChar* spB;662 char* spA; 663 char* spB; 634 664 UCell* res; 635 665 int argc = 1; … … 663 693 { 664 694 ur_setType( res, UT_OPCODE ); 665 ur_opcode(res) = ur_int(ur_s_next(res));666 ur_ opcodeAtom(res)= ur_atom(tos);695 ur_opcode(res) = ur_int(ur_s_next(res)); 696 ur_atom(res) = ur_atom(tos); 667 697 } 668 698 break;
