Browse Source

* Added as many "const" qualifiers as possible to the public API.

tags/v0.99.beta14
Sam Hocevar sam 17 years ago
parent
commit
2149829bdf
20 changed files with 87 additions and 85 deletions
  1. +5
    -5
      caca/caca.h
  2. +2
    -2
      caca/caca_internals.h
  3. +2
    -2
      caca/driver_conio.c
  4. +2
    -2
      caca/driver_gl.c
  5. +2
    -2
      caca/driver_ncurses.c
  6. +2
    -2
      caca/driver_raw.c
  7. +2
    -2
      caca/driver_slang.c
  8. +2
    -2
      caca/driver_vga.c
  9. +2
    -2
      caca/driver_win32.c
  10. +2
    -2
      caca/driver_x11.c
  11. +4
    -4
      caca/event.c
  12. +3
    -3
      caca/graphics.c
  13. +1
    -1
      cucul/attr.c
  14. +5
    -5
      cucul/canvas.c
  15. +2
    -2
      cucul/cucul.c
  16. +20
    -19
      cucul/cucul.h
  17. +3
    -3
      cucul/dither.c
  18. +20
    -19
      cucul/export.c
  19. +4
    -4
      cucul/font.c
  20. +2
    -2
      cucul/frame.c

+ 5
- 5
caca/caca.h View File

@@ -192,9 +192,9 @@ __extern caca_display_t * caca_create_display(cucul_canvas_t *);
__extern int caca_free_display(caca_display_t *); __extern int caca_free_display(caca_display_t *);
__extern int caca_refresh_display(caca_display_t *); __extern int caca_refresh_display(caca_display_t *);
__extern int caca_set_display_time(caca_display_t *, unsigned int); __extern int caca_set_display_time(caca_display_t *, unsigned int);
__extern unsigned int caca_get_display_time(caca_display_t *);
__extern unsigned int caca_get_display_width(caca_display_t *);
__extern unsigned int caca_get_display_height(caca_display_t *);
__extern unsigned int caca_get_display_time(caca_display_t const *);
__extern unsigned int caca_get_display_width(caca_display_t const *);
__extern unsigned int caca_get_display_height(caca_display_t const *);
__extern int caca_set_display_title(caca_display_t *, char const *); __extern int caca_set_display_title(caca_display_t *, char const *);
/* @} */ /* @} */


@@ -206,8 +206,8 @@ __extern int caca_set_display_title(caca_display_t *, char const *);
* @{ */ * @{ */
__extern int caca_get_event(caca_display_t *, unsigned int, __extern int caca_get_event(caca_display_t *, unsigned int,
caca_event_t *, int); caca_event_t *, int);
__extern unsigned int caca_get_mouse_x(caca_display_t *);
__extern unsigned int caca_get_mouse_y(caca_display_t *);
__extern unsigned int caca_get_mouse_x(caca_display_t const *);
__extern unsigned int caca_get_mouse_y(caca_display_t const *);
__extern int caca_set_mouse(caca_display_t *, int); __extern int caca_set_mouse(caca_display_t *, int);
__extern int caca_set_cursor(caca_display_t *, int); __extern int caca_set_cursor(caca_display_t *, int);
/* @} */ /* @} */


+ 2
- 2
caca/caca_internals.h View File

@@ -108,8 +108,8 @@ struct caca_display
int (* init_graphics) (caca_display_t *); int (* init_graphics) (caca_display_t *);
int (* end_graphics) (caca_display_t *); int (* end_graphics) (caca_display_t *);
int (* set_display_title) (caca_display_t *, char const *); int (* set_display_title) (caca_display_t *, char const *);
unsigned int (* get_display_width) (caca_display_t *);
unsigned int (* get_display_height) (caca_display_t *);
unsigned int (* get_display_width) (caca_display_t const *);
unsigned int (* get_display_height) (caca_display_t const *);
void (* display) (caca_display_t *); void (* display) (caca_display_t *);
void (* handle_resize) (caca_display_t *); void (* handle_resize) (caca_display_t *);
int (* get_event) (caca_display_t *, caca_event_t *); int (* get_event) (caca_display_t *, caca_event_t *);


+ 2
- 2
caca/driver_conio.c View File

@@ -83,13 +83,13 @@ static int conio_set_display_title(caca_display_t *dp, char const *title)
return -1; return -1;
} }


