Include <glob.h>.
(MAX_TIME): New macro.
(Masterisk): New variable.
(get_database_stream): Argument changed to (MDatabaseInfo *).
Callers changed.
(get_dir_info): Renamed from duplicate_dirname. Callers changed.
(find_database): New function.
(update_database_list): New function.
(mdatabase__init): Initialize Masterisk. Setup mdb_list by
calling update_database_list.
(mdatabase__check): New function.
(mdatabase_find): Use update_database and find_database. Don't
handle MDatabaseHookFunc.
(mdatabase_list): Call update_database at first.
(mdatabase_define): Adjusted for the change of mdb->extra_info.