Add a linkedlist macro that maintains a sorted list

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-03-26 19:19:31 +00:00
parent dd2700d0b1
commit e6fc9ae52c
3 changed files with 41 additions and 5 deletions

View File

@@ -878,7 +878,7 @@ static void config_cache_attribute(const char *configfile, enum config_cache_att
cfmtime->who_asked = cfmtime->filename + strlen(configfile) + 1;
strcpy(cfmtime->who_asked, who_asked);
/* Note that the file mtime is initialized to 0, i.e. 1970 */
AST_LIST_INSERT_TAIL(&cfmtime_head, cfmtime, list);
AST_LIST_INSERT_SORTALPHA(&cfmtime_head, cfmtime, list, filename);
}
if (!stat(configfile, &statbuf))
@@ -1211,7 +1211,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
cfmtime->who_asked = cfmtime->filename + strlen(fn) + 1;
strcpy(cfmtime->who_asked, who_asked);
/* Note that the file mtime is initialized to 0, i.e. 1970 */
AST_LIST_INSERT_TAIL(&cfmtime_head, cfmtime, list);
AST_LIST_INSERT_SORTALPHA(&cfmtime_head, cfmtime, list, filename);
}
}