2013-11-28 13:25:33 +01:00
|
|
|
/*
|
2013-10-31 15:29:07 +01:00
|
|
|
* Copyright (C) 2013 INRIA.
|
|
|
|
*
|
2014-08-23 15:43:13 +02:00
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
2013-10-31 15:29:07 +01:00
|
|
|
*/
|
|
|
|
|
2013-11-04 11:25:27 +01:00
|
|
|
/**
|
2014-12-06 02:05:51 +01:00
|
|
|
* @ingroup posix
|
2013-10-31 15:29:07 +01:00
|
|
|
* @{
|
2013-11-28 13:25:33 +01:00
|
|
|
*
|
2015-05-22 07:34:41 +02:00
|
|
|
* @file
|
2013-10-31 15:29:07 +01:00
|
|
|
* @brief string operations
|
|
|
|
*
|
|
|
|
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/strings.h.html">
|
|
|
|
* The Open Group Base Specifications Issue 7, <strings.h>
|
|
|
|
* </a>
|
|
|
|
*
|
2015-02-08 18:51:25 +01:00
|
|
|
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
2013-10-31 15:29:07 +01:00
|
|
|
*/
|
|
|
|
#ifndef STRINGS_H
|
|
|
|
#define STRINGS_H
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2013-11-06 20:21:06 +01:00
|
|
|
#include <stddef.h>
|
2013-10-31 15:29:07 +01:00
|
|
|
|
2014-10-10 11:51:11 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-10-31 15:29:07 +01:00
|
|
|
/**
|
|
|
|
* @brief Returns the position of the first (least significant) bit set in
|
2013-11-04 11:25:27 +01:00
|
|
|
* integer *i*, or 0 if no bits are set in i.
|
2013-10-31 15:29:07 +01:00
|
|
|
*
|
|
|
|
* @param[in] i an integer number.
|
|
|
|
*
|
|
|
|
* @return Position (1 for least significant bit) of the first bit set,
|
|
|
|
* 0 if no bits are set.
|
|
|
|
*
|
|
|
|
* @see <a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/ffs.html">
|
|
|
|
* The Open Group Base Specification Issue 7, ffs
|
|
|
|
* </a>
|
|
|
|
*/
|
|
|
|
#define ffs(i) __builtin_ffs(i)
|
|
|
|
|
2014-10-10 11:51:11 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-10-31 15:29:07 +01:00
|
|
|
#endif /* STRINGS_H */
|