Ignore:
Timestamp:
Jun 15, 2008, 3:50:02 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Export cucul_file_t operations in the public header.
  • Implement cucul_file_read() and cucul_file_write().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/figfont.c

    r2305 r2406  
    302302
    303303    /* Open font: if not found, try .tlf, then .flf */
    304     f = _cucul_file_open(path, "r");
     304    f = cucul_file_open(path, "r");
    305305#if !defined __KERNEL__ && defined HAVE_SNPRINTF
    306306
     
    313313        snprintf(altpath, 2047, "%s.tlf", path);
    314314        altpath[2047] = '\0';
    315         f = _cucul_file_open(altpath, "r");
     315        f = cucul_file_open(altpath, "r");
    316316    }
    317317    if(!f)
     
    319319        snprintf(altpath, 2047, "%s.flf", path);
    320320        altpath[2047] = '\0';
    321         f = _cucul_file_open(altpath, "r");
     321        f = cucul_file_open(altpath, "r");
    322322    }
    323323#endif
     
    333333    ff->full_layout = 0;
    334334    ff->codetag_count = 0;
    335     _cucul_file_gets(buf, 2048, f);
     335    cucul_file_gets(f, buf, 2048);
    336336    if(sscanf(buf, "%*[ft]lf2a%6s %u %u %u %i %u %u %u %u\n", hardblank,
    337337              &ff->height, &ff->baseline, &ff->max_length,
     
    340340    {
    341341        debug("figfont error: `%s' has invalid header: %s", path, buf);
    342         _cucul_file_close(f);
     342        cucul_file_close(f);
    343343        free(ff);
    344344        seterrno(EINVAL);
     
    352352        debug("figfont error: `%s' has invalid layout %i/%u",
    353353                path, ff->old_layout, ff->full_layout);
    354         _cucul_file_close(f);
     354        cucul_file_close(f);
    355355        free(ff);
    356356        seterrno(EINVAL);
     
    362362    /* Skip comment lines */
    363363    for(i = 0; i < comment_lines; i++)
    364         _cucul_file_gets(buf, 2048, f);
     364        cucul_file_gets(f, buf, 2048);
    365365
    366366    /* Read mandatory characters (32-127, 196, 214, 220, 228, 246, 252, 223)
     
    369369    ff->lookup = NULL;
    370370
    371     for(i = 0, size = 0; !_cucul_file_eof(f); ff->glyphs++)
     371    for(i = 0, size = 0; !cucul_file_eof(f); ff->glyphs++)
    372372    {
    373373        if((ff->glyphs % 2048) == 0)
     
    386386        else
    387387        {
    388             if(_cucul_file_gets(buf, 2048, f) == NULL)
     388            if(cucul_file_gets(f, buf, 2048) == NULL)
    389389                break;
    390390
     
    397397            {
    398398                for(j = 0; j < ff->height; j++)
    399                     _cucul_file_gets(buf, 2048, f);
     399                    cucul_file_gets(f, buf, 2048);
    400400                continue;
    401401            }
     
    424424                data = realloc(data, size += 2048);
    425425
    426             _cucul_file_gets(data + i, 2048, f);
     426            cucul_file_gets(f, data + i, 2048);
    427427            i = (uintptr_t)strchr(data + i, 0) - (uintptr_t)data;
    428428        }
    429429    }
    430430
    431     _cucul_file_close(f);
     431    cucul_file_close(f);
    432432
    433433    if(ff->glyphs < EXT_GLYPHS)
Note: See TracChangeset for help on using the changeset viewer.