Module: kamailio Branch: master Commit: 53afec4962e2dc3ec0971ba97da94f37c57780d3 URL: https://github.com/kamailio/kamailio/commit/53afec4962e2dc3ec0971ba97da94f37...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-08-31T11:19:50+02:00
core: clist - helper macro to test if a clist is empty
---
Modified: src/core/clist.h
---
Diff: https://github.com/kamailio/kamailio/commit/53afec4962e2dc3ec0971ba97da94f37... Patch: https://github.com/kamailio/kamailio/commit/53afec4962e2dc3ec0971ba97da94f37...
---
diff --git a/src/core/clist.h b/src/core/clist.h index 2b796e6ff4..143c61951c 100644 --- a/src/core/clist.h +++ b/src/core/clist.h @@ -15,8 +15,8 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */
@@ -121,4 +121,10 @@ #define clist_foreach_safe(head, v, bak, dir) \ for((v)=(head)->dir, (bak)=(v)->dir; (v)!=(void*)(head); \ (v)=(bak), (bak)=(v)->dir) + +/*! \brief test if clist is empty (1 - empty; 0 - not empty)*/ +#define clist_empty(head, dir) \ + (((head)->dir!=(void*)(head))?0:1) + + #endif