131
132
size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_format(3, 4);
135
* Get the count of continuous non zero chars starting from the beginning.
137
* @param len maximum number of characters to check in the string, that
138
* is the maximum value which is returned by the function
140
static inline size_t av_strnlen(const char *s, size_t len)
143
for (i = 0; i < len && s[i]; i++)
134
149
* Print arguments following specified format into a large enough auto
135
150
* allocated buffer. It is similar to GNU asprintf().
136
151
* @param fmt printf-compatible format string, specifying how the
295
310
int av_escape(char **dst, const char *src, const char *special_chars,
296
311
enum AVEscapeMode mode, int flags);
313
#define AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES 1 ///< accept codepoints over 0x10FFFF
314
#define AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS 2 ///< accept non-characters - 0xFFFE and 0xFFFF
315
#define AV_UTF8_FLAG_ACCEPT_SURROGATES 4 ///< accept UTF-16 surrogates codes
316
#define AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES 8 ///< exclude control codes not accepted by XML
318
#define AV_UTF8_FLAG_ACCEPT_ALL \
319
AV_UTF8_FLAG_ACCEPT_INVALID_BIG_CODES|AV_UTF8_FLAG_ACCEPT_NON_CHARACTERS|AV_UTF8_FLAG_ACCEPT_SURROGATES
322
* Read and decode a single UTF-8 code point (character) from the
323
* buffer in *buf, and update *buf to point to the next byte to
326
* In case of an invalid byte sequence, the pointer will be updated to
327
* the next byte after the invalid sequence and the function will
328
* return an error code.
330
* Depending on the specified flags, the function will also fail in
331
* case the decoded code point does not belong to a valid range.
333
* @note For speed-relevant code a carefully implemented use of
334
* GET_UTF8() may be preferred.
336
* @param codep pointer used to return the parsed code in case of success.
337
* The value in *codep is set even in case the range check fails.
338
* @param bufp pointer to the address the first byte of the sequence
339
* to decode, updated by the function to point to the
340
* byte next after the decoded sequence
341
* @param buf_end pointer to the end of the buffer, points to the next
342
* byte past the last in the buffer. This is used to
343
* avoid buffer overreads (in case of an unfinished
344
* UTF-8 sequence towards the end of the buffer).
345
* @param flags a collection of AV_UTF8_FLAG_* flags
346
* @return >= 0 in case a sequence was successfully read, a negative
347
* value in case of invalid sequence
349
int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,