Changeset 963


Ignore:
Timestamp:
May 19, 2006, 7:30:01 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Documented the newly exported charset functions.
File:
1 edited

Legend:

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

    r962 r963  
    9393};
    9494
     95/** \brief Convert a UTF-8 character to UTF-32.
     96 *
     97 *  This function converts a UTF-8 character read from a string and returns
     98 *  its value in the UTF-32 character set.
     99 *
     100 *  This function never fails, but its behaviour with illegal UTF-8 sequences
     101 *  is undefined.
     102 *
     103 *  \param s A string containing the UTF-8 character.
     104 *  \return The corresponding UTF-32 character.
     105 */
    95106unsigned long int cucul_utf8_to_utf32(char const *s)
    96107{
     
    112123}
    113124
     125/** \brief Convert a UTF-32 character to UTF-8.
     126 *
     127 *  This function converts a UTF-32 character read from a string and writes
     128 *  its value in the UTF-8 character set into the given buffer.
     129 *
     130 *  This function never fails, but its behaviour with illegal UTF-32 characters
     131 *  is undefined.
     132 *
     133 *  \param buf A pointer to a character buffer where the UTF-8 sequence will
     134 *  be written.
     135 *  \param ch The UTF-32 character.
     136 *  \return The number of bytes written.
     137 */
    114138unsigned int cucul_utf32_to_utf8(char *buf, unsigned long int ch)
    115139{
     
    142166}
    143167
     168/** \brief Convert a UTF-32 character to CP437.
     169 *
     170 *  This function converts a UTF-32 character read from a string and returns
     171 *  its value in the CP437 character set, or "?" if the character has no
     172 *  equivalent.
     173 *
     174 *  This function never fails.
     175 *
     176 *  \param ch The UTF-32 character.
     177 *  \return The corresponding CP437 character, or "?" if not representable.
     178 */
    144179unsigned char cucul_utf32_to_cp437(unsigned long int ch)
    145180{
     
    163198}
    164199
     200/** \brief Convert a CP437 character to UTF-32.
     201 *
     202 *  This function converts a CP437 character read from a string and returns
     203 *  its value in the UTF-32 character set, or zero if the character is a
     204 *  CP437 control character.
     205 *
     206 *  This function never fails.
     207 *
     208 *  \param ch The CP437 character.
     209 *  \return The corresponding UTF-32 character, or zero if not representable.
     210 */
    165211unsigned long int cucul_cp437_to_utf32(unsigned char ch)
    166212{
     
    176222    return 0x00000000;
    177223}
     224
     225/*
     226 * XXX: The following functions are local.
     227 */
    178228
    179229unsigned int _cucul_strlen_utf8(char const *s)
Note: See TracChangeset for help on using the changeset viewer.