SIS
Symmetric Index Structures
/Users/dbr/ma/src/bas/lml/alphabet.h
Go to the documentation of this file.
00001 #ifndef _HEADER_FILE_ALPHABET_
00002 #define _HEADER_FILE_ALPHABET_
00003 
00004 #define NO_CODE ((U16)(-1))
00005 #define ALPHABET_FIRST_MARKER ((UINT)(0x10000))
00006 
00007 #define mAlphabetGetSize( alph ) ( (alph)->maxMarker - NO_CODE + (alph)->numberOfSymbols )
00008 
00009 #define mAlphabetGetCode( alph, symbol ) ( (symbol) < ALPHABET_FIRST_MARKER ? (alph)->symbolToCode[(symbol)] : \
00010 ( (symbol) > (alph)->maxMarker ? NO_CODE : ( (alph)->maxMarker - NO_CODE + (alph)->numberOfSymbols ) ) )
00011 
00012 typedef struct tAlphabet{
00013     U16 * symbolToCode;
00014     UINT numberOfSymbols;
00015     UINT maxMarker;
00016 } Alphabet;
00017 
00018 Alphabet * AlphabetInit();
00019 void AlphabetAdd( Alphabet * alph, const Automaton * aut );
00020 void AlphabetFree( Alphabet * alph );
00021 void AlphabetWrite( Alphabet * alph, FILE * fp );
00022 Alphabet * AlphabetRead( FILE * fp );
00023 
00024 #endif