Re: [xml] Hash question: behavior of a hash with xmlHashAddEntry and xmlHashAddEntry2 types

On Mon, Mar 19, 2007 at 02:56:45PM -0500, David Hagood wrote:
Given that I have created a hash with xmlHashCreate:

1) Is it valid to populate it with calls to both xmlHashAddEntry and
xmlHashAddEntry2 - in other words, having entries with one or two strings.
2) What is the behavior of xmlHashLookup and xmlHashLookup2 in such a case?

For example, is the following code valid?

xmlHashAddEntry2(hash,BAD_CAST "Smokey",BAD_CAST "Bear",&bear);

And if so, what will  xmlHashLookup(hash,BAD_CAST "Smokey") return?

The hash documentation isn't clear on whether this is valid or not.

  That should be valid xmlHashAddEntry is a call to xmlHashAddEntry3 
with 2 extra NULL args, and xmlHashLookup is a call to xmlHashLookup3
with 2 extra NULL args, everything is done internally with 3 args.
Note however that I never tried to mix in libxml2 code itself.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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