remove unneeded assignment in inner loop. rematrixing bands are contiguous.
[FFMpeg-mirror/lagarith.git] / libavutil / avstring.h
blobd716c3a282e1d66f281b1f24cca1ebc08c243242
1 /*
2 * Copyright (c) 2007 Mans Rullgard
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVUTIL_AVSTRING_H
22 #define AVUTIL_AVSTRING_H
24 #include <stddef.h>
26 /**
27 * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to
28 * the address of the first character in str after the prefix.
30 * @param str input string
31 * @param pfx prefix to test
32 * @param ptr updated if the prefix is matched inside str
33 * @return non-zero if the prefix matches, zero otherwise
35 int av_strstart(const char *str, const char *pfx, const char **ptr);
37 /**
38 * Return non-zero if pfx is a prefix of str independent of case. If
39 * it is, *ptr is set to the address of the first character in str
40 * after the prefix.
42 * @param str input string
43 * @param pfx prefix to test
44 * @param ptr updated if the prefix is matched inside str
45 * @return non-zero if the prefix matches, zero otherwise
47 int av_stristart(const char *str, const char *pfx, const char **ptr);
49 /**
50 * Copy the string src to dst, but no more than size - 1 bytes, and
51 * null-terminate dst.
53 * This function is the same as BSD strlcpy().
55 * @param dst destination buffer
56 * @param src source string
57 * @param size size of destination buffer
58 * @return the length of src
60 * WARNING: since the return value is the length of src, src absolutely
61 * _must_ be a properly 0-terminated string, otherwise this will read beyond
62 * the end of the buffer and possibly crash.
64 size_t av_strlcpy(char *dst, const char *src, size_t size);
66 /**
67 * Append the string src to the string dst, but to a total length of
68 * no more than size - 1 bytes, and null-terminate dst.
70 * This function is similar to BSD strlcat(), but differs when
71 * size <= strlen(dst).
73 * @param dst destination buffer
74 * @param src source string
75 * @param size size of destination buffer
76 * @return the total length of src and dst
78 * WARNING: since the return value use the length of src and dst, these absolutely
79 * _must_ be a properly 0-terminated strings, otherwise this will read beyond
80 * the end of the buffer and possibly crash.
82 size_t av_strlcat(char *dst, const char *src, size_t size);
84 /**
85 * Append output to a string, according to a format. Never write out of
86 * the destination buffer, and and always put a terminating 0 within
87 * the buffer.
88 * @param dst destination buffer (string to which the output is
89 * appended)
90 * @param size total size of the destination buffer
91 * @param fmt printf-compatible format string, specifying how the
92 * following parameters are used
93 * @return the length of the string that would have been generated
94 * if enough space had been available
96 size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...);
98 #endif /* AVUTIL_AVSTRING_H */