# HG changeset patch # User ib # Date 1315311083 0 # Node ID a59b359c20f760cab45e3b980af5b6b65be0372f # Parent ddcf459482e94971783d2327418ba3b22bade425 Add doxygen comments to cut.c and cut.h. diff -r ddcf459482e9 -r a59b359c20f7 gui/util/cut.c --- 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 #include #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]; diff -r ddcf459482e9 -r a59b359c20f7 gui/util/cut.h --- 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 +/** + * @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);