summaryrefslogtreecommitdiff
path: root/include/asterisk/app.h
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-10-15 22:33:30 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-10-15 22:33:30 +0000
commitc74a2d0b455849f5178ea16d94629b924bebf025 (patch)
treea02c02a5a661dba55796ba78a3c160128a2cf51b /include/asterisk/app.h
parenta39f3a7521bebed699c91346d4e72d26388042ab (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: https://origsvn.digium.com/svn/asterisk/trunk@224225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/app.h')
-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