From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 3/3] message: Code independent of protocol stack
Date: Thu, 13 Jan 2011 16:41:39 -0600 [thread overview]
Message-ID: <4D2F7FA3.9050600@gmail.com> (raw)
In-Reply-To: <4D2F898D.2000900@nokia.com>
[-- Attachment #1: Type: text/plain, Size: 2057 bytes --]
Hi Faiyaz,
>> Please keep this as an internal API (e.g.
>> __ofono_message_path_from_uuid) and update ofono.h appropriately.
>
> Based on a comment in Patch 2/3, message.h and message.c are internal to
> core and to me they look more of a utility/helper functions to sms.c
> file (and in future cdma-sms.c file). So should I even include
> "message.h" in ofono.h file. I could only rename the function to be
> message_XXX.
>
> The sms.h still maintains the API "__ofono_sms_message_path_from_uuid"
> which is shared with "smart-messaging.c" and is defined in ofono.h
>
>
That would be fine as well.
>>> - if (message_dbus_register(sms, m) == FALSE)
>>> + if (ofono_message_dbus_register(
>>> + __ofono_atom_get_path(sms->atom),
>>> + m) == FALSE)
>>
>> This looks a bit ugly, can you find a better way to do this? Perhaps
>> message_create should simply take an atom as well.
> I think we can go with
> 1) Pass "sms->atom", add "struct ofono_atom *atom" in the message struct
> and initialize the reference of the same in message_create. But I am not
> sure if it will be okay to pass a reference to a private data member
> from struct ofono_sms.
> struct message {
> struct ofono_uuid uuid;
> enum message_state state;
> void *data;
> struct ofono_atom *atom;
> };
>
> 2) Pass "__ofono_atom_get_path(sms->atom)" and use malloc in
> message_create to initialize "atompath". Just use atompath through the
> code. But a general observation I had was that in ofono we used "static
> char xxx[]" instead of doing malloc. Hence did not go this route in the
> initial patch.
>
> struct message {
> struct ofono_uuid uuid;
> enum message_state state;
> void *data;
> char *atompath;
> };
>
> Please let me know your thoughts on the same.
>
I don't think there's a huge difference between the two. Use the atom
member for now and I will have a closer look when you resubmit.
Regards,
-Denis
prev parent reply other threads:[~2011-01-13 22:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 19:50 [PATCH 3/3] message: Code independent of protocol stack Faiyaz Baxamusa
2011-01-13 18:20 ` Denis Kenzior
2011-01-13 23:23 ` Faiyaz Baxamusa
2011-01-13 22:41 ` Denis Kenzior [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D2F7FA3.9050600@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.