X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Flibmemcached_examples.rst;h=38d6f7b5ef4e9c331a4c4ae1134db0b3f69c7c1f;hb=ef301192f389f5f6ab4f8ed8c204ca7e115fe0b1;hp=82e2858852f825e9a326d06650b1d5e53941eba3;hpb=1eae35aca01e152e10113cd97b7571ebd6eb5bd9;p=m6w6%2Flibmemcached diff --git a/docs/libmemcached_examples.rst b/docs/libmemcached_examples.rst index 82e28588..38d6f7b5 100644 --- a/docs/libmemcached_examples.rst +++ b/docs/libmemcached_examples.rst @@ -1,29 +1,24 @@ -.. highlight:: perl +======== +Examples +======== +Examples for libmemcached -**** -NAME -**** - - -libmemcached_examples - Examples for libmemcached - - -*********** +----------- DESCRIPTION -*********** +----------- For full examples, test cases are found in tests/\*.c in the main distribution. These are always up to date, and are used for each test run of the library. +------------------------------ Creating and Freeing structure -============================== - +------------------------------ -.. code-block:: perl +.. code-block:: c memcached_st *memc; memcached_return_t rc; @@ -37,12 +32,13 @@ The above code would create a connection and then free the connection when finished. +--------------------- Connecting to servers -===================== +--------------------- -.. code-block:: perl +.. code-block:: c memcached_server_st *servers; memcached_st *memc= memcached_create(NULL); @@ -71,12 +67,13 @@ You can reuse the \ ``memcached_server_st``\ object with multile \ ``memcached_ structures. +---------------------------- Adding a value to the server -============================ +---------------------------- -.. code-block:: perl +.. code-block:: c char *key= "foo"; char *value; @@ -103,12 +100,13 @@ Adding a value to the server It is best practice to always look at the return value of any operation. +------------------------ Fetching multiple values -======================== +------------------------ -.. code-block:: perl +.. code-block:: c memcached_return_t rc; char *keys[]= {"fudge", "son", "food"}; @@ -137,27 +135,19 @@ Notice that you freed values returned from memcached_fetch(). The define -**** +---- HOME -**** +---- To find out more information please check: `https://launchpad.net/libmemcached `_ -****** -AUTHOR -****** - - -Brian Aker, - - -******** +-------- SEE ALSO -******** +-------- -memcached(1) +:manpage:`memcached(1)`