Mercurial > mplayer.hg
comparison gui/util/string.c @ 35475:49f29de2ff10
Cosmetic: Place doxygen note at the end of the comment.
author | ib |
---|---|
date | Sun, 02 Dec 2012 23:46:31 +0000 |
parents | 1edb306bc754 |
children | ab09ed2d181b |
comparison
equal
deleted
inserted
replaced
35474:e53785e5205b | 35475:49f29de2ff10 |
---|---|
211 /** | 211 /** |
212 * @brief Assign a duplicated string. | 212 * @brief Assign a duplicated string. |
213 * | 213 * |
214 * The string is duplicated by calling #gstrdup(). | 214 * The string is duplicated by calling #gstrdup(). |
215 * | 215 * |
216 * @note @a *old is freed prior to the assignment. | |
217 * | |
218 * @param old pointer to a variable suitable to store the new pointer | 216 * @param old pointer to a variable suitable to store the new pointer |
219 * @param str string to be duplicated | 217 * @param str string to be duplicated |
218 * | |
219 * @note @a *old is freed prior to the assignment. | |
220 */ | 220 */ |
221 void setdup(char **old, const char *str) | 221 void setdup(char **old, const char *str) |
222 { | 222 { |
223 free(*old); | 223 free(*old); |
224 *old = gstrdup(str); | 224 *old = gstrdup(str); |
225 } | 225 } |
226 | 226 |
227 /** | 227 /** |
228 * @brief Assign a newly allocated string | 228 * @brief Assign a newly allocated string |
229 * containing the path created from a directory and a filename. | 229 * containing the path created from a directory and a filename. |
230 * | |
231 * @note @a *old is freed prior to the assignment. | |
232 * | 230 * |
233 * @param old pointer to a variable suitable to store the new pointer | 231 * @param old pointer to a variable suitable to store the new pointer |
234 * @param dir directory | 232 * @param dir directory |
235 * @param name filename | 233 * @param name filename |
234 * | |
235 * @note @a *old is freed prior to the assignment. | |
236 */ | 236 */ |
237 void setddup(char **old, const char *dir, const char *name) | 237 void setddup(char **old, const char *dir, const char *name) |
238 { | 238 { |
239 free(*old); | 239 free(*old); |
240 *old = malloc(strlen(dir) + strlen(name) + 2); | 240 *old = malloc(strlen(dir) + strlen(name) + 2); |
329 } | 329 } |
330 | 330 |
331 /** | 331 /** |
332 * @brief Read characters from @a file. | 332 * @brief Read characters from @a file. |
333 * | 333 * |
334 * @note Reading stops with an end-of-line character or at end of file. | |
335 * | |
336 * @param str pointer to a buffer to receive the read characters | 334 * @param str pointer to a buffer to receive the read characters |
337 * @param size number of characters read at the most (including a terminating null-character) | 335 * @param size number of characters read at the most (including a terminating null-character) |
338 * @param file file to read from | 336 * @param file file to read from |
339 * | 337 * |
340 * @return str (success) or NULL (error) | 338 * @return str (success) or NULL (error) |
339 * | |
340 * @note Reading stops with an end-of-line character or at end of file. | |
341 */ | 341 */ |
342 char *fgetstr(char *str, int size, FILE *file) | 342 char *fgetstr(char *str, int size, FILE *file) |
343 { | 343 { |
344 char *s; | 344 char *s; |
345 | 345 |