Changeset 2406 for libcaca/trunk/cucul/figfont.c
- Timestamp:
- Jun 15, 2008, 3:50:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/cucul/figfont.c
r2305 r2406 302 302 303 303 /* Open font: if not found, try .tlf, then .flf */ 304 f = _cucul_file_open(path, "r");304 f = cucul_file_open(path, "r"); 305 305 #if !defined __KERNEL__ && defined HAVE_SNPRINTF 306 306 … … 313 313 snprintf(altpath, 2047, "%s.tlf", path); 314 314 altpath[2047] = '\0'; 315 f = _cucul_file_open(altpath, "r");315 f = cucul_file_open(altpath, "r"); 316 316 } 317 317 if(!f) … … 319 319 snprintf(altpath, 2047, "%s.flf", path); 320 320 altpath[2047] = '\0'; 321 f = _cucul_file_open(altpath, "r");321 f = cucul_file_open(altpath, "r"); 322 322 } 323 323 #endif … … 333 333 ff->full_layout = 0; 334 334 ff->codetag_count = 0; 335 _cucul_file_gets(buf, 2048, f);335 cucul_file_gets(f, buf, 2048); 336 336 if(sscanf(buf, "%*[ft]lf2a%6s %u %u %u %i %u %u %u %u\n", hardblank, 337 337 &ff->height, &ff->baseline, &ff->max_length, … … 340 340 { 341 341 debug("figfont error: `%s' has invalid header: %s", path, buf); 342 _cucul_file_close(f);342 cucul_file_close(f); 343 343 free(ff); 344 344 seterrno(EINVAL); … … 352 352 debug("figfont error: `%s' has invalid layout %i/%u", 353 353 path, ff->old_layout, ff->full_layout); 354 _cucul_file_close(f);354 cucul_file_close(f); 355 355 free(ff); 356 356 seterrno(EINVAL); … … 362 362 /* Skip comment lines */ 363 363 for(i = 0; i < comment_lines; i++) 364 _cucul_file_gets(buf, 2048, f);364 cucul_file_gets(f, buf, 2048); 365 365 366 366 /* Read mandatory characters (32-127, 196, 214, 220, 228, 246, 252, 223) … … 369 369 ff->lookup = NULL; 370 370 371 for(i = 0, size = 0; ! _cucul_file_eof(f); ff->glyphs++)371 for(i = 0, size = 0; !cucul_file_eof(f); ff->glyphs++) 372 372 { 373 373 if((ff->glyphs % 2048) == 0) … … 386 386 else 387 387 { 388 if( _cucul_file_gets(buf, 2048, f) == NULL)388 if(cucul_file_gets(f, buf, 2048) == NULL) 389 389 break; 390 390 … … 397 397 { 398 398 for(j = 0; j < ff->height; j++) 399 _cucul_file_gets(buf, 2048, f);399 cucul_file_gets(f, buf, 2048); 400 400 continue; 401 401 } … … 424 424 data = realloc(data, size += 2048); 425 425 426 _cucul_file_gets(data + i, 2048, f);426 cucul_file_gets(f, data + i, 2048); 427 427 i = (uintptr_t)strchr(data + i, 0) - (uintptr_t)data; 428 428 } 429 429 } 430 430 431 _cucul_file_close(f);431 cucul_file_close(f); 432 432 433 433 if(ff->glyphs < EXT_GLYPHS)
Note: See TracChangeset
for help on using the changeset viewer.