summaryrefslogtreecommitdiffstats
path: root/common/collection/collection.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-07-17 19:22:13 -0400
committerSimo Sorce <ssorce@redhat.com>2009-07-20 10:50:51 -0400
commite519ed7c7f203a6a95e58b7e770253c093d2dec6 (patch)
tree432b4e983ae6bc3df72bec4fdaade59dd8d2cb58 /common/collection/collection.h
parentc0a1d64228042c3d4bbf62447a49d085fd30fda1 (diff)
downloadsssd-e519ed7c7f203a6a95e58b7e770253c093d2dec6.tar.gz
sssd-e519ed7c7f203a6a95e58b7e770253c093d2dec6.tar.xz
sssd-e519ed7c7f203a6a95e58b7e770253c093d2dec6.zip
COLLECTION & INI Cleanup
I started to cleanup the unit tests from the type cust around NULL and found several problems that I had to address: 1) The choice of the "." as a search separator turned out to be a poor choice. The problem was that the file name has "." and INI was relaying on files to be used as property names. I corrected that part in the INI but after discussion with Simo we decided to switch from "." to "!" as special symbol anyways. 2) Found that the property rename was not reinitializing the hash. Corrected. Added ticket to add unit tests around it (#83).
Diffstat (limited to 'common/collection/collection.h')
-rw-r--r--common/collection/collection.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/common/collection/collection.h b/common/collection/collection.h
index 73ac7b34c..6868cb6e8 100644
--- a/common/collection/collection.h
+++ b/common/collection/collection.h
@@ -165,20 +165,20 @@ struct collection_iterator;
* get_item function will return you the item that is your "wallet".
* You can then change something or just get information about the item you
* retrieved. But in most cases you do not the wallet itself. You want to get
- * something from the vallet or put something into it. IMO money would be an
+ * something from the wallet or put something into it. IMO money would be an
* obvious choice. To do this you use update_xxx_property functions.
* There might be a bag somewhere deep and you might want to add something to
* it. add_xxx_property_xxx functions allow you to specify sub collection you
* want the item to be added to. If this sub collection argument is NULL top
* level collection is assumed.
- * The search in the collections users a dotted notation to refer to an item (or
+ * The search in the collections users a "x!y!z" notation to refer to an item (or
* property). You can search for "wallet" and it will find any first instance of
* the "wallet" in your luggage. But you might have two wallets. One is yours and
- * another is your significant other's. So you might say find "my.wallet".
+ * another is your significant other's. So you might say find "my!wallet".
* It will find wallet in your bad (collection) named "my". This collection can
* be many levels deep inside other collections. You do not need to know the
* full path to get to it. But if you have the full path you can use the fill
- * path like this "luggage.newbags.my.wallet".
+ * path like this "luggage!newbags!my!wallet".
* It is useful to be able to put bags into bags as well as get them out of each
* other. When the collection is created the header keeps a reference count on
* how many copies of the collection are known to the world. So one can put a
@@ -188,6 +188,9 @@ struct collection_iterator;
* By extracting reference from an internal collection the caller gains access
* to the collection directly and thus has responsibility to destroy it after
* use.
+ * Characters with codes less than space in ASCII table are illegal for property
+ * names.
+ * Character '!' also illegal in property name and reserved for "x!y!z" notation.
*/
/* Function that creates a named collection */
@@ -324,7 +327,7 @@ int col_set_timestamp(struct collection_item *ci,
/* Update functions */
/* All update functions search the property using the search algorithm
* described at the top of the header file.
- * Use same dotted notation to specify a property.
+ * Use same "x!y" notation to specify a property.
*/
/* Update a string property in the collection.
* Length should include the terminating 0 */
@@ -450,7 +453,7 @@ int col_get_item(struct collection_item *ci, /* Collection to find things
/* Group of functions that allows retrieving individual elements of the collection_item
* hiding the internal implementation.
*/
-const char *col_get_item_property(struct collection_item *ci,int *property_len);
+const char *col_get_item_property(struct collection_item *ci, int *property_len);
int col_get_item_type(struct collection_item *ci);
int col_get_item_length(struct collection_item *ci);
void *col_get_item_data(struct collection_item *ci);