summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_str.h
diff options
context:
space:
mode:
authorShilpa Singh <shilpa.singh@samsung.com>2015-11-09 12:42:48 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-09 12:42:50 -0800
commit0c1bb7d7b3d4e9a91ae33455ab761d7e9405c2df (patch)
treec159a644f60846496e8287dedee7e91e5c411707 /src/lib/eina/eina_str.h
parent599141a96b68262022a281dbb7c225fd68d57b18 (diff)
eina: add API eina_strftime
Summary: Add new API eina_strftime API in eina_str @feature Test Plan: test case and example also updated Reviewers: tasn, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3148 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/eina/eina_str.h')
-rw-r--r--src/lib/eina/eina_str.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/eina/eina_str.h b/src/lib/eina/eina_str.h
index 100cc81c48..0448269792 100644
--- a/src/lib/eina/eina_str.h
+++ b/src/lib/eina/eina_str.h
@@ -355,6 +355,32 @@ static inline size_t eina_strlen_bounded(const char *str, size_t maxlen) EINA_PU
355 * @since 1.13 355 * @since 1.13
356 */ 356 */
357EAPI unsigned char *eina_memdup(unsigned char *mem, size_t size, Eina_Bool terminate); 357EAPI unsigned char *eina_memdup(unsigned char *mem, size_t size, Eina_Bool terminate);
358
359/**
360 * @brief Create and update the buffer based on strftime output.
361 *
362 * @param tm Pointer to a tm structure needed by strftime.
363 * @param format String containing format specifiers needed by strftime.
364 * @return Updated buffer based on strftime output
365 *
366 * This will create a buffer of exact required size based on strftime output
367 * once use is complete the buffer has to be freed using free.
368 *
369 * Example usage:
370 * @code
371 * time_t curr_time;
372 * struct tm *info;
373 * char *buf;
374 * curr_time = time(NULL);
375 * info = localtime(&curr_time);
376 * buf = eina_strftime("%I:%M%p", info);
377 * //after use
378 * free(buf);
379 * @endcode
380 *
381 * @since 1.16.0
382 */
383EAPI char *eina_strftime(const char *format, const struct tm *tm);
358#include "eina_inline_str.x" 384#include "eina_inline_str.x"
359 385
360/** 386/**