From e839b770962dd326a7ccd37b893904fe649e15d1 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 26 Aug 2009 09:07:23 +0200 Subject: [PATCH] Documented mpdm_sscanf() (Closes: #1111). --- TODO | 2 +- mpdm_s.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 185d462..9217976 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ Minimum Profit Data Manager (MPDM) TODO / Bug List Release Critical Bugs --------------------- - * 1111: Document mpdm_sscanf(). * 1112: Document the `DETECTED_ENCODING' variable. * 1113: Document the `TEMP_ENCODING' variable. @@ -238,5 +237,6 @@ Closed (Tue, 03 Feb 2009 07:25:21 +0100). * 1110: Win32 file globbing fails when a leading directory is specified (Wed, 25 Mar 2009 17:04:29 +0100). + * 1111: Document mpdm_sscanf() (Wed, 26 Aug 2009 09:07:01 +0200). Email bugs to angel@triptico.com diff --git a/mpdm_s.c b/mpdm_s.c index 9184ba8..4687851 100644 --- a/mpdm_s.c +++ b/mpdm_s.c @@ -982,6 +982,23 @@ struct { { L'\0', NULL, NULL }, }; +/** + * mpdm_sscanf - Extracts data like sscanf() + * @fmt: the string format + * @str: the string to be parsed + * @offset: the character offset to start scanning + * + * Extracts data from a string using a special format pattern, very + * much like the scanf() series of functions in the C library. Apart + * from the standard percent-sign-commands (%s, %u, %d, %i, %f, %x, + * %n, %[, with optional size and * to ignore), it implements %S, + * to match a string of characters upto what follows in the format + * string. Also, the %[ set of characters can include other % formats. + * + * Returns an array with the extracted values. If %n is used, the + * position in the scanned string is returned as the value. + * [Strings] + */ mpdm_t mpdm_sscanf(const mpdm_t fmt, const mpdm_t str, int offset) { wchar_t *i = (wchar_t *)str->data; -- 2.11.4.GIT