[no subject]



    GHashTable* g_hash_table_new                (GHashFunc hash_func,
                                                 GEqualFunc key_equal_func);
    ...
    guint       (*GHashFunc)                    (gconstpointer key);
    ...
    gboolean    (*GEqualFunc)                   (gconstpointer a,
                                                 gconstpointer b);

It looks to me as your functions are defined as:

    guint HashFunction (gpointer key);
    gint  HashCompare  (gpointer a, gpointer b);

They need to be:

    guint     HashFunction (gconstpointer key);
    gboolean  HashCompare  (gconstpointer a, gconstpointer b);

Something you should realize: Almost all technical documentation is
either written by techies, or written by technical writers that may
not understand what the techie actually wants to know. A compromise
always need to be made between too much information (i.e. annoying and
hard to use as 'reference material' for the knowledgable), and too
little information (people that are just getting started throwing
themselves into a project, and realizing they don't understand the
basics).

The reference material online is fairly complete, but it is not
especially verbose. People such as myself actually *prefer* this, as
the other details are usually incorrect, limit further implementation
changes, and take up a lot more room in the documents that could be
spent on other, more complicated subjects.

In this case, strdup() may not officially be ANSI (I'm surprised that
it might not be...), but it has been in most libc.a implementations
for UNIX for at least the last decade.

If you are using UNIX, type "man strdup", and you should find it. It
fits in with strcpy(), strcmp(), etc., which un-coincidentally, is
exactly where GLIB has placed it.

mark

-- 
mark mielke cc/markm ncf ca/markm nortelnetworks com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]