"Fossies" - the Fresh Open Source Software Archive

Member "ncc-2.8/dbstree.C" (1 Dec 2004, 1012 Bytes) of package /linux/privat/old/ncc-2.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /******************************************************************************
    2     dbstree.C 
    3 
    4     Dynamic Binary Search Tree used throughout the entire project.
    5 
    6     A dbsNode applied as a parent class to a specific class will provide
    7     transparent storage in a dbstree. As a result no duplicates may be
    8     stored and locating stored data is performed in less than 32 steps.
    9 
   10     Check dbstree.tex for technical information on this tree.
   11 
   12 *****************************************************************************/
   13 
   14 #include <stdio.h>
   15 #include <assert.h>
   16 #include <string.h>
   17 #include "dbstree.h"
   18 
   19 //***************************************************************
   20 // A tree of case sensitive strings -- char *Name
   21 //***************************************************************
   22 
   23 char *dbsNodeStr::Query;
   24 
   25 int dbsNodeStr::compare (dbsNodeStr *n)
   26 {
   27     return strcmp (Name, n->Name);
   28 }
   29 
   30 int dbsNodeStr::compare ()
   31 {
   32     return strcmp (Name, Query);
   33 }
   34 
   35 dbsNodeStr::dbsNodeStr ()
   36 {
   37     Name = Query;
   38 }
   39 
   40 dbsNodeStr::~dbsNodeStr ()
   41 { }