add API function for parsing strings to time_t (issue #6320, with mods)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2006-02-15 00:24:24 +00:00
parent 124b00c4a4
commit 4662d58b01
8 changed files with 66 additions and 72 deletions

View File

@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
* Copyright (C) 1999 - 2006, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
@@ -223,6 +223,15 @@ int ast_false(const char *val);
*/
void ast_join(char *s, size_t len, char * const w[]);
/*
\brief Parse a time (integer) string.
\param src String to parse
\param dst Destination
\param _default Value to use if the string does not contain a valid time
\return zero on success, non-zero on failure
*/
int ast_get_time_t(const char *src, time_t *dst, time_t _default);
/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
struct ast_realloca {