Mercurial > mplayer.hg
changeset 33981:a59b359c20f7
Add doxygen comments to cut.c and cut.h.
author | ib |
---|---|
date | Tue, 06 Sep 2011 12:11:23 +0000 |
parents | ddcf459482e9 |
children | d7527ee45784 |
files | gui/util/cut.c gui/util/cut.h |
diffstat | 2 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/util/cut.c Tue Sep 06 11:18:00 2011 +0000 +++ b/gui/util/cut.c Tue Sep 06 12:11:23 2011 +0000 @@ -16,11 +16,25 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +/** + * @file + * @brief Parser helpers + */ + #include <stdlib.h> #include <string.h> #include "cut.h" +/** + * @brief Extract a part of a string delimited by a separator character. + * + * @param in string to be analyzed + * @param out pointer suitable to store the extracted part + * @param sep separator character + * @param num number of separator characters to be skipped before extraction starts + * @param maxout maximum length of extracted part (including the trailing null byte) + */ void cutItemString(char *in, char *out, char sep, int num, size_t maxout) { int n; @@ -39,6 +53,15 @@ out[c] = 0; } +/** + * @brief Extract a numeric part of a string delimited by a separator character. + * + * @param in string to be analyzed + * @param sep separator character + * @param num number of separator characters to be skipped before extraction starts + * + * @return extracted number (numeric part) + */ int cutItemToInt(char *in, char sep, int num) { char tmp[64];
--- a/gui/util/cut.h Tue Sep 06 11:18:00 2011 +0000 +++ b/gui/util/cut.h Tue Sep 06 12:11:23 2011 +0000 @@ -21,6 +21,11 @@ #include <stddef.h> +/** + * @def cutItem(in, out, sep, num) + * Wraps #cutItemString(): + * Extract a part of a string delimited by a separator character at most the size of @a out. + */ #define cutItem(in, out, sep, num) cutItemString(in, out, sep, num, sizeof(out)) void cutItemString(char *in, char *out, char sep, int num, size_t maxout);