projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge trunk.
[awesomized/libmemcached]
/
docs
/
libmemcached_examples.rst
diff --git
a/docs/libmemcached_examples.rst
b/docs/libmemcached_examples.rst
index 81137e86353dc7e31a696932dc257bc89cf79ec5..a9e30b30f864e49bb8653f467d355aea59da62c2 100644
(file)
--- a/
docs/libmemcached_examples.rst
+++ b/
docs/libmemcached_examples.rst
@@
-21,15
+21,16
@@
Connecting to servers
.. code-block:: c
.. code-block:: c
-
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
-
memcached_st *memc= memcached(config_string, strlen(config_string);
-
{
-
...
-
}
+ const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com"
+ memcached_st *memc= memcached(config_string, strlen(config_string);
+ {
+ ...
+ }
memcached_free(memc);
memcached_free(memc);
-In the above code you create a \ ``memcached_st``\ object with three server by making use of :manpage:`memcached_create_with_options(3)`.
+In the above code you create a :c:type:`memcached_st` object with three server
+by making use of :c:func:`memcached_create_with_options()`.
--------------------------
--------------------------
@@
-40,6
+41,8
@@
Creating a pool of servers
.. code-block:: c
.. code-block:: c
+Creating a pool of Servers::
+
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
const char *config_string= "--SERVER=host10.example.com --SERVER=host11.example.com --SERVER=host10.example.com";
memcached_pool_st* pool= memcached_pool(config_string, strlen(config_string));
@@
-62,10
+65,10
@@
Creating a pool of servers
-In the above code you create a
\ ``memcached_pool_st``\
object with three
-server by making use of :
manpage:`memcached_pool(3
)`.
+In the above code you create a
:c:type:`memcached_pool_st`
object with three
+server by making use of :
c:func:`memcached_pool(
)`.
-When
memcached_pool_destroy()
all memory will be released that is associated
+When
:c:func:`memcached_pool_destroy()`
all memory will be released that is associated
with the pool.
with the pool.
@@
-77,6
+80,8
@@
Adding a value to the server
.. code-block:: c
.. code-block:: c
+Adding a value to the Server::
+
char *key= "foo";
char *value= "value";
char *key= "foo";
char *value= "value";
@@
-104,14
+109,14
@@
Fetching multiple values
size_t key_length[]= {5, 3, 4};
unsigned int x;
uint32_t flags;
size_t key_length[]= {5, 3, 4};
unsigned int x;
uint32_t flags;
-
+
char return_key[MEMCACHED_MAX_KEY];
size_t return_key_length;
char *return_value;
size_t return_value_length;
char return_key[MEMCACHED_MAX_KEY];
size_t return_key_length;
char *return_value;
size_t return_value_length;
-
+
rc= memcached_mget(memc, keys, key_length, 3);
rc= memcached_mget(memc, keys, key_length, 3);
-
+
x= 0;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
x= 0;
while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
&return_value_length, &flags, &rc)))
@@
-122,7
+127,7
@@
Fetching multiple values
Notice that you freed values returned from memcached_fetch(). The define
Notice that you freed values returned from memcached_fetch(). The define
-
\ ``MEMCACHED_MAX_KEY``\
is provided for usage.
+
:c:type:`MEMCACHED_MAX_KEY`
is provided for usage.