"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "config.c" between
multitail-6.2.1.tgz and multitail-6.4.tgz

About: multitail lets you view one or multiple files like the original tail program.

config.c  (multitail-6.2.1.tgz):config.c  (multitail-6.4.tgz)
skipping to change at line 25 skipping to change at line 25
#include "mt.h" #include "mt.h"
#include "mem.h" #include "mem.h"
#include "error.h" #include "error.h"
#include "utils.h" #include "utils.h"
#include "color.h" #include "color.h"
#include "term.h" #include "term.h"
#include "exec.h" #include "exec.h"
#include "globals.h" #include "globals.h"
#include "config.h" #include "config.h"
#include "xclip.h"
/* "local global" */ /* "local global" */
int cur_colorscheme_nr = -1; int cur_colorscheme_nr = -1;
int cur_filterscheme_nr = -1; int cur_filterscheme_nr = -1;
int cur_editscheme_nr = -1; int cur_editscheme_nr = -1;
mybool_t config_yes_no(char *what) mybool_t config_yes_no(char *what)
{ {
if (what[0] == '1' || strcasecmp(what, "yes") == 0 || strcasecmp(what, "y ") == 0 || strcasecmp(what, "on") == 0) if (what[0] == '1' || strcasecmp(what, "yes") == 0 || strcasecmp(what, "y ") == 0 || strcasecmp(what, "on") == 0)
{ {
skipping to change at line 730 skipping to change at line 731
} }
void set_check_mail(int linenr, char *cmd, char *par) void set_check_mail(int linenr, char *cmd, char *par)
{ {
check_for_mail = get_value_arg("check_mail", par, VAL_ZERO_POSITIVE); check_for_mail = get_value_arg("check_mail", par, VAL_ZERO_POSITIVE);
} }
void set_tab_stop(int linenr, char *cmd, char *par) void set_tab_stop(int linenr, char *cmd, char *par)
{ {
tab_width = atoi(par); tab_width = atoi(par);
if (tab_width == 0)
config_error_exit(linenr, "tab_stop: value cannot be 0.\n");
} }
void set_tail(int linenr, char *cmd, char *par) void set_tail(int linenr, char *cmd, char *par)
{ {
myfree(tail); myfree(tail);
tail = mystrdup(par); tail = mystrdup(par);
} }
void set_titlebar(int linenr, char *cmd, char *par) void set_titlebar(int linenr, char *cmd, char *par)
{ {
skipping to change at line 831 skipping to change at line 834
void set_default_min_shrink(int linenr, char *cmd, char *par) void set_default_min_shrink(int linenr, char *cmd, char *par)
{ {
default_min_shrink = get_value_arg("min_shrink", par, VAL_POSITIVE); default_min_shrink = get_value_arg("min_shrink", par, VAL_POSITIVE);
} }
void set_scrollback_show_winnrs(int linenr, char *cmd, char *par) void set_scrollback_show_winnrs(int linenr, char *cmd, char *par)
{ {
default_sb_showwinnr = config_yes_no(par); default_sb_showwinnr = config_yes_no(par);
} }
void set_wordwrapmaxlength(int linenr, char *cmd, char *par) void set_wordwrapmaxlength(int linenr, char *cmd, char *par)
{ {
wordwrapmaxlength = get_value_arg("wordwrapmaxlength", par, VAL_POSITIVE) ; wordwrapmaxlength = get_value_arg("wordwrapmaxlength", par, VAL_POSITIVE) ;
} }
void set_xclip(int linenr, char *cmd, char *par)
{
if (file_exist(par) == -1)
error_exit(TRUE, FALSE, "xclip binary '%s' does not exist");
xclip = strdup(par);
}
void set_map_delete_as_backspace(int linenr, char *cmd, char *par)
{
map_delete_as_backspace = config_yes_no(par);
}
void set_searchhistory_file(int linenr, char *cmd, char *par) void set_searchhistory_file(int linenr, char *cmd, char *par)
{ {
if (par[0] == 0x00) if (par[0] == 0x00)
{ {
search_h.history_file = NULL; search_h.history_file = NULL;
search_h.history_size = 0; search_h.history_size = 0;
} }
else else
{ {
search_h.history_file = myrealpath(par); search_h.history_file = myrealpath(par);
skipping to change at line 1059 skipping to change at line 1075
{ "follow_filename", set_follow_filename }, { "follow_filename", set_follow_filename },
{ "global_default_nkb", set_global_default_nkb }, { "global_default_nkb", set_global_default_nkb },
{ "global_default_nlines", set_global_default_nlines }, { "global_default_nlines", set_global_default_nlines },
{ "global_mark_change", set_global_mark_change }, { "global_mark_change", set_global_mark_change },
{ "gnu_tail", set_gnu_tail }, { "gnu_tail", set_gnu_tail },
{ "idleline_char", set_idleline_char }, { "idleline_char", set_idleline_char },
{ "idleline_color", set_idleline_color }, { "idleline_color", set_idleline_color },
{ "include", do_load_config }, { "include", do_load_config },
{ "inverse", set_inverse_attrs }, { "inverse", set_inverse_attrs },
{ "line_ts_format", set_line_ts_format }, { "line_ts_format", set_line_ts_format },
{ "map_delete_as_backspace", set_map_delete_as_backspace },
{ "markerline_char", set_markerline_char }, { "markerline_char", set_markerline_char },
{ "markerline_color", set_markerline_attrs }, { "markerline_color", set_markerline_attrs },
{ "markerline_timestamp", set_markerline_timestamp }, { "markerline_timestamp", set_markerline_timestamp },
{ "mcsre", add_cs_re }, { "mcsre", add_cs_re },
{ "mcsre_s", add_cs_re }, { "mcsre_s", add_cs_re },
{ "mcsre_val_bigger", add_cs_re }, { "mcsre_val_bigger", add_cs_re },
{ "mcsre_val_equal", add_cs_re }, { "mcsre_val_equal", add_cs_re },
{ "mcsre_val_less", add_cs_re }, { "mcsre_val_less", add_cs_re },
{ "min_n_bufferlines", set_min_n_bufferlines }, { "min_n_bufferlines", set_min_n_bufferlines },
{ "min_shrink", set_default_min_shrink }, { "min_shrink", set_default_min_shrink },
skipping to change at line 1104 skipping to change at line 1121
{ "syslog_ts_format", set_syslog_ts_format }, { "syslog_ts_format", set_syslog_ts_format },
{ "tab_stop", set_tab_stop }, { "tab_stop", set_tab_stop },
{ "tail", set_tail }, { "tail", set_tail },
{ "titlebar", set_titlebar }, { "titlebar", set_titlebar },
{ "ts_format", set_ts_format }, { "ts_format", set_ts_format },
{ "umask", set_umask }, { "umask", set_umask },
{ "useeditscheme", use_editscheme }, { "useeditscheme", use_editscheme },
{ "usefilterscheme", use_filterscheme }, { "usefilterscheme", use_filterscheme },
{ "warn_closed", set_warn_closed }, { "warn_closed", set_warn_closed },
{ "window_number", set_window_number }, { "window_number", set_window_number },
{ "wordwrapmaxlength", set_wordwrapmaxlength } { "wordwrapmaxlength", set_wordwrapmaxlength },
{ "xclip", set_xclip }
}; };
int find_config_entry_in_dispatch_table(char *cmd_name) int find_config_entry_in_dispatch_table(char *cmd_name)
{ {
int left = 0; int left = 0;
int right = (sizeof(cf_entries) / sizeof(config_file_keyword)) - 1; int right = (sizeof(cf_entries) / sizeof(config_file_keyword)) - 1;
while(left <= right) while(left <= right)
{ {
int mid = (left + right) / 2; int mid = (left + right) / 2;
skipping to change at line 1227 skipping to change at line 1245
} }
else else
{ {
int path_max = find_path_max(); int path_max = find_path_max();
char *path = mymalloc(path_max + 1); char *path = mymalloc(path_max + 1);
char *home = getenv("HOME"); char *home = getenv("HOME");
struct passwd *pp = getuserinfo(); struct passwd *pp = getuserinfo();
if (home) if (home)
snprintf(path, path_max, "%s/.multitailrc", home); snprintf(path, path_max, "%s/.multitailrc", home);
else else if (pp)
snprintf(path, path_max, "%s/.multitailrc", pp -> pw_dir) ; snprintf(path, path_max, "%s/.multitailrc", pp -> pw_dir) ;
do_load_config(-1, NULL, path); if (pp || home)
do_load_config(-1, NULL, path);
myfree(path); myfree(path);
} }
} }
char load_configfile(char *config_file) char load_configfile(char *config_file)
{ {
static char config_loaded = 0; static char config_loaded = 0;
if (config_loaded == 0) if (config_loaded == 0)
 End of changes. 8 change blocks. 
4 lines changed or deleted 23 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS