1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;2.&#160;Basic C Library Functions</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="index.html" title="The Linux Kernel API"><link rel="prev" href="API-hlist-for-each-entry-safe.html" title="hlist_for_each_entry_safe"><link rel="next" href="API-simple-strtoull.html" title="simple_strtoull"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;2.&#160;Basic C Library Functions</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-hlist-for-each-entry-safe.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-simple-strtoull.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="libc"></a>Chapter&#160;2.&#160;Basic C Library Functions</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="libc.html#idp1122555668">String Conversions</a></span></dt><dt><span class="sect1"><a href="ch02s02.html">String Manipulation</a></span></dt><dt><span class="sect1"><a href="ch02s03.html">Bit Operations</a></span></dt></dl></div><p>
2       When writing drivers, you cannot in general use routines which are
3       from the C Library.  Some of the functions have been found generally
4       useful and they are listed below.  The behaviour of these functions
5       may vary slightly from those defined by ANSI, and these deviations
6       are noted in the text.
7     </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1122555668"></a>String Conversions</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-simple-strtoull.html"><span class="phrase">simple_strtoull</span></a></span><span class="refpurpose"> &#8212; 
8  convert a string to an unsigned long long
9 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtoul.html"><span class="phrase">simple_strtoul</span></a></span><span class="refpurpose"> &#8212; 
10     convert a string to an unsigned long
11 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtol.html"><span class="phrase">simple_strtol</span></a></span><span class="refpurpose"> &#8212; 
12     convert a string to a signed long
13 </span></dt><dt><span class="refentrytitle"><a href="API-simple-strtoll.html"><span class="phrase">simple_strtoll</span></a></span><span class="refpurpose"> &#8212; 
14     convert a string to a signed long long
15 </span></dt><dt><span class="refentrytitle"><a href="API-vsnprintf.html"><span class="phrase">vsnprintf</span></a></span><span class="refpurpose"> &#8212; 
16     Format a string and place it in a buffer
17 </span></dt><dt><span class="refentrytitle"><a href="API-vscnprintf.html"><span class="phrase">vscnprintf</span></a></span><span class="refpurpose"> &#8212; 
18     Format a string and place it in a buffer
19 </span></dt><dt><span class="refentrytitle"><a href="API-snprintf.html"><span class="phrase">snprintf</span></a></span><span class="refpurpose"> &#8212; 
20     Format a string and place it in a buffer
21 </span></dt><dt><span class="refentrytitle"><a href="API-scnprintf.html"><span class="phrase">scnprintf</span></a></span><span class="refpurpose"> &#8212; 
22     Format a string and place it in a buffer
23 </span></dt><dt><span class="refentrytitle"><a href="API-vsprintf.html"><span class="phrase">vsprintf</span></a></span><span class="refpurpose"> &#8212; 
24     Format a string and place it in a buffer
25 </span></dt><dt><span class="refentrytitle"><a href="API-sprintf.html"><span class="phrase">sprintf</span></a></span><span class="refpurpose"> &#8212; 
26     Format a string and place it in a buffer
27 </span></dt><dt><span class="refentrytitle"><a href="API-vbin-printf.html"><span class="phrase">vbin_printf</span></a></span><span class="refpurpose"> &#8212; 
28     Parse a format string and place args' binary value in a buffer
29 </span></dt><dt><span class="refentrytitle"><a href="API-bstr-printf.html"><span class="phrase">bstr_printf</span></a></span><span class="refpurpose"> &#8212; 
30     Format a string from binary arguments and place it in a buffer
31 </span></dt><dt><span class="refentrytitle"><a href="API-bprintf.html"><span class="phrase">bprintf</span></a></span><span class="refpurpose"> &#8212; 
32     Parse a format string and place args' binary value in a buffer
33 </span></dt><dt><span class="refentrytitle"><a href="API-vsscanf.html"><span class="phrase">vsscanf</span></a></span><span class="refpurpose"> &#8212; 
34     Unformat a buffer into a list of arguments
35 </span></dt><dt><span class="refentrytitle"><a href="API-sscanf.html"><span class="phrase">sscanf</span></a></span><span class="refpurpose"> &#8212; 
36     Unformat a buffer into a list of arguments
37 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtol.html"><span class="phrase">kstrtol</span></a></span><span class="refpurpose"> &#8212; 
38  convert a string to a long
39 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoul.html"><span class="phrase">kstrtoul</span></a></span><span class="refpurpose"> &#8212; 
40  convert a string to an unsigned long
41 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoull.html"><span class="phrase">kstrtoull</span></a></span><span class="refpurpose"> &#8212; 
42  convert a string to an unsigned long long
43 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoll.html"><span class="phrase">kstrtoll</span></a></span><span class="refpurpose"> &#8212; 
44     convert a string to a long long
45 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtouint.html"><span class="phrase">kstrtouint</span></a></span><span class="refpurpose"> &#8212; 
46     convert a string to an unsigned int
47 </span></dt><dt><span class="refentrytitle"><a href="API-kstrtoint.html"><span class="phrase">kstrtoint</span></a></span><span class="refpurpose"> &#8212; 
48     convert a string to an int
49 </span></dt></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-hlist-for-each-entry-safe.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="API-simple-strtoull.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">hlist_for_each_entry_safe</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">simple_strtoull</span></td></tr></table></div></body></html>
50