static unsigned int conio_get_display_width(caca_display_t *dp)
static unsigned int conio_get_display_width(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->width * 6; return dp->cv->width * 6;
} }


static unsigned int conio_get_display_height(caca_display_t *dp)
static unsigned int conio_get_display_height(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->height * 10; return dp->cv->height * 10;


+ 2
- 2
caca/driver_gl.c View File

@@ -197,12 +197,12 @@ static int gl_set_display_title(caca_display_t *dp, char const *title)
return 0; return 0;
} }


static unsigned int gl_get_display_width(caca_display_t *dp)
static unsigned int gl_get_display_width(caca_display_t const *dp)
{ {
return dp->drv.p->width; return dp->drv.p->width;
} }


static unsigned int gl_get_display_height(caca_display_t *dp)
static unsigned int gl_get_display_height(caca_display_t const *dp)
{ {
return dp->drv.p->height; return dp->drv.p->height;
} }


+ 2
- 2
caca/driver_ncurses.c View File

@@ -326,13 +326,13 @@ static int ncurses_set_display_title(caca_display_t *dp, char const *title)
return 0; return 0;
} }


static unsigned int ncurses_get_display_width(caca_display_t *dp)
static unsigned int ncurses_get_display_width(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->width * 6; return dp->cv->width * 6;
} }


static unsigned int ncurses_get_display_height(caca_display_t *dp)
static unsigned int ncurses_get_display_height(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->height * 10; return dp->cv->height * 10;


+ 2
- 2
caca/driver_raw.c View File

@@ -55,12 +55,12 @@ static int raw_set_display_title(caca_display_t *dp, char const *title)
return -1; return -1;
} }


static unsigned int raw_get_display_width(caca_display_t *dp)
static unsigned int raw_get_display_width(caca_display_t const *dp)
{ {
return 0; return 0;
} }


static unsigned int raw_get_display_height(caca_display_t *dp)
static unsigned int raw_get_display_height(caca_display_t const *dp)
{ {
return 0; return 0;
} }


+ 2
- 2
caca/driver_slang.c View File

@@ -193,13 +193,13 @@ static int slang_set_display_title(caca_display_t *dp, char const *title)
return 0; return 0;
} }


static unsigned int slang_get_display_width(caca_display_t *dp)
static unsigned int slang_get_display_width(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->width * 6; return dp->cv->width * 6;
} }


static unsigned int slang_get_display_height(caca_display_t *dp)
static unsigned int slang_get_display_height(caca_display_t const *dp)
{ {
/* Fallback to a 6x10 font */ /* Fallback to a 6x10 font */
return dp->cv->height * 10; return dp->cv->height * 10;


+ 2
- 2
caca/driver_vga.c View File

@@ -101,13 +101,13 @@ static int vga_set_display_title(caca_display_t *dp, char const *title)
return -1; return -1;
} }


static unsigned int vga_get_display_width(caca_display_t *dp)
static unsigned int vga_get_display_width(caca_display_t const *dp)
{ {
/* Fallback to a 320x200 screen */ /* Fallback to a 320x200 screen */
return 320; return 320;
} }


static unsigned int vga_get_display_height(caca_display_t *dp)
static unsigned int vga_get_display_height(caca_display_t const *dp)
{ {
/* Fallback to a 320x200 screen */ /* Fallback to a 320x200 screen */
return 200; return 200;


+ 2
- 2
caca/driver_win32.c View File

@@ -171,7 +171,7 @@ static int win32_set_display_title(caca_display_t *dp, char const *title)
return 0; return 0;
} }


static unsigned int win32_get_display_width(caca_display_t *dp)
static unsigned int win32_get_display_width(caca_display_t const *dp)
{ {
/* FIXME */ /* FIXME */


@@ -179,7 +179,7 @@ static unsigned int win32_get_display_width(caca_display_t *dp)
return dp->cv->width * 6; return dp->cv->width * 6;
} }


static unsigned int win32_get_display_height(caca_display_t *dp)
static unsigned int win32_get_display_height(caca_display_t const *dp)
{ {
/* FIXME */ /* FIXME */




+ 2
- 2
caca/driver_x11.c View File

@@ -274,12 +274,12 @@ static int x11_set_display_title(caca_display_t *dp, char const *title)
return 0; return 0;
} }


static unsigned int x11_get_display_width(caca_display_t *dp)
static unsigned int x11_get_display_width(caca_display_t const *dp)
{ {
return dp->cv->width * dp->drv.p->font_width; return dp->cv->width * dp->drv.p->font_width;
} }


