[systemd-devel] [PATCH 1/7] libsystemd-bus: bring definitions in sync with kdbus
Daniel Mack
daniel at zonque.org
Wed Dec 4 00:29:07 PST 2013
On 12/04/2013 09:13 AM, Yin Kangkai wrote:
> On 2013-12-04, 08:49 +0100, Daniel Mack wrote:
>>> Actually, I have a stupid question, do we have any particular reason
>>> to use "part/PART"? giving the fact that we already have term "item"
>>> everywhere in the code...
>>>
>>> struct kdbus_item, items, kdbus_msg.items...
>>>
>>> My opinion, on the contrary, we should replace all the KDBUS_PART_xxx
>>> into KDBUS_ITEM_xxx, that seems more reasonable to me :)
>>
>> Nope. A 'part' is more generic: anything that has size header and a
>> dynamic length is a 'part' and can be iterated over with
>> KDBUS_PART_FOREACH. Hence, an 'item' is a 'part', but not vice versa.
>> See struct kdbus_name_list for example.
>
> Thanks Daniel for the reply.
>
> OK now I understand KDBUS_PART_NEXT/FOREACH is not only for
> "item".
>
> But KDBUS_PART_HEADER_SIZE and KDBUS_PART_SIZE seems "item" specific,
> no?
You're right, it's used in that context only, and it assumes 2 *
sizeof(u64) as header size, so we should probably rename it. We've
changed thing forth and back a couple of times.
Give us some time to reconsider :)
Thanks,
Daniel
More information about the systemd-devel
mailing list