#include #include #include #include #include #include "owl.h" static const char fileIdent[] = "$Id$"; static int in_regtest = 0; #define OWLVAR_BOOL(name,default,summary,description) \ { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \ NULL, NULL, NULL, NULL, NULL } #define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \ { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \ validate, set, NULL, get, NULL } #define OWLVAR_INT(name,default,summary,description) \ { name, OWL_VARIABLE_INT, NULL, default, "", summary,description, NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \ { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ validate, set, NULL, get, NULL, NULL } #define OWLVAR_PATH(name,default,summary,description) \ { name, OWL_VARIABLE_STRING, default, 0, "", summary,description, NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_STRING(name,default,summary,description) \ { name, OWL_VARIABLE_STRING, default, 0, "", summary,description, NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_STRING_FULL(name,default,summary,description,validate,set,get) \ { name, OWL_VARIABLE_STRING, default, 0, "", summary,description, NULL, \ validate, set, NULL, get, NULL, NULL } /* enums are really integers, but where validset is a comma-separated * list of strings which can be specified. The tokens, starting at 0, * correspond to the values that may be specified. */ #define OWLVAR_ENUM(name,default,summary,description,validset) \ { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ owl_variable_enum_validate, \ NULL, owl_variable_enum_set_fromstring, \ NULL, owl_variable_enum_get_tostring, \ NULL } #define OWLVAR_ENUM_FULL(name,default,summary,description,validset,validate, set, get) \ { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \ validate, \ set, owl_variable_enum_set_fromstring, \ get, owl_variable_enum_get_tostring, \ NULL } static owl_variable variables_to_init[] = { OWLVAR_BOOL( "personalbell" /* %OwlVarStub */, 0, "ring the terminal bell when personal messages are received", "" ), OWLVAR_BOOL( "bell" /* %OwlVarStub */, 1, "enable / disable the terminal bell", "" ), OWLVAR_BOOL_FULL( "debug" /* %OwlVarStub */, OWL_DEBUG, "whether debugging is enabled", "If set to 'on', debugging messages are logged to the\n" "file specified by the debugfile variable.\n", NULL, owl_variable_debug_set, NULL), OWLVAR_BOOL( "startuplogin" /* %OwlVarStub */, 1, "send a login message when owl starts", "" ), OWLVAR_BOOL( "shutdownlogout" /* %OwlVarStub */, 1, "send a logout message when owl exits", "" ), OWLVAR_BOOL( "rxping" /* %OwlVarStub */, 0, "display received pings", "" ), OWLVAR_BOOL( "txping" /* %OwlVarStub */, 1, "send pings", "" ), OWLVAR_BOOL( "sepbar_disable" /* %OwlVarStub */, 0, "disable printing information in the seperator bar", "" ), OWLVAR_BOOL( "smartstrip" /* %OwlVarStub */, 1, "strip kerberos instance for reply", ""), OWLVAR_BOOL( "newlinestrip" /* %OwlVarStub */, 1, "strip leading and trailing newlines", ""), OWLVAR_BOOL( "displayoutgoing" /* %OwlVarStub */, 1, "display outgoing messages", "" ), OWLVAR_BOOL( "loginsubs" /* %OwlVarStub */, 1, "load logins from .anyone on startup", "" ), OWLVAR_BOOL( "logging" /* %OwlVarStub */, 0, "turn personal logging on or off", "If this is set to on, personal messages are\n" "logged in the directory specified\n" "by the 'logpath' variable. The filename in that\n" "directory is derived from the sender of the message.\n" ), OWLVAR_BOOL( "classlogging" /* %OwlVarStub */, 0, "turn class logging on or off", "If this is set to on, class messages are\n" "logged in the directory specified\n" "by the 'classlogpath' variable.\n" "The filename in that directory is derived from\n" "the name of the class to which the message was sent.\n" ), OWLVAR_BOOL( "colorztext" /* %OwlVarStub */, 1, "allow @color() in zephyrs to change color", "Note that only messages received after this variable\n" "is set will be affected." ), OWLVAR_BOOL( "fancylines" /* %OwlVarStub */, 1, "Use 'nice' line drawing on the terminal.", "If turned off, dashes, pipes and pluses will be used\n" "to draw lines on the screen. Useful when the terminal\n" "is causing problems" ), OWLVAR_BOOL( "zcrypt" /* %OwlVarStub */, 1, "Do automatic zcrypt processing", "" ), OWLVAR_ENUM_FULL( "disable-ctrl-d" /* %OwlVarStub:lockout_ctrld */, 1, "don't send zephyrs on C-d", "If set to 'off', C-d won't send a zephyr from the edit\n" "window. If set to 'on', C-d will always send a zephyr\n" "being composed in the edit window. If set to 'middle',\n" "C-d will only ever send a zephyr if the cursor is at\n" "the end of the message being composed.\n\n" "Note that this works by changing the C-d keybinding\n" "in the editmulti keymap.\n", "off,middle,on", NULL, owl_variable_disable_ctrl_d_set, NULL), OWLVAR_BOOL( "_burningears" /* %OwlVarStub:burningears */, 0, "[NOT YET IMPLEMENTED] beep on messages matching patterns", "" ), OWLVAR_BOOL( "_summarymode" /* %OwlVarStub:summarymode */, 0, "[NOT YET IMPLEMENTED]", "" ), OWLVAR_PATH( "logpath" /* %OwlVarStub */, "~/zlog/people", "path for logging personal zephyrs", "Specifies a directory which must exist.\n" "Files will be created in the directory for each sender.\n"), OWLVAR_PATH( "classlogpath" /* %OwlVarStub:classlogpath */, "~/zlog/class", "path for logging class zephyrs", "Specifies a directory which must exist.\n" "Files will be created in the directory for each class.\n"), OWLVAR_PATH( "debug_file" /* %OwlVarStub */, OWL_DEBUG_FILE, "path for logging debug messages when debugging is enabled", "This file will be logged to if 'debug' is set to 'on'.\n"), OWLVAR_PATH( "zsigproc" /* %OwlVarStub:zsigproc */, NULL, "name of a program to run that will generate zsigs", "This program should produce a zsig on stdout when run.\n" "Note that it is important that this program not block.\n" ), OWLVAR_PATH( "newmsgproc" /* %OwlVarStub:newmsgproc */, NULL, "name of a program to run when new messages are present", "The named program will be run when owl recevies new.\n" "messages. It will not be run again until the first\n" "instance exits"), OWLVAR_STRING( "zsig" /* %OwlVarStub */, "", "zephyr signature", "If 'zsigproc' is not set, this string will be used\n" "as a zsig. If this is also unset, the 'zwrite-signature'\n" "zephyr variable will be used instead.\n"), OWLVAR_STRING( "appendtosepbar" /* %OwlVarStub */, "", "string to append to the end of the sepbar", "The sepbar is the bar separating the top and bottom\n" "of the owl screen. Any string specified here will\n" "be displayed on the right of the sepbar\n"), OWLVAR_BOOL( "zaway" /* %OwlVarStub */, 0, "turn zaway on or off", "" ), OWLVAR_STRING( "zaway_msg" /* %OwlVarStub */, OWL_DEFAULT_ZAWAYMSG, "zaway msg for responding to zephyrs when away", "" ), OWLVAR_STRING( "zaway_msg_default" /* %OwlVarStub */, OWL_DEFAULT_ZAWAYMSG, "default zaway message", "" ), OWLVAR_STRING( "view_home" /* %OwlVarStub */, "all", "home view to switch to after 'X' and 'V'", "SEE ALSO: view, filter\n" ), OWLVAR_STRING( "alert_filter" /* %OwlVarStub */, "none", "filter on which to trigger alert actions", "" ), OWLVAR_STRING( "alert_action" /* %OwlVarStub */, "nop", "owl command to execute for alert actions", "" ), OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "tty name for zephyr location", "", NULL, owl_variable_tty_set, NULL), OWLVAR_STRING( "default_style" /* %OwlVarStub */, "__unspecified__", "name of the default formatting style", "This sets the default message formatting style.\n" "Styles may be created with the 'style' command.\n" "Some built-in styles include:\n" " default - the default owl formatting\n" " basic - simple formatting\n" " oneline - one line per-message\n" " perl - legacy perl interface\n" "\nSEE ALSO: style, show styles, view -s