\hypertarget{group__avr__string}{}\doxysubsection{$<$string.\+h$>$\+: Strings}
\label{group__avr__string}\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group__avr__string_gaedb0e7bb7333d6122472acddb5df20ac}{\+\_\+\+F\+FS}}(x)
\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup}} (const char $\ast$s1)
\item 
size\+\_\+t \mbox{\hyperlink{group__avr__string_ga63e609bfa0d354dcd7e35b297c2e6fdd}{strlcat}} (char $\ast$, const char $\ast$, size\+\_\+t)
\item 
size\+\_\+t \mbox{\hyperlink{group__avr__string_ga64bc119cf084d1ecfd95098994597f12}{strlcpy}} (char $\ast$, const char $\ast$, size\+\_\+t)
\item 
char $\ast$ \mbox{\hyperlink{group__avr__string_ga6ace85338eafe22a0ff52c00eb9779b8}{strtok}} (char $\ast$, const char $\ast$)
\end{DoxyCompactItemize}


\doxysubsubsection{Detailed Description}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{string_8h}{string.h}}>} }
\end{DoxyCode}


The string functions perform string operations on N\+U\+LL terminated strings.

\begin{DoxyNote}{Note}
If the strings you are working on resident in program space (flash), you will need to use the string functions described in \mbox{\hyperlink{group__avr__pgmspace}{$<$avr/pgmspace.\+h$>$\+: Program Space Utilities}}. 
\end{DoxyNote}


\doxysubsubsection{Macro Definition Documentation}
\mbox{\Hypertarget{group__avr__string_gaedb0e7bb7333d6122472acddb5df20ac}\label{group__avr__string_gaedb0e7bb7333d6122472acddb5df20ac}} 
\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}!\_FFS@{\_FFS}}
\index{\_FFS@{\_FFS}!$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxyparagraph{\texorpdfstring{\_FFS}{\_FFS}}
{\footnotesize\ttfamily \#define \+\_\+\+F\+FS(\begin{DoxyParamCaption}\item[{}]{x }\end{DoxyParamCaption})}

This macro finds the first (least significant) bit set in the input value.

This macro is very similar to the function ffs() except that it evaluates its argument at compile-\/time, so it should only be applied to compile-\/time constant expressions where it will reduce to a constant itself. Application of this macro to expressions that are not constant at compile-\/time is not recommended, and might result in a huge amount of code generated.

\begin{DoxyReturn}{Returns}
The \mbox{\hyperlink{group__avr__string_gaedb0e7bb7333d6122472acddb5df20ac}{\+\_\+\+F\+F\+S()}} macro returns the position of the first (least significant) bit set in the word val, or 0 if no bits are set. The least significant bit is position 1. Only 16 bits of argument are evaluted. 
\end{DoxyReturn}


\doxysubsubsection{Function Documentation}
\mbox{\Hypertarget{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}\label{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}} 
\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}!strdup@{strdup}}
\index{strdup@{strdup}!$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxyparagraph{\texorpdfstring{strdup()}{strdup()}}
{\footnotesize\ttfamily char $\ast$ strdup (\begin{DoxyParamCaption}\item[{const char $\ast$}]{s1 }\end{DoxyParamCaption})}



Duplicate a string. 

The \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup()}} function allocates memory and copies into it the string addressed by s1, including the terminating null character.

