Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

mkstring.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2000 KOM/Darmstadt University of Technology
00003  *
00004  * This program is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License as published by the
00006  * Free Software Foundation; either version 2, or (at your option) any
00007  * later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00017  * USA.
00018  */
00019 #ifndef MKSTRING_H
00020 #define MKSTRING_H
00021 
00022 /*
00023  * Basic types
00024  */
00025 
00026 enum BaseStringEnum
00027 {
00028   Type_Undefined,         /* prevents crashes in Namespace */
00029 
00030   /* initializers for simplified caching strategy recognition */
00031   Strategy_NONE,      /* keyword for no strategy */
00032 
00033   Type_Size           /* COUNTER */
00034 };
00035 
00036 #define TYPE_Undefined BaseString[Type_Undefined]
00037 #define STRATEGY_NONE  BaseString[Strategy_NONE]
00038 
00039 extern int BaseString [Type_Size];
00040 
00041 /*
00042  * Structs for the Namespaces
00043  */
00044 
00045 struct bintree
00046 {
00047   char** array;
00048   int   size;
00049 
00050   bintree ( );
00051 
00052   int insert ( const char* str );
00053   int insert ( const char* str, int index );
00054   void dump ( int i = 0 ) const;
00055 };
00056 
00057 struct binforest
00058 {
00059   char     one_char_static[2*256];
00060   bintree *forest[256];
00061 
00062   binforest ( );
00063 
00064   int insert ( const char* str );
00065   const char* get ( const int& index ) const;
00066   void dump ( ) const;
00067 };
00068 
00069 extern int mkstring ( const char* str );
00070 extern void mkstringInit ( );
00071 extern void dumpstring ( );
00072 extern const char* getstring ( const int& i );
00073 
00074 /*
00075  * use the binary tree
00076                         0
00077             1                        2
00078       3           4            5           6
00079    7     8     9     10    11    12    13    14
00080  15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
00081  */
00082 
00083 #endif /* MKSTRING_H */
00084 

Generated on Sat Mar 23 18:58:40 2002 for Komssys-mkauto by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002