"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.1/doc/rcvars.txt" (4 Jan 2015, 2990 Bytes) of archive /linux/misc/tin-2.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "rcvars.txt": 2.3.1_vs_2.3.2.

    1 Adding new tinrc variables:
    2 
    3 . Think of a name for your variable, we'll call it NAME
    4 . Add it to tincfg.tbl, the ordering of this file decides the order of the
    5   Option 'M'enu. Use an appropriate type.
    6 . Add an entry for it to the tin.1 man page under the
    7   "GLOBAL OPTIONS MENU AND TINRC CONFIGURABLE VARIABLES" section
    8   and one to the tin.5 man page under the "FILES" section (subsection tinrc)
    9 . Add NAME with the correct type to the master declaration in tinrc.h
   10 . Add an initial value for NAME in the correct position in t_config tinrc={};
   11   in init.c
   12 . In config.c/options_menu.c, add the following:
   13 
   14 	In read_config_file(), a match_*() function to read NAME into the
   15 	internal tinrc table, which may not necessarily be the same type.
   16 
   17 	In write_config_file(), code to write out NAME in some ASCII
   18 	friendly format.
   19 
   20 	In change_config_file(), you may need an OPT_NAME: switch to do any
   21 	special post-processing needed when NAME is changed on the Option
   22 	'M'enu, particularly when using OPT_STRING
   23 
   24 . Add the following definition to extern.h
   25 	struct opttxt txt_NAME
   26 
   27 . Fill the above structure out in lang.c
   28 	help text  - shown as help when asked for in Option 'M'enu
   29 	             should be 80 characters max
   30 	opt text   - the text shown on the left side in the Option 'M'enu
   31 	             should be 36 characters max, including the tailing :
   32 	tinrc text - the comment text that precedes the variable when
   33 	             written to the tinrc file. This is optional.
   34 
   35 . If the variable is to be chosen from a list, then the second field of
   36   tincfg.tbl is the name of an array which holds the textual descriptions
   37   of the options. Add this array to lang.c and extern.h
   38   Don't forget to add NULL as the very last array member in lang.c. Various
   39   functions rely on it.
   40 
   41 Adding a new attribute:
   42 
   43 . Think of a name, we'll call it NAME
   44 . Document it on the tin.5 man page under the
   45   "${TIN_HOMEDIR-"$HOME"}/.tin/attributes" section
   46 . Add it to the t_attribute and t_attribute_state structure in tin.h
   47 . Define the default value for it in attrib.c:set_default_attributes()
   48 . Set the default state for it in attrib.c:set_default_state()
   49 . Add it to tinrc.h and tincfg.tbl
   50 . In read_attributes_file() add a MATCH_<TYPE> entry to parse it in
   51   under the appropriate first letter section.
   52 . In set_attrib() and assign_attributes_to_groups(), add a corresponding
   53   SET_<TYPE> entry
   54 . In write_attributes_file(), add a minimal entry in the header to
   55   describe the usage of the attribute and add code to write out the
   56   attribute
   57 . Add code to write out the attribute in dump_attributes() and dump_scopes()
   58 . In options_menu.c:config_page() add UPDATE_(INT_|STRING_)ATTRIBUTES
   59   under the appropriate case OPT_* section; add entries in option_is_visible(),
   60   check_state(), reset_state(), initialize_attributes()
   61 . Free up the attribute in memory.c:free_attributes_array() if needed
   62 
   63 Where possible try to keep the ordering of the attributes in the various
   64 functions and structures consistent