static unsigned int x11_get_display_height(caca_display_t *dp)
static unsigned int x11_get_display_height(caca_display_t const *dp)
{ {
return dp->cv->height * dp->drv.p->font_height; return dp->cv->height * dp->drv.p->font_height;
} }


+ 4
- 4
caca/event.c View File

@@ -125,10 +125,10 @@ int caca_get_event(caca_display_t *dp, unsigned int event_mask,
* \param dp The libcaca graphical context. * \param dp The libcaca graphical context.
* \return The X mouse coordinate. * \return The X mouse coordinate.
*/ */
unsigned int caca_get_mouse_x(caca_display_t *dp)
unsigned int caca_get_mouse_x(caca_display_t const *dp)
{ {
if(dp->mouse.x >= dp->cv->width) if(dp->mouse.x >= dp->cv->width)
dp->mouse.x = dp->cv->width - 1;
return dp->cv->width - 1;


return dp->mouse.x; return dp->mouse.x;
} }
@@ -145,10 +145,10 @@ unsigned int caca_get_mouse_x(caca_display_t *dp)
* \param dp The libcaca graphical context. * \param dp The libcaca graphical context.
* \return The Y mouse coordinate. * \return The Y mouse coordinate.
*/ */
unsigned int caca_get_mouse_y(caca_display_t *dp)
unsigned int caca_get_mouse_y(caca_display_t const *dp)
{ {
if(dp->mouse.y >= dp->cv->height) if(dp->mouse.y >= dp->cv->height)
dp->mouse.y = dp->cv->height - 1;
return dp->cv->height - 1;


return dp->mouse.y; return dp->mouse.y;
} }


+ 3
- 3
caca/graphics.c View File

@@ -64,7 +64,7 @@ int caca_set_display_title(caca_display_t *dp, char const *title)
* \param dp The libcaca display context. * \param dp The libcaca display context.
* \return The display width. * \return The display width.
*/ */
unsigned int caca_get_display_width(caca_display_t *dp)
unsigned int caca_get_display_width(caca_display_t const *dp)
{ {
return dp->drv.get_display_width(dp); return dp->drv.get_display_width(dp);
} }
@@ -81,7 +81,7 @@ unsigned int caca_get_display_width(caca_display_t *dp)
* \param dp The libcaca display context. * \param dp The libcaca display context.
* \return The display height. * \return The display height.
*/ */
unsigned int caca_get_display_height(caca_display_t *dp)
unsigned int caca_get_display_height(caca_display_t const *dp)
{ {
return dp->drv.get_display_height(dp); return dp->drv.get_display_height(dp);
} }
@@ -120,7 +120,7 @@ int caca_set_display_time(caca_display_t *dp, unsigned int usec)
* \param dp The libcaca display context. * \param dp The libcaca display context.
* \return The render time in microseconds. * \return The render time in microseconds.
*/ */
unsigned int caca_get_display_time(caca_display_t *dp)
unsigned int caca_get_display_time(caca_display_t const *dp)
{ {
return dp->rendertime; return dp->rendertime;
} }


+ 1
- 1
cucul/attr.c View File

@@ -50,7 +50,7 @@ static uint8_t nearest_ansi(uint16_t);
* \param y Y coordinate. * \param y Y coordinate.
* \return The requested attribute. * \return The requested attribute.
*/ */
unsigned long int cucul_get_attr(cucul_canvas_t *cv, int x, int y)
unsigned long int cucul_get_attr(cucul_canvas_t const *cv, int x, int y)
{ {
if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height) if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height)
return (unsigned long int)cv->curattr; return (unsigned long int)cv->curattr;


+ 5
- 5
cucul/canvas.c View File

@@ -69,7 +69,7 @@ int cucul_gotoxy(cucul_canvas_t *cv, int x, int y)
* \param cv A handle to the libcucul canvas. * \param cv A handle to the libcucul canvas.
* \return The cursor's X coordinate. * \return The cursor's X coordinate.
*/ */
int cucul_get_cursor_x(cucul_canvas_t *cv)
int cucul_get_cursor_x(cucul_canvas_t const *cv)
{ {
return cv->frames[cv->frame].x; return cv->frames[cv->frame].x;
} }
@@ -83,7 +83,7 @@ int cucul_get_cursor_x(cucul_canvas_t *cv)
* \param cv A handle to the libcucul canvas. * \param cv A handle to the libcucul canvas.
* \return The cursor's Y coordinate. * \return The cursor's Y coordinate.
*/ */
int cucul_get_cursor_y(cucul_canvas_t *cv)
int cucul_get_cursor_y(cucul_canvas_t const *cv)
{ {
return cv->frames[cv->frame].y; return cv->frames[cv->frame].y;
} }
@@ -192,7 +192,7 @@ int cucul_put_char(cucul_canvas_t *cv, int x, int y, unsigned long int ch)
* \param y Y coordinate. * \param y Y coordinate.
* \return This function always returns 0. * \return This function always returns 0.
*/ */
unsigned long int cucul_get_char(cucul_canvas_t *cv, int x, int y)
unsigned long int cucul_get_char(cucul_canvas_t const *cv, int x, int y)
{ {
if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height) if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height)
return ' '; return ' ';
@@ -340,7 +340,7 @@ int cucul_set_canvas_handle(cucul_canvas_t *cv, int x, int y)
* \param cv A handle to the libcucul canvas. * \param cv A handle to the libcucul canvas.
* \return The canvas' handle's X coordinate. * \return The canvas' handle's X coordinate.
*/ */
int cucul_get_canvas_handle_x(cucul_canvas_t *cv)
int cucul_get_canvas_handle_x(cucul_canvas_t const *cv)
{ {
return cv->frames[cv->frame].handlex; return cv->frames[cv->frame].handlex;
} }
@@ -354,7 +354,7 @@ int cucul_get_canvas_handle_x(cucul_canvas_t *cv)
* \param cv A handle to the libcucul canvas. * \param cv A handle to the libcucul canvas.
* \return The canvas' handle's Y coordinate. * \return The canvas' handle's Y coordinate.
*/ */
int cucul_get_canvas_handle_y(cucul_canvas_t *cv)
int cucul_get_canvas_handle_y(cucul_canvas_t const *cv)
{ {
return cv->frames[cv->frame].handley; return cv->frames[cv->frame].handley;
} }


+ 2
- 2
cucul/cucul.c View File

@@ -149,7 +149,7 @@ int cucul_set_canvas_size(cucul_canvas_t *cv, unsigned int width,
* \param cv A libcucul canvas * \param cv A libcucul canvas
* \return The canvas width. * \return The canvas width.
*/ */
unsigned int cucul_get_canvas_width(cucul_canvas_t *cv)
unsigned int cucul_get_canvas_width(cucul_canvas_t const *cv)
{ {
return cv->width; return cv->width;
} }
@@ -163,7 +163,7 @@ unsigned int cucul_get_canvas_width(cucul_canvas_t *cv)
* \param cv A libcucul canvas * \param cv A libcucul canvas
* \return The canvas height. * \return The canvas height.
*/ */
unsigned int cucul_get_canvas_height(cucul_canvas_t *cv)
unsigned int cucul_get_canvas_height(cucul_canvas_t const *cv)
{ {
return cv->height; return cv->height;
} }


+ 20
- 19
cucul/cucul.h View File

@@ -86,8 +86,8 @@ typedef struct cucul_font cucul_font_t;
__extern cucul_canvas_t * cucul_create_canvas(unsigned int, unsigned int); __extern cucul_canvas_t * cucul_create_canvas(unsigned int, unsigned int);
__extern int cucul_set_canvas_size(cucul_canvas_t *, unsigned int, __extern int cucul_set_canvas_size(cucul_canvas_t *, unsigned int,
unsigned int); unsigned int);
__extern unsigned int cucul_get_canvas_width(cucul_canvas_t *);
__extern unsigned int cucul_get_canvas_height(cucul_canvas_t *);
__extern unsigned int cucul_get_canvas_width(cucul_canvas_t const *);
__extern unsigned int cucul_get_canvas_height(cucul_canvas_t const *);
__extern int cucul_free_canvas(cucul_canvas_t *); __extern int cucul_free_canvas(cucul_canvas_t *);
__extern int cucul_rand(int, int); __extern int cucul_rand(int, int);
/* @} */ /* @} */
@@ -100,12 +100,12 @@ __extern int cucul_rand(int, int);
* @{ */ * @{ */
#define CUCUL_MAGIC_FULLWIDTH 0x000ffffe /**< Used to indicate that the previous character was a fullwidth glyph. */ #define CUCUL_MAGIC_FULLWIDTH 0x000ffffe /**< Used to indicate that the previous character was a fullwidth glyph. */
__extern int cucul_gotoxy(cucul_canvas_t *, int, int); __extern int cucul_gotoxy(cucul_canvas_t *, int, int);
__extern int cucul_get_cursor_x(cucul_canvas_t *);
__extern int cucul_get_cursor_y(cucul_canvas_t *);
__extern int cucul_get_cursor_x(cucul_canvas_t const *);
__extern int cucul_get_cursor_y(cucul_canvas_t const *);
__extern int cucul_put_char(cucul_canvas_t *, int, int, unsigned long int); __extern int cucul_put_char(cucul_canvas_t *, int, int, unsigned long int);
__extern unsigned long int cucul_get_char(cucul_canvas_t *, int, int);
__extern unsigned long int cucul_get_char(cucul_canvas_t const *, int, int);
__extern int cucul_put_str(cucul_canvas_t *, int, int, char const *); __extern int cucul_put_str(cucul_canvas_t *, int, int, char const *);
__extern unsigned long int cucul_get_attr(cucul_canvas_t *, int, int);
__extern unsigned long int cucul_get_attr(cucul_canvas_t const *, int, int);
__extern int cucul_set_attr(cucul_canvas_t *, unsigned long int); __extern int cucul_set_attr(cucul_canvas_t *, unsigned long int);
__extern int cucul_put_attr(cucul_canvas_t *, int, int, unsigned long int); __extern int cucul_put_attr(cucul_canvas_t *, int, int, unsigned long int);
__extern int cucul_set_color_ansi(cucul_canvas_t *, unsigned char, __extern int cucul_set_color_ansi(cucul_canvas_t *, unsigned char,
@@ -115,8 +115,8 @@ __extern int cucul_set_color_argb(cucul_canvas_t *, unsigned int,
__extern int cucul_printf(cucul_canvas_t *, int, int, char const *, ...); __extern int cucul_printf(cucul_canvas_t *, int, int, char const *, ...);
__extern int cucul_clear_canvas(cucul_canvas_t *); __extern int cucul_clear_canvas(cucul_canvas_t *);
__extern int cucul_set_canvas_handle(cucul_canvas_t *, int, int); __extern int cucul_set_canvas_handle(cucul_canvas_t *, int, int);
__extern int cucul_get_canvas_handle_x(cucul_canvas_t *);
__extern int cucul_get_canvas_handle_y(cucul_canvas_t *);
__extern int cucul_get_canvas_handle_x(cucul_canvas_t const *);
__extern int cucul_get_canvas_handle_y(cucul_canvas_t const *);
__extern int cucul_blit(cucul_canvas_t *, int, int, cucul_canvas_t const *, __extern int cucul_blit(cucul_canvas_t *, int, int, cucul_canvas_t const *,
cucul_canvas_t const *); cucul_canvas_t const *);
__extern int cucul_set_canvas_boundaries(cucul_canvas_t *, int, int, __extern int cucul_set_canvas_boundaries(cucul_canvas_t *, int, int,
@@ -204,9 +204,9 @@ __extern int cucul_fill_triangle(cucul_canvas_t *, int, int, int, int, int,
* removal, copying etc. * removal, copying etc.
* *
* @{ */ * @{ */
__extern unsigned int cucul_get_frame_count(cucul_canvas_t *);
__extern unsigned int cucul_get_frame_count(cucul_canvas_t const *);
__extern int cucul_set_frame(cucul_canvas_t *, unsigned int); __extern int cucul_set_frame(cucul_canvas_t *, unsigned int);
__extern char const *cucul_get_frame_name(cucul_canvas_t *);
__extern char const *cucul_get_frame_name(cucul_canvas_t const *);
__extern int cucul_set_frame_name(cucul_canvas_t *, char const *); __extern int cucul_set_frame_name(cucul_canvas_t *, char const *);
__extern int cucul_create_frame(cucul_canvas_t *, unsigned int); __extern int cucul_create_frame(cucul_canvas_t *, unsigned int);
__extern int cucul_free_frame(cucul_canvas_t *, unsigned int); __extern int cucul_free_frame(cucul_canvas_t *, unsigned int);
@@ -228,11 +228,11 @@ __extern int cucul_set_dither_palette(cucul_dither_t *,
unsigned int r[], unsigned int g[], unsigned int r[], unsigned int g[],
unsigned int b[], unsigned int a[]); unsigned int b[], unsigned int a[]);
__extern int cucul_set_dither_brightness(cucul_dither_t *, float); __extern int cucul_set_dither_brightness(cucul_dither_t *, float);
__extern float cucul_get_dither_brightness(cucul_dither_t *);
__extern float cucul_get_dither_brightness(cucul_dither_t const *);
__extern int cucul_set_dither_gamma(cucul_dither_t *, float); __extern int cucul_set_dither_gamma(cucul_dither_t *, float);
__extern float cucul_get_dither_gamma(cucul_dither_t *);
__extern float cucul_get_dither_gamma(cucul_dither_t const *);
__extern int cucul_set_dither_contrast(cucul_dither_t *, float); __extern int cucul_set_dither_contrast(cucul_dither_t *, float);
__extern float cucul_get_dither_contrast(cucul_dither_t *);
__extern float cucul_get_dither_contrast(cucul_dither_t const *);
__extern int cucul_set_dither_antialias(cucul_dither_t *, char const *); __extern int cucul_set_dither_antialias(cucul_dither_t *, char const *);
__extern char const * const * cucul_get_dither_antialias_list(cucul_dither_t __extern char const * const * cucul_get_dither_antialias_list(cucul_dither_t
const *); const *);
@@ -262,11 +262,12 @@ __extern int cucul_free_dither(cucul_dither_t *);
* @{ */ * @{ */
__extern cucul_font_t *cucul_load_font(void const *, unsigned int); __extern cucul_font_t *cucul_load_font(void const *, unsigned int);
__extern char const * const * cucul_get_font_list(void); __extern char const * const * cucul_get_font_list(void);
__extern unsigned int cucul_get_font_width(cucul_font_t *);
__extern unsigned int cucul_get_font_height(cucul_font_t *);
__extern unsigned long int const *cucul_get_font_blocks(cucul_font_t *);
__extern int cucul_render_canvas(cucul_canvas_t *, cucul_font_t *, void *,
unsigned int, unsigned int, unsigned int);
__extern unsigned int cucul_get_font_width(cucul_font_t const *);
__extern unsigned int cucul_get_font_height(cucul_font_t const *);
__extern unsigned long int const *cucul_get_font_blocks(cucul_font_t const *);
__extern int cucul_render_canvas(cucul_canvas_t const *, cucul_font_t const *,
void *, unsigned int, unsigned int,
unsigned int);
__extern int cucul_free_font(cucul_font_t *); __extern int cucul_free_font(cucul_font_t *);
/* @} */ /* @} */


@@ -282,7 +283,7 @@ __extern long int cucul_import_memory(cucul_canvas_t *, void const *,
__extern long int cucul_import_file(cucul_canvas_t *, char const *, __extern long int cucul_import_file(cucul_canvas_t *, char const *,
char const *); char const *);
__extern char const * const * cucul_get_import_list(void); __extern char const * const * cucul_get_import_list(void);
__extern void *cucul_export_memory(cucul_canvas_t *, char const *,
__extern void *cucul_export_memory(cucul_canvas_t const *, char const *,
unsigned long int *); unsigned long int *);
__extern char const * const * cucul_get_export_list(void); __extern char const * const * cucul_get_export_list(void);
/* @} */ /* @} */


+ 3
- 3
cucul/dither.c View File

@@ -441,7 +441,7 @@ int cucul_set_dither_brightness(cucul_dither_t *d, float brightness)
* \param d Dither object. * \param d Dither object.
* \return Brightness value. * \return Brightness value.
*/ */
float cucul_get_dither_brightness(cucul_dither_t *d)
float cucul_get_dither_brightness(cucul_dither_t const *d)
{ {
return d->brightness; return d->brightness;
} }
@@ -493,7 +493,7 @@ int cucul_set_dither_gamma(cucul_dither_t *d, float gamma)
* \param d Dither object. * \param d Dither object.
* \return Gamma value. * \return Gamma value.
*/ */
float cucul_get_dither_gamma(cucul_dither_t *d)
float cucul_get_dither_gamma(cucul_dither_t const *d)
{ {
return d->gamma; return d->gamma;
} }
@@ -526,7 +526,7 @@ int cucul_set_dither_contrast(cucul_dither_t *d, float contrast)
* \param d Dither object. * \param d Dither object.
* \return Contrast value. * \return Contrast value.
*/ */
float cucul_get_dither_contrast(cucul_dither_t *d)
float cucul_get_dither_contrast(cucul_dither_t const *d)
{ {
return d->contrast; return d->contrast;
} }


+ 20
- 19
cucul/export.c View File

@@ -45,15 +45,15 @@ static inline int sprintu16(char *s, uint16_t x)
return 2; return 2;
} }


static void *export_caca(cucul_canvas_t *, unsigned long int *);
static void *export_ansi(cucul_canvas_t *, unsigned long int *);
static void *export_utf8(cucul_canvas_t *, unsigned long int *, int);
static void *export_html(cucul_canvas_t *, unsigned long int *);
static void *export_html3(cucul_canvas_t *, unsigned long int *);
static void *export_irc(cucul_canvas_t *, unsigned long int *);
static void *export_ps(cucul_canvas_t *, unsigned long int *);
static void *export_svg(cucul_canvas_t *, unsigned long int *);
static void *export_tga(cucul_canvas_t *, unsigned long int *);
static void *export_caca(cucul_canvas_t const *, unsigned long int *);
static void *export_ansi(cucul_canvas_t const *, unsigned long int *);
static void *export_utf8(cucul_canvas_t const *, unsigned long int *, int);
static void *export_html(cucul_canvas_t const *, unsigned long int *);
static void *export_html3(cucul_canvas_t const *, unsigned long int *);
static void *export_irc(cucul_canvas_t const *, unsigned long int *);
static void *export_ps(cucul_canvas_t const *, unsigned long int *);
static void *export_svg(cucul_canvas_t const *, unsigned long int *);
static void *export_tga(cucul_canvas_t const *, unsigned long int *);


/** \brief Export a canvas into a foreign format. /** \brief Export a canvas into a foreign format.
* *
@@ -82,7 +82,7 @@ static void *export_tga(cucul_canvas_t *, unsigned long int *);
* allocated bytes will be written. * allocated bytes will be written.
* \return A pointer to the exported memory area, or NULL in case of error. * \return A pointer to the exported memory area, or NULL in case of error.
*/ */
void *cucul_export_memory(cucul_canvas_t *cv, char const *format,
void *cucul_export_memory(cucul_canvas_t const *cv, char const *format,
unsigned long int *bytes) unsigned long int *bytes)
{ {
if(!strcasecmp("caca", format)) if(!strcasecmp("caca", format))
@@ -155,7 +155,7 @@ char const * const * cucul_get_export_list(void)
*/ */


/* Generate a native libcaca canvas file. */ /* Generate a native libcaca canvas file. */
static void *export_caca(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_caca(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
uint32_t *attrs = cv->attrs; uint32_t *attrs = cv->attrs;
uint32_t *chars = cv->chars; uint32_t *chars = cv->chars;
@@ -201,7 +201,8 @@ static void *export_caca(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Generate UTF-8 representation of current canvas. */ /* Generate UTF-8 representation of current canvas. */
static void *export_utf8(cucul_canvas_t *cv, unsigned long int *bytes, int cr)
static void *export_utf8(cucul_canvas_t const *cv, unsigned long int *bytes,
int cr)
{ {
static uint8_t const palette[] = static uint8_t const palette[] =
{ {
@@ -281,7 +282,7 @@ static void *export_utf8(cucul_canvas_t *cv, unsigned long int *bytes, int cr)
} }


/* Generate ANSI representation of current canvas. */ /* Generate ANSI representation of current canvas. */
static void *export_ansi(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_ansi(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
static uint8_t const palette[] = static uint8_t const palette[] =
{ {
@@ -361,7 +362,7 @@ static void *export_ansi(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Generate HTML representation of current canvas. */ /* Generate HTML representation of current canvas. */
static void *export_html(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_html(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
char *data, *cur; char *data, *cur;
unsigned int x, y, len; unsigned int x, y, len;
@@ -443,7 +444,7 @@ static void *export_html(cucul_canvas_t *cv, unsigned long int *bytes)
* but permits viewing in old browsers (or limited ones such as links). It * but permits viewing in old browsers (or limited ones such as links). It
* will not work under gecko (mozilla rendering engine) unless you set a * will not work under gecko (mozilla rendering engine) unless you set a
* correct header. */ * correct header. */
static void *export_html3(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_html3(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
char *data, *cur; char *data, *cur;
unsigned int x, y, len; unsigned int x, y, len;
@@ -545,7 +546,7 @@ static void *export_html3(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Export a text file with IRC colours */ /* Export a text file with IRC colours */
static void *export_irc(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_irc(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
static uint8_t const palette[] = static uint8_t const palette[] =
{ {
@@ -652,7 +653,7 @@ static void *export_irc(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Export a PostScript document. */ /* Export a PostScript document. */
static void *export_ps(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_ps(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
static char const *ps_header = static char const *ps_header =
"%!\n" "%!\n"
@@ -761,7 +762,7 @@ static void *export_ps(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Export an SVG vector image */ /* Export an SVG vector image */
static void *export_svg(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_svg(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
static char const svg_header[] = static char const svg_header[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
@@ -847,7 +848,7 @@ static void *export_svg(cucul_canvas_t *cv, unsigned long int *bytes)
} }


/* Export a TGA image */ /* Export a TGA image */
static void *export_tga(cucul_canvas_t *cv, unsigned long int *bytes)
static void *export_tga(cucul_canvas_t const *cv, unsigned long int *bytes)
{ {
char const * const *fontlist; char const * const *fontlist;
char *data, *cur; char *data, *cur;


+ 4
- 4
cucul/font.c View File

@@ -325,7 +325,7 @@ char const * const * cucul_get_font_list(void)
* \param f The font, as returned by cucul_load_font() * \param f The font, as returned by cucul_load_font()
* \return The standard glyph width. * \return The standard glyph width.
*/ */
unsigned int cucul_get_font_width(cucul_font_t *f)
unsigned int cucul_get_font_width(cucul_font_t const *f)
{ {
return f->header.width; return f->header.width;
} }
@@ -340,7 +340,7 @@ unsigned int cucul_get_font_width(cucul_font_t *f)
* \param f The font, as returned by cucul_load_font() * \param f The font, as returned by cucul_load_font()
* \return The standard glyph height. * \return The standard glyph height.
*/ */
unsigned int cucul_get_font_height(cucul_font_t *f)
unsigned int cucul_get_font_height(cucul_font_t const *f)
{ {
return f->header.height; return f->header.height;
} }
@@ -365,7 +365,7 @@ unsigned int cucul_get_font_height(cucul_font_t *f)
* \param f The font, as returned by cucul_load_font() * \param f The font, as returned by cucul_load_font()
* \return The list of Unicode blocks supported by the font. * \return The list of Unicode blocks supported by the font.
*/ */
unsigned long int const *cucul_get_font_blocks(cucul_font_t *f)
unsigned long int const *cucul_get_font_blocks(cucul_font_t const *f)
{ {
return (unsigned long int const *)f->user_block_list; return (unsigned long int const *)f->user_block_list;
} }
@@ -415,7 +415,7 @@ int cucul_free_font(cucul_font_t *f)
* \param pitch The pitch (in bytes) of an image buffer line. * \param pitch The pitch (in bytes) of an image buffer line.
* \return This function always returns 0. * \return This function always returns 0.
*/ */
int cucul_render_canvas(cucul_canvas_t *cv, cucul_font_t *f,
int cucul_render_canvas(cucul_canvas_t const *cv, cucul_font_t const *f,
void *buf, unsigned int width, void *buf, unsigned int width,
unsigned int height, unsigned int pitch) unsigned int height, unsigned int pitch)
{ {


+ 2
- 2
cucul/frame.c View File

@@ -37,7 +37,7 @@
* \param cv A libcucul canvas * \param cv A libcucul canvas
* \return The frame count * \return The frame count
*/ */
unsigned int cucul_get_frame_count(cucul_canvas_t *cv)
unsigned int cucul_get_frame_count(cucul_canvas_t const *cv)
{ {
return cv->framecount; return cv->framecount;
} }
@@ -83,7 +83,7 @@ int cucul_set_frame(cucul_canvas_t *cv, unsigned int id)
* \param cv A libcucul canvas. * \param cv A libcucul canvas.
* \return The current frame's name. * \return The current frame's name.
*/ */
char const *cucul_get_frame_name(cucul_canvas_t *cv)
char const *cucul_get_frame_name(cucul_canvas_t const *cv)
{ {
return cv->frames[cv->frame].name; return cv->frames[cv->frame].name;
} }


Loading…
Cancel
Save