#include #include #include #include #include #include "owl.h" #define OWLVAR_BOOL(name,default,summary,description) \ { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \ { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \ validate, set, NULL, get, NULL, NULL } #define OWLVAR_INT(name,default,summary,description) \ { g_strdup(name), OWL_VARIABLE_INT, NULL, default, "", g_strdup(summary), g_strdup(description), NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \ { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \ validate, set, NULL, get, NULL, NULL } #define OWLVAR_PATH(name,default,summary,description) \ { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "", g_strdup(summary), g_strdup(description), NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_STRING(name,default,summary,description) \ { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "", g_strdup(summary), g_strdup(description), NULL, \ NULL, NULL, NULL, NULL, NULL, NULL } #define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \ { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, validset, g_strdup(summary), g_strdup(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) \ { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(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) \ { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \ validate, \ set, owl_variable_enum_set_fromstring, \ get, owl_variable_enum_get_tostring, \ NULL } int owl_variable_add_defaults(owl_vardict *vd) { owl_variable variables_to_init[] = { OWLVAR_STRING( "personalbell" /* %OwlVarStub */, "off", "ring the terminal bell when personal messages are received", "Can be set to 'on', 'off', or the name of a filter which\n" "messages need to match in order to ring the bell"), 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 BarnOwl starts", "" ), OWLVAR_BOOL( "shutdownlogout" /* %OwlVarStub */, 1, "send a logout message when BarnOwl 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 separator 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_ENUM( "loggingdirection" /* %OwlVarStub */, OWL_LOGGING_DIRECTION_BOTH, "specifies which kind of messages should be logged", "Can be one of 'both', 'in', or 'out'. If 'in' is\n" "selected, only incoming messages are logged, if 'out'\n" "is selected only outgoing messages are logged. If 'both'\n" "is selected both incoming and outgoing messages are\n" "logged.", "both,in,out"), 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_BOOL_FULL( "pseudologins" /* %OwlVarStub */, 0, "Enable zephyr pseudo logins", "When this is enabled, BarnOwl will periodically check the zephyr\n" "location of users in your .anyone file. If a user is present\n" "but sent no login message, or a user is not present that sent no\n" "logout message, a pseudo login or logout message will be created\n", NULL, owl_variable_pseudologins_set, NULL), OWLVAR_BOOL( "ignorelogins" /* %OwlVarStub */, 0, "Enable printing of login notifications", "When this is enabled, BarnOwl will print login and logout notifications\n" "for AIM, zephyr, or other protocols. If disabled BarnOwl will not print\n" "login or logout notifications.\n"), OWLVAR_STRING( "logfilter" /* %OwlVarStub */, "", "name of a filter controlling which messages to log", "If non empty, any messages matching the given filter will be logged.\n" "This is a completely separate mechanism from the other logging\n" "variables like logging, classlogging, loglogins, loggingdirection,\n" "etc. If you want this variable to control all logging, make sure\n" "all other logging variables are in their default state.\n"), OWLVAR_BOOL( "loglogins" /* %OwlVarStub */, 0, "Enable logging of login notifications", "When this is enabled, BarnOwl will log login and logout notifications\n" "for AIM, zephyr, or other protocols. If disabled BarnOwl will not print\n" "login or logout notifications.\n"), 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_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" "BarnOwl will append a dot and the current process's pid to the filename."), 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\n" "See the documentation for 'zsig' for more information about\n" "how the outgoing zsig is chosen." ), OWLVAR_PATH( "newmsgproc" /* %OwlVarStub:newmsgproc */, NULL, "name of a program to run when new messages are present", "The named program will be run when BarnOwl receives new\n" "messages. It will not be run again until the first\n" "instance exits"), OWLVAR_STRING( "zsender" /* %OwlVarStub */, "", "zephyr sender name", "Allows you to customize the outgoing username in\n" "zephyrs. If this is unset, it will use your Kerberos\n" "principal. Note that customizing the sender name will\n" "cause your zephyrs to be sent unauthenticated."), OWLVAR_STRING( "zsigfunc" /* %OwlVarStub */, "BarnOwl::default_zephyr_signature()", "zsig perl function", "Called every time you start a zephyrgram without an\n" "explicit zsig. The default setting implements the policy\n" "described in the documentation for the 'zsig' variable.\n" "See also BarnOwl::random_zephyr_signature().\n"), OWLVAR_STRING( "zsig" /* %OwlVarStub */, "", "zephyr signature", "The zsig to get on outgoing messages. If this variable is\n" "unset, 'zsigproc' will be run to generate a zsig. If that is\n" "also unset, the 'zwrite-signature' zephyr variable will be\n" "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 BarnOwl 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_BOOL_FULL( "aaway" /* %OwlVarStub */, 0, "Set AIM away status", "", NULL, owl_variable_aaway_set, NULL), OWLVAR_STRING( "aaway_msg" /* %OwlVarStub */, OWL_DEFAULT_AAWAYMSG, "AIM away msg for responding when away", "" ), OWLVAR_STRING( "aaway_msg_default" /* %OwlVarStub */, OWL_DEFAULT_AAWAYMSG, "default AIM away 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", "BarnOwl 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 */, "default", "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 BarnOwl formatting\n" " oneline - one line per-message\n" " perl - legacy perl interface\n" "\nSEE ALSO: style, show styles, view -s