TITLE Programmers Notes for Box Backup

This directory contains the programmers notes for the Box Backup system. They will be of interest only if you want to review or modify the code.

These notes are intended to be run through a script to produce HTML at some later stage, hence the marks such as 'TITLE'.


SUBTITLE Organisation

The project is split up into several modules. The modules within 'lib' are building blocks for creation of the actual executable programs within 'bin'. 'test' contains unit tests for lib and bin modules.

The file modules.txt lists the modules which are to be built, and their dependencies. It also allows for platform differences.


SUBTITLE Documentation Organisation

In this directory, the files correspond to modules or areas of interest. Sub directories of the same name contain files documenting specific classes within that module.


SUBTITLE Suggested reading order

* common/lib_common.txt
* common/lib_server.txt
* bin_bbackupd.txt
* backup_encryption.txt
* bin_bbstored.txt
* raidfile/lib_raidfile.txt

and refer to other sections as required.


SUBTITLE Building

The makefiles are generated by makebuildenv.pl. (The top level makefile is generated by makeparcels.pl, but this is for the end user to use, not a programmer.)

To build a module, cd to it and type make. If the -DRELEASE option is specified (RELEASE=1 with GNU make) the release version will be built. The object files and exes are placed in a directory structure under 'release' or 'debug'.

It is intended that a test will be written for everything, so in general make commands will be issued only within the test/* modules. Once it has been built, cd to debug/test/<testname> and run the test with ./t .


SUBTITLE Programming style

The code is written to be easy to write. Ease of programming is the primary concern, as this should lead to fewer bugs. Efficiency improvements can be made later when the system as a whole works.

Much use is made of the STL.

There is no common base class.

All errors are reported using exceptions.

Some of the boring code is generated by perl scripts from description files.

There are a lot of modules and classes which can easily be used to build other projects in the future -- there is a lot of "framework" code.


SUBTITLE Lots more documentation

The files are extensively commented. Consider this notes as an overview, and then read the source files for detailed and definitive information.

Each function and class has a very brief decsription of it's purpose in a standard header, and extensive efforts have been maed to comment the code itself.

