TABLE OF CONTENTS


trish2/string_collection [ Modules ]

[ Top ] [ 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 ]

[ Top ] [ 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

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 ]

[ Top ] [ 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

RETURN VALUE

The data bunch (not freed).

SEE ALSO

string_collection, string_collection_new, patricia_free


trish2/string_collection_save [ Functions ]

[ Top ] [ 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

SEE ALSO

string_collection, string_collection_load, patricia_save


trish2/string_collection_load [ Functions ]

[ Top ] [ 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 ]

[ Top ] [ 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

string_collection, string_collection_new