Ticket #3066: refactoring of dir_list class and related code.

Initial commit: use GCompareFunc instead of sortfn.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Move sort_field member out from panel_sort_info_t structure.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Rename panel_sort_info_t to dir_sort_options_t

...and use it in routines of load and sort directory.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dir_list_grow): new public API of dir_list.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(handle_path): don't check list size here.

(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Add dir_list::len member to keep number of items in list.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(clean_dir): try minimize memory usage.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(dir_list_append): add new dir_list API and use it.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Rename macros related to dir_list::size.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Rename functions:

set_zero_dir -> dir_list_init
clean_dir -> dir_list_clean
do_sort -> dir_list_sort
do_load_dir -> dir_list_load
do_reload_dir -> dir_list_reload
get_dotdot_dir_stat -> dir_get_dotdot_stat

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>