TABLE OF CONTENTS
- trish2/string_collection
- trish2/string_collection_new
- trish2/string_collection_free
- trish2/string_collection_save
- trish2/string_collection_load
- trish2/string_collection_ptr
trish2/string_collection [ Modules ]
NAME
string_collection
SYNOPSIS
#include <string_collection.h>
DESCRIPTION
A string collection is a set of pointers to strings that guarantees that each different string is only stored once. The PATRICIA structure allows to search for existing strings in the collection. Its data member is a bunch of wchar_t containing all the strings of the collection.
EXAMPLE
SEE ALSO
patricia, bunch, string_collection_new, string_collection_free, string_collection_save, string_collection_load, string_collection_ptr
trish2/string_collection_new [ Functions ]
NAME
string_collection_new
SYNOPSIS
#include <string_collection.h> patricia_t *string_collection_new(unsigned int node_block, unsigned int string_block, unsigned int collection_size);
FUNCTION
string_collection_new creates a PATRICIA tree holding the collection of strings.
INPUTS
- node_block : PATRICIA tree nodes block size.
- string_block : Tail strings block size.
- collection_size : Data block size. An estimate of the collection size in wide characters.
RETURN VALUE
A freshly allocated string collection, which is a PATRICIA tree.
SEE ALSO
string_collection, string_collection_free, patricia_new
trish2/string_collection_free [ Functions ]
NAME
string_collection_free
SYNOPSIS
#include <string_collection.h> bunch_t *string_collection_free(patricia_t *scoll);
FUNCTION
string_collection_free is an alias for patricia_free.
INPUTS
- scoll : String collectionto destroy.
RETURN VALUE
The data bunch (not freed).
SEE ALSO
string_collection, string_collection_new, patricia_free
trish2/string_collection_save [ Functions ]
NAME
string_collection_save
SYNOPSIS
#include <string_collection.h> void string_collection_save(patricia_t *scoll, FILE *f);
FUNCTION
string_collection_save is an alias for patricia_save. Bunches are not pruned.
INPUTS
- scoll : String collection to write.
- f : File handler created with fopen (mode "w" or "a").
SEE ALSO
string_collection, string_collection_load, patricia_save
trish2/string_collection_load [ Functions ]
NAME
string_collection_load -- read a string collection from a file
SYNOPSIS
* #include <string_collection.h> * patricia_t *string_collection_load(FILE *f);
FUNCTION
string_collection_load is an alias for patricia_load.
INPUTS
f : File handler to read from created with fopen (mode "r").
RETURN VALUE
The string collection as a PATRICIA tree.
SEE ALSO
string_collection, string_collection_save, patricia_load
trish2/string_collection_ptr [ Functions ]
NAME
string_collection_ptr -- get the unique pointer for a string in a collection
SYNOPSIS
* #include <string_collection.h> * wchar_t *string_collection_ptr(patricia_t *scoll, const wchar_t *w);
FUNCTION
string_collection_ptr searches w in the PATRICIA tree scoll and adds it if it is not found. The returned value is a pointer to a string which is a copy of w. string_collection_ptr guarantees to return the same pointer for different calls with the same collection and the same string.
INPUTS
scoll : String collection. w : String to search.
RETURN VALUE
Pointer to the copy in the collection of w. This is a claimed pointer.
SEE ALSO