\begin{DoxyWarning}{Warning}
The \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup()}} function calls \mbox{\hyperlink{stdlib_8h_a4996af830ebe744d9678e5251dfd3ebd}{malloc()}} to allocate the memory for the duplicated string! The user is responsible for freeing the memory by calling \mbox{\hyperlink{stdlib_8h_afb8699abb1f51d920a176e695ff3be8a}{free()}}.
\end{DoxyWarning}
\begin{DoxyReturn}{Returns}
The \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup()}} function returns a pointer to the resulting string dest. If \mbox{\hyperlink{stdlib_8h_a4996af830ebe744d9678e5251dfd3ebd}{malloc()}} cannot allocate enough storage for the string, \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup()}} will return N\+U\+LL.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Be sure to check the return value of the \mbox{\hyperlink{group__avr__string_ga8569f20e38a030b5a28fd951abec2c9b}{strdup()}} function to make sure that the function has succeeded in allocating the memory! 
\end{DoxyWarning}
\mbox{\Hypertarget{group__avr__string_ga63e609bfa0d354dcd7e35b297c2e6fdd}\label{group__avr__string_ga63e609bfa0d354dcd7e35b297c2e6fdd}} 
\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}!strlcat@{strlcat}}
\index{strlcat@{strlcat}!$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxyparagraph{\texorpdfstring{strlcat()}{strlcat()}}
{\footnotesize\ttfamily size\+\_\+t strlcat (\begin{DoxyParamCaption}\item[{char $\ast$}]{dst,  }\item[{const char $\ast$}]{src,  }\item[{size\+\_\+t}]{siz }\end{DoxyParamCaption})}



Concatenate two strings. 

Appends src to string dst of size siz (unlike strncat(), siz is the full size of dst, not space left). At most siz-\/1 characters will be copied. Always N\+U\+LL terminates (unless siz $<$= strlen(dst)).

\begin{DoxyReturn}{Returns}
The \mbox{\hyperlink{group__avr__string_ga63e609bfa0d354dcd7e35b297c2e6fdd}{strlcat()}} function returns strlen(src) + M\+IN(siz, strlen(initial dst)). If retval $>$= siz, truncation occurred. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__avr__string_ga64bc119cf084d1ecfd95098994597f12}\label{group__avr__string_ga64bc119cf084d1ecfd95098994597f12}} 
\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}!strlcpy@{strlcpy}}
\index{strlcpy@{strlcpy}!$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxyparagraph{\texorpdfstring{strlcpy()}{strlcpy()}}
{\footnotesize\ttfamily size\+\_\+t strlcpy (\begin{DoxyParamCaption}\item[{char $\ast$}]{dst,  }\item[{const char $\ast$}]{src,  }\item[{size\+\_\+t}]{siz }\end{DoxyParamCaption})}



Copy a string. 

Copy src to string dst of size siz. At most siz-\/1 characters will be copied. Always N\+U\+LL terminates (unless siz == 0).

\begin{DoxyReturn}{Returns}
The \mbox{\hyperlink{group__avr__string_ga64bc119cf084d1ecfd95098994597f12}{strlcpy()}} function returns strlen(src). If retval $>$= siz, truncation occurred. 
\end{DoxyReturn}
\mbox{\Hypertarget{group__avr__string_ga6ace85338eafe22a0ff52c00eb9779b8}\label{group__avr__string_ga6ace85338eafe22a0ff52c00eb9779b8}} 
\index{$<$string.h$>$: Strings@{$<$string.h$>$: Strings}!strtok@{strtok}}
\index{strtok@{strtok}!$<$string.h$>$: Strings@{$<$string.h$>$: Strings}}
\doxyparagraph{\texorpdfstring{strtok()}{strtok()}}
{\footnotesize\ttfamily char $\ast$ strtok (\begin{DoxyParamCaption}\item[{char $\ast$}]{s,  }\item[{const char $\ast$}]{delim }\end{DoxyParamCaption})}



Parses the string s into tokens. 

strtok parses the string s into tokens. The first call to strtok should have s as its first argument. Subsequent calls should have the first argument set to N\+U\+LL. If a token ends with a delimiter, this delimiting character is overwritten with a \textquotesingle{}\textbackslash{}0\textquotesingle{} and a pointer to the next character is saved for the next call to strtok. The delimiter string delim may be different for each call.

\begin{DoxyReturn}{Returns}
The \mbox{\hyperlink{group__avr__string_ga6ace85338eafe22a0ff52c00eb9779b8}{strtok()}} function returns a pointer to the next token or N\+U\+LL when no more tokens are found.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
\mbox{\hyperlink{group__avr__string_ga6ace85338eafe22a0ff52c00eb9779b8}{strtok()}} is N\+OT reentrant. For a reentrant version of this function see {\ttfamily strtok\+\_\+r()}. 
\end{DoxyNote}
