* is pressed during playback, it will immediately break out of the message and continue
* execution of your code.
*/
-int ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout);
+enum ast_getdata_result ast_app_getdata(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout);
/*! \brief Plays a stream and gets DTMF data from a channel
* \param c Which channel one is interacting with
* is pressed during playback, it will immediately break out of the message and continue
* execution of your code.
*/
-int ast_app_getdata_terminator(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, char *terminator);
+enum ast_getdata_result ast_app_getdata_terminator(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, char *terminator);
/*! \brief Full version with audiofd and controlfd. NOTE: returns '2' on ctrlfd available, not '1' like other full functions */
int ast_app_getdata_full(struct ast_channel *c, const char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd);
return res;
}
-int ast_load_resource(const char *resource_name)
+enum ast_module_load_result ast_load_resource(const char *resource_name)
{
struct ast_module *mod;
- int res;
+ enum ast_module_load_result res;
/* If we're trying to load a module that previously declined to load,
* transparently unload it first so we dlclose, then dlopen it afresh.
type->name = NULL;
}
-int stasis_message_type_create(const char *name,
+enum stasis_message_type_result stasis_message_type_create(const char *name,
struct stasis_message_vtable *vtable,
struct stasis_message_type **result)
{
{
int res = AST_TEST_PASS;
const char *in = "a\"bcdefg\"hijkl\\mnopqrs tuv\twxyz";
- char out[256] = { 0 };
- char small[4] = { 0 };
int i;
+#define LONG_SIZE 256
+#define SHORT_SIZE 4
static struct {
char *buf;
const char *output;
} tests[] = {
- {0, sizeof(out),
+ {NULL, LONG_SIZE,
"a\\\"bcdefg\\\"hijkl\\\\mnopqrs tuv\twxyz"},
- {0, sizeof(small),
+ {NULL, SHORT_SIZE,
"a\\\""},
};
- tests[0].buf = out;
- tests[1].buf = small;
+ tests[0].buf = ast_alloca(LONG_SIZE);
+ tests[1].buf = ast_alloca(SHORT_SIZE);
switch (cmd) {
case TEST_INIT:
}
}
+#undef LONG_SIZE
+#undef SHORT_SIZE
return res;
}