| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2007 Mans Rullgard | 2 * Copyright (c) 2007 Mans Rullgard |
| 3 * | 3 * |
| 4 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
| 5 * | 5 * |
| 6 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2.1 of the License, or (at your option) any later version. | 9 * version 2.1 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #define AVUTIL_AVSTRING_H | 22 #define AVUTIL_AVSTRING_H |
| 23 | 23 |
| 24 #include <stddef.h> | 24 #include <stddef.h> |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to | 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. | 28 * the address of the first character in str after the prefix. |
| 29 * | 29 * |
| 30 * @param str input string | 30 * @param str input string |
| 31 * @param pfx prefix to test | 31 * @param pfx prefix to test |
| 32 * @param ptr updated after the prefix in str in there is a match | 32 * @param ptr updated if the prefix is matched inside str |
| 33 * @return non-zero if the prefix matches, zero otherwise | 33 * @return non-zero if the prefix matches, zero otherwise |
| 34 */ | 34 */ |
| 35 int av_strstart(const char *str, const char *pfx, const char **ptr); | 35 int av_strstart(const char *str, const char *pfx, const char **ptr); |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Return non-zero if pfx is a prefix of str independent of case. If | 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 | 39 * it is, *ptr is set to the address of the first character in str |
| 40 * after the prefix. | 40 * after the prefix. |
| 41 * | 41 * |
| 42 * @param str input string | 42 * @param str input string |
| 43 * @param pfx prefix to test | 43 * @param pfx prefix to test |
| 44 * @param ptr updated after the prefix in str in there is a match | 44 * @param ptr updated if the prefix is matched inside str |
| 45 * @return non-zero if the prefix matches, zero otherwise | 45 * @return non-zero if the prefix matches, zero otherwise |
| 46 */ | 46 */ |
| 47 int av_stristart(const char *str, const char *pfx, const char **ptr); | 47 int av_stristart(const char *str, const char *pfx, const char **ptr); |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Copy the string src to dst, but no more than size - 1 bytes, and | 50 * Copy the string src to dst, but no more than size - 1 bytes, and |
| 51 * null terminate dst. | 51 * null-terminate dst. |
| 52 * | 52 * |
| 53 * This function is the same as BSD strlcpy(). | 53 * This function is the same as BSD strlcpy(). |
| 54 * | 54 * |
| 55 * @param dst destination buffer | 55 * @param dst destination buffer |
| 56 * @param src source string | 56 * @param src source string |
| 57 * @param size size of destination buffer | 57 * @param size size of destination buffer |
| 58 * @return the length of src | 58 * @return the length of src |
| 59 */ | 59 */ |
| 60 size_t av_strlcpy(char *dst, const char *src, size_t size); | 60 size_t av_strlcpy(char *dst, const char *src, size_t size); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Append the string src to the string dst, but to a total length of | 63 * Append the string src to the string dst, but to a total length of |
| 64 * no more than size - 1 bytes, and null terminate dst. | 64 * no more than size - 1 bytes, and null-terminate dst. |
| 65 * | 65 * |
| 66 * This function is similar to BSD strlcat(), but differs when | 66 * This function is similar to BSD strlcat(), but differs when |
| 67 * size <= strlen(dst). | 67 * size <= strlen(dst). |
| 68 * | 68 * |
| 69 * @param dst destination buffer | 69 * @param dst destination buffer |
| 70 * @param src source string | 70 * @param src source string |
| 71 * @param size size of destination buffer | 71 * @param size size of destination buffer |
| 72 * @return the total length of src and dst | 72 * @return the total length of src and dst |
| 73 */ | 73 */ |
| 74 size_t av_strlcat(char *dst, const char *src, size_t size); | 74 size_t av_strlcat(char *dst, const char *src, size_t size); |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Append output to a string, according to a format. Never write out of | 77 * Append output to a string, according to a format. Never write out of |
| 78 * the destination buffer, and and always put a terminating 0 within | 78 * the destination buffer, and and always put a terminating 0 within |
| 79 * the buffer. | 79 * the buffer. |
| 80 * @param dst destination buffer (string to which the output is | 80 * @param dst destination buffer (string to which the output is |
| 81 * appended) | 81 * appended) |
| 82 * @param size total size of the destination buffer | 82 * @param size total size of the destination buffer |
| 83 * @param fmt printf-compatible format string, specifying how the | 83 * @param fmt printf-compatible format string, specifying how the |
| 84 * following parameters are used | 84 * following parameters are used |
| 85 * @return the length of the string that would have been generated | 85 * @return the length of the string that would have been generated |
| 86 * if enough space had been available | 86 * if enough space had been available |
| 87 */ | 87 */ |
| 88 size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...); | 88 size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...); |
| 89 | 89 |
| 90 #endif /* AVUTIL_AVSTRING_H */ | 90 #endif /* AVUTIL_AVSTRING_H */ |
| OLD | NEW |