diff -rc pork-0.99.8.1/ChangeLog pork-0.99.8.1a/ChangeLog *** pork-0.99.8.1/ChangeLog Thu Apr 28 10:35:15 2005 --- pork-0.99.8.1a/ChangeLog Mon Jul 3 00:13:27 2006 *************** *** 0 **** --- 1,5 ---- + Added a success message when a perl file is loaded successfully. + + Added auto load perl file options AUTO_LOAD_PERL (boolean) and AUTO_LOAD_PERL_FILE (string). If AUTO_LOAD_PERL is set to TRUE, the pork will attempt to automatically load the file set in AUTO_LOAD_PERL_FILE on start-up. Use the "/save" command to save these options for testing. The auto load function defaults to FALSE. + + Made a few error messages a little more unique and clearer. diff -rc pork-0.99.8.1/src/pork.c pork-0.99.8.1a/src/pork.c *** pork-0.99.8.1/src/pork.c Thu Apr 28 10:35:18 2005 --- pork-0.99.8.1a/src/pork.c Sun Jul 2 23:47:44 2006 *************** *** 146,151 **** --- 146,152 ---- int main(int argc, char **argv) { struct passwd *pw; char buf[PATH_MAX]; + char buf_auto_load[PATH_MAX]; struct imwindow *imwindow; int ret; time_t timer_last_run; *************** *** 205,210 **** --- 206,227 ---- screen_draw_input(); screen_doupdate(); + /* + ** Autoload Perl File if specified. + */ + if (opt_get_bool(OPT_AUTO_LOAD_PERL)) + { + if (opt_get_str(OPT_AUTO_LOAD_PERL_FILE) == NULL) + return; + + expand_path(opt_get_str(OPT_AUTO_LOAD_PERL_FILE), buf_auto_load, sizeof(buf_auto_load)); + ret = perl_load_file(buf_auto_load); + if (ret != 0) + screen_err_msg("(autoload) Error: The file \"%s\" couldn't be loaded", buf_auto_load); + else + screen_cmd_output("Successfully auto-loaded perl file %s.", buf_auto_load); + } + time(&timer_last_run); while (1) { time_t time_now; diff -rc pork-0.99.8.1/src/pork_command.c pork-0.99.8.1a/src/pork_command.c *** pork-0.99.8.1/src/pork_command.c Thu Apr 28 10:35:19 2005 --- pork-0.99.8.1a/src/pork_command.c Sun Jul 2 23:00:30 2006 *************** *** 621,627 **** opt = wopt_find(variable); strtoupper(variable); if (opt == -1) { ! screen_err_msg("Unknown variable: %s", variable); return; } --- 621,627 ---- opt = wopt_find(variable); strtoupper(variable); if (opt == -1) { ! screen_err_msg("(win_set) Unknown variable: %s", variable); return; } *************** *** 2621,2626 **** --- 2621,2628 ---- ret = perl_load_file(buf); if (ret != 0) screen_err_msg("Error: The file %s couldn't be loaded", buf); + else + screen_cmd_output("Successfully loaded perl file %s.", buf); } USER_COMMAND(cmd_ping) { *************** *** 2734,2740 **** strtoupper(variable); opt = opt_find(variable); if (opt == -1) { ! screen_err_msg("Unknown variable: %s", variable); return; } --- 2736,2742 ---- strtoupper(variable); opt = opt_find(variable); if (opt == -1) { ! screen_err_msg("(set) Unknown variable: %s", variable); return; } diff -rc pork-0.99.8.1/src/pork_conf.c pork-0.99.8.1a/src/pork_conf.c *** pork-0.99.8.1/src/pork_conf.c Thu Apr 28 10:35:19 2005 --- pork-0.99.8.1a/src/pork_conf.c Sun Jul 2 22:55:52 2006 *************** *** 448,454 **** char buf[PATH_MAX]; if (read_conf(SYSTEM_PORKRC) != 0) ! screen_err_msg("Error reading the system-wide porkrc file"); pw = getpwuid(getuid()); if (pw == NULL) { --- 448,454 ---- char buf[PATH_MAX]; if (read_conf(SYSTEM_PORKRC) != 0) ! screen_err_msg("Error reading the system-wide porkrc file %s", SYSTEM_PORKRC); pw = getpwuid(getuid()); if (pw == NULL) { diff -rc pork-0.99.8.1/src/pork_set.c pork-0.99.8.1a/src/pork_set.c *** pork-0.99.8.1/src/pork_set.c Thu Apr 28 10:35:18 2005 --- pork-0.99.8.1a/src/pork_set.c Sun Jul 2 23:20:25 2006 *************** *** 72,77 **** --- 72,89 ---- opt_set_int, NULL, SET_INT(DEFAULT_ACTIVITY_TYPES) + },{ "AUTO_LOAD_PERL", + OPT_BOOL, + 0, + opt_set_bool, + NULL, + SET_BOOL(DEFAULT_AUTO_LOAD_PERL) + },{ "AUTO_LOAD_PERL_FILE", + OPT_STR, + 0, + opt_set_str, + NULL, + SET_STR(DEFAULT_AUTO_LOAD_PERL_FILE) },{ "AUTO_RECONNECT", OPT_BOOL, 0, diff -rc pork-0.99.8.1/src/pork_set.h pork-0.99.8.1a/src/pork_set.h *** pork-0.99.8.1/src/pork_set.h Thu Apr 28 10:35:18 2005 --- pork-0.99.8.1a/src/pork_set.h Sun Jul 2 23:20:47 2006 *************** *** 27,32 **** --- 27,34 ---- enum { OPT_ACTIVITY_TYPES = 0, + OPT_AUTO_LOAD_PERL, + OPT_AUTO_LOAD_PERL_FILE, OPT_AUTO_RECONNECT, OPT_AUTO_REJOIN, OPT_AUTOSEND_AWAY, diff -rc pork-0.99.8.1/src/pork_set_defaults.h pork-0.99.8.1a/src/pork_set_defaults.h *** pork-0.99.8.1/src/pork_set_defaults.h Thu Apr 28 10:35:18 2005 --- pork-0.99.8.1a/src/pork_set_defaults.h Sun Jul 2 22:44:09 2006 *************** *** 17,22 **** --- 17,24 ---- #define DEFAULT_ACTIVITY_TYPES 0xffffffff #define DEFAULT_AUTO_RECONNECT 1 #define DEFAULT_AUTO_REJOIN 1 + #define DEFAULT_AUTO_LOAD_PERL 0 + #define DEFAULT_AUTO_LOAD_PERL_FILE "" #define DEFAULT_AUTOSEND_AWAY 0 #define DEFAULT_BANNER "*** " #define DEFAULT_BEEP 0