Open Source Telephony
 help / color / mirror / Atom feed
From: James Prestwood <james.prestwood@linux.intel.com>
To: ofono@ofono.org
Subject: Re: [PATCH] watchlist: added macro for notifying with no args
Date: Tue, 14 Nov 2017 09:25:04 -0800	[thread overview]
Message-ID: <a3549bc2-98f5-e403-67ae-36ecd4106f65@linux.intel.com> (raw)
In-Reply-To: <1510680276-1215-1-git-send-email-james.prestwood@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

Sorry, did I not mean to send to this list.


On 11/14/2017 09:24 AM, James Prestwood wrote:
> The macros currently did not support notifying a watchlist with
> no extra arguments.
> ---
>   src/watchlist.h | 18 +++++++++++++++++-
>   1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/src/watchlist.h b/src/watchlist.h
> index 737b80d..3d87810 100644
> --- a/src/watchlist.h
> +++ b/src/watchlist.h
> @@ -2,7 +2,7 @@
>    *
>    *  Wireless daemon for Linux
>    *
> - *  Copyright (C) 2016  Intel Corporation. All rights reserved.
> + *  Copyright (C) 2016-2017  Intel Corporation. All rights reserved.
>    *
>    *  This library is free software; you can redistribute it and/or
>    *  modify it under the terms of the GNU Lesser General Public
> @@ -92,3 +92,19 @@ void __watchlist_prune_stale(struct watchlist *watchlist);
>   		if ((watchlist)->stale_items)				\
>   			__watchlist_prune_stale(watchlist);		\
>   	} while	(false)
> +
> +#define WATCHLIST_NOTIFY_NO_ARGS(watchlist, type)			\
> +	do {								\
> +		const struct l_queue_entry *entry =			\
> +				l_queue_get_entries((watchlist)->items);\
> +									\
> +		(watchlist)->in_notify = true;				\
> +		for (; entry; entry = entry->next) {			\
> +			struct watchlist_item *item = entry->data;	\
> +			type t = item->notify;				\
> +			t(item->notify_data);			\
> +		}							\
> +		(watchlist)->in_notify = false;				\
> +		if ((watchlist)->stale_items)				\
> +			__watchlist_prune_stale(watchlist);		\
> +	} while	(false)


      reply	other threads:[~2017-11-14 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 17:24 [PATCH] watchlist: added macro for notifying with no args James Prestwood
2017-11-14 17:25 ` James Prestwood [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=a3549bc2-98f5-e403-67ae-36ecd4106f65@linux.intel.com \
    --to=james.prestwood@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox