Ignore:
Timestamp:
May 18, 2008, 8:13:45 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Start working on the internal code documentation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/debug.c

    r2326 r2336  
    3939extern int _zz_debugfd;
    4040
     41/**
     42 * Helper macro to write an integer value to a given file descriptor,
     43 * either in base 10 or in hexadecimal.
     44 */
    4145#define WRITE_INT(fd, i, base) \
    4246    do \
     
    5357    } while(0)
    5458
     59/**
     60 * Format a string, printf-like, and write the resulting data to zzuf's
     61 * debug file descriptor _zz_debugfd. If the debug file descriptor is
     62 * still -1, this function does nothing.
     63 *
     64 * This function's code is roughly equivalent to the following *printf
     65 * calls, except it only uses signal-safe functions:
     66 *  - fprintf(stderr, "** zzuf debug ** ");
     67 *  - vfprintf(stderr, format, args);
     68 *  - fprintf(stderr, "\n");
     69 */
    5570void _zz_debug(char const *format, ...)
    5671{
     
    6580    saved_errno = errno;
    6681    va_start(args, format);
    67 
    68 #if 0
    69     /* This function's code is equivalent to the following *printf calls,
    70      * except it only uses signal-safe functions */
    71     fprintf(stderr, "** zzuf debug ** ");
    72     vfprintf(stderr, format, args);
    73     fprintf(stderr, "\n");
    74 #endif
    7582
    7683    write(_zz_debugfd, "** zzuf debug ** ", 17);
Note: See TracChangeset for help on using the changeset viewer.