CBB stores the values of a few standard variables in the .cbbrc.tcl file. Whenever CBB starts, it first sources this
file. This file is regenerated based on the current value of the
relevant variables whenever an account is created, loaded, or saved.
Any additions/deletions will be lost. However, changes to the values
of the variables will be maintained. Figure 4 on
page shows a sample .cbbrc.tcl file.
Figure 4: Sample .cbbrc.tcl File
CBB has a user configurable menu entitled External. The file extern.conf controls the contents of this menu. An example of an extern.conf file is:
Reports ... <tab> conf-reports -report -t %t -a %a Graphs ... <tab> conf-reports -graph -t %t -a %a - Calculator <tab> xcalc Calendar <tab> xcalendar
The first field (everything before the <tab>) is the name to appear on the External menu. The second field (everything after the <tab> is the command line of the program to execute. Before launching the external program, CBB will save the current contents of the buffer to a temporary file. This allows the external program to have access to any changes that have been made, but not yet saved. The %t is replaced with the full path name of this temporary file. The %a is replaced with the full name of the current account file.
CBB has a ``simple'' well defined interface for installing new reports. Each report is a standalone ``program'' which understands a predefined set of command line options and displays its output to stdout.
When the Configure Reports program is launched, it looks for the file, .../lib/cbb/reports/reports.conf. This file consists of entries like the following:
Transaction List rep-txn-list.pl Txn List by Category rep-by-cat.pl Short List by Category rep-by-cat-shrt.pl
Each line contains two fields. The report name which will appear in the dialog box, and the executable name of the report. CBB scans this file when it starts up in order to create the Reports menu.
CBB assumes that all report executables will also be located in the .../lib/cbb/reports/ directory. Each report must accept the following options where date if of the form mm/dd/[yy[yy]] and account-list is a list of a CBB (ASCII) format account files:
Usage: report [ -from date ] [ -to date] account-list
The report executable will read the entries in the specified account files, ignore any entries outside the specified date range, and print its output to stdout. The last thing the report should print is a single line containing the text none.
When a report is selected from the Reports menu, CBB displays the Report Configuration dialog box. When the user clicks on Generate Report, CBB saves the current contents of its ``buffer'' to a temporary file. It then looks up the corresponding report executable, and launches it with the above options. CBB reads the output of the executable (stopping when it receives a line containing only the text none) and routes it according what the user specified in the Report Configuration dialog box.
The procedure for creating and installing new graphs is analogous to the reports procedure. One thing to note, the graph executable should wait for a carriage return from stdin before exiting. This is CBB's way of letting the graph executable know that the user is done looking at the graph.