You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1384 lines
77 KiB
HTML
1384 lines
77 KiB
HTML
<!-- HTML header for doxygen 1.8.7-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.6.3"/>
|
|
<!--BEGIN PROJECT_NAME--><title>avr-libc: avr-libc: <string.h>: Strings</title><!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME--><title>avr-libc: <string.h>: Strings</title><!--END !PROJECT_NAME-->
|
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
$treeview
|
|
$search
|
|
$mathjax
|
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
$extrastylesheet
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
|
|
<!--BEGIN TITLEAREA-->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<!--BEGIN PROJECT_LOGO-->
|
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td>
|
|
<!--END PROJECT_LOGO-->
|
|
<!--BEGIN PROJECT_NAME-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectname">avr-libc
|
|
<!--BEGIN PROJECT_NUMBER--> <span id="projectnumber">2.0.0</span><!--END PROJECT_NUMBER-->
|
|
</div>
|
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
|
</td>
|
|
<!--END PROJECT_NAME-->
|
|
<!--BEGIN !PROJECT_NAME-->
|
|
<!--BEGIN PROJECT_BRIEF-->
|
|
<td style="padding-left: 0.5em;">
|
|
<div id="projectbrief">$projectbrief</div>
|
|
</td>
|
|
<!--END PROJECT_BRIEF-->
|
|
<!--END !PROJECT_NAME-->
|
|
<!--BEGIN DISABLE_INDEX-->
|
|
<!--BEGIN SEARCHENGINE-->
|
|
<td>$searchbox</td>
|
|
<!--END SEARCHENGINE-->
|
|
<!--END DISABLE_INDEX-->
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<table>
|
|
<tr>
|
|
<td align="left"><a href="http://www.nongnu.org/avr-libc/"><h2>AVR Libc Home Page</h2></a></td>
|
|
<td align="center" colspan=4><img src="avrs.png" alt="AVRs" align="middle" border="0"></td>
|
|
<td align="right"><a href="https://savannah.nongnu.org/projects/avr-libc/"><h2>AVR Libc Development Pages</h2></a></td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" width="20%"><a href="index.html"><h2>Main Page</h2></a></td>
|
|
<td align="center" width="20%"><a href="pages.html"><h2>User Manual</h2></a></td>
|
|
<td align="center" width="20%"><a href="modules.html"><h2>Library Reference</h2></a></td>
|
|
<td align="center" width="20%"><a href="FAQ.html"><h2>FAQ</h2></a></td>
|
|
<td align="center" width="20%"><a href="group__demos.html"><h2>Example Projects</h2></a></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<!--END TITLEAREA-->
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.6.3 -->
|
|
<script type="text/javascript"><!--
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
--></script>
|
|
<div class="contents">
|
|
<h1><string.h>: Strings</h1><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td colspan="2"><h2>Defines</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gaedb0e7bb7333d6122472acddb5df20ac">_FFS</a>(x)</td></tr>
|
|
<tr><td colspan="2"><h2>Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gab978764fd2814cd14f9f1a3620aa4ca2">ffs</a> (int __val)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gacc4734579c84c1b33a9ba9433f2063e4">ffsl</a> (long __val)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">__extension__ int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gad9ad8d36c2a662f6f3ff420fb0f25826">ffsll</a> (long long __val)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga8f2913a691990ae107e9687b8949b553">memccpy</a> (void *, const void *, int, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga8d270897496bfff9daf51edd64d712d0">memchr</a> (const void *, int, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga4cd54dc9109f0d3da49d9c35e6441b61">memcmp</a> (const void *, const void *, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga5f60008005ea7557430149926cf583d7">memcpy</a> (void *, const void *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga1c22a39c9d936f18aa0764e331e3cddc">memmem</a> (const void *, size_t, const void *, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga8efa99bafd35937d045832774bf57486">memmove</a> (void *, const void *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga9ce73bf9cc6fe7fc3dc88b3dce7ed33f">memrchr</a> (const void *, int, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga8f49550cc1e16fff2d707f91667eb80c">memset</a> (void *, int, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga1fd2a6e188f02599e5eeb17519f67f3e">strcat</a> (char *, const char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga4a03589020c79fa0b93673634bef711b">strchr</a> (const char *, int) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga5f625e090454a8cfbbfaafba26b5bf3b">strchrnul</a> (const char *, int) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga46f3cbd2de457c0fb340a1f379fc33ba">strcmp</a> (const char *, const char *) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga54e4f23104fa6f722f9459d2673a1eba">strcpy</a> (char *, const char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gaea3f5ad280b6d689b5f9937ef6f0d805">strcasecmp</a> (const char *, const char *) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gae240697c78aee7b9c47cb2c9452526ea">strcasestr</a> (const char *, const char *) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga53e212c1732d63bc80f649e542aff120">strcspn</a> (const char *__s, const char *__reject) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b">strdup</a> (const char *s1)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga63e609bfa0d354dcd7e35b297c2e6fdd">strlcat</a> (char *, const char *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga64bc119cf084d1ecfd95098994597f12">strlcpy</a> (char *, const char *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga7fd4936b86eb6b87e98587044c562715">strlen</a> (const char *) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga119342b34031ba4ee28f4e38a22c5f0d">strlwr</a> (char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gafa4a8701698b766f40180c735726cfe7">strncat</a> (char *, const char *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga36cc0ab27fbcc70615214170ae79fbf7">strncmp</a> (const char *, const char *, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga81577c743915e4fb8759ef9081f10838">strncpy</a> (char *, const char *, size_t)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga60b6f90e97d0574c5f5725d9db15cd9d">strncasecmp</a> (const char *, const char *, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga3d3e512a095039a7e2f86859537d761b">strnlen</a> (const char *, size_t) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga386481b53df5f2437a1da78b400b6440">strpbrk</a> (const char *__s, const char *__accept) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga84c8b3489ec089d8be4c30f42104828b">strrchr</a> (const char *, int) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gacfdb3ab0c1f988f86d04d706d8e0ce3f">strrev</a> (char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gaff88adec2ad0446259766197ec3863de">strsep</a> (char **, const char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gacbc51d76d5f8f4cacf27238494d866d8">strspn</a> (const char *__s, const char *__accept) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga6a441da9211eb85881d99c60b1003552">strstr</a> (const char *, const char *) __ATTR_PURE__</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#ga6ace85338eafe22a0ff52c00eb9779b8">strtok</a> (char *, const char *)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gac0dbc25e8b202114031a4aa2a7c5177b">strtok_r</a> (char *, const char *, char **)</td></tr>
|
|
<tr><td class="memItemLeft" align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__avr__string.html#gaa50fa5cd42285f7c3980a3b0eafe77b5">strupr</a> (char *)</td></tr>
|
|
</table>
|
|
<hr/><a name="_details"></a><h2>Detailed Description</h2>
|
|
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <<a class="code" href="string_8h.html">string.h</a>></span>
|
|
</pre></div><p>The string functions perform string operations on NULL terminated strings.</p>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>If the strings you are working on resident in program space (flash), you will need to use the string functions described in <a class="el" href="group__avr__pgmspace.html"><avr/pgmspace.h>: Program Space Utilities</a>. </dd></dl>
|
|
<hr/><h2>Define Documentation</h2>
|
|
<a class="anchor" id="gaedb0e7bb7333d6122472acddb5df20ac"></a><!-- doxytag: member="string.h::_FFS" ref="gaedb0e7bb7333d6122472acddb5df20ac" args="(x)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define _FFS</td>
|
|
<td>(</td>
|
|
<td class="paramtype">x </td>
|
|
<td class="paramname"></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>This macro finds the first (least significant) bit set in the input value.</p>
|
|
<p>This macro is very similar to the function <a class="el" href="group__avr__string.html#gab978764fd2814cd14f9f1a3620aa4ca2" title="This function finds the first (least significant) bit set in the input value.">ffs()</a> 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.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gaedb0e7bb7333d6122472acddb5df20ac">_FFS()</a> 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. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/><h2>Function Documentation</h2>
|
|
<a class="anchor" id="gab978764fd2814cd14f9f1a3620aa4ca2"></a><!-- doxytag: member="string.h::ffs" ref="gab978764fd2814cd14f9f1a3620aa4ca2" args="(int __val)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int ffs </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>This function finds the first (least significant) bit set in the input value. </p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gab978764fd2814cd14f9f1a3620aa4ca2" title="This function finds the first (least significant) bit set in the input value.">ffs()</a> function 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.</dd></dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>For expressions that are constant at compile time, consider using the <a class="el" href="group__avr__string.html#gaedb0e7bb7333d6122472acddb5df20ac">_FFS</a> macro instead. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacc4734579c84c1b33a9ba9433f2063e4"></a><!-- doxytag: member="string.h::ffsl" ref="gacc4734579c84c1b33a9ba9433f2063e4" args="(long __val)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int ffsl </td>
|
|
<td>(</td>
|
|
<td class="paramtype">long </td>
|
|
<td class="paramname"> <em>__val</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Same as <a class="el" href="group__avr__string.html#gab978764fd2814cd14f9f1a3620aa4ca2" title="This function finds the first (least significant) bit set in the input value.">ffs()</a>, for an argument of type long. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gad9ad8d36c2a662f6f3ff420fb0f25826"></a><!-- doxytag: member="string.h::ffsll" ref="gad9ad8d36c2a662f6f3ff420fb0f25826" args="(long long __val)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int ffsll </td>
|
|
<td>(</td>
|
|
<td class="paramtype">long long </td>
|
|
<td class="paramname"> <em>__val</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Same as <a class="el" href="group__avr__string.html#gab978764fd2814cd14f9f1a3620aa4ca2" title="This function finds the first (least significant) bit set in the input value.">ffs()</a>, for an argument of type long long. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8f2913a691990ae107e9687b8949b553"></a><!-- doxytag: member="string.h::memccpy" ref="ga8f2913a691990ae107e9687b8949b553" args="(void *, const void *, int, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memccpy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy memory area. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga8f2913a691990ae107e9687b8949b553" title="Copy memory area.">memccpy()</a> function copies no more than <code>len</code> bytes from memory area <code>src</code> to memory area <code>dest</code>, stopping when the character <code>val</code> is found.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8f2913a691990ae107e9687b8949b553" title="Copy memory area.">memccpy()</a> function returns a pointer to the next character in <code>dest</code> after <code>val</code>, or NULL if <code>val</code> was not found in the first <code>len</code> characters of <code>src</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8d270897496bfff9daf51edd64d712d0"></a><!-- doxytag: member="string.h::memchr" ref="ga8d270897496bfff9daf51edd64d712d0" args="(const void *, int, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memchr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Scan memory for a character. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga8d270897496bfff9daf51edd64d712d0" title="Scan memory for a character.">memchr()</a> function scans the first len bytes of the memory area pointed to by src for the character val. The first byte to match val (interpreted as an unsigned character) stops the operation.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8d270897496bfff9daf51edd64d712d0" title="Scan memory for a character.">memchr()</a> function returns a pointer to the matching byte or NULL if the character does not occur in the given memory area. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga4cd54dc9109f0d3da49d9c35e6441b61"></a><!-- doxytag: member="string.h::memcmp" ref="ga4cd54dc9109f0d3da49d9c35e6441b61" args="(const void *, const void *, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int memcmp </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>s2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Compare memory areas. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga4cd54dc9109f0d3da49d9c35e6441b61" title="Compare memory areas.">memcmp()</a> function compares the first len bytes of the memory areas s1 and s2. The comparision is performed using unsigned char operations.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga4cd54dc9109f0d3da49d9c35e6441b61" title="Compare memory areas.">memcmp()</a> function returns an integer less than, equal to, or greater than zero if the first len bytes of s1 is found, respectively, to be less than, to match, or be greater than the first len bytes of s2.</dd></dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>Be sure to store the result in a 16 bit variable since you may get incorrect results if you use an unsigned char or char due to truncation.</dd></dl>
|
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>This function is not -mint8 compatible, although if you only care about testing for equality, this function should be safe to use. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga5f60008005ea7557430149926cf583d7"></a><!-- doxytag: member="string.h::memcpy" ref="ga5f60008005ea7557430149926cf583d7" args="(void *, const void *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memcpy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy a memory area. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga5f60008005ea7557430149926cf583d7" title="Copy a memory area.">memcpy()</a> function copies len bytes from memory area src to memory area dest. The memory areas may not overlap. Use <a class="el" href="group__avr__string.html#ga8efa99bafd35937d045832774bf57486" title="Copy memory area.">memmove()</a> if the memory areas do overlap.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga5f60008005ea7557430149926cf583d7" title="Copy a memory area.">memcpy()</a> function returns a pointer to dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga1c22a39c9d936f18aa0764e331e3cddc"></a><!-- doxytag: member="string.h::memmem" ref="ga1c22a39c9d936f18aa0764e331e3cddc" args="(const void *, size_t, const void *, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memmem </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>s2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len2</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#ga1c22a39c9d936f18aa0764e331e3cddc">memmem()</a> function finds the start of the first occurrence of the substring <code>s2</code> of length <code>len2</code> in the memory area <code>s1</code> of length <code>len1</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga1c22a39c9d936f18aa0764e331e3cddc">memmem()</a> function returns a pointer to the beginning of the substring, or <code>NULL</code> if the substring is not found. If <code>len2</code> is zero, the function returns <code>s1</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8efa99bafd35937d045832774bf57486"></a><!-- doxytag: member="string.h::memmove" ref="ga8efa99bafd35937d045832774bf57486" args="(void *, const void *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memmove </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy memory area. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga8efa99bafd35937d045832774bf57486" title="Copy memory area.">memmove()</a> function copies len bytes from memory area src to memory area dest. The memory areas may overlap.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8efa99bafd35937d045832774bf57486" title="Copy memory area.">memmove()</a> function returns a pointer to dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga9ce73bf9cc6fe7fc3dc88b3dce7ed33f"></a><!-- doxytag: member="string.h::memrchr" ref="ga9ce73bf9cc6fe7fc3dc88b3dce7ed33f" args="(const void *, int, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memrchr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const void * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#ga9ce73bf9cc6fe7fc3dc88b3dce7ed33f">memrchr()</a> function is like the <a class="el" href="group__avr__string.html#ga8d270897496bfff9daf51edd64d712d0" title="Scan memory for a character.">memchr()</a> function, except that it searches backwards from the end of the <code>len</code> bytes pointed to by <code>src</code> instead of forwards from the front. (Glibc, GNU extension.)</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga9ce73bf9cc6fe7fc3dc88b3dce7ed33f">memrchr()</a> function returns a pointer to the matching byte or <code>NULL</code> if the character does not occur in the given memory area. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8f49550cc1e16fff2d707f91667eb80c"></a><!-- doxytag: member="string.h::memset" ref="ga8f49550cc1e16fff2d707f91667eb80c" args="(void *, int, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void * memset </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Fill memory with a constant byte. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga8f49550cc1e16fff2d707f91667eb80c" title="Fill memory with a constant byte.">memset()</a> function fills the first len bytes of the memory area pointed to by dest with the constant byte val.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8f49550cc1e16fff2d707f91667eb80c" title="Fill memory with a constant byte.">memset()</a> function returns a pointer to the memory area dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaea3f5ad280b6d689b5f9937ef6f0d805"></a><!-- doxytag: member="string.h::strcasecmp" ref="gaea3f5ad280b6d689b5f9937ef6f0d805" args="(const char *, const char *) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int strcasecmp </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Compare two strings ignoring case. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#gaea3f5ad280b6d689b5f9937ef6f0d805" title="Compare two strings ignoring case.">strcasecmp()</a> function compares the two strings <code>s1</code> and <code>s2</code>, ignoring the case of the characters.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gaea3f5ad280b6d689b5f9937ef6f0d805" title="Compare two strings ignoring case.">strcasecmp()</a> function returns an integer less than, equal to, or greater than zero if <code>s1</code> is found, respectively, to be less than, to match, or be greater than <code>s2</code>. A consequence of the ordering used by <a class="el" href="group__avr__string.html#gaea3f5ad280b6d689b5f9937ef6f0d805" title="Compare two strings ignoring case.">strcasecmp()</a> is that if <code>s1</code> is an initial substring of <code>s2</code>, then <code>s1</code> is considered to be "less than" <code>s2</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gae240697c78aee7b9c47cb2c9452526ea"></a><!-- doxytag: member="string.h::strcasestr" ref="gae240697c78aee7b9c47cb2c9452526ea" args="(const char *, const char *) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strcasestr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#gae240697c78aee7b9c47cb2c9452526ea">strcasestr()</a> function finds the first occurrence of the substring <code>s2</code> in the string <code>s1</code>. This is like <a class="el" href="group__avr__string.html#ga6a441da9211eb85881d99c60b1003552" title="Locate a substring.">strstr()</a>, except that it ignores case of alphabetic symbols in searching for the substring. (Glibc, GNU extension.)</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gae240697c78aee7b9c47cb2c9452526ea">strcasestr()</a> function returns a pointer to the beginning of the substring, or <code>NULL</code> if the substring is not found. If <code>s2</code> points to a string of zero length, the function returns <code>s1</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga1fd2a6e188f02599e5eeb17519f67f3e"></a><!-- doxytag: member="string.h::strcat" ref="ga1fd2a6e188f02599e5eeb17519f67f3e" args="(char *, const char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strcat </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Concatenate two strings. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga1fd2a6e188f02599e5eeb17519f67f3e" title="Concatenate two strings.">strcat()</a> function appends the src string to the dest string overwriting the '\0' character at the end of dest, and then adds a terminating '\0' character. The strings may not overlap, and the dest string must have enough space for the result.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga1fd2a6e188f02599e5eeb17519f67f3e" title="Concatenate two strings.">strcat()</a> function returns a pointer to the resulting string dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga4a03589020c79fa0b93673634bef711b"></a><!-- doxytag: member="string.h::strchr" ref="ga4a03589020c79fa0b93673634bef711b" args="(const char *, int) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strchr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Locate character in string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga4a03589020c79fa0b93673634bef711b" title="Locate character in string.">strchr()</a> function returns a pointer to the first occurrence of the character <code>val</code> in the string <code>src</code>.</p>
|
|
<p>Here "character" means "byte" - these functions do not work with wide or multi-byte characters.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga4a03589020c79fa0b93673634bef711b" title="Locate character in string.">strchr()</a> function returns a pointer to the matched character or <code>NULL</code> if the character is not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga5f625e090454a8cfbbfaafba26b5bf3b"></a><!-- doxytag: member="string.h::strchrnul" ref="ga5f625e090454a8cfbbfaafba26b5bf3b" args="(const char *, int) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strchrnul </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>c</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#ga5f625e090454a8cfbbfaafba26b5bf3b">strchrnul()</a> function is like <a class="el" href="group__avr__string.html#ga4a03589020c79fa0b93673634bef711b" title="Locate character in string.">strchr()</a> except that if <code>c</code> is not found in <code>s</code>, then it returns a pointer to the null byte at the end of <code>s</code>, rather than <code>NULL</code>. (Glibc, GNU extension.)</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga5f625e090454a8cfbbfaafba26b5bf3b">strchrnul()</a> function returns a pointer to the matched character, or a pointer to the null byte at the end of <code>s</code> (i.e., <code>s+strlen</code>(s)) if the character is not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga46f3cbd2de457c0fb340a1f379fc33ba"></a><!-- doxytag: member="string.h::strcmp" ref="ga46f3cbd2de457c0fb340a1f379fc33ba" args="(const char *, const char *) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int strcmp </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Compare two strings. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga46f3cbd2de457c0fb340a1f379fc33ba" title="Compare two strings.">strcmp()</a> function compares the two strings <code>s1</code> and <code>s2</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga46f3cbd2de457c0fb340a1f379fc33ba" title="Compare two strings.">strcmp()</a> function returns an integer less than, equal to, or greater than zero if <code>s1</code> is found, respectively, to be less than, to match, or be greater than <code>s2</code>. A consequence of the ordering used by <a class="el" href="group__avr__string.html#ga46f3cbd2de457c0fb340a1f379fc33ba" title="Compare two strings.">strcmp()</a> is that if <code>s1</code> is an initial substring of <code>s2</code>, then <code>s1</code> is considered to be "less than" <code>s2</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga54e4f23104fa6f722f9459d2673a1eba"></a><!-- doxytag: member="string.h::strcpy" ref="ga54e4f23104fa6f722f9459d2673a1eba" args="(char *, const char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strcpy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy a string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga54e4f23104fa6f722f9459d2673a1eba" title="Copy a string.">strcpy()</a> function copies the string pointed to by src (including the terminating '\0' character) to the array pointed to by dest. The strings may not overlap, and the destination string dest must be large enough to receive the copy.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga54e4f23104fa6f722f9459d2673a1eba" title="Copy a string.">strcpy()</a> function returns a pointer to the destination string dest.</dd></dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd>If the destination string of a <a class="el" href="group__avr__string.html#ga54e4f23104fa6f722f9459d2673a1eba" title="Copy a string.">strcpy()</a> is not large enough (that is, if the programmer was stupid/lazy, and failed to check the size before copying) then anything might happen. Overflowing fixed length strings is a favourite cracker technique. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga53e212c1732d63bc80f649e542aff120"></a><!-- doxytag: member="string.h::strcspn" ref="ga53e212c1732d63bc80f649e542aff120" args="(const char *__s, const char *__reject) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strcspn </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>reject</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#ga53e212c1732d63bc80f649e542aff120">strcspn()</a> function calculates the length of the initial segment of <code>s</code> which consists entirely of characters not in <code>reject</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga53e212c1732d63bc80f649e542aff120">strcspn()</a> function returns the number of characters in the initial segment of <code>s</code> which are not in the string <code>reject</code>. The terminating zero is not considered as a part of string. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga8569f20e38a030b5a28fd951abec2c9b"></a><!-- doxytag: member="string.h::strdup" ref="ga8569f20e38a030b5a28fd951abec2c9b" args="(const char *s1)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strdup </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Duplicate a string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b" title="Duplicate a string.">strdup()</a> function allocates memory and copies into it the string addressed by s1, including the terminating null character.</p>
|
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b" title="Duplicate a string.">strdup()</a> function calls <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a> to allocate the memory for the duplicated string! The user is responsible for freeing the memory by calling <a class="el" href="group__avr__stdlib.html#gafb8699abb1f51d920a176e695ff3be8a">free()</a>.</dd></dl>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b" title="Duplicate a string.">strdup()</a> function returns a pointer to the resulting string dest. If <a class="el" href="group__avr__stdlib.html#ga4996af830ebe744d9678e5251dfd3ebd">malloc()</a> cannot allocate enough storage for the string, <a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b" title="Duplicate a string.">strdup()</a> will return NULL.</dd></dl>
|
|
<dl class="warning"><dt><b>Warning:</b></dt><dd>Be sure to check the return value of the <a class="el" href="group__avr__string.html#ga8569f20e38a030b5a28fd951abec2c9b" title="Duplicate a string.">strdup()</a> function to make sure that the function has succeeded in allocating the memory! </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga63e609bfa0d354dcd7e35b297c2e6fdd"></a><!-- doxytag: member="string.h::strlcat" ref="ga63e609bfa0d354dcd7e35b297c2e6fdd" args="(char *, const char *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strlcat </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dst</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>siz</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Concatenate two strings. </p>
|
|
<p>Appends <code>src</code> to string <code>dst</code> of size <code>siz</code> (unlike <a class="el" href="group__avr__string.html#gafa4a8701698b766f40180c735726cfe7" title="Concatenate two strings.">strncat()</a>, <code>siz</code> is the full size of <code>dst</code>, not space left). At most <code>siz-1</code> characters will be copied. Always NULL terminates (unless <code>siz</code> <= <code>strlen(dst)</code>).</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga63e609bfa0d354dcd7e35b297c2e6fdd" title="Concatenate two strings.">strlcat()</a> function returns strlen(src) + MIN(siz, strlen(initial dst)). If retval >= siz, truncation occurred.</dd></dl>
|
|
<p>Appends src to string dst of size siz (unlike <a class="el" href="group__avr__string.html#gafa4a8701698b766f40180c735726cfe7" title="Concatenate two strings.">strncat()</a>, siz is the full size of dst, not space left). At most siz-1 characters will be copied. Always NULL terminates (unless siz <= strlen(dst)).</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga63e609bfa0d354dcd7e35b297c2e6fdd" title="Concatenate two strings.">strlcat()</a> function returns strlen(src) + MIN(siz, strlen(initial dst)). If retval >= siz, truncation occurred. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga64bc119cf084d1ecfd95098994597f12"></a><!-- doxytag: member="string.h::strlcpy" ref="ga64bc119cf084d1ecfd95098994597f12" args="(char *, const char *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strlcpy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dst</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>siz</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy a string. </p>
|
|
<p>Copy <code>src</code> to string <code>dst</code> of size <code>siz</code>. At most <code>siz-1</code> characters will be copied. Always NULL terminates (unless <code>siz</code> == 0).</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga64bc119cf084d1ecfd95098994597f12" title="Copy a string.">strlcpy()</a> function returns strlen(src). If retval >= siz, truncation occurred.</dd></dl>
|
|
<p>Copy src to string dst of size siz. At most siz-1 characters will be copied. Always NULL terminates (unless siz == 0).</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga64bc119cf084d1ecfd95098994597f12" title="Copy a string.">strlcpy()</a> function returns strlen(src). If retval >= siz, truncation occurred. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga7fd4936b86eb6b87e98587044c562715"></a><!-- doxytag: member="string.h::strlen" ref="ga7fd4936b86eb6b87e98587044c562715" args="(const char *) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strlen </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Calculate the length of a string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga7fd4936b86eb6b87e98587044c562715" title="Calculate the length of a string.">strlen()</a> function calculates the length of the string src, not including the terminating '\0' character.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga7fd4936b86eb6b87e98587044c562715" title="Calculate the length of a string.">strlen()</a> function returns the number of characters in src. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga119342b34031ba4ee28f4e38a22c5f0d"></a><!-- doxytag: member="string.h::strlwr" ref="ga119342b34031ba4ee28f4e38a22c5f0d" args="(char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strlwr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>s</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Convert a string to lower case. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga119342b34031ba4ee28f4e38a22c5f0d" title="Convert a string to lower case.">strlwr()</a> function will convert a string to lower case. Only the upper case alphabetic characters [A .. Z] are converted. Non-alphabetic characters will not be changed.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga119342b34031ba4ee28f4e38a22c5f0d" title="Convert a string to lower case.">strlwr()</a> function returns a pointer to the converted string. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga60b6f90e97d0574c5f5725d9db15cd9d"></a><!-- doxytag: member="string.h::strncasecmp" ref="ga60b6f90e97d0574c5f5725d9db15cd9d" args="(const char *, const char *, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int strncasecmp </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Compare two strings ignoring case. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga60b6f90e97d0574c5f5725d9db15cd9d" title="Compare two strings ignoring case.">strncasecmp()</a> function is similar to <a class="el" href="group__avr__string.html#gaea3f5ad280b6d689b5f9937ef6f0d805" title="Compare two strings ignoring case.">strcasecmp()</a>, except it only compares the first <code>len</code> characters of <code>s1</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga60b6f90e97d0574c5f5725d9db15cd9d" title="Compare two strings ignoring case.">strncasecmp()</a> function returns an integer less than, equal to, or greater than zero if <code>s1</code> (or the first <code>len</code> bytes thereof) is found, respectively, to be less than, to match, or be greater than <code>s2</code>. A consequence of the ordering used by <a class="el" href="group__avr__string.html#ga60b6f90e97d0574c5f5725d9db15cd9d" title="Compare two strings ignoring case.">strncasecmp()</a> is that if <code>s1</code> is an initial substring of <code>s2</code>, then <code>s1</code> is considered to be "less than" <code>s2</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gafa4a8701698b766f40180c735726cfe7"></a><!-- doxytag: member="string.h::strncat" ref="gafa4a8701698b766f40180c735726cfe7" args="(char *, const char *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strncat </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Concatenate two strings. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#gafa4a8701698b766f40180c735726cfe7" title="Concatenate two strings.">strncat()</a> function is similar to <a class="el" href="group__avr__string.html#ga1fd2a6e188f02599e5eeb17519f67f3e" title="Concatenate two strings.">strcat()</a>, except that only the first n characters of src are appended to dest.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gafa4a8701698b766f40180c735726cfe7" title="Concatenate two strings.">strncat()</a> function returns a pointer to the resulting string dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga36cc0ab27fbcc70615214170ae79fbf7"></a><!-- doxytag: member="string.h::strncmp" ref="ga36cc0ab27fbcc70615214170ae79fbf7" args="(const char *, const char *, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">int strncmp </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Compare two strings. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga36cc0ab27fbcc70615214170ae79fbf7" title="Compare two strings.">strncmp()</a> function is similar to <a class="el" href="group__avr__string.html#ga46f3cbd2de457c0fb340a1f379fc33ba" title="Compare two strings.">strcmp()</a>, except it only compares the first (at most) n characters of s1 and s2.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga36cc0ab27fbcc70615214170ae79fbf7" title="Compare two strings.">strncmp()</a> function returns an integer less than, equal to, or greater than zero if s1 (or the first n bytes thereof) is found, respectively, to be less than, to match, or be greater than s2. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga81577c743915e4fb8759ef9081f10838"></a><!-- doxytag: member="string.h::strncpy" ref="ga81577c743915e4fb8759ef9081f10838" args="(char *, const char *, size_t)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strncpy </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>dest</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Copy a string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga81577c743915e4fb8759ef9081f10838" title="Copy a string.">strncpy()</a> function is similar to <a class="el" href="group__avr__string.html#ga54e4f23104fa6f722f9459d2673a1eba" title="Copy a string.">strcpy()</a>, except that not more than n bytes of src are copied. Thus, if there is no null byte among the first n bytes of src, the result will not be null-terminated.</p>
|
|
<p>In the case where the length of src is less than that of n, the remainder of dest will be padded with nulls.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga81577c743915e4fb8759ef9081f10838" title="Copy a string.">strncpy()</a> function returns a pointer to the destination string dest. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga3d3e512a095039a7e2f86859537d761b"></a><!-- doxytag: member="string.h::strnlen" ref="ga3d3e512a095039a7e2f86859537d761b" args="(const char *, size_t) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strnlen </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">size_t </td>
|
|
<td class="paramname"> <em>len</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Determine the length of a fixed-size string. </p>
|
|
<p>The strnlen function returns the number of characters in the string pointed to by src, not including the terminating '\0' character, but at most len. In doing this, strnlen looks only at the first len characters at src and never beyond src+len.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The strnlen function returns strlen(src), if that is less than len, or len if there is no '\0' character among the first len characters pointed to by src. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga386481b53df5f2437a1da78b400b6440"></a><!-- doxytag: member="string.h::strpbrk" ref="ga386481b53df5f2437a1da78b400b6440" args="(const char *__s, const char *__accept) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strpbrk </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>accept</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#ga386481b53df5f2437a1da78b400b6440">strpbrk()</a> function locates the first occurrence in the string <code>s</code> of any of the characters in the string <code>accept</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga386481b53df5f2437a1da78b400b6440">strpbrk()</a> function returns a pointer to the character in <code>s</code> that matches one of the characters in <code>accept</code>, or <code>NULL</code> if no such character is found. The terminating zero is not considered as a part of string: if one or both args are empty, the result will be <code>NULL</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga84c8b3489ec089d8be4c30f42104828b"></a><!-- doxytag: member="string.h::strrchr" ref="ga84c8b3489ec089d8be4c30f42104828b" args="(const char *, int) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strrchr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>src</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>val</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Locate character in string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga84c8b3489ec089d8be4c30f42104828b" title="Locate character in string.">strrchr()</a> function returns a pointer to the last occurrence of the character val in the string src.</p>
|
|
<p>Here "character" means "byte" - these functions do not work with wide or multi-byte characters.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga84c8b3489ec089d8be4c30f42104828b" title="Locate character in string.">strrchr()</a> function returns a pointer to the matched character or NULL if the character is not found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacfdb3ab0c1f988f86d04d706d8e0ce3f"></a><!-- doxytag: member="string.h::strrev" ref="gacfdb3ab0c1f988f86d04d706d8e0ce3f" args="(char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strrev </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>s</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Reverse a string. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#gacfdb3ab0c1f988f86d04d706d8e0ce3f" title="Reverse a string.">strrev()</a> function reverses the order of the string.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gacfdb3ab0c1f988f86d04d706d8e0ce3f" title="Reverse a string.">strrev()</a> function returns a pointer to the beginning of the reversed string. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaff88adec2ad0446259766197ec3863de"></a><!-- doxytag: member="string.h::strsep" ref="gaff88adec2ad0446259766197ec3863de" args="(char **, const char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strsep </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char ** </td>
|
|
<td class="paramname"> <em>sp</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>delim</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Parse a string into tokens. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#gaff88adec2ad0446259766197ec3863de" title="Parse a string into tokens.">strsep()</a> function locates, in the string referenced by <code>*sp</code>, the first occurrence of any character in the string <code>delim</code> (or the terminating '\0' character) and replaces it with a '\0'. The location of the next character after the delimiter character (or <code>NULL</code>, if the end of the string was reached) is stored in <code>*sp</code>. An ``empty'' field, i.e. one caused by two adjacent delimiter characters, can be detected by comparing the location referenced by the pointer returned in <code>*sp</code> to '\0'.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gaff88adec2ad0446259766197ec3863de" title="Parse a string into tokens.">strsep()</a> function returns a pointer to the original value of <code>*sp</code>. If <code>*sp</code> is initially <code>NULL</code>, <a class="el" href="group__avr__string.html#gaff88adec2ad0446259766197ec3863de" title="Parse a string into tokens.">strsep()</a> returns <code>NULL</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gacbc51d76d5f8f4cacf27238494d866d8"></a><!-- doxytag: member="string.h::strspn" ref="gacbc51d76d5f8f4cacf27238494d866d8" args="(const char *__s, const char *__accept) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">size_t strspn </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>accept</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
<p>The <a class="el" href="group__avr__string.html#gacbc51d76d5f8f4cacf27238494d866d8">strspn()</a> function calculates the length of the initial segment of <code>s</code> which consists entirely of characters in <code>accept</code>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gacbc51d76d5f8f4cacf27238494d866d8">strspn()</a> function returns the number of characters in the initial segment of <code>s</code> which consist only of characters from <code>accept</code>. The terminating zero is not considered as a part of string. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga6a441da9211eb85881d99c60b1003552"></a><!-- doxytag: member="string.h::strstr" ref="ga6a441da9211eb85881d99c60b1003552" args="(const char *, const char *) __ATTR_PURE__" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strstr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s1</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>s2</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Locate a substring. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#ga6a441da9211eb85881d99c60b1003552" title="Locate a substring.">strstr()</a> function finds the first occurrence of the substring <code>s2</code> in the string <code>s1</code>. The terminating '\0' characters are not compared.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga6a441da9211eb85881d99c60b1003552" title="Locate a substring.">strstr()</a> function returns a pointer to the beginning of the substring, or <code>NULL</code> if the substring is not found. If <code>s2</code> points to a string of zero length, the function returns <code>s1</code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="ga6ace85338eafe22a0ff52c00eb9779b8"></a><!-- doxytag: member="string.h::strtok" ref="ga6ace85338eafe22a0ff52c00eb9779b8" args="(char *, const char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strtok </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>s</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>delim</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Parses the string s into tokens. </p>
|
|
<p>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 NULL. If a token ends with a delimiter, this delimiting character is overwritten with a '\0' 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.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#ga6ace85338eafe22a0ff52c00eb9779b8" title="Parses the string s into tokens.">strtok()</a> function returns a pointer to the next token or NULL when no more tokens are found.</dd></dl>
|
|
<dl class="note"><dt><b>Note:</b></dt><dd><a class="el" href="group__avr__string.html#ga6ace85338eafe22a0ff52c00eb9779b8" title="Parses the string s into tokens.">strtok()</a> is NOT reentrant. For a reentrant version of this function see <code><a class="el" href="group__avr__string.html#gac0dbc25e8b202114031a4aa2a7c5177b" title="Parses string into tokens.">strtok_r()</a></code>. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gac0dbc25e8b202114031a4aa2a7c5177b"></a><!-- doxytag: member="string.h::strtok_r" ref="gac0dbc25e8b202114031a4aa2a7c5177b" args="(char *, const char *, char **)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strtok_r </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>string</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const char * </td>
|
|
<td class="paramname"> <em>delim</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char ** </td>
|
|
<td class="paramname"> <em>last</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Parses string into tokens. </p>
|
|
<p>strtok_r parses string into tokens. The first call to strtok_r should have string as its first argument. Subsequent calls should have the first argument set to NULL. If a token ends with a delimiter, this delimiting character is overwritten with a '\0' and a pointer to the next character is saved for the next call to strtok_r. The delimiter string <code>delim</code> may be different for each call. <code>last</code> is a user allocated char* pointer. It must be the same while parsing the same string. strtok_r is a reentrant version of <a class="el" href="group__avr__string.html#ga6ace85338eafe22a0ff52c00eb9779b8" title="Parses the string s into tokens.">strtok()</a>.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gac0dbc25e8b202114031a4aa2a7c5177b" title="Parses string into tokens.">strtok_r()</a> function returns a pointer to the next token or NULL when no more tokens are found. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
<a class="anchor" id="gaa50fa5cd42285f7c3980a3b0eafe77b5"></a><!-- doxytag: member="string.h::strupr" ref="gaa50fa5cd42285f7c3980a3b0eafe77b5" args="(char *)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char * strupr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"> <em>s</em></td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>Convert a string to upper case. </p>
|
|
<p>The <a class="el" href="group__avr__string.html#gaa50fa5cd42285f7c3980a3b0eafe77b5" title="Convert a string to upper case.">strupr()</a> function will convert a string to upper case. Only the lower case alphabetic characters [a .. z] are converted. Non-alphabetic characters will not be changed.</p>
|
|
<dl class="return"><dt><b>Returns:</b></dt><dd>The <a class="el" href="group__avr__string.html#gaa50fa5cd42285f7c3980a3b0eafe77b5" title="Convert a string to upper case.">strupr()</a> function returns a pointer to the converted string. The pointer is the same as that passed in since the operation is perform in place. </dd></dl>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Defines</a></div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<!-- HTML footer for doxygen 1.8.7-->
|
|
<!-- start footer part -->
|
|
<!--BEGIN GENERATE_TREEVIEW-->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
$navpath
|
|
<li class="footer">$generatedby
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> 1.6.3 </li>
|
|
</ul>
|
|
</div>
|
|
<!--END GENERATE_TREEVIEW-->
|
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
|
|
</a> 1.6.3
|
|
</small></address>
|
|
<!--END !GENERATE_TREEVIEW-->
|
|
</body>
|
|
</html>
|