Parcourir la source

* Minor documentation fixes.

tags/v0.99.beta14
Sam Hocevar sam il y a 18 ans
Parent
révision
44c286272c
2 fichiers modifiés avec 13 ajouts et 14 suppressions
  1. +0
    -1
      cucul/canvas.c
  2. +13
    -13
      cucul/import.c

+ 0
- 1
cucul/canvas.c Voir le fichier

@@ -143,7 +143,6 @@ int cucul_putchar(cucul_canvas_t *cv, int x, int y, unsigned long int ch)
* \param cv A handle to the libcucul canvas.
* \param x X coordinate.
* \param y Y coordinate.
* \param ch The requested character value.
* \return This function always returns 0.
*/
unsigned long int cucul_getchar(cucul_canvas_t *cv, int x, int y)


+ 13
- 13
cucul/import.c Voir le fichier

@@ -76,42 +76,42 @@ static void ansi_parse_grcm(cucul_canvas_t *, struct ansi_grcm *,
* - \c ENOMEM Not enough memory to allocate canvas.
* - \c EINVAL Invalid format requested.
*
* \param A libcucul canvas in which to import the file.
* \param buffer A \e libcucul buffer containing the data to be loaded
* into a canvas.
* \param cv A libcucul canvas in which to import the file.
* \param data A memory area containing the data to be loaded into the canvas.
* \param len The size in bytes of the memory area.
* \param format A string describing the input format.
* \return The number of bytes read, or -1 if an error occurred.
*/
long int cucul_import_memory(cucul_canvas_t *cv, void const *buf,
long int cucul_import_memory(cucul_canvas_t *cv, void const *data,
unsigned long int len, char const *format)
{
if(!strcasecmp("caca", format))
return import_caca(cv, buf, len);
return import_caca(cv, data, len);
if(!strcasecmp("utf8", format))
return import_ansi(cv, buf, len, 1);
return import_ansi(cv, data, len, 1);
if(!strcasecmp("text", format))
return import_text(cv, buf, len);
return import_text(cv, data, len);
if(!strcasecmp("ansi", format))
return import_ansi(cv, buf, len, 0);
return import_ansi(cv, data, len, 0);

/* Autodetection */
if(!strcasecmp("", format))
{
unsigned char const *str = buf;
unsigned char const *str = data;
unsigned int i;

/* If 4 first bytes are 0xcaca + 'CV' */
if(len >= 4 && str[0] == 0xca &&
str[1] == 0xca && str[2] == 'C' && str[3] == 'V')
return import_caca(cv, buf, len);
return import_caca(cv, data, len);

/* If we find ESC[ argv, we guess it's an ANSI file */
for(i = 0; i + 1 < len; i++)
if((str[i] == 0x1b) && (str[i + 1] == '['))
return import_ansi(cv, buf, len, 0);
return import_ansi(cv, data, len, 0);

/* Otherwise, import it as text */
return import_text(cv, buf, len);
return import_text(cv, data, len);
}

#if defined HAVE_ERRNO_H
@@ -140,7 +140,7 @@ long int cucul_import_memory(cucul_canvas_t *cv, void const *buf,
* cucul_import_file() may also fail and set \b errno for any of the
* errors specified for the routine fopen().
*
* \param A libcucul canvas in which to import the file.
* \param cv A libcucul canvas in which to import the file.
* \param filename The name of the file to load.
* \param format A string describing the input format.
* \return The number of bytes read, or -1 if an error occurred.


Chargement…
Annuler
Enregistrer