Deploy to GitHub pages
[awesomized/libmemcached] / libmemcached / memcached_fetch.html
index d2e5d599f42a8c00cae68deee9434a15811f1d91..bb2525d947a950cff26a6aed10a90099cdf24d57 100644 (file)
   
     
       <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
-        <script src="../_static/jquery.js"></script>
-        <script src="../_static/underscore.js"></script>
-        <script src="../_static/doctools.js"></script>
-        <script src="../_static/language_data.js"></script>
+        <script type="text/javascript" src="../_static/jquery.js"></script>
+        <script type="text/javascript" src="../_static/underscore.js"></script>
+        <script type="text/javascript" src="../_static/doctools.js"></script>
+        <script type="text/javascript" src="../_static/language_data.js"></script>
     
     <script type="text/javascript" src="../_static/js/theme.js"></script>
 
@@ -36,7 +36,7 @@
     <link rel="index" title="Index" href="../genindex.html" />
     <link rel="search" title="Search" href="../search.html" />
     <link rel="copyright" title="Copyright" href="../copyright.html" />
-    <link rel="next" title="Misc" href="index_misc.html" />
+    <link rel="next" title="libmemcachedutil - C/C++ utilities extending libmemcached" href="../libmemcachedutil/index.html" />
     <link rel="prev" title="Deprecated Functionality" href="index_deprecated.html" /> 
 </head>
 
@@ -85,8 +85,7 @@
               
             
             
-              <p class="caption"><span class="caption-text">libmemcached</span></p>
-<ul class="current">
+              <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="../libmemcached.html">Introduction</a></li>
 <li class="toctree-l1 current"><a class="reference internal" href="index.html">libmemcached API</a><ul class="current">
 <li class="toctree-l2"><a class="reference internal" href="index_basics.html">Basics</a></li>
 </li>
 </ul>
 </li>
-<li class="toctree-l1"><a class="reference internal" href="index_misc.html">Misc</a></li>
-</ul>
-<p class="caption"><span class="caption-text">libmemcachedutil</span></p>
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil.html">Introduction</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil/index.html">libmemcachedutil API</a></li>
-</ul>
-<p class="caption"><span class="caption-text">libhashkit</span></p>
-<ul>
-<li class="toctree-l1"><a class="reference internal" href="../libhashkit.html">Introduction</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../libhashkit/index.html">libhashkit API</a></li>
-</ul>
-<p class="caption"><span class="caption-text">Client Applications</span></p>
-<ul>
 <li class="toctree-l1"><a class="reference internal" href="../bin/index.html">Client Applications</a></li>
+<li class="toctree-l1"><a class="reference internal" href="index_misc.html">Miscellaneous</a></li>
 </ul>
-<p class="caption"><span class="caption-text">Copyright</span></p>
 <ul>
+<li class="toctree-l1"><a class="reference internal" href="../changelogs.html">Change Logs</a></li>
 <li class="toctree-l1"><a class="reference internal" href="../copyright.html">Copyright</a></li>
 </ul>
 
       <li class="wy-breadcrumbs-aside">
         
             
+            
+              <a href="https://github.com/m6w6/libmemcached/blob/v1.x/docs/source/libmemcached/memcached_fetch.rst" class="fa fa-github"> Edit on GitHub</a>
+            
+          
         
       </li>
     
   <div class="section" id="memcached-fetch">
 <h1>memcached_fetch<a class="headerlink" href="#memcached-fetch" title="Permalink to this headline">¶</a></h1>
 <div class="section" id="synopsis">
-<span id="index-0"></span><h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
-<p>#include &lt;libmemcached/memcached.h&gt;</p>
+<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt>#include &lt;libmemcached/memcached.h&gt;</dt>
+<dd>Compile and link with -lmemcached</dd>
+</dl>
 <dl class="function">
 <dt id="_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t">
