Revision c2a5b473

View differences:

libavutil/common.h
192 192
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
193 193
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
194 194

  
195
/*!
196
 * \def GET_UTF8(val, GET_BYTE, ERROR)
197
 * Convert a UTF-8 character (up to 4 bytes long) to its 32-bit UCS-4 encoded form
198
 * \param val is the output and should be of type uint32_t. It holds the converted
199
 * UCS-4 character and should be a left value.
200
 * \param GET_BYTE gets UTF-8 encoded bytes from any proper source. It can be
201
 * a function or a statement whose return value or evaluated value is of type
202
 * uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range,
203
 * and up to 7 times in the general case.
204
 * \param ERROR action that should be taken when an invalid UTF-8 byte is returned
205
 * from GET_BYTE. It should be a statement that jumps out of the macro,
206
 * like exit(), goto, return, break, or continue.
195
/**
196
 * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
197
 *
198
 * @param val      Output value, must be an lvalue of type uint32_t.
199
 * @param GET_BYTE Expression reading one byte from the input.
200
 *                 Evaluated up to 7 times (4 for the currently
201
 *                 assigned Unicode range).  With a memory buffer
202
 *                 input, this could be *ptr++.
203
 * @param ERROR    Expression to be evaluated on invalid input,
204
 *                 typically a goto statement.
207 205
 */
208 206
#define GET_UTF8(val, GET_BYTE, ERROR)\
209 207
    val= GET_BYTE;\
......
220 218
        }\
221 219
    }
222 220

  
223
/*!
224
 * \def GET_UTF16(val, GET_16BIT, ERROR)
225
 * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form
226
 * \param val is the output and should be of type uint32_t. It holds the converted
227
 * UCS-4 character and should be a left value.
228
 * \param GET_16BIT gets two bytes of UTF-16 encoded data converted to native endianness.
229
 * It can be a function or a statement whose return value or evaluated value is of type
230
 * uint16_t. It will be executed up to 2 times.
231
 * \param ERROR action that should be taken when an invalid UTF-16 surrogate is
232
 * returned from GET_BYTE. It should be a statement that jumps out of the macro,
233
 * like exit(), goto, return, break, or continue.
221
/**
222
 * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
223
 *
224
 * @param val       Output value, must be an lvalue of type uint32_t.
225
 * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
226
 *                  to native byte order.  Evaluated one or two times.
227
 * @param ERROR     Expression to be evaluated on invalid input,
228
 *                  typically a goto statement.
234 229
 */
235 230
#define GET_UTF16(val, GET_16BIT, ERROR)\
236 231
    val = GET_16BIT;\

Also available in: Unified diff