Ignore:
Timestamp:
Apr 25, 2006, 11:59:58 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Check for <errno.h>.
  • Started changing function prototypes so that they return an integer instead of void, just in case they might fail.
File:
1 edited

Legend:

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

    r859 r870  
    2828/** \brief Draw a box on the canvas using the given character.
    2929 *
     30 *  This function never fails.
     31 *
    3032 *  \param cv The handle to the libcucul canvas.
    3133 *  \param x1 X coordinate of the upper-left corner of the box.
     
    3436 *  \param y2 Y coordinate of the lower-right corner of the box.
    3537 *  \param str UTF-8 string containing the character to use to draw the box.
    36  *  \return void
     38 *  \return This function always returns 0.
    3739 */
    38 void cucul_draw_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    39                     char const *str)
     40int cucul_draw_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
     41                   char const *str)
    4042{
    4143    cucul_draw_line(cv, x1, y1, x1, y2, str);
     
    4345    cucul_draw_line(cv, x2, y2, x2, y1, str);
    4446    cucul_draw_line(cv, x2, y1, x1, y1, str);
     47
     48    return 0;
    4549}
    4650
    4751/** \brief Draw a thin box on the canvas.
     52 *
     53 *  This function never fails.
    4854 *
    4955 *  \param cv The handle to the libcucul canvas.
     
    5258 *  \param x2 X coordinate of the lower-right corner of the box.
    5359 *  \param y2 Y coordinate of the lower-right corner of the box.
    54  *  \return void
     60 *  \return This function always returns 0.
    5561 */
    56 void cucul_draw_thin_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2)
     62int cucul_draw_thin_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2)
    5763{
    5864    int x, y, xmax, ymax;
     
    7480
    7581    if(x2 < 0 || y2 < 0 || x1 > xmax || y1 > ymax)
    76         return;
     82        return 0;
    7783
    7884    /* Draw edges */
     
    105111    if(x2 <= xmax && y2 <= ymax)
    106112        _cucul_putchar32(cv, x2, y2, (uint32_t)'\'');
     113
     114    return 0;
    107115}
    108116
    109117/** \brief Fill a box on the canvas using the given character.
     118 *
     119 *  This function never fails.
    110120 *
    111121 *  \param cv The handle to the libcucul canvas.
     
    115125 *  \param y2 Y coordinate of the lower-right corner of the box.
    116126 *  \param str UTF-8 string containing the character to fill the box with.
    117  *  \return void
     127 *  \return This function always returns 0.
    118128 */
    119 void cucul_fill_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
    120                     char const *str)
     129int cucul_fill_box(cucul_canvas_t *cv, int x1, int y1, int x2, int y2,
     130                   char const *str)
    121131{
    122132    int x, y, xmax, ymax;
     
    139149
    140150    if(x2 < 0 || y2 < 0 || x1 > xmax || y1 > ymax)
    141         return;
     151        return 0;
    142152
    143153    if(x1 < 0) x1 = 0;
     
    151161        for(x = x1; x <= x2; x++)
    152162            _cucul_putchar32(cv, x, y, ch);
     163
     164    return 0;
    153165}
    154166
Note: See TracChangeset for help on using the changeset viewer.