mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
add support for per-module version numbers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
15
cli.c
15
cli.c
@@ -227,19 +227,18 @@ static int handle_unload(int fd, int argc, char *argv[])
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
#define MODLIST_FORMAT "%-25s %-40.40s %-10d\n"
|
||||
#define MODLIST_FORMAT2 "%-25s %-40.40s %-10s\n"
|
||||
#define MODLIST_FORMAT "%-30s %-40.40s %-20.20s %-10d\n"
|
||||
#define MODLIST_FORMAT2 "%-30s %-40.40s %-20.20s %-10s\n"
|
||||
|
||||
AST_MUTEX_DEFINE_STATIC(climodentrylock);
|
||||
static int climodentryfd = -1;
|
||||
|
||||
static int modlist_modentry(char *module, char *description, int usecnt, char *like)
|
||||
static int modlist_modentry(const char *module, const char *description, int usecnt, const char *version, const char *like)
|
||||
{
|
||||
/* Comparing the like with the module */
|
||||
if ( strstr(module,like) != NULL) {
|
||||
ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt);
|
||||
if (strstr(module, like) != NULL) {
|
||||
ast_cli(climodentryfd, MODLIST_FORMAT, module, description, version, usecnt);
|
||||
return 1;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -385,8 +384,8 @@ static int handle_modlist(int fd, int argc, char *argv[])
|
||||
|
||||
ast_mutex_lock(&climodentrylock);
|
||||
climodentryfd = fd;
|
||||
ast_cli(fd, MODLIST_FORMAT2, "Module", "Description", "Use Count");
|
||||
ast_cli(fd,"%d modules loaded\n",ast_update_module_list(modlist_modentry,like));
|
||||
ast_cli(fd, MODLIST_FORMAT2, "Module", "Description", "Version", "Use Count");
|
||||
ast_cli(fd,"%d modules loaded\n", ast_update_module_list(modlist_modentry, like));
|
||||
climodentryfd = -1;
|
||||
ast_mutex_unlock(&climodentrylock);
|
||||
return RESULT_SUCCESS;
|
||||
|
Reference in New Issue
Block a user