From: Johan Hedberg <johan.hedberg@gmail.com>
To: Alfonso Acosta <fons@spotify.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 2/2] core: Add subscription API for Manufacturer Specific Data
Date: Mon, 13 Oct 2014 11:01:38 +0300 [thread overview]
Message-ID: <20141013080138.GA5588@t440s.lan> (raw)
In-Reply-To: <1412954626-30226-3-git-send-email-fons@spotify.com>
Hi Alfonso,
On Fri, Oct 10, 2014, Alfonso Acosta wrote:
> --- a/src/adapter.h
> +++ b/src/adapter.h
> @@ -30,6 +30,8 @@
> #include <glib.h>
> #include <stdbool.h>
>
> +#include "eir.h"
> +
> #define MAX_NAME_LENGTH 248
>
> /* Invalid SSP passkey value used to indicate negative replies */
> @@ -138,6 +140,14 @@ struct btd_adapter_pin_cb_iter *btd_adapter_pin_cb_iter_new(
> void btd_adapter_pin_cb_iter_free(struct btd_adapter_pin_cb_iter *iter);
> bool btd_adapter_pin_cb_iter_end(struct btd_adapter_pin_cb_iter *iter);
>
> +typedef void (*btd_msd_cb_t) (struct btd_adapter *adapter,
> + struct btd_device *dev,
> + const struct eir_msd *msd);
> +void btd_adapter_register_msd_cb(struct btd_adapter *adapter,
> + btd_msd_cb_t cb);
In our user space code we try to follow the following principles for
internal header files:
1) The c-file that includes them should also include the prerequisites
2) We don't use multi-include guards
The general idea is that we don't want hidden and implicit dependencies
but prefer having them explicitly spelled out. This practice also helps
detect circular dependencies. For public header files or those of
library-like modules we don't follow this practice (e.g. gdbus/gdbus.h).
As for your patch, I'd suggest to spell out each of the three variables
in your bt_msd_cb_t instead of using the "struct eir_msd" in adapter.h.
That way you don't have a dependency to eir.h from adapter.h.
Johan
next prev parent reply other threads:[~2014-10-13 8:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 15:23 [PATCH v2 0/2] core: Add plugin-support for Manufacturer Specific Data EIR Alfonso Acosta
2014-10-10 15:23 ` [PATCH v2 1/2] core: Add Manufacturer Specific Data EIR field Alfonso Acosta
2014-10-10 15:23 ` [PATCH v2 2/2] core: Add subscription API for Manufacturer Specific Data Alfonso Acosta
2014-10-13 8:01 ` Johan Hedberg [this message]
2014-10-13 11:45 ` Alfonso Acosta
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=20141013080138.GA5588@t440s.lan \
--to=johan.hedberg@gmail.com \
--cc=fons@spotify.com \
--cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).