Ignore:
Timestamp:
Nov 8, 2006, 5:43:59 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Renamed cucul_export() to cucul_export_memory(), paves the way for a cucul_export_file() but I'm not sure yet this is a good idea.
  • Use the new import/export API in libcaca.
Location:
libcaca/trunk/caca
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca0.c

    r1287 r1306  
    214214cucul_canvas_t *__caca0_load_sprite(char const *file)
    215215{
    216     cucul_buffer_t *buf;
    217216    cucul_canvas_t *cv;
    218217
    219     buf = cucul_load_file(file);
    220     if(!buf)
     218    cv = cucul_create_canvas(0, 0);;
     219    if(cucul_import_file(cv, file, "") < 0)
     220    {
     221        cucul_free_canvas(cv);
    221222        return NULL;
    222     cv = cucul_import_canvas(buf, "");
    223     cucul_free_buffer(buf);
    224     if(!cv)
    225         return NULL;
     223    }
    226224
    227225    return cv;
  • libcaca/trunk/caca/driver_raw.c

    r1233 r1306  
    6767static void raw_display(caca_display_t *dp)
    6868{
    69     cucul_buffer_t *buffer;
     69    void *buffer;
     70    unsigned long int len;
    7071
    71     buffer = cucul_export_canvas(dp->cv, "caca");
    72     fwrite(cucul_get_buffer_data(buffer),
    73            cucul_get_buffer_size(buffer), 1, stdout);
    74     fflush(stdout);
    75     cucul_free_buffer(buffer);
     72    buffer = cucul_export_memory(dp->cv, "caca", &len);
     73    if(!buffer)
     74        return;
     75    fwrite(buffer, len, 1, stdout);
     76    free(buffer);
    7677}
    7778
Note: See TracChangeset for help on using the changeset viewer.