# Circular Index Card File Program

Topics
Overview | User Interfaces
Directory Contents | Compiling
Customizing | Config File
Database Files | Welcome Message

Overview

The Circular Index Card File Program is a persistent string database used to store various name and address information in an index card file format. All the string members can grow and shrink as needed. This code has been compiled and tested under DOS, Windows 95, HPUX 10.20, and Solaris 2.4.

Each string member in the CCIndex class is labeled with a program identifier to create the following entry fields in the user interface programs:

NAME
COMPANY/AGENCY
DEPARTMENT/TITLE
PHONE NUMBER
FAX NUMBER
CELLULAR NUMBER
BEEPER NUMBER
EMAIL ADDRESS
STREET ADDRESS
INTERNET URLS
COMMENTS

The "NAME" field is a case-sensitive key member used to uniquely identify each object in the database. An object's key name can only appear once in the database. The key name restriction is enforced to prevent duplicate names from appearing in the database. The database will support duplicate names, but this feature was not implemented in this program.

All the other fields are optional and can be changed as needed. The "STREET ADDRESS", "INTERNET URLS", and "COMMENTS" field are multi-line text field, that allow up to four lines of text to be entered.

User interfaces

wxWindows Version:

For detailed instructions on using the wxWindows program, see the wxWindows User Interface page.

A portable windows based version was developed for Windows 95 and Motif using the "wxWindows" GUI library, version 1.68B. For more information on wxWindows, visit the wxWindows Home Site at: http://web.ukonline.co.uk/julian.smart/wxwin/. The Windows 95 version was built with Microsoft Visual C/C++ version 4.2 and tested under Windows 95A, Windows 95B, and Windows NT workstation version 4.0. The Motif version was built with HPUX C++ version 10.24 and tested under HPUX 10.20 on series 700 workstations and series 800 servers.

Curses Version:

For detailed instructions on using the Curses program, see the Curses User Interface page.

The curses version was developed for use with UNIX systems to access the database via telnet sessions. It was built with the Independent Terminal Type Class and ported to DOS for testing purposes. In order for the terminal interface to work under DOS and Windows 95 the ANSI.SYS driver must be loaded.

Directory Contents

All the components of the Index Card File Database are located in the "examples" subdirectory, under "ccindex".

    base     - Source code directory for the base programs.
    bin      - Binary directory for the program executables.
    curses   - Source code and makefiles for the Curses user interface.
    db_files - Default location for the data file and the index file.
    wx168b    - Source code and makefile for the wxWindows user interface.

Compiling the applications

Curses Version:

Four makefiles are provided in the "curses" directory to compile the source code on one of four different compilers:

    "msvc40.mak"  - Makefile for Microsoft visual C/C++ 4.2
    "djgpp.mak"   - Makefile for DJGPP gcc 2.7.2.1
    "gnu_gcc.mak" - Makefile for GNU g++ 2.7.2.1 and egcs-2.90.29
    "hpux10.mak"  - Makefile for HPUX C++ A.10.24

wxWindows Version:

Two makefiles are provided in the "wxwin" directory to compile the source code with wxWindows version 1.68B on one of two different compilers:

    "msvc40.mak"  - Makefile for Microsoft visual C/C++ 4.2
    "hpux10.mak"  - Makefile for HPUX C++ A.10.24

Building the Executable:

If you want to change the name of the executable, modify the PROJECT macro in the makefile. To compile use the "make -f" option followed by the makefile name. To compile using MSVC use the "nmake -f" option. The resulting executable will be named after the name set by the PROJECT macro in the makefile. Use the following examples to compile the curses version using the make utility:

    make VBDDIR=/apps/database/vbdbase -f hpux10.mak
    make VBDDIR=/apps/database/vbdbase -f gnu_gcc.mak
    make VBDDIR=D:/vbdbase -f djgpp.mak
    nmake VBDDIR=D:\vbdbase -f msvc40.mak

