mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 14:06:27 +00:00
Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes all traces of it. Previously exported symbols removed: * __ast_register_file * __ast_unregister_file * ast_complete_source_filename This also removes the mtx_prof static variable that was declared when MTX_PROFILE was enabled. This variable was only used in lock.c so it is now initialized in that file only. ASTERISK-26480 #close Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
This commit is contained in:
@@ -149,8 +149,6 @@
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
ASTERISK_REGISTER_FILE()
|
||||
|
||||
#include "asterisk/_private.h"
|
||||
|
||||
#undef sched_setscheduler
|
||||
@@ -487,75 +485,6 @@ static struct {
|
||||
unsigned int need_quit_handler:1;
|
||||
} sig_flags;
|
||||
|
||||
#if !defined(LOW_MEMORY)
|
||||
struct registered_file {
|
||||
AST_RWLIST_ENTRY(registered_file) list;
|
||||
const char *file;
|
||||
};
|
||||
|
||||
static AST_RWLIST_HEAD_STATIC(registered_files, registered_file);
|
||||
#endif /* ! LOW_MEMORY */
|
||||
|
||||
void __ast_register_file(const char *file)
|
||||
{
|
||||
#if !defined(LOW_MEMORY)
|
||||
struct registered_file *reg;
|
||||
|
||||
reg = ast_calloc(1, sizeof(*reg));
|
||||
if (!reg) {
|
||||
return;
|
||||
}
|
||||
|
||||
reg->file = file;
|
||||
AST_RWLIST_WRLOCK(®istered_files);
|
||||
AST_RWLIST_INSERT_HEAD(®istered_files, reg, list);
|
||||
AST_RWLIST_UNLOCK(®istered_files);
|
||||
#endif /* ! LOW_MEMORY */
|
||||
}
|
||||
|
||||
void __ast_unregister_file(const char *file)
|
||||
{
|
||||
#if !defined(LOW_MEMORY)
|
||||
struct registered_file *find;
|
||||
|
||||
AST_RWLIST_WRLOCK(®istered_files);
|
||||
AST_RWLIST_TRAVERSE_SAFE_BEGIN(®istered_files, find, list) {
|
||||
if (!strcasecmp(find->file, file)) {
|
||||
AST_RWLIST_REMOVE_CURRENT(list);
|
||||
break;
|
||||
}
|
||||
}
|
||||
AST_RWLIST_TRAVERSE_SAFE_END;
|
||||
AST_RWLIST_UNLOCK(®istered_files);
|
||||
|
||||
if (find) {
|
||||
ast_free(find);
|
||||
}
|
||||
#endif /* ! LOW_MEMORY */
|
||||
}
|
||||
|
||||
char *ast_complete_source_filename(const char *partial, int n)
|
||||
{
|
||||
#if !defined(LOW_MEMORY)
|
||||
struct registered_file *find;
|
||||
size_t len = strlen(partial);
|
||||
int count = 0;
|
||||
char *res = NULL;
|
||||
|
||||
AST_RWLIST_RDLOCK(®istered_files);
|
||||
AST_RWLIST_TRAVERSE(®istered_files, find, list) {
|
||||
if (!strncasecmp(find->file, partial, len) && ++count > n) {
|
||||
res = ast_strdup(find->file);
|
||||
break;
|
||||
}
|
||||
}
|
||||
AST_RWLIST_UNLOCK(®istered_files);
|
||||
return res;
|
||||
#else /* if defined(LOW_MEMORY) */
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(LOW_MEMORY)
|
||||
struct thread_list_t {
|
||||
AST_RWLIST_ENTRY(thread_list_t) list;
|
||||
|
||||
Reference in New Issue
Block a user