1..::docs::memcached_create(3) libmemcached ..::docs::memcached_create(3)
2
3
4
6 memcached_create, memcached_free - Create a memcached_st structure
7
9 C Client Library for memcached (libmemcached, -lmemcached)
10
12 #include <memcached.h>
13
14 memcached_st *memcached_create (memcached_st *ptr);
15
16 void memcached_free (memcached_st *ptr);
17
18 memcached_st *memcached_clone(memcached_st *clone, memcached_st *source);
19
21 memcached_create() is used to create a "memcached_st" structure that
22 will then be used by other libmemcached(3) functions to communicate
23 with the server. You should either pass a statically declared
24 "memcached_st" to memcached_create() or a NULL. If a NULL passed in
25 then a structure is allocated for you.
26
27 memcached_clone() is similar to memcached_create(3) but it copies the
28 defaults and list of servers from the source "memcached_st". If you
29 pass a null as the argument for the source to clone, it is the same as
30 a call to memcached_create(). If the clone argument is NULL a
31 "memcached_st" will be allocated for you. If you pass a pointer to a
32 memory area for the clone pointer, make sure you memset it to 0 (unless
33 you got the clone from a factory method in libmemcached).
34
35 To clean up memory associated with a "memcached_st" structure you
36 should pass it to memcached_free() when you are finished using it.
37 memcached_free() is the only way to make sure all memory is deallocated
38 when you finish using the structure.
39
41 memcached_create() returns a pointer to the memcached_st that was
42 created (or initialized). On an allocation failure, it returns NULL.
43
44 memcached_clone() returns a pointer to the memcached_st that was
45 created (or initialized). On an allocation failure, it returns NULL. If
46 you pass in a preallocated structure it must be cleared first (aka
47 memset()).
48
50 To find out more information please check:
51 <http://tangent.org/552/libmemcached.html>
52
54 Brian Aker, <brian@tangent.org>
55
57 memcached(1) libmemcached(3) memcached_strerror(3)
58
59
60
61 2009-05-20 ..::docs::memcached_create(3)