Use the following examples to compile the wxWindows version using the make utility:

    make VBDDIR=/apps/database/vbdbase WXWIN=/apps/wxwin -f hpux10.mak
    nmake VBDDIR=D:\vbdbase WXWIN=C:\wx -f msvc40.mak

The VBDDIR variable points the installation path of the VBD distribution and the WXWIN variable points to the wxWindows library installation path. NOTE: The DJGPP compiler requires the use of UNIX style path separators.

Installing:

Execute a "make -f (makefile name) install" to move the executable to the bin directory. A default program configuration file should exist in the "bin" directory. A copy of the program configuration is stored in the "curses" and the "wx168b" directories.

Removing the Object Files and the Executable:

To remove the object files and the executable use the "make -f" option followed by the makefile name, followed by "clean": make -f hpux10.mak clean

Under MSVC use the "nmake -f" option followed by the makefile name, followed by "clean": nmake -f msvc40.mak clean

Customizing the User Interface

To customize the application, enter the "base" directory and modify the "dbconfig.hpp" file. This file is used to set the default file locations of the database files and the program configuration file. You can also change the program identifiers of the string members in the CCIndex class. Each program identifier is used to name an entry field in user interface program.

Program Configuration Files

Both the Windows version and the Curses version share a common program configuration file. The "bin" subdirectory is the default location for the configuration file.

    ccindex.ini  (DOS, Windows 95 configuration file)
    _ccindex.unx (UNIX configuration file, must rename to .ccindex)

This program will search for the its configuration file in the directory where it was executed. If the program cannot find its configuration file, it will search the environment for the CCINDEXCFG variable. The CCINDEXCFG is used to tell the program where its configuration file is if it is located in a different directory. Under UNIX a copy the configuration file can be placed in each users directory to create a custom profile. The following are some examples of how to set a path to the program configuration file in the environment:

    POSIX compatible shell under UNIX:
    CCINDEXCFG=/apps/vbdbase/examples/ccindex/bin/.ccindex
    export CCINDEXOCFG

    C shell under UNIX:
    setenv CCINDEXCFG /apps/vbdbase/examples/ccindex/bin/.ccindex

    Under DOS, Windows 95:
    set CCINDEXCFG=C:\vbdbase\examples\ccindex\bin\ccindex.ini

Database Files

The "db_files" subdirectory is the default location for the database files. The program uses both a data file and an index file. The data file named "ccindex.pod" stores the database and the index file named "ccindex.btx" stores the location of each object in the data file. Both the name and location of the database files can be changed in the program's configuration file. You can use any text editor to edit the program's configuration file.

When a database file is created the binary file itself is platform independent. Different types of machines running the same version of the application compiled for that platform can access the file. This allows a single database to be distributed across the network. For example: if the main database file resides on an UNIX server then a PC client or another UNIX work station can NFS mount the directory where the database resides and use the same database.

All of the string objects created by the CCIndex class is managed by the Persistent Object Database manager and the Persistent base class. Files created by the POD manager are given a ".pod" extension to allow the user to identify them as POD data files. Index files created by the POD manager are given a ".btx" extenuation to allow the user to identify them as B-tree index files. An index file is a VBD file used to store the address where the object's data can be found in the data file. Index files were implemented to increase the speed of search operations.

Any files created directly with the VBD file manager are usually given a ".vbd" file extension. The POD manager and the Persistent base class gives persistent objects the ability to store complex types, pointers, and references. The VBD file manager used alone is not limited to object oriented databases. It can be used to store any type of variable length binary data. However, files created using either the POD manager or the VBD file manager will maintain the same file structure and be identified by a signature stored in the file header.

Welcome Message

The program's welcome message is only used in the Windows version. A file named "welcome.txt", located in the "bin" subdirectory by default, contains the program's welcome message. The welcome message is used to display program information when the program first starts. Both the name and location of the welcome message can be changed in the program configuration file. You can use any text editor to edit the program's configuration file and welcome message.

End Of Document