[Freeipa-devel] [PATCH] Stack and Queue APIs using collection

Dmitri Pal dpal at redhat.com
Thu Jul 2 13:44:24 UTC 2009


Stephen Gallagher wrote:
> On 07/01/2009 06:25 PM, Dmitri Pal wrote:
> > Patch adds two convenience interfaces that  allow using collection as a
> > queue or as a stack.
>
>
>
>
>
> > ------------------------------------------------------------------------
>
> > _______________________________________________
> > Freeipa-devel mailing list
> > Freeipa-devel at redhat.com
> > https://www.redhat.com/mailman/listinfo/freeipa-devel
>
> I will ack this and commit it but I'm going to fix two things:
>
> 1) Formatting bug: every "return error;" line in collection_queue.c and
> collection_stack.c is prepended by a tab instead of four spaces. There's
> also one in queue test before "unsigned count;"
>
Weird.  This is bug in the editor.
I will try not to forget to check for that.

> 2) Trace messages are wrong for enqueue_any_property.
>
Thanks.

> I've also opened https://fedorahosted.org/sssd/ticket/69 (tangentially
> related). The collection API has the potential for namespace collision
> with programs attempting to import it, so we should clear that up. This
> patch made me aware of it, but it's true of the pre-existing code, so
> it'll be better to fix it all at once.
I understand the motivation. Is it really the best practice?
I am concerned that it will be a big effort.
I already have about 5 dozen functions.
Some of them have collection in the name, some do not.
Blindly adding "col" or some other prefix does not seem to be the right
approach.
It would require a global rethinking of the naming.
So far I used the following terminology:

property - a key value pair
item - property in a internal representation of the collection (think
turned into an object)
collection  - set of items and other collections

So names are constructed from these terms and actions (sometimes with
preposition and type):
insert_str_property
modify_bool_item
create_collection

If we follow the proposal in the ticket we would have:
col_create_collection - looks a bit strange to me. Is it Ok with everybody?
Suggestions welcome.

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel at redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel




-- 
Thank you,
Dmitri Pal

Engineering Manager IPA project,
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/




More information about the Freeipa-devel mailing list