number_of_hosts <-- encapsulated.
[m6w6/libmemcached] / docs / memcached_create.pod
1 =head1 NAME
2
3 memcached_create, memcached_free, memcached_clone, memcached_servers_reset- Create a memcached_st structure
4
5 =head1 LIBRARY
6
7 C Client Library for memcached (libmemcached, -lmemcached)
8
9 =head1 SYNOPSIS
10
11 #include <memcached.h>
12
13 memcached_st *memcached_create (memcached_st *ptr);
14
15 void memcached_free (memcached_st *ptr);
16
17 memcached_st *memcached_clone (memcached_st *destination, memcached_st *source);
18
19 void memcached_servers_reset(memcached_st);
20
21 =head1 DESCRIPTION
22
23 memcached_create() is used to create a C<memcached_st> structure that will then
24 be used by other libmemcached(3) functions to communicate with the server. You
25 should either pass a statically declared C<memcached_st> to memcached_create() or
26 a NULL. If a NULL passed in then a structure is allocated for you.
27
28 memcached_clone() is similar to memcached_create(3) but it copies the
29 defaults and list of servers from the source C<memcached_st>. If you pass a null as
30 the argument for the source to clone, it is the same as a call to memcached_create().
31 If the destination argument is NULL a C<memcached_st> will be allocated for you.
32
33 memcached_servers_reset() allows you to zero out the list of servers that
34 the memcached_st has.
35
36 To clean up memory associated with a C<memcached_st> structure you should pass
37 it to memcached_free() when you are finished using it. memcached_free() is
38 the only way to make sure all memory is deallocated when you finish using
39 the structure.
40
41 You may wish to avoid using memcached_create(3) or memcached_clone(3) with a
42 stack based allocation. The most common issues related to ABI safety involve
43 heap allocated structures.
44
45 =head1 RETURN
46
47 memcached_create() returns a pointer to the memcached_st that was created
48 (or initialized). On an allocation failure, it returns NULL.
49
50 memcached_clone() returns a pointer to the memcached_st that was created
51 (or initialized). On an allocation failure, it returns NULL.
52
53 =head1 HOME
54
55 To find out more information please check:
56 L<https://launchpad.net/libmemcached>
57
58 =head1 AUTHOR
59
60 Brian Aker, E<lt>brian@tangent.orgE<gt>
61
62 =head1 SEE ALSO
63
64 memcached(1) libmemcached(3) memcached_strerror(3)
65
66 =cut
67