1998-02-27 07:54:42 +03:00
|
|
|
/* Setup loading/saving.
|
|
|
|
Copyright (C) 1994 Miguel de Icaza
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2000-08-23 02:50:00 +04:00
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <sys/types.h> /* Needed to include local .h files */
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
2001-09-03 09:07:40 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "global.h"
|
2001-09-03 09:07:40 +04:00
|
|
|
#include "tty.h"
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
#include "dir.h"
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "panel.h"
|
|
|
|
#include "main.h"
|
2002-12-08 07:16:30 +03:00
|
|
|
#include "tree.h" /* xtree_mode */
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "profile.h"
|
1998-12-03 00:27:27 +03:00
|
|
|
#define WANT_WIDGETS
|
1998-02-27 07:54:42 +03:00
|
|
|
#include "setup.h"
|
|
|
|
#include "mouse.h" /* To make view.h happy */
|
|
|
|
#include "view.h" /* For the externs */
|
|
|
|
#include "key.h" /* For the externs */
|
|
|
|
#include "hotlist.h" /* load/save/done hotlist */
|
|
|
|
#include "panelize.h" /* load/save/done panelize */
|
|
|
|
#include "layout.h"
|
|
|
|
#include "menu.h" /* menubar_visible declaration */
|
|
|
|
#include "win.h" /* lookup_key */
|
|
|
|
#include "cmd.h"
|
2002-12-08 07:16:30 +03:00
|
|
|
#include "file.h" /* safe_delete */
|
1998-04-15 07:16:29 +04:00
|
|
|
|
2001-06-06 02:49:15 +04:00
|
|
|
#ifdef HAVE_CHARSET
|
|
|
|
#include "charsets.h"
|
|
|
|
#endif
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#ifdef USE_NETCODE
|
|
|
|
# include "../vfs/ftpfs.h"
|
|
|
|
#endif
|
|
|
|
|
2002-08-19 05:43:40 +04:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
|
|
|
# include "../edit/edit.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
extern char *find_ignore_dirs;
|
|
|
|
|
|
|
|
extern int num_history_items_recorded;
|
|
|
|
|
2002-08-17 05:11:21 +04:00
|
|
|
char *profile_name; /* .mc/ini */
|
|
|
|
char *global_profile_name; /* mc.lib */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
char setup_color_string [4096];
|
|
|
|
char term_color_string [4096];
|
|
|
|
char color_terminal_string [512];
|
|
|
|
|
|
|
|
#define load_int(a,b,c) GetPrivateProfileInt(a,b,c,profile_name)
|
|
|
|
#define load_string(a,b,c,d,e) GetPrivateProfileString(a,b,c,d,e,profile_name)
|
|
|
|
#define save_string WritePrivateProfileString
|
|
|
|
|
|
|
|
int startup_left_mode;
|
|
|
|
int startup_right_mode;
|
|
|
|
|
|
|
|
/* Ugly hack to allow panel_save_setup to work as a place holder for */
|
|
|
|
/* default panel values */
|
|
|
|
int saving_setup;
|
|
|
|
|
2000-02-02 19:57:51 +03:00
|
|
|
static const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *key;
|
|
|
|
sortfn *sort_type;
|
|
|
|
} sort_names [] = {
|
|
|
|
{ "name", (sortfn *) sort_name },
|
|
|
|
{ "extension", (sortfn *) sort_ext },
|
|
|
|
{ "time", (sortfn *) sort_time },
|
|
|
|
{ "atime", (sortfn *) sort_atime },
|
|
|
|
{ "ctime", (sortfn *) sort_ctime },
|
|
|
|
{ "size", (sortfn *) sort_size },
|
|
|
|
{ "inode", (sortfn *) sort_inode },
|
|
|
|
{ "unsorted", (sortfn *) unsorted },
|
|
|
|
{ 0, 0 }
|
|
|
|
};
|
|
|
|
|
2000-02-02 19:57:51 +03:00
|
|
|
static const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *key;
|
|
|
|
int list_type;
|
|
|
|
} list_types [] = {
|
1998-05-12 08:26:21 +04:00
|
|
|
{ "full", list_full },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "brief", list_brief },
|
1998-05-12 08:26:21 +04:00
|
|
|
{ "long", list_long },
|
|
|
|
{ "user", list_user },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ 0, 0 }
|
|
|
|
};
|
|
|
|
|
2000-02-02 19:57:51 +03:00
|
|
|
static const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *opt_name;
|
|
|
|
int opt_type;
|
|
|
|
} panel_types [] = {
|
|
|
|
{ "listing", view_listing },
|
|
|
|
{ "quickview", view_quick },
|
|
|
|
{ "info", view_info },
|
|
|
|
{ "tree", view_tree },
|
|
|
|
{ 0, 0 }
|
|
|
|
};
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2000-02-02 19:57:51 +03:00
|
|
|
static const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *opt_name;
|
|
|
|
int *opt_addr;
|
|
|
|
} layout [] = {
|
|
|
|
{ "equal_split", &equal_split },
|
|
|
|
{ "first_panel_size", &first_panel_size },
|
|
|
|
{ "message_visible", &message_visible },
|
|
|
|
{ "keybar_visible", &keybar_visible },
|
2002-12-26 19:10:45 +03:00
|
|
|
{ "xterm_title", &xterm_title },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "output_lines", &output_lines },
|
|
|
|
{ "command_prompt", &command_prompt },
|
2001-06-19 04:43:56 +04:00
|
|
|
{ "menubar_visible", &menubar_visible },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "show_mini_info", &show_mini_info },
|
|
|
|
{ "permission_mode", &permission_mode },
|
|
|
|
{ "filetype_mode", &filetype_mode },
|
|
|
|
{ 0, 0 }
|
|
|
|
};
|
|
|
|
|
2000-02-02 19:57:51 +03:00
|
|
|
static const struct {
|
1998-02-27 07:54:42 +03:00
|
|
|
char *opt_name;
|
|
|
|
int *opt_addr;
|
|
|
|
} options [] = {
|
|
|
|
{ "show_backups", &show_backups },
|
|
|
|
{ "show_dot_files", &show_dot_files },
|
|
|
|
{ "verbose", &verbose },
|
|
|
|
{ "mark_moves_down", &mark_moves_down },
|
|
|
|
{ "pause_after_run", &pause_after_run },
|
|
|
|
{ "shell_patterns", &easy_patterns },
|
|
|
|
{ "auto_save_setup", &auto_save_setup },
|
|
|
|
{ "auto_menu", &auto_menu },
|
|
|
|
{ "use_internal_view", &use_internal_view },
|
|
|
|
{ "use_internal_edit", &use_internal_edit },
|
|
|
|
{ "clear_before_exec", &clear_before_exec },
|
|
|
|
{ "mix_all_files", &mix_all_files },
|
|
|
|
{ "fast_reload", &fast_reload },
|
|
|
|
{ "fast_reload_msg_shown", &fast_reload_w },
|
|
|
|
{ "confirm_delete", &confirm_delete },
|
|
|
|
{ "confirm_overwrite", &confirm_overwrite },
|
|
|
|
{ "confirm_execute", &confirm_execute },
|
|
|
|
{ "confirm_exit", &confirm_exit },
|
2002-10-22 01:03:22 +04:00
|
|
|
{ "safe_delete", &safe_delete },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "mouse_repeat_rate", &mou_auto_repeat },
|
|
|
|
{ "double_click_speed", &double_click_speed },
|
2001-06-06 02:49:15 +04:00
|
|
|
#ifndef HAVE_CHARSET
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "eight_bit_clean", &eight_bit_clean },
|
|
|
|
{ "full_eight_bits", &full_eight_bits },
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* !HAVE_CHARSET */
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "use_8th_bit_as_meta", &use_8th_bit_as_meta },
|
|
|
|
{ "confirm_view_dir", &confirm_view_dir },
|
|
|
|
{ "mouse_move_pages", &mouse_move_pages },
|
|
|
|
{ "mouse_move_pages_viewer", &mouse_move_pages_viewer },
|
|
|
|
{ "fast_refresh", &fast_refresh },
|
|
|
|
{ "navigate_with_arrows", &navigate_with_arrows },
|
|
|
|
{ "drop_menus", &drop_menus },
|
1998-03-14 03:42:23 +03:00
|
|
|
{ "wrap_mode", &global_wrap_mode},
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "old_esc_mode", &old_esc_mode },
|
|
|
|
{ "cd_symlinks", &cd_symlinks },
|
|
|
|
{ "show_all_if_ambiguous", &show_all_if_ambiguous },
|
|
|
|
{ "have_fast_cpu", &have_fast_cpu },
|
2002-12-27 09:48:33 +03:00
|
|
|
{ "max_dirt_limit", &max_dirt_limit },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "torben_fj_mode", &torben_fj_mode },
|
|
|
|
{ "use_file_to_guess_type", &use_file_to_check_type },
|
|
|
|
{ "alternate_plus_minus", &alternate_plus_minus },
|
|
|
|
{ "only_leading_plus_minus", &only_leading_plus_minus },
|
|
|
|
{ "show_output_starts_shell", &output_starts_shell },
|
|
|
|
{ "panel_scroll_pages", &panel_scroll_pages },
|
|
|
|
{ "xtree_mode", &xtree_mode },
|
|
|
|
{ "num_history_items_recorded", &num_history_items_recorded },
|
1998-12-05 02:39:41 +03:00
|
|
|
{ "file_op_compute_totals", &file_op_compute_totals },
|
1999-09-21 00:03:58 +04:00
|
|
|
#ifdef USE_VFS
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "vfs_timeout", &vfs_timeout },
|
|
|
|
#ifdef USE_NETCODE
|
|
|
|
{ "ftpfs_directory_timeout", &ftpfs_directory_timeout },
|
|
|
|
{ "use_netrc", &use_netrc },
|
|
|
|
{ "ftpfs_retry_seconds", &ftpfs_retry_seconds },
|
|
|
|
{ "ftpfs_always_use_proxy", &ftpfs_always_use_proxy },
|
|
|
|
{ "ftpfs_use_passive_connections", &ftpfs_use_passive_connections },
|
1998-10-11 23:19:03 +04:00
|
|
|
{ "ftpfs_use_unix_list_options", &ftpfs_use_unix_list_options },
|
1999-01-31 23:28:13 +03:00
|
|
|
{ "ftpfs_first_cd_then_ls", &ftpfs_first_cd_then_ls },
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_NETCODE */
|
|
|
|
#endif /* USE_VFS */
|
1998-02-27 07:54:42 +03:00
|
|
|
#ifdef USE_INTERNAL_EDIT
|
|
|
|
{ "editor_word_wrap_line_length", &option_word_wrap_line_length },
|
|
|
|
{ "editor_key_emulation", &edit_key_emulation },
|
|
|
|
{ "editor_tab_spacing", &option_tab_spacing },
|
|
|
|
{ "editor_fill_tabs_with_spaces", &option_fill_tabs_with_spaces },
|
|
|
|
{ "editor_return_does_auto_indent", &option_return_does_auto_indent },
|
|
|
|
{ "editor_backspace_through_tabs", &option_backspace_through_tabs },
|
|
|
|
{ "editor_fake_half_tabs", &option_fake_half_tabs },
|
|
|
|
{ "editor_option_save_mode", &option_save_mode },
|
2002-11-30 03:37:14 +03:00
|
|
|
{ "editor_option_save_position", &option_save_position },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ "editor_option_backup_ext_int", &option_backup_ext_int },
|
|
|
|
{ "editor_option_auto_para_formatting", &option_auto_para_formatting },
|
|
|
|
{ "editor_option_typewriter_wrap", &option_typewriter_wrap },
|
|
|
|
{ "editor_edit_confirm_save", &edit_confirm_save },
|
1998-04-24 19:18:08 +04:00
|
|
|
{ "editor_syntax_highlighting", &option_syntax_highlighting },
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_INTERNAL_EDIT */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
{ "nice_rotating_dash", &nice_rotating_dash },
|
1999-01-17 07:17:20 +03:00
|
|
|
{ "horizontal_split", &horizontal_split },
|
1998-02-27 07:54:42 +03:00
|
|
|
{ 0, 0 }
|
|
|
|
};
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void
|
2002-11-11 10:35:08 +03:00
|
|
|
panel_save_setup (struct WPanel *panel, char *section)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
char buffer [BUF_TINY];
|
1998-02-27 07:54:42 +03:00
|
|
|
int i;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%d", panel->reverse);
|
1998-02-27 07:54:42 +03:00
|
|
|
save_string (section, "reverse", buffer, profile_name);
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%d", panel->case_sensitive);
|
1998-02-27 07:54:42 +03:00
|
|
|
save_string (section, "case_sensitive", buffer, profile_name);
|
|
|
|
for (i = 0; sort_names [i].key; i++)
|
|
|
|
if (sort_names [i].sort_type == (sortfn *) panel->sort_type){
|
|
|
|
save_string (section, "sort_order",
|
|
|
|
sort_names [i].key, profile_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; list_types [i].key; i++)
|
|
|
|
if (list_types [i].list_type == panel->list_type){
|
2002-07-30 04:12:53 +04:00
|
|
|
save_string (section, "list_mode", list_types [i].key, profile_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
break;
|
|
|
|
}
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
save_string (section, "user_format",
|
|
|
|
panel->user_format, profile_name);
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
for (i = 0; i < LIST_TYPES; i++){
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "user_status%d", i);
|
1999-09-21 00:03:58 +04:00
|
|
|
save_string (section, buffer,
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->user_status_format [i], profile_name);
|
|
|
|
}
|
1999-09-21 00:03:58 +04:00
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%d", panel->user_mini_status);
|
1998-02-27 07:54:42 +03:00
|
|
|
save_string (section, "user_mini_status", buffer,
|
|
|
|
profile_name);
|
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void
|
|
|
|
save_layout (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *profile;
|
|
|
|
int i;
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
char buffer [BUF_TINY];
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
|
|
|
|
|
|
|
/* Save integer options */
|
|
|
|
for (i = 0; layout [i].opt_name; i++){
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_snprintf (buffer, sizeof (buffer), "%d", *layout [i].opt_addr);
|
1998-02-27 07:54:42 +03:00
|
|
|
save_string ("Layout", layout [i].opt_name, buffer, profile);
|
|
|
|
}
|
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (profile);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void
|
|
|
|
save_configure (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *profile;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
|
|
|
|
|
|
|
/* Save integer options */
|
|
|
|
for (i = 0; options [i].opt_name; i++)
|
|
|
|
set_int (profile, options [i].opt_name, *options [i].opt_addr);
|
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (profile);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
static void
|
|
|
|
panel_save_type (char *section, int type)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
int i;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
for (i = 0; panel_types [i].opt_name; i++)
|
|
|
|
if (panel_types [i].opt_type == type){
|
|
|
|
save_string (section, "display", panel_types [i].opt_name,
|
|
|
|
profile_name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-09-29 22:05:38 +04:00
|
|
|
static void
|
2002-11-11 10:35:08 +03:00
|
|
|
save_panel_types (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
|
|
|
type = get_display_type (0);
|
|
|
|
panel_save_type ("New Left Panel", type);
|
|
|
|
if (type == view_listing)
|
|
|
|
panel_save_setup (left_panel, left_panel->panel_name);
|
|
|
|
type = get_display_type (1);
|
|
|
|
panel_save_type ("New Right Panel", type);
|
|
|
|
if (type == view_listing)
|
|
|
|
panel_save_setup (right_panel, right_panel->panel_name);
|
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void
|
|
|
|
save_setup (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *profile;
|
2001-06-06 15:52:32 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
saving_setup = 1;
|
|
|
|
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
|
|
|
|
2001-06-20 19:08:18 +04:00
|
|
|
save_configure ();
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
save_layout ();
|
|
|
|
save_string ("Dirs", "other_dir",
|
|
|
|
get_other_type () == view_listing
|
|
|
|
? opanel->cwd : ".", profile);
|
2003-10-26 09:32:42 +03:00
|
|
|
if (current_panel != NULL)
|
1999-03-27 22:00:18 +03:00
|
|
|
WritePrivateProfileString ("Dirs", "current_is_left",
|
|
|
|
get_current_index () == 0 ? "1" : "0", profile);
|
1998-02-27 07:54:42 +03:00
|
|
|
save_hotlist ();
|
2001-06-20 19:08:18 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
save_panelize ();
|
|
|
|
save_panel_types ();
|
1998-03-31 01:04:59 +04:00
|
|
|
/* directory_history_save (); */
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2001-09-16 04:53:43 +04:00
|
|
|
#if defined(USE_VFS) && defined (USE_NETCODE)
|
1998-02-27 07:54:42 +03:00
|
|
|
WritePrivateProfileString ("Misc", "ftpfs_password",
|
|
|
|
ftpfs_anonymous_passwd, profile);
|
|
|
|
if (ftpfs_proxy_host)
|
|
|
|
WritePrivateProfileString ("Misc", "ftp_proxy_host",
|
|
|
|
ftpfs_proxy_host, profile);
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_VFS && USE_NETCODE */
|
2001-06-06 02:49:15 +04:00
|
|
|
|
|
|
|
#ifdef HAVE_CHARSET
|
|
|
|
save_string( "Misc", "display_codepage",
|
|
|
|
get_codepage_id( display_codepage ), profile_name );
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* HAVE_CHARSET */
|
2001-06-06 02:49:15 +04:00
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (profile);
|
1998-02-27 07:54:42 +03:00
|
|
|
saving_setup = 0;
|
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
void
|
|
|
|
panel_load_setup (WPanel *panel, char *section)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
int i;
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
char buffer [BUF_TINY];
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->reverse = load_int (section, "reverse", 0);
|
|
|
|
panel->case_sensitive = load_int (section, "case_sensitive", OS_SORT_CASE_SENSITIVE_DEFAULT);
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Load sort order */
|
|
|
|
load_string (section, "sort_order", "name", buffer, sizeof (buffer));
|
|
|
|
panel->sort_type = (sortfn *) sort_name;
|
|
|
|
for (i = 0; sort_names [i].key; i++)
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
if ( g_strcasecmp (sort_names [i].key, buffer) == 0){
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->sort_type = sort_names [i].sort_type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Load the listing mode */
|
2002-07-30 04:12:53 +04:00
|
|
|
load_string (section, "list_mode", "full", buffer, sizeof (buffer));
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->list_type = list_full;
|
|
|
|
for (i = 0; list_types [i].key; i++)
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
if ( g_strcasecmp (list_types [i].key, buffer) == 0){
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->list_type = list_types [i].list_type;
|
|
|
|
break;
|
|
|
|
}
|
2001-09-16 05:10:09 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* User formats */
|
|
|
|
if (panel->user_format){
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (panel->user_format);
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->user_format = 0;
|
|
|
|
}
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
panel->user_format = g_strdup (get_profile_string (section, "user_format",
|
1998-02-27 07:54:42 +03:00
|
|
|
DEFAULT_USER_FORMAT,
|
|
|
|
profile_name));
|
|
|
|
for (i = 0; i < LIST_TYPES; i++){
|
|
|
|
if (panel->user_status_format [i])
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (panel->user_status_format [i]);
|
|
|
|
g_snprintf (buffer, sizeof (buffer), "user_status%d", i);
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->user_status_format [i] =
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_strdup (get_profile_string (section, buffer,
|
1998-02-27 07:54:42 +03:00
|
|
|
DEFAULT_USER_FORMAT, profile_name));
|
|
|
|
}
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
panel->user_mini_status =
|
|
|
|
load_int (section, "user_mini_status", 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
static void
|
|
|
|
load_layout (char *profile_name)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
int i;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
for (i = 0; layout [i].opt_name; i++)
|
|
|
|
*layout [i].opt_addr =
|
|
|
|
load_int ("Layout", layout [i].opt_name,
|
|
|
|
*layout [i].opt_addr);
|
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
static int
|
|
|
|
load_mode (char *section)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char buffer [20];
|
|
|
|
int i;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
int mode = view_listing;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Load the display mode */
|
|
|
|
load_string (section, "display", "listing", buffer, sizeof (buffer));
|
|
|
|
|
|
|
|
for (i = 0; panel_types [i].opt_name; i++)
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
if ( g_strcasecmp (panel_types [i].opt_name, buffer) == 0){
|
1998-02-27 07:54:42 +03:00
|
|
|
mode = panel_types [i].opt_type;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
2001-10-01 10:08:56 +04:00
|
|
|
#ifdef USE_NETCODE
|
1998-12-03 00:27:27 +03:00
|
|
|
static char *
|
|
|
|
do_load_string (char *s, char *ss, char *def)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
2000-04-14 05:19:58 +04:00
|
|
|
char *buffer = g_malloc (BUF_SMALL);
|
1998-02-27 07:54:42 +03:00
|
|
|
char *p;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2000-04-14 05:19:58 +04:00
|
|
|
load_string (s, ss, def, buffer, BUF_SMALL);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
p = g_strdup (buffer);
|
|
|
|
g_free (buffer);
|
1998-02-27 07:54:42 +03:00
|
|
|
return p;
|
|
|
|
}
|
2001-10-01 10:08:56 +04:00
|
|
|
#endif /* !USE_NETCODE */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
1999-02-17 06:00:27 +03:00
|
|
|
char *
|
|
|
|
setup_init (void)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *profile;
|
|
|
|
char *inifile;
|
1999-02-17 06:00:27 +03:00
|
|
|
|
|
|
|
if (profile_name)
|
|
|
|
return profile_name;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
2001-06-06 15:52:32 +04:00
|
|
|
profile = concat_dir_and_file (home_dir, PROFILE_NAME);
|
|
|
|
if (!exist_file (profile)){
|
|
|
|
inifile = concat_dir_and_file (mc_home, "mc.ini");
|
|
|
|
if (exist_file (inifile)){
|
|
|
|
g_free (profile);
|
|
|
|
profile = inifile;
|
|
|
|
} else
|
|
|
|
g_free (inifile);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
profile_name = profile;
|
|
|
|
|
1999-02-17 06:00:27 +03:00
|
|
|
return profile;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
load_setup (void)
|
|
|
|
{
|
|
|
|
char *profile;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
profile = setup_init ();
|
2002-08-17 05:11:21 +04:00
|
|
|
|
|
|
|
/* mc.lib is common for all users, but has priority lower than
|
|
|
|
~/.mc/ini. FIXME: it's only used for keys and treestore now */
|
|
|
|
global_profile_name = concat_dir_and_file (mc_home, "mc.lib");
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Load integer boolean options */
|
|
|
|
for (i = 0; options [i].opt_name; i++)
|
|
|
|
*options [i].opt_addr =
|
|
|
|
get_int (profile, options [i].opt_name, *options [i].opt_addr);
|
|
|
|
|
|
|
|
load_layout (profile);
|
|
|
|
|
|
|
|
load_panelize ();
|
|
|
|
|
|
|
|
startup_left_mode = load_mode ("New Left Panel");
|
|
|
|
startup_right_mode = load_mode ("New Right Panel");
|
|
|
|
|
|
|
|
/* At least one of the panels is a listing panel */
|
|
|
|
if (startup_left_mode != view_listing && startup_right_mode!=view_listing)
|
|
|
|
startup_left_mode = view_listing;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
if (!other_dir){
|
1999-02-17 06:00:27 +03:00
|
|
|
char *buffer;
|
1999-09-21 00:03:58 +04:00
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
buffer = (char*) g_malloc (MC_MAXPATHLEN);
|
1998-02-27 07:54:42 +03:00
|
|
|
load_string ("Dirs", "other_dir", ".", buffer,
|
|
|
|
MC_MAXPATHLEN);
|
|
|
|
if (vfs_file_is_local (buffer))
|
|
|
|
other_dir = buffer;
|
|
|
|
else
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (buffer);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
2001-06-20 19:08:18 +04:00
|
|
|
|
|
|
|
boot_current_is_left =
|
|
|
|
GetPrivateProfileInt ("Dirs", "current_is_left", 1, profile);
|
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
#ifdef USE_NETCODE
|
|
|
|
ftpfs_proxy_host = do_load_string ("Misc", "ftp_proxy_host", "gate");
|
|
|
|
#endif
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
load_string ("Misc", "find_ignore_dirs", "", setup_color_string,
|
|
|
|
sizeof (setup_color_string));
|
|
|
|
if (setup_color_string [0])
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
find_ignore_dirs = g_strconcat (":", setup_color_string, ":", NULL);
|
1999-09-21 00:03:58 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
/* The default color and the terminal dependent color */
|
|
|
|
load_string ("Colors", "base_color", "", setup_color_string,
|
|
|
|
sizeof (setup_color_string));
|
|
|
|
load_string ("Colors", getenv ("TERM"), "",
|
|
|
|
term_color_string, sizeof (term_color_string));
|
|
|
|
load_string ("Colors", "color_terminals", "",
|
|
|
|
color_terminal_string, sizeof (color_terminal_string));
|
|
|
|
|
|
|
|
/* Load the directory history */
|
1998-03-31 01:04:59 +04:00
|
|
|
/* directory_history_load (); */
|
1998-02-27 07:54:42 +03:00
|
|
|
/* Remove the temporal entries */
|
|
|
|
profile_clean_section ("Temporal:New Left Panel", profile_name);
|
|
|
|
profile_clean_section ("Temporal:New Right Panel", profile_name);
|
2001-09-16 04:53:43 +04:00
|
|
|
#if defined(USE_VFS) && defined (USE_NETCODE)
|
2000-02-02 19:57:51 +03:00
|
|
|
ftpfs_init_passwd ();
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_VFS && USE_NETCODE */
|
2001-06-06 02:49:15 +04:00
|
|
|
|
|
|
|
#ifdef HAVE_CHARSET
|
2001-08-17 01:01:12 +04:00
|
|
|
if ( load_codepages_list() > 0 ) {
|
2001-06-06 15:52:32 +04:00
|
|
|
char cpname[128];
|
|
|
|
load_string( "Misc", "display_codepage", "",
|
|
|
|
cpname, sizeof(cpname) );
|
2001-06-08 00:47:36 +04:00
|
|
|
if ( cpname[0] != '\0' )
|
2001-06-06 02:49:15 +04:00
|
|
|
display_codepage = get_codepage_index( cpname );
|
2001-06-08 00:47:36 +04:00
|
|
|
}
|
|
|
|
|
2001-08-17 01:01:12 +04:00
|
|
|
init_translation_table( source_codepage, display_codepage );
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* HAVE_CHARSET */
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
2001-09-16 04:53:43 +04:00
|
|
|
#if defined(USE_VFS) && defined (USE_NETCODE)
|
1998-12-03 00:27:27 +03:00
|
|
|
char *
|
|
|
|
load_anon_passwd ()
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char buffer [255];
|
|
|
|
|
|
|
|
load_string ("Misc", "ftpfs_password", "", buffer, sizeof (buffer));
|
|
|
|
if (buffer [0])
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
return g_strdup (buffer);
|
1998-02-27 07:54:42 +03:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
2001-09-16 04:53:43 +04:00
|
|
|
#endif /* USE_VFS && USE_NETCODE */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
void done_setup (void)
|
|
|
|
{
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
g_free (profile_name);
|
2002-08-17 05:11:21 +04:00
|
|
|
g_free (global_profile_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
done_hotlist ();
|
|
|
|
done_panelize ();
|
1998-03-31 01:04:59 +04:00
|
|
|
/* directory_history_free (); */
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
|
1998-12-03 00:27:27 +03:00
|
|
|
static void
|
|
|
|
load_keys_from_section (char *terminal, char *profile_name)
|
1998-02-27 07:54:42 +03:00
|
|
|
{
|
|
|
|
char *section_name;
|
|
|
|
void *profile_keys;
|
|
|
|
char *key, *value, *valcopy;
|
|
|
|
int key_code;
|
|
|
|
|
|
|
|
if (!terminal)
|
|
|
|
return;
|
|
|
|
|
Glibing..... (2)
Wed Jan 27 03:17:44 1999 Timur Bakeyev <mc@bat.ru>
* Converted memory managment to Glib. Now we use g_new()/g_malloc()/
g_strdup()/g_free() routings. Also, copy_strings() replaced by
g_strconcat(), strcasecmp() -> g_strcasecmp(),and sprintf() by
g_snprintf().
* Some sequences of malloc()/sprintf() changed to g_strdup_printf().
* mad.[ch]: Modified, to work with new GLib's memory managment. Fixed
a missing #undef for tempnam, which caused dead loop. Add several new
functions to emulate GLib memory managment.
*main.c, mad.[ch]: Add a new switch "-M", which allows to redirect MAD
messages to the file.
* util.[ch], utilunix.c: Modified, deleted our variants of strcasecmp()
and strdup() - we have g_ equivalences. Remove get_full_name() - it is
similar to concat_dir_and_file(). Some other tricks with g_* functions.
* global.h: Modified, extended. Now it is main memory mangment include -
i.e. all inclusions of <stdlib.h>, <malloc.h>, <glib.h>, "fs.h", "mem.h",
"util.h" and "mad.h" done there. This elimanates problem with proper or-
der of #include's.
* All around the source - changed order of #include's, most of them gone
to global.h (see above), minor changes, like "0" -> NULL in string func-
tions.
1999-01-27 04:08:30 +03:00
|
|
|
section_name = g_strconcat ("terminal:", terminal, NULL);
|
1998-02-27 07:54:42 +03:00
|
|
|
profile_keys = profile_init_iterator (section_name, profile_name);
|
2003-01-23 17:26:22 +03:00
|
|
|
g_free (section_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
while (profile_keys){
|
|
|
|
profile_keys = profile_iterator_next (profile_keys, &key, &value);
|
|
|
|
key_code = lookup_key (key);
|
2001-06-08 02:36:45 +04:00
|
|
|
if (key_code){
|
|
|
|
valcopy = convert_controls (value);
|
1998-02-27 07:54:42 +03:00
|
|
|
define_sequence (key_code, valcopy, MCKEY_NOACTION);
|
2001-06-08 02:36:45 +04:00
|
|
|
g_free (valcopy);
|
|
|
|
}
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void load_key_defs (void)
|
|
|
|
{
|
2001-07-22 10:00:30 +04:00
|
|
|
/*
|
|
|
|
* Load keys from mc.lib before ~/.mc/ini, so that the user
|
|
|
|
* definitions override global settings.
|
|
|
|
*/
|
2002-08-17 05:11:21 +04:00
|
|
|
load_keys_from_section ("general", global_profile_name);
|
|
|
|
load_keys_from_section (getenv ("TERM"), global_profile_name);
|
2001-07-22 10:00:30 +04:00
|
|
|
load_keys_from_section ("general", profile_name);
|
2001-07-23 23:14:40 +04:00
|
|
|
load_keys_from_section (getenv ("TERM"), profile_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* We don't want a huge database loaded in core */
|
2002-08-17 05:11:21 +04:00
|
|
|
free_profile_name (global_profile_name);
|
1998-02-27 07:54:42 +03:00
|
|
|
}
|