Changeset 4230 for zzuf/trunk/src


Ignore:
Timestamp:
Jan 6, 2010, 1:35:49 AM (10 years ago)
Author:
Sam Hocevar
Message:

Make seek() debug information more user-friendly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/libzzuf/lib-stream.c

    r4153 r4230  
    204204    return 0;
    205205#endif
     206}
     207
     208static char const *get_seek_mode_name(int mode)
     209{
     210    /* We don’t use switch/case to avoid duplicate labels */
     211    if (mode == SEEK_CUR)
     212        return "SEEK_CUR";
     213    if (mode == SEEK_SET)
     214        return "SEEK_SET";
     215    if (mode == SEEK_END)
     216        return "SEEK_END";
     217    return "SEEK_???";
    206218}
    207219
     
    339351        } \
    340352        _zz_setpos(fd, newpos); \
    341         debug("%s([%i], %lli, %i) = %i", __func__, \
    342               fd, (long long int)offset, whence, ret); \
     353        debug("%s([%i], %lli, %s) = %i", __func__, \
     354              fd, (long long int)offset, get_seek_mode_name(whence), ret); \
    343355        debug_stream("new", stream); \
    344356    } while(0)
Note: See TracChangeset for help on using the changeset viewer.