-<span id="_CPPv315memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t"></span><span id="_CPPv215memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t"></span><span id="memcached_fetch__memcached_stP.cP.sP.sP.uint32_tP.memcached_return_tP"></span>char *<code class="sig-name descname">memcached_fetch</code><span class="sig-paren">(</span><a class="reference internal" href="memcached_create.html#_CPPv412memcached_st" title="memcached_st">memcached_st</a> *<em>ptr</em>, char *<em>key</em>, size_t *<em>key_length</em>, size_t *<em>value_length</em>, uint32_t *<em>flags</em>, <a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t">memcached_return_t</a> *<em>error</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="Permalink to this definition">¶</a><br /></dt>
+<span id="_CPPv315memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t"></span><span id="_CPPv215memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t"></span><span id="memcached_fetch__memcached_stP.cP.sP.sP.uint32_tP.memcached_return_tP"></span>char *<code class="descname">memcached_fetch</code><span class="sig-paren">(</span><a class="reference internal" href="memcached_create.html#_CPPv412memcached_st" title="memcached_st">memcached_st</a> *<em>ptr</em>, char *<em>key</em>, size_t *<em>key_length</em>, size_t *<em>value_length</em>, uint32_t *<em>flags</em>, <a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t">memcached_return_t</a> *<em>error</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="Permalink to this definition">¶</a><br /></dt>
 <dd><div class="deprecated">
-<p><span class="versionmodified deprecated">Deprecated since version 0.50: </span>Use <a class="reference internal" href="memcached_get.html#_CPPv422memcached_fetch_resultP12memcached_stP19memcached_result_stP18memcached_return_t" title="memcached_fetch_result"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch_result()</span></code></a> instead.</p>
+<p><span class="versionmodified">Deprecated since version 0.50: </span>Use <a class="reference internal" href="memcached_get.html#_CPPv422memcached_fetch_resultP12memcached_stP19memcached_result_stP18memcached_return_t" title="memcached_fetch_result"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch_result()</span></code></a> instead.</p>
 </div>
 </dd></dl>
 
-<p>Compile and link with -lmemcached</p>
 </div>
 <div class="section" id="description">
 <h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
-<p><a class="reference internal" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="memcached_fetch"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch()</span></code></a> is used to fetch an individual value from the server. <a class="reference internal" href="memcached_get.html#_CPPv414memcached_mgetP12memcached_stPPCKcPK6size_t6size_t" title="memcached_mget"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_mget()</span></code></a> must always be called before using this method.
-You must pass in a key and its length to fetch the object. You must supply
-three pointer variables which will give you the state of the returned
-object.  A <code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">uint32_t</span></code> pointer to contain whatever flags you stored with the value, a <code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">size_t</span></code> pointer which will be filled with size of of the
-object, and a <a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">memcached_return_t</span></code></a> pointer to hold any error. The
-object will be returned upon success and NULL will be returned on failure. <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> is returned by the *error value when all objects that have been found are returned. The final value upon <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> is null.</p>
+<p><a class="reference internal" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="memcached_fetch"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch()</span></code></a> is used to fetch an individual value from the server.
+<a class="reference internal" href="memcached_get.html#_CPPv414memcached_mgetP12memcached_stPPCKcPK6size_t6size_t" title="memcached_mget"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_mget()</span></code></a> must always be called before using this method.
+You must pass in a key and its length to fetch the object.</p>
+<p>You must supply three pointer variables which will give you the state of the returned
+object:</p>
+<blockquote>
+<div><ul class="simple">
+<li>A <code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">uint32_t</span></code> pointer to contain whatever flags you stored with the value,</li>
+<li>a <code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">size_t</span></code> pointer which will be filled with size of of the object, and</li>
+<li>a <a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">memcached_return_t</span></code></a> pointer to hold any error.</li>
+</ul>
+</div></blockquote>
+<p>The object will be returned upon success and NULL will be returned on failure.</p>
+<p><a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> is returned by the error value when all objects that have been found are returned.
+The final value upon <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> is a NULL pointer.</p>
 <p>Values returned by <a class="reference internal" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="memcached_fetch"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch()</span></code></a> must be freed by the caller.</p>
 <p>All of the above functions are not tested when the
-<code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_BEHAVIOR_USE_UDP</span></code> has been set. Executing any of these
-functions with this behavior on will result in <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t23MEMCACHED_NOT_SUPPORTEDE" title="MEMCACHED_NOT_SUPPORTED"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOT_SUPPORTED</span></code></a> being returned, or for those functions which do not return a <a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">memcached_return_t</span></code></a>, the error function parameter will be set to <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t23MEMCACHED_NOT_SUPPORTEDE" title="MEMCACHED_NOT_SUPPORTED"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOT_SUPPORTED</span></code></a>.</p>
+<a class="reference internal" href="memcached_behavior.html#_CPPv4N20memcached_behavior_t26MEMCACHED_BEHAVIOR_USE_UDPE" title="MEMCACHED_BEHAVIOR_USE_UDP"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_BEHAVIOR_USE_UDP</span></code></a> has been set. Executing any of these
+functions with this behavior on will result in <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t23MEMCACHED_NOT_SUPPORTEDE" title="MEMCACHED_NOT_SUPPORTED"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOT_SUPPORTED</span></code></a>
+being returned, or for those functions which do not return a
+<a class="reference internal" href="memcached_return_t.html#_CPPv418memcached_return_t" title="memcached_return_t"><code class="xref cpp cpp-type docutils literal notranslate"><span class="pre">memcached_return_t</span></code></a>, the error function parameter will
+be set to <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t23MEMCACHED_NOT_SUPPORTEDE" title="MEMCACHED_NOT_SUPPORTED"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOT_SUPPORTED</span></code></a>.</p>
 </div>
 <div class="section" id="return-value">
 <h2>RETURN VALUE<a class="headerlink" href="#return-value" title="Permalink to this headline">¶</a></h2>
 <p><a class="reference internal" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="memcached_fetch"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch()</span></code></a> sets error to
-to <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> upon successful conclusion.
-<a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE" title="MEMCACHED_NOTFOUND"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOTFOUND</span></code></a> will be return if no keys at all were found.</p>
+to <a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t13MEMCACHED_ENDE" title="MEMCACHED_END"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_END</span></code></a> upon successful conclusion.</p>
+<p><a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t18MEMCACHED_NOTFOUNDE" title="MEMCACHED_NOTFOUND"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_NOTFOUND</span></code></a> will be return if no keys at all were found.</p>
 <p><a class="reference internal" href="memcached_return_t.html#_CPPv4N18memcached_return_t21MEMCACHED_KEY_TOO_BIGE" title="MEMCACHED_KEY_TOO_BIG"><code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_KEY_TOO_BIG</span></code></a> is set to error whenever <a class="reference internal" href="#_CPPv415memcached_fetchP12memcached_stPcP6size_tP6size_tP8uint32_tP18memcached_return_t" title="memcached_fetch"><code class="xref cpp cpp-func docutils literal notranslate"><span class="pre">memcached_fetch()</span></code></a> was used
 and the key was set larger then <code class="xref cpp cpp-any docutils literal notranslate"><span class="pre">MEMCACHED_MAX_KEY</span></code>, which was the largest
 key allowed for the original memcached ascii server.</p>
 </div>
 <div class="section" id="see-also">
 <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li><em class="manpage"><a class="manpage reference external" href="https://linux.die.net/man/1/memcached">memcached(1)</a></em></li>
+<li><a class="reference internal" href="../libmemcached.html"><span class="doc">C/C++ Client Library for memcached</span></a></li>
+<li><a class="reference internal" href="memcached_strerror.html"><span class="doc">Converting Error Codes to Messages</span></a></li>
+<li><a class="reference internal" href="memcached_get.html"><span class="doc">Retrieving data from the server</span></a></li>
+</ul>
 </div>
 </div>
 
@@ -234,7 +246,7 @@ key allowed for the original memcached ascii server.</p>
   
     <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
       
-        <a href="index_misc.html" class="btn btn-neutral float-right" title="Misc" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
+        <a href="../libmemcachedutil/index.html" class="btn btn-neutral float-right" title="libmemcachedutil - C/C++ utilities extending libmemcached" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
       
       
         <a href="index_deprecated.html" class="btn btn-neutral float-left" title="Deprecated Functionality" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>