add tab completion for 'core set debug X filename.c'

(closes issue #13969)
Reported by: jtodd
Patches:
      20081205__bug13969.diff.txt uploaded by Corydon76 (license 14)
Tested by: mvanbaak, eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Michiel van Baak
2008-12-10 17:09:15 +00:00
parent 6c569f1e3a
commit c8c8995b70
3 changed files with 91 additions and 8 deletions

View File

@@ -319,6 +319,24 @@ void ast_unregister_file_version(const char *file)
ast_free(find);
}
char *ast_complete_source_filename(const char *partial, int n)
{
struct file_version *find;
size_t len = strlen(partial);
int count = 0;
char *res = NULL;
AST_RWLIST_RDLOCK(&file_versions);
AST_RWLIST_TRAVERSE(&file_versions, find, list) {
if (!strncasecmp(find->file, partial, len) && ++count > n) {
res = ast_strdup(find->file);
break;
}
}
AST_RWLIST_UNLOCK(&file_versions);
return res;
}
/*! \brief Find version for given module name */
const char *ast_file_version_find(const char *file)
{