39 #ifndef SWITCH_CONSOLE_H
40 #define SWITCH_CONSOLE_H
45 #define SWITCH_CMD_CHUNK_LEN 1024
46 #define SWITCH_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); s.data = malloc(SWITCH_CMD_CHUNK_LEN); \
47 switch_assert(s.data); \
48 memset(s.data, 0, SWITCH_CMD_CHUNK_LEN); \
50 s.data_size = SWITCH_CMD_CHUNK_LEN; \
51 s.write_function = switch_console_stream_write; \
52 s.raw_write_function = switch_console_stream_raw_write; \
53 s.alloc_len = SWITCH_CMD_CHUNK_LEN; \
54 s.alloc_chunk = SWITCH_CMD_CHUNK_LEN
switch_status_t switch_console_run_complete_func(const char *func, const char *line, const char *last_word, switch_console_callback_match_t **matches)
switch_text_channel_t
A target to write log/debug info to.
#define SWITCH_END_EXTERN_C
switch_status_t(* switch_console_complete_callback_t)(const char *, const char *, switch_console_callback_match_t **matches)
switch_memory_pool_t * pool
A representation of an XML tree.
switch_status_t switch_console_shutdown(void)
switch_status_t switch_console_add_complete_func(const char *name, switch_console_complete_callback_t cb)
void switch_status_t switch_console_stream_raw_write(switch_stream_handle_t *handle, uint8_t *data, switch_size_t datalen)
char * switch_console_expand_alias(char *cmd, char *arg)
unsigned char switch_console_complete(const char *line, const char *last_word, FILE *console_out, switch_stream_handle_t *stream, switch_xml_t xml)
void switch_console_push_match_unique(switch_console_callback_match_t **matches, const char *new_val)
void switch_console_free_matches(switch_console_callback_match_t **matches)
void switch_console_push_match(switch_console_callback_match_t **matches, const char *new_val)
switch_status_t switch_console_init(switch_memory_pool_t *pool)
void switch_console_printf(switch_text_channel_t channel, const char *file, const char *func, int line, const char *fmt,...) PRINTF_FUNCTION(5
A method akin to printf that allows you to redirect output to a specific console "channel".
switch_status_t switch_status_t switch_stream_write_file_contents(switch_stream_handle_t *stream, const char *path)
switch_status_t
Common return values.
void switch_console_save_history(void)
switch_status_t switch_console_del_complete_func(const char *name)
switch_status_t switch_console_stream_write(switch_stream_handle_t *handle, const char *fmt,...) PRINTF_FUNCTION(2
A method akin to printf for dealing with api streams.
struct apr_pool_t switch_memory_pool_t
switch_status_t switch_console_execute(char *xcmd, int rec, switch_stream_handle_t *istream)
void switch_console_sort_matches(switch_console_callback_match_t *matches)
void switch_console_loop(void)
A simple comand loop that reads input from the terminal.
#define SWITCH_BEGIN_EXTERN_C