[MPlayer-cvslog] r34069 - in trunk/gui/util: cut.c cut.h
ib
subversion at mplayerhq.hu
Tue Sep 6 14:11:23 CEST 2011
Author: ib
Date: Tue Sep 6 14:11:23 2011
New Revision: 34069
Log:
Add doxygen comments to cut.c and cut.h.
Modified:
trunk/gui/util/cut.c
trunk/gui/util/cut.h
Modified: trunk/gui/util/cut.c
==============================================================================
--- trunk/gui/util/cut.c Tue Sep 6 13:18:00 2011 (r34068)
+++ trunk/gui/util/cut.c Tue Sep 6 14:11:23 2011 (r34069)
@@ -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 @@ void cutItemString(char *in, char *out,
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];
Modified: trunk/gui/util/cut.h
==============================================================================
--- trunk/gui/util/cut.h Tue Sep 6 13:18:00 2011 (r34068)
+++ trunk/gui/util/cut.h Tue Sep 6 14:11:23 2011 (r34069)
@@ -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);
More information about the MPlayer-cvslog
mailing list