﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
320	psMetadata can't support generic psList metadata -- suggested API modification	robert.desonia@…	eugene	"As the metadata API was specified in the SDRS, PS_META_LIST is treated as a
special case to support duplicate-key items in the psHash portion of the
psMetadata structure.

What I did to eliminate this confusing and limiting 'feature' was to create a
new psMetadataType called 'PS_META_MULTI' in which tags the item in the psHash
as a container of multiple psMetadataItems with the same key (stored in psList,
just as before).  This now allows psMetadata to easily distinguish between a
psList of generic pointers and a list of psMetadataItems with the same key/name.

In the process, I eliminated the need to have the following line in the example:
psMetadataAdd(md,PS_LIST_TAIL,""COMMENT"", PS_META_LIST, ""head of comment block"",
NULL);

By using a new psMetadataFlags enum PS_META_DUPLICATE_OK, the generation of the
PS_META_MULTI entry in the psHash is automatically done when the second entry is
added (and transversely removed if the key becomes unique again).  The user need
not create a PS_META_MULTI entry, just do the following:

// creates a new entry with type PS_META_STR in psList and psHash
psMetadataAdd(md,PS_LIST_TAIL,""COMMENT"",PS_META_STR|PS_META_DUPLICATE_OK,"""",""DATA"");
// creates a new entry in psList, and forces the creation of a PS_META_MULTI 
// in psHash containing the first entry and this entry.
psMetadataAdd(md,PS_LIST_TAIL,""COMMENT"",PS_META_STR|PS_META_DUPLICATE_OK,"""",""PARAMS"");

... for clarification ...
item = psMetadataLookup(md,""COMMENT"");
// item->type is PS_META_MULTI
// item->data.list is a psList of 2 psMetadataItems from above.

For psMetadataRemove, if you try to remove an item by location that is part of a
PS_META_MULTI entry, that item is removed from just the psList of PS_META_MULTI,
leaving the others still in there.  If the PS_META_MULTI can be demoted to a
single entry (i.e., the key is unique again), it is.  If psMetadataRemove is
given a key-name, all the items in the PS_META_MULTI are removed from the
psMetadata's psList before the PS_META_MULTI is removed, eliminating string
comparisons in finding the entries in the psMetadata's psList (increasing
performance). 

-rdd"	defect	closed	high		PSLib SDRS	unspecified	normal	fixed		
