RE: [gtk-list] GLib: multi-dimensional GHashTables



Hmm, one last time... does anybody care about this or should I go crawl
under a rock and develop a solution that solves my problem and nobody
else's?

Just checking,
Charles

-----Original Message-----
From: Charles Randall [mailto:crandall@matchlogic.com]
Sent: Friday, July 23, 1999 2:40 PM
To: gtk-list@redhat.com
Subject: [gtk-list] GLib: multi-dimensional GHashTables


I'd like to get some feeback on a proof-of-concept implementation of
multi-dimensional GHashTables. These are like the hashes of hashes described
in Perl's Data Structures Cookbook man page (man perldsc).

I've attached a sample program with proof-of-concept versions of
g_md_hash_table_insert() and  g_md_hash_table_lookup().

These allow the programmer to pass in a "base" hash and a set of keys and
insert or lookup an associated value. All keys are assumed to be of the same
data type (in this example, they're all strings).

In Perl's syntax, this is just  like

	$hash{"dog"}{"lassie"}{"color"} = "gold";
	$value = $hash{"dog"}{"lassie"}{"color"};

Given this, you can implement a fairly sophisticated data storage mechanism.

Has anyone else looked at or wanted something like this?

Charles

 <<md_hash.c>> 



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