Adding missing pod file.
[awesomized/libmemcached] / docs / memcached_callback.pod
1 =head1 NAME
2
3 memcached_callback_get memcached_callback_set
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_return
14 memcached_callback_set (memcached_st *ptr,
15 memcached_callback flag,
16 void *data);
17
18 void *
19 memcached_callback_get (memcached_st *ptr,
20 memcached_callback flag,
21 memcached_return *error);
22
23 =head1 DESCRIPTION
24
25 libmemcached(3) can have callbacks set key execution points. These either
26 provide function calls at points in the code, or return pointers to
27 structures for particular usages.
28
29 memcached_callback_get() takes a callback flag and returns the structure or
30 function set by memcached_callback_set().
31
32 memcached_callback_set() changes the function/structure assigned by a
33 callback flag. No connections are reset.
34
35 =over 4
36
37 =item MEMCACHED_CALLBACK_CLEANUP_FUNCTION
38
39 When memcached_delete() is called this function will be excuted. At the
40 point of its execution all connections have been closed.
41
42 =item MEMCACHED_CALLBACK_CLONE_FUNCTION
43
44 When memcached_delete() is called this function will be excuted. At the
45 point of its execution all connections have been closed.
46
47 =item MEMCACHED_CALLBACK_USER_DATA
48
49 This allows you to store a pointer to a specifc piece of data. This can be
50 retrieved from inside of memcached_fetch_exectue(). Cloning a memcached_st
51 will copy the pointer to the clone.
52
53 =item MEMCACHED_CALLBACK_MALLOC_FUNCTION,
54
55 This alllows yout to pass in a customized version of malloc that will be used instead of the builtin malloc(3) call.
56 The prototype for this is:
57
58 void *(*memcached_malloc_function)(memcached_st *ptr, const size_t size);
59
60 You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for malloc.
61
62 =item MEMCACHED_CALLBACK_REALLOC_FUNCTION,
63
64 This alllows yout to pass in a customized version of realloc that will be used instead of the builtin realloc(3) call.
65 The prototype for this is:
66
67 void *(*memcached_realloc_function)(memcached_st *ptr, void *mem, const size_t size);
68
69 You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for realloc.
70
71 =item MEMCACHED_CALLBACK_FREE_FUNCTION,
72
73 This alllows yout to pass in a customized version of realloc that will be used instead of the builtin free(3) call.
74 The prototype for this is:
75
76 typedef void (*memcached_free_function)(memcached_st *ptr, void *mem);
77
78 You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for realloc.
79
80 =back
81
82 =head1 RETURN
83
84 memcached_callback_get() return the function or structure that was provided.
85 Upon error, nothing is set, null is returned, and the memcached_return
86 argument is set to MEMCACHED_FAILURE.
87
88 memcached_callback_set() returns MEMCACHED_SUCCESS upon successful setting,
89 otherwise MEMCACHED_FAILURE on error.
90
91 =head1 HOME
92
93 To find out more information please check:
94 L<http://tangent.org/552/libmemcached.html>
95
96 =head1 AUTHOR
97
98 Brian Aker, E<lt>brian@tangent.orgE<gt>
99
100 =head1 SEE ALSO
101
102 memcached(1) libmemcached(3) memcached_strerror(3)
103
104 =cut
105