comparison gui/util/string.c @ 35479:ab09ed2d181b

Add doxygen comments to string.c. Additionally, revise two comments.
author ib
date Mon, 03 Dec 2012 10:50:48 +0000
parents 49f29de2ff10
children 0477dcdcd6d6
comparison
equal deleted inserted replaced
35478:f30b45bafb82 35479:ab09ed2d181b
14 * You should have received a copy of the GNU General Public License along 14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., 15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */ 17 */
18 18
19 /**
20 * @file
21 * @brief String utilities
22 */
23
19 #include <stdlib.h> 24 #include <stdlib.h>
20 #include <string.h> 25 #include <string.h>
21 26
22 #include "string.h" 27 #include "string.h"
23 #include "gui/interface.h" 28 #include "gui/interface.h"
143 } 148 }
144 149
145 return in; 150 return in;
146 } 151 }
147 152
153 /**
154 * @brief A strchr() that can handle NULL pointers.
155 *
156 * @param str string to examine
157 * @param c character to find
158 *
159 * @return return value of strchr() or NULL, if @a str is NULL
160 */
148 char *gstrchr(const char *str, int c) 161 char *gstrchr(const char *str, int c)
149 { 162 {
150 if (!str) 163 if (!str)
151 return NULL; 164 return NULL;
152 165
157 * @brief A strcmp() that can handle NULL pointers. 170 * @brief A strcmp() that can handle NULL pointers.
158 * 171 *
159 * @param a string to be compared 172 * @param a string to be compared
160 * @param b string which is compared 173 * @param b string which is compared
161 * 174 *
162 * @return return value of strcmp() or -1, if a or b are NULL 175 * @return return value of strcmp() or -1, if @a a or @a b are NULL
163 */ 176 */
164 int gstrcmp(const char *a, const char *b) 177 int gstrcmp(const char *a, const char *b)
165 { 178 {
166 if (!a && !b) 179 if (!a && !b)
167 return 0; 180 return 0;
176 * 189 *
177 * @param a string to be compared 190 * @param a string to be compared
178 * @param b string which is compared 191 * @param b string which is compared
179 * @param n number of characters compared at the most 192 * @param n number of characters compared at the most
180 * 193 *
181 * @return return value of strncmp() or -1, if a or b are NULL 194 * @return return value of strncmp() or -1, if @a a or @a b are NULL
182 */ 195 */
183 int gstrncmp(const char *a, const char *b, size_t n) 196 int gstrncmp(const char *a, const char *b, size_t n)
184 { 197 {
185 if (!a && !b) 198 if (!a && !b)
186 return 0; 199 return 0;