xref: /csrg-svn/lib/libc/string/ffs.3 (revision 66942)
161193Sbostic.\" Copyright (c) 1990, 1991, 1993
261193Sbostic.\"	The Regents of the University of California.  All rights reserved.
341945Sbostic.\"
441945Sbostic.\" This code is derived from software contributed to Berkeley by
541945Sbostic.\" Chris Torek.
641945Sbostic.\" %sccs.include.redist.man%
741945Sbostic.\"
8*66942Sbostic.\"     @(#)ffs.3	8.2 (Berkeley) 04/19/94
941945Sbostic.\"
1048351Scael.Dd
1148351Scael.Dt FFS 3
1248351Scael.Os
1348351Scael.Sh NAME
1448351Scael.Nm ffs
1548351Scael.Nd find first bit set in a bit string
1648351Scael.Sh SYNOPSIS
1748351Scael.Fd #include <string.h>
1848351Scael.Ft int
1948351Scael.Fn ffs "int value"
2048351Scael.Sh DESCRIPTION
2148351ScaelThe
2248351Scael.Fn ffs
23*66942Sbosticfunction finds the first bit set in
2448351Scael.Fa value
2541945Sbosticand returns the index of that bit.
2641945SbosticBits are numbered starting from 1, starting at the right-most
2741945Sbosticbit.
2841945SbosticA return value of 0 means that the argument was zero.
2948351Scael.Sh SEE ALSO
3048351Scael.Xr bitstring 3
3148351Scael.Sh HISTORY
3248351ScaelThe
3348351Scael.Fn ffs
3448351Scaelfunction appeared in
3548351Scael.Bx 4.3 .
36