[asterisk-commits] russell: branch group/asterisk-cpp r168384 - in /team/group/asterisk-cpp: inc...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jan 10 15:01:17 CST 2009
Author: russell
Date: Sat Jan 10 15:01:16 2009
New Revision: 168384
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168384
Log:
asterisk.c builds
Modified:
team/group/asterisk-cpp/include/asterisk/cli.h
team/group/asterisk-cpp/main/asterisk.c
Modified: team/group/asterisk-cpp/include/asterisk/cli.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/cli.h?view=diff&rev=168384&r1=168383&r2=168384
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/cli.h (original)
+++ team/group/asterisk-cpp/include/asterisk/cli.h Sat Jan 10 15:01:16 2009
@@ -148,7 +148,8 @@
* \arg \ref CLI_command_API
*/
struct ast_cli_entry {
- char * const cmda[AST_MAX_CMD_LEN]; /*!< words making up the command.
+ ast_cli_entry(cli_fn h, const char *s) : summary(s), handler(h) {}
+ char *cmda[AST_MAX_CMD_LEN]; /*!< words making up the command.
* set the first entry to NULL for a new-style entry. */
const char *summary; /*!< Summary of the command (< 60 characters) */
Modified: team/group/asterisk-cpp/main/asterisk.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/asterisk.c?view=diff&rev=168384&r1=168383&r2=168384
==============================================================================
--- team/group/asterisk-cpp/main/asterisk.c (original)
+++ team/group/asterisk-cpp/main/asterisk.c Sat Jan 10 15:01:16 2009
@@ -1459,7 +1459,7 @@
fprintf(stdout, "\033]2;%s\007", text);
}
-static void set_icon(char *text)
+static void set_icon(const char *text)
{
if (getenv("TERM") && strstr(getenv("TERM"), "xterm"))
fprintf(stdout, "\033]1;%s\007", text);
@@ -2004,26 +2004,26 @@
#define ASTERISK_PROMPT2 "%s*CLI> "
static struct ast_cli_entry cli_asterisk[] = {
- AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown"),
- AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
- AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
- AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
- AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"),
- AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
- AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
- AST_CLI_DEFINE(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
- AST_CLI_DEFINE(show_license, "Show the license(s) for this copy of Asterisk"),
- AST_CLI_DEFINE(handle_version, "Display version info"),
- AST_CLI_DEFINE(handle_bang, "Execute a shell command"),
+ ast_cli_entry(handle_abort_shutdown, "Cancel a running shutdown"),
+ ast_cli_entry(handle_stop_now, "Shut down Asterisk immediately"),
+ ast_cli_entry(handle_stop_gracefully, "Gracefully shut down Asterisk"),
+ ast_cli_entry(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
+ ast_cli_entry(handle_restart_now, "Restart Asterisk immediately"),
+ ast_cli_entry(handle_restart_gracefully, "Restart Asterisk gracefully"),
+ ast_cli_entry(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
+ ast_cli_entry(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
+ ast_cli_entry(show_license, "Show the license(s) for this copy of Asterisk"),
+ ast_cli_entry(handle_version, "Display version info"),
+ ast_cli_entry(handle_bang, "Execute a shell command"),
#if !defined(LOW_MEMORY)
- AST_CLI_DEFINE(handle_show_version_files, "List versions of files used to build Asterisk"),
- AST_CLI_DEFINE(handle_show_threads, "Show running threads"),
+ ast_cli_entry(handle_show_version_files, "List versions of files used to build Asterisk"),
+ ast_cli_entry(handle_show_threads, "Show running threads"),
#if defined(HAVE_SYSINFO) || defined(HAVE_SYSCTL)
- AST_CLI_DEFINE(handle_show_sysinfo, "Show System Information"),
+ ast_cli_entry(handle_show_sysinfo, "Show System Information"),
#endif
- AST_CLI_DEFINE(handle_show_profile, "Display profiling info"),
- AST_CLI_DEFINE(handle_show_settings, "Show some core settings"),
- AST_CLI_DEFINE(handle_clear_profile, "Clear profiling info"),
+ ast_cli_entry(handle_show_profile, "Display profiling info"),
+ ast_cli_entry(handle_show_settings, "Show some core settings"),
+ ast_cli_entry(handle_clear_profile, "Clear profiling info"),
#endif /* ! LOW_MEMORY */
};
@@ -2264,9 +2264,9 @@
if (!strcmp(retstr, AST_CLI_COMPLETE_EOF))
break;
- if (matches + 1 >= match_list_len) {
+ if (matches + 1 >= (int) match_list_len) {
match_list_len <<= 1;
- if ((match_list_tmp = ast_realloc(match_list, match_list_len * sizeof(char *)))) {
+ if ((match_list_tmp = (char **) ast_realloc(match_list, match_list_len * sizeof(char *)))) {
match_list = match_list_tmp;
} else {
if (match_list)
@@ -2281,8 +2281,8 @@
if (!match_list)
return (char **) NULL;
- if (matches >= match_list_len) {
- if ((match_list_tmp = ast_realloc(match_list, (match_list_len + 1) * sizeof(char *)))) {
+ if (matches >= (int) match_list_len) {
+ if ((match_list_tmp = (char **) ast_realloc(match_list, (match_list_len + 1) * sizeof(char *)))) {
match_list = match_list_tmp;
} else {
if (match_list)
@@ -2391,7 +2391,7 @@
char *mbuf;
int mlen = 0, maxmbuf = 2048;
/* Start with a 2048 byte buffer */
- if (!(mbuf = ast_malloc(maxmbuf)))
+ if (!(mbuf = (char *) ast_malloc(maxmbuf)))
return (char *)(CC_ERROR);
snprintf(buf, sizeof(buf), "_COMMAND MATCHESARRAY \"%s\" \"%s\"", lf->buffer, ptr);
fdsend(ast_consock, buf);
@@ -2401,7 +2401,7 @@
if (mlen + 1024 > maxmbuf) {
/* Every step increment buffer 1024 bytes */
maxmbuf += 1024;
- if (!(mbuf = ast_realloc(mbuf, maxmbuf)))
+ if (!(mbuf = (char *) ast_realloc(mbuf, maxmbuf)))
return (char *)(CC_ERROR);
}
/* Only read 1024 bytes at a time */
@@ -2557,7 +2557,7 @@
char filename[80] = "";
char *hostname;
char *cpid;
- char *version;
+ const char *version;
int pid;
char *stringp = NULL;
@@ -2575,7 +2575,7 @@
}
if (data) {
char prefix[] = "cli quit after ";
- char *tmp = alloca(strlen(data) + strlen(prefix) + 1);
+ char *tmp = (char *) alloca(strlen(data) + strlen(prefix) + 1);
sprintf(tmp, "%s%s", prefix, data);
if (write(ast_consock, tmp, strlen(tmp) + 1) < 0) {
ast_log(LOG_ERROR, "write() failed: %s\n", strerror(errno));
@@ -2743,7 +2743,7 @@
{
struct ast_config *cfg;
struct ast_variable *v;
- char *config = DEFAULT_CONFIG_FILE;
+ const char *config = DEFAULT_CONFIG_FILE;
char hostname[MAXHOSTNAMELEN] = "";
struct ast_flags config_flags = { 0 };
struct {
@@ -3065,7 +3065,7 @@
char *remotesock = NULL;
/* Remember original args for restart */
- if (argc > ARRAY_LEN(_argv) - 1) {
+ if (argc > (int) ARRAY_LEN(_argv) - 1) {
fprintf(stderr, "Truncating argument size to %d\n", (int)ARRAY_LEN(_argv) - 1);
argc = ARRAY_LEN(_argv) - 1;
}
More information about the asterisk-commits
mailing list