aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-15 22:33:30 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-15 22:33:30 +0000
commit0c997b3fd177c4da568347d1dd6056e88cec08c5 (patch)
treea02c02a5a661dba55796ba78a3c160128a2cf51b /include
parent3531d342bf3c976a443c3696088880419d2e05c5 (diff)
Create an API for adding an optional time unit onto the ends of time periods.
Two examples of its use are included, and the usage could be expanded in some cases into certain configuration options where time periods are specified. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224225 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/app.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 6d73b7786..e2ec86328 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -84,6 +84,12 @@ struct ast_ivr_menu {
static struct ast_ivr_option __options_##holder[] = foo;\
static struct ast_ivr_menu holder = { title, flags, __options_##holder }
+typedef enum {
+ TIMELEN_HOURS,
+ TIMELEN_MINUTES,
+ TIMELEN_SECONDS,
+ TIMELEN_MILLISECONDS,
+} ast_timelen;
/*! \brief Runs an IVR menu
\return returns 0 on successful completion, -1 on hangup, or -2 on user error in menu */
@@ -580,6 +586,17 @@ int ast_safe_fork(int stop_reaper);
*/
void ast_safe_fork_cleanup(void);
+/*!
+ * \brief Common routine to parse time lengths, with optional time unit specifier
+ * \param[in] timestr String to parse
+ * \param[in] defunit Default unit type
+ * \param[out] result Resulting value, specified in milliseconds
+ * \retval 0 Success
+ * \retval -1 Failure
+ * \since 1.8
+ */
+int ast_app_parse_timelen(const char *timestr, int *result, ast_timelen defunit);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif