memcached 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/Manifest +206 -12
- data/Rakefile +32 -1
- data/ext/extconf.rb +10 -35
- data/ext/libmemcached-0.32/AUTHORS +7 -0
- data/ext/libmemcached-0.32/COPYING +32 -0
- data/ext/libmemcached-0.32/ChangeLog +303 -0
- data/ext/libmemcached-0.32/INSTALL +302 -0
- data/ext/libmemcached-0.32/Makefile.am +36 -0
- data/ext/libmemcached-0.32/Makefile.in +828 -0
- data/ext/libmemcached-0.32/NEWS +1 -0
- data/ext/libmemcached-0.32/README +33 -0
- data/ext/libmemcached-0.32/THANKS +14 -0
- data/ext/libmemcached-0.32/TODO +11 -0
- data/ext/libmemcached-0.32/aclocal.m4 +1852 -0
- data/ext/libmemcached-0.32/clients/Makefile.am +73 -0
- data/ext/libmemcached-0.32/clients/Makefile.in +770 -0
- data/ext/libmemcached-0.32/clients/client_options.h +32 -0
- data/ext/libmemcached-0.32/clients/execute.c +64 -0
- data/ext/libmemcached-0.32/clients/execute.h +5 -0
- data/ext/libmemcached-0.32/clients/generator.c +74 -0
- data/ext/libmemcached-0.32/clients/generator.h +20 -0
- data/ext/libmemcached-0.32/clients/memcat.c +178 -0
- data/ext/libmemcached-0.32/clients/memcp.c +251 -0
- data/ext/libmemcached-0.32/clients/memdump.c +170 -0
- data/ext/libmemcached-0.32/clients/memerror.c +80 -0
- data/ext/libmemcached-0.32/clients/memflush.c +143 -0
- data/ext/libmemcached-0.32/clients/memrm.c +160 -0
- data/ext/libmemcached-0.32/clients/memslap.c +441 -0
- data/ext/libmemcached-0.32/clients/memstat.c +326 -0
- data/ext/libmemcached-0.32/clients/utilities.c +207 -0
- data/ext/libmemcached-0.32/clients/utilities.h +41 -0
- data/ext/libmemcached-0.32/config.h.in +252 -0
- data/ext/libmemcached-0.32/config/compile +143 -0
- data/ext/libmemcached-0.32/config/config.guess +1561 -0
- data/ext/libmemcached-0.32/config/config.rpath +666 -0
- data/ext/libmemcached-0.32/config/config.sub +1686 -0
- data/ext/libmemcached-0.32/config/depcomp +630 -0
- data/ext/libmemcached-0.32/config/install-sh +520 -0
- data/ext/libmemcached-0.32/config/ltmain.sh +8406 -0
- data/ext/libmemcached-0.32/config/missing +376 -0
- data/ext/libmemcached-0.32/configure +23048 -0
- data/ext/libmemcached-0.32/configure.ac +122 -0
- data/ext/libmemcached-0.32/docs/Makefile.am +415 -0
- data/ext/libmemcached-0.32/docs/Makefile.in +918 -0
- data/ext/libmemcached-0.32/docs/libmemcached.pod +123 -0
- data/ext/libmemcached-0.32/docs/libmemcached_examples.pod +115 -0
- data/ext/libmemcached-0.32/docs/libmemcachedutil.pod +40 -0
- data/ext/libmemcached-0.32/docs/memcached_analyze.pod +52 -0
- data/ext/libmemcached-0.32/docs/memcached_auto.pod +97 -0
- data/ext/libmemcached-0.32/docs/memcached_behavior.pod +224 -0
- data/ext/libmemcached-0.32/docs/memcached_callback.pod +123 -0
- data/ext/libmemcached-0.32/docs/memcached_create.pod +61 -0
- data/ext/libmemcached-0.32/docs/memcached_delete.pod +54 -0
- data/ext/libmemcached-0.32/docs/memcached_dump.pod +53 -0
- data/ext/libmemcached-0.32/docs/memcached_flush.pod +46 -0
- data/ext/libmemcached-0.32/docs/memcached_flush_buffers.pod +42 -0
- data/ext/libmemcached-0.32/docs/memcached_generate_hash_value.pod +57 -0
- data/ext/libmemcached-0.32/docs/memcached_get.pod +161 -0
- data/ext/libmemcached-0.32/docs/memcached_memory_allocators.pod +73 -0
- data/ext/libmemcached-0.32/docs/memcached_pool.pod +77 -0
- data/ext/libmemcached-0.32/docs/memcached_quit.pod +47 -0
- data/ext/libmemcached-0.32/docs/memcached_sasl.pod +63 -0
- data/ext/libmemcached-0.32/docs/memcached_server_st.pod +75 -0
- data/ext/libmemcached-0.32/docs/memcached_servers.pod +102 -0
- data/ext/libmemcached-0.32/docs/memcached_set.pod +187 -0
- data/ext/libmemcached-0.32/docs/memcached_stats.pod +82 -0
- data/ext/libmemcached-0.32/docs/memcached_strerror.pod +46 -0
- data/ext/libmemcached-0.32/docs/memcached_user_data.pod +49 -0
- data/ext/libmemcached-0.32/docs/memcached_verbosity.pod +41 -0
- data/ext/libmemcached-0.32/docs/memcached_version.pod +56 -0
- data/ext/libmemcached-0.32/docs/memcat.pod +37 -0
- data/ext/libmemcached-0.32/docs/memcp.pod +40 -0
- data/ext/libmemcached-0.32/docs/memdump.pod +31 -0
- data/ext/libmemcached-0.32/docs/memerror.pod +30 -0
- data/ext/libmemcached-0.32/docs/memflush.pod +35 -0
- data/ext/libmemcached-0.32/docs/memrm.pod +34 -0
- data/ext/libmemcached-0.32/docs/memslap.pod +33 -0
- data/ext/libmemcached-0.32/docs/memstat.pod +35 -0
- data/ext/libmemcached-0.32/libmemcached/Makefile.am +107 -0
- data/ext/libmemcached-0.32/libmemcached/Makefile.in +1050 -0
- data/ext/libmemcached-0.32/libmemcached/byteorder.c +31 -0
- data/ext/libmemcached-0.32/libmemcached/common.h +183 -0
- data/ext/libmemcached-0.32/libmemcached/crc.c +86 -0
- data/ext/libmemcached-0.32/libmemcached/hsieh_hash.c +68 -0
- data/ext/libmemcached-0.32/libmemcached/jenkins_hash.c +213 -0
- data/ext/libmemcached-0.32/libmemcached/libmemcached.ver +1 -0
- data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.d +28 -0
- data/ext/libmemcached-0.32/libmemcached/libmemcached_probes.h +78 -0
- data/ext/libmemcached-0.32/libmemcached/md5.c +354 -0
- data/ext/libmemcached-0.32/libmemcached/memcached.c +152 -0
- data/ext/libmemcached-0.32/libmemcached/memcached.h +302 -0
- data/ext/libmemcached-0.32/libmemcached/memcached.hpp +799 -0
- data/ext/libmemcached-0.32/libmemcached/memcached/README.txt +7 -0
- data/ext/libmemcached-0.32/libmemcached/memcached/protocol_binary.h +366 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_allocators.c +72 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_analyze.c +100 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_auto.c +207 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_behavior.c +285 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_callback.c +175 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_configure.h.in +23 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_connect.c +361 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_constants.h +145 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_delete.c +0 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_do.c +34 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_dump.c +79 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_fetch.c +102 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_flush.c +89 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_flush_buffers.c +22 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_get.c +495 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_get.h +87 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_hash.c +252 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_hosts.c +510 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_internal.h +31 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_io.c +547 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_io.h +59 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_key.c +28 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_parse.c +74 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_pool.h +38 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_purge.c +76 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_quit.c +75 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_response.c +528 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_result.c +57 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_result.h +59 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_sasl.c +225 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_sasl.h +44 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_server.c +159 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_server.h +93 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_stats.c +454 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_storage.c +514 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_storage.h +107 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_strerror.c +92 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_string.c +138 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_string.h +53 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_types.h +44 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_util.h +15 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_verbosity.c +36 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_version.c +112 -0
- data/ext/libmemcached-0.32/libmemcached/memcached_watchpoint.h +38 -0
- data/ext/libmemcached-0.32/libmemcached/murmur_hash.c +76 -0
- data/ext/libmemcached-0.32/libmemcached/visibility.h +51 -0
- data/ext/libmemcached-0.32/libmemcachedutil/Makefile.am +11 -0
- data/ext/libmemcached-0.32/libmemcachedutil/Makefile.in +602 -0
- data/ext/libmemcached-0.32/libmemcachedutil/libmemcachedutil.ver +1 -0
- data/ext/libmemcached-0.32/libmemcachedutil/memcached_pool.c +170 -0
- data/ext/libmemcached-0.32/m4/ac_cxx_compile_stdcxx_0x.m4 +103 -0
- data/ext/libmemcached-0.32/m4/ac_cxx_header_stdcxx_98.m4 +67 -0
- data/ext/libmemcached-0.32/m4/acx_pthread.m4 +276 -0
- data/ext/libmemcached-0.32/m4/byteorder.m4 +40 -0
- data/ext/libmemcached-0.32/m4/deprecated.m4 +17 -0
- data/ext/libmemcached-0.32/m4/enable_utillib.m4 +16 -0
- data/ext/libmemcached-0.32/m4/extensions.m4 +94 -0
- data/ext/libmemcached-0.32/m4/hsieh.m4 +18 -0
- data/ext/libmemcached-0.32/m4/lib-prefix.m4 +221 -0
- data/ext/libmemcached-0.32/m4/libtool.m4 +7360 -0
- data/ext/libmemcached-0.32/m4/ltoptions.m4 +368 -0
- data/ext/libmemcached-0.32/m4/ltsugar.m4 +123 -0
- data/ext/libmemcached-0.32/m4/ltversion.m4 +23 -0
- data/ext/libmemcached-0.32/m4/lt~obsolete.m4 +92 -0
- data/ext/libmemcached-0.32/m4/memcached.m4 +30 -0
- data/ext/libmemcached-0.32/m4/pandora_64bit.m4 +55 -0
- data/ext/libmemcached-0.32/m4/pandora_canonical.m4 +151 -0
- data/ext/libmemcached-0.32/m4/pandora_check_compiler_version.m4 +37 -0
- data/ext/libmemcached-0.32/m4/pandora_check_cxx_standard.m4 +16 -0
- data/ext/libmemcached-0.32/m4/pandora_enable_dtrace.m4 +41 -0
- data/ext/libmemcached-0.32/m4/pandora_ensure_gcc_version.m4 +36 -0
- data/ext/libmemcached-0.32/m4/pandora_have_better_malloc.m4 +54 -0
- data/ext/libmemcached-0.32/m4/pandora_have_sasl.m4 +133 -0
- data/ext/libmemcached-0.32/m4/pandora_header_assert.m4 +23 -0
- data/ext/libmemcached-0.32/m4/pandora_libtool.m4 +15 -0
- data/ext/libmemcached-0.32/m4/pandora_optimize.m4 +79 -0
- data/ext/libmemcached-0.32/m4/pandora_shared_ptr.m4 +56 -0
- data/ext/libmemcached-0.32/m4/pandora_vc_build.m4 +32 -0
- data/ext/libmemcached-0.32/m4/pandora_warnings.m4 +262 -0
- data/ext/libmemcached-0.32/m4/pod2man.m4 +7 -0
- data/ext/libmemcached-0.32/m4/protocol_binary.m4 +23 -0
- data/ext/libmemcached-0.32/m4/setsockopt.m4 +57 -0
- data/ext/libmemcached-0.32/m4/visibility.m4 +52 -0
- data/ext/libmemcached-0.32/support/Makefile.am +4 -0
- data/ext/libmemcached-0.32/support/Makefile.in +485 -0
- data/ext/libmemcached-0.32/support/libmemcached-fc.spec.in +105 -0
- data/ext/libmemcached-0.32/support/libmemcached.pc.in +10 -0
- data/ext/libmemcached-0.32/support/libmemcached.spec +105 -0
- data/ext/libmemcached-0.32/support/libmemcached.spec.in +105 -0
- data/ext/libmemcached-0.32/support/set_benchmark.sh +5 -0
- data/ext/libmemcached-0.32/tests/Makefile.am +105 -0
- data/ext/libmemcached-0.32/tests/Makefile.in +748 -0
- data/ext/libmemcached-0.32/tests/atomsmasher.c +245 -0
- data/ext/libmemcached-0.32/tests/function.c +4781 -0
- data/ext/libmemcached-0.32/tests/ketama_test_cases.h +108 -0
- data/ext/libmemcached-0.32/tests/output.cmp +7 -0
- data/ext/libmemcached-0.32/tests/output.res +7 -0
- data/ext/libmemcached-0.32/tests/output2.res +46 -0
- data/ext/libmemcached-0.32/tests/plus.cpp +293 -0
- data/ext/libmemcached-0.32/tests/r/memcat.res +19 -0
- data/ext/libmemcached-0.32/tests/r/memcp.res +27 -0
- data/ext/libmemcached-0.32/tests/r/memrm.res +19 -0
- data/ext/libmemcached-0.32/tests/r/memslap.res +33 -0
- data/ext/libmemcached-0.32/tests/r/memstat.res +33 -0
- data/ext/libmemcached-0.32/tests/server.c +118 -0
- data/ext/libmemcached-0.32/tests/server.h +25 -0
- data/ext/libmemcached-0.32/tests/start.c +16 -0
- data/ext/libmemcached-0.32/tests/t/memcat.test +4 -0
- data/ext/libmemcached-0.32/tests/t/memcp.test +3 -0
- data/ext/libmemcached-0.32/tests/t/memrm.test +3 -0
- data/ext/libmemcached-0.32/tests/t/memslap.test +5 -0
- data/ext/libmemcached-0.32/tests/t/memstat.test +3 -0
- data/ext/libmemcached-0.32/tests/test.c +137 -0
- data/ext/libmemcached-0.32/tests/test.h +46 -0
- data/ext/libmemcached-0.32/tests/udp.c +76 -0
- data/memcached.gemspec +4 -4
- data/test/unit/memcached_test.rb +30 -0
- metadata +213 -16
- data/ext/libmemcached-0.32.tar.gz +0 -0
- data/ext/libmemcached-1.patch +0 -270
- data/ext/libmemcached-10.patch +0 -12
- data/ext/libmemcached-2.patch +0 -116
- data/ext/libmemcached-3.patch +0 -8
- data/ext/libmemcached-4.patch +0 -40
- data/ext/libmemcached-5.patch +0 -832
- data/ext/libmemcached-6.patch +0 -20
- data/ext/libmemcached-7.patch +0 -2989
- data/ext/libmemcached-8.patch +0 -137
- data/ext/libmemcached-9.patch +0 -13
- data/ext/sasl.patch +0 -29283
@@ -0,0 +1,123 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_callback_get, memcached_callback_set - Get and set a callback
|
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
|
+
You can use MEMCACHED_CALLBACK_USER_DATA to provide custom context if required for any
|
36
|
+
of the callbacks
|
37
|
+
|
38
|
+
=over 4
|
39
|
+
|
40
|
+
=item MEMCACHED_CALLBACK_CLEANUP_FUNCTION
|
41
|
+
|
42
|
+
When memcached_delete() is called this function will be excuted. At the
|
43
|
+
point of its execution all connections have been closed.
|
44
|
+
|
45
|
+
=item MEMCACHED_CALLBACK_CLONE_FUNCTION
|
46
|
+
|
47
|
+
When memcached_delete() is called this function will be excuted. At the
|
48
|
+
point of its execution all connections have been closed.
|
49
|
+
|
50
|
+
=item MEMCACHED_CALLBACK_PREFIX_KEY
|
51
|
+
|
52
|
+
You can set a value which will be used to create a domain for your keys.
|
53
|
+
The value specified here will be prefixed to each of your keys. The value can not
|
54
|
+
be greater then MEMCACHED_PREFIX_KEY_MAX_SIZE - 1 and will reduce MEMCACHED_MAX_KEY by
|
55
|
+
the value of your key. The prefix key is only applied to the primary key,
|
56
|
+
not the master key. MEMCACHED_FAILURE will be returned if no key is set. In the case
|
57
|
+
of a key which is too long MEMCACHED_BAD_KEY_PROVIDED will be returned.
|
58
|
+
|
59
|
+
=item MEMCACHED_CALLBACK_USER_DATA
|
60
|
+
|
61
|
+
This allows you to store a pointer to a specifc piece of data. This can be
|
62
|
+
retrieved from inside of memcached_fetch_execute(). Cloning a memcached_st
|
63
|
+
will copy the pointer to the clone.
|
64
|
+
|
65
|
+
=item MEMCACHED_CALLBACK_MALLOC_FUNCTION
|
66
|
+
|
67
|
+
DEPRECATED: use memcached_set_memory_allocators instead.
|
68
|
+
|
69
|
+
=item MEMCACHED_CALLBACK_REALLOC_FUNCTION
|
70
|
+
|
71
|
+
DEPRECATED: use memcached_set_memory_allocators instead.
|
72
|
+
|
73
|
+
=item MEMCACHED_CALLBACK_FREE_FUNCTION
|
74
|
+
|
75
|
+
DEPRECATED: use memcached_set_memory_allocators instead.
|
76
|
+
|
77
|
+
=item MEMCACHED_CALLBACK_GET_FAILURE
|
78
|
+
|
79
|
+
This function implements the read through cache behavior. On failure of retrieval this callback will be called.
|
80
|
+
You are responsible for populating the result object provided. This result object will then be stored in the server and
|
81
|
+
returned to the calling process. You must clone the memcached_st in order to
|
82
|
+
make use of it. The value will be stored only if you return
|
83
|
+
MEMCACHED_SUCCESS or MEMCACHED_BUFFERED. Returning MEMCACHED_BUFFERED will
|
84
|
+
cause the object to be buffered and not sent immediatly (if this is the default behavior based on your connection setup this will happen automatically).
|
85
|
+
|
86
|
+
The prototype for this is:
|
87
|
+
memcached_return (*memcached_trigger_key)(memcached_st *ptr, char *key, size_t key_length, memcached_result_st *result);
|
88
|
+
|
89
|
+
=item MEMCACHED_CALLBACK_DELETE_TRIGGER
|
90
|
+
|
91
|
+
This function implements a trigger upon successful deletion of a key. The memcached_st structure will need to be cloned
|
92
|
+
in order to make use of it.
|
93
|
+
|
94
|
+
The prototype for this is:
|
95
|
+
typedef memcached_return (*memcached_trigger_delete_key)(memcached_st *ptr, char *key, size_t key_length);
|
96
|
+
|
97
|
+
|
98
|
+
=back
|
99
|
+
|
100
|
+
=head1 RETURN
|
101
|
+
|
102
|
+
memcached_callback_get() return the function or structure that was provided.
|
103
|
+
Upon error, nothing is set, null is returned, and the memcached_return
|
104
|
+
argument is set to MEMCACHED_FAILURE.
|
105
|
+
|
106
|
+
memcached_callback_set() returns MEMCACHED_SUCCESS upon successful setting,
|
107
|
+
otherwise MEMCACHED_FAILURE on error.
|
108
|
+
|
109
|
+
=head1 HOME
|
110
|
+
|
111
|
+
To find out more information please check:
|
112
|
+
L<http://tangent.org/552/libmemcached.html>
|
113
|
+
|
114
|
+
=head1 AUTHOR
|
115
|
+
|
116
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
117
|
+
|
118
|
+
=head1 SEE ALSO
|
119
|
+
|
120
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
121
|
+
|
122
|
+
=cut
|
123
|
+
|
@@ -0,0 +1,61 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_create, memcached_free - 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 *clone, memcached_st *source);
|
18
|
+
|
19
|
+
=head1 DESCRIPTION
|
20
|
+
|
21
|
+
memcached_create() is used to create a C<memcached_st> structure that will then
|
22
|
+
be used by other libmemcached(3) functions to communicate with the server. You
|
23
|
+
should either pass a statically declared C<memcached_st> to memcached_create() or
|
24
|
+
a NULL. If a NULL passed in then a structure is allocated for you.
|
25
|
+
|
26
|
+
memcached_clone() is similar to memcached_create(3) but it copies the
|
27
|
+
defaults and list of servers from the source C<memcached_st>. If you pass a null as
|
28
|
+
the argument for the source to clone, it is the same as a call to memcached_create().
|
29
|
+
If the clone argument is NULL a C<memcached_st> will be allocated for you.
|
30
|
+
If you pass a pointer to a memory area for the clone pointer, make sure you
|
31
|
+
memset it to 0 (unless you got the clone from a factory method in libmemcached).
|
32
|
+
|
33
|
+
To clean up memory associated with a C<memcached_st> structure you should pass
|
34
|
+
it to memcached_free() when you are finished using it. memcached_free() is
|
35
|
+
the only way to make sure all memory is deallocated when you finish using
|
36
|
+
the structure.
|
37
|
+
|
38
|
+
=head1 RETURN
|
39
|
+
|
40
|
+
memcached_create() returns a pointer to the memcached_st that was created
|
41
|
+
(or initialized). On an allocation failure, it returns NULL.
|
42
|
+
|
43
|
+
memcached_clone() returns a pointer to the memcached_st that was created
|
44
|
+
(or initialized). On an allocation failure, it returns NULL. If you pass in
|
45
|
+
a preallocated structure it must be cleared first (aka memset()).
|
46
|
+
|
47
|
+
=head1 HOME
|
48
|
+
|
49
|
+
To find out more information please check:
|
50
|
+
L<http://tangent.org/552/libmemcached.html>
|
51
|
+
|
52
|
+
=head1 AUTHOR
|
53
|
+
|
54
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
55
|
+
|
56
|
+
=head1 SEE ALSO
|
57
|
+
|
58
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
59
|
+
|
60
|
+
=cut
|
61
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_delete - Delete a key
|
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_delete (memcached_st *ptr,
|
15
|
+
const char *key, size_t key_length,
|
16
|
+
time_t expiration);
|
17
|
+
|
18
|
+
memcached_return
|
19
|
+
memcached_delete_by_key (memcached_st *ptr,
|
20
|
+
const char *master_key, size_t master_key_length,
|
21
|
+
const char *key, size_t key_length,
|
22
|
+
time_t expiration);
|
23
|
+
|
24
|
+
=head1 DESCRIPTION
|
25
|
+
|
26
|
+
memcached_delete() is used to delete a particular key. An expiration value
|
27
|
+
can be applied so that the key is deleted after that many seconds.
|
28
|
+
memcached_delete_by_key() works the same, but it takes a master key to
|
29
|
+
find the given value.
|
30
|
+
|
31
|
+
=head1 RETURN
|
32
|
+
|
33
|
+
A value of type C<memcached_return> is returned
|
34
|
+
On success that value will be C<MEMCACHED_SUCCESS>.
|
35
|
+
Use memcached_strerror() to translate this value to a printable string.
|
36
|
+
|
37
|
+
If you are using the non-blocking mode of the library, success only
|
38
|
+
means that the message was queued for delivery.
|
39
|
+
|
40
|
+
=head1 HOME
|
41
|
+
|
42
|
+
To find out more information please check:
|
43
|
+
L<http://tangent.org/552/libmemcached.html>
|
44
|
+
|
45
|
+
=head1 AUTHOR
|
46
|
+
|
47
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
48
|
+
|
49
|
+
=head1 SEE ALSO
|
50
|
+
|
51
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
52
|
+
|
53
|
+
=cut
|
54
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_dump - get a list of keys found on memcached servers
|
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_dump (memcached_st *ptr,
|
15
|
+
memcached_dump_func *function,
|
16
|
+
void *context,
|
17
|
+
uint32_t number_of_callbacks);
|
18
|
+
|
19
|
+
typedef memcached_return (*memcached_dump_func)(memcached_st *ptr,
|
20
|
+
const char *key,
|
21
|
+
size_t key_length,
|
22
|
+
void *context);
|
23
|
+
|
24
|
+
=head1 DESCRIPTION
|
25
|
+
|
26
|
+
memcached_dump() is used to get a list of keys found memcached(1) servers.
|
27
|
+
Because memcached(1) does not guarentee to dump all keys you can not assume
|
28
|
+
you have fetched all keys from the server. The function takes an array
|
29
|
+
of callbacks that it will use to execute on keys as they are found.
|
30
|
+
|
31
|
+
Currently the binar protocol is not supported.
|
32
|
+
|
33
|
+
=head1 RETURN
|
34
|
+
|
35
|
+
A value of type C<memcached_return> is returned
|
36
|
+
On success that value will be C<MEMCACHED_SUCCESS>.
|
37
|
+
Use memcached_strerror() to translate this value to a printable string.
|
38
|
+
|
39
|
+
=head1 HOME
|
40
|
+
|
41
|
+
To find out more information please check:
|
42
|
+
L<http://tangent.org/552/libmemcached.html>
|
43
|
+
|
44
|
+
=head1 AUTHOR
|
45
|
+
|
46
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
47
|
+
|
48
|
+
=head1 SEE ALSO
|
49
|
+
|
50
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
51
|
+
|
52
|
+
=cut
|
53
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_flush - wipe contents of memcached servers
|
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_flush (memcached_st *ptr,
|
15
|
+
time_t expiration);
|
16
|
+
|
17
|
+
=head1 DESCRIPTION
|
18
|
+
|
19
|
+
memcached_flush() is used to wipe clean the contents of memcached(1) servers.
|
20
|
+
It will either do this immediately or expire the content based on the
|
21
|
+
expiration time passed to the method (a value of zero causes an immediate
|
22
|
+
flush). The operation is not atomic to multiple servers, just atomic to a
|
23
|
+
single server. That is, it will flush the servers in the order that they were
|
24
|
+
added.
|
25
|
+
|
26
|
+
=head1 RETURN
|
27
|
+
|
28
|
+
A value of type C<memcached_return> is returned
|
29
|
+
On success that value will be C<MEMCACHED_SUCCESS>.
|
30
|
+
Use memcached_strerror() to translate this value to a printable string.
|
31
|
+
|
32
|
+
=head1 HOME
|
33
|
+
|
34
|
+
To find out more information please check:
|
35
|
+
L<http://tangent.org/552/libmemcached.html>
|
36
|
+
|
37
|
+
=head1 AUTHOR
|
38
|
+
|
39
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
40
|
+
|
41
|
+
=head1 SEE ALSO
|
42
|
+
|
43
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
44
|
+
|
45
|
+
=cut
|
46
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_flush_buffers - Flush buffers and send buffered commands
|
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_flush_buffers (memcached_st *ptr);
|
15
|
+
|
16
|
+
=head1 DESCRIPTION
|
17
|
+
|
18
|
+
memcached_flush_buffers() is used in conjunction with
|
19
|
+
MEMCACHED_BEHAVIOR_BUFFER_REQUESTS (see memcached_behavior(3)) to flush
|
20
|
+
all buffers by sending the buffered commands to the server for processing..
|
21
|
+
|
22
|
+
=head1 RETURN
|
23
|
+
|
24
|
+
A value of type C<memcached_return> is returned
|
25
|
+
On success that value will be C<MEMCACHED_SUCCESS>.
|
26
|
+
Use memcached_strerror() to translate this value to a printable string.
|
27
|
+
|
28
|
+
=head1 HOME
|
29
|
+
|
30
|
+
To find out more information please check:
|
31
|
+
L<http://tangent.org/552/libmemcached.html>
|
32
|
+
|
33
|
+
=head1 AUTHOR
|
34
|
+
|
35
|
+
Trond Norbye, E<lt>trond.norbye@sun.comE<gt>
|
36
|
+
|
37
|
+
=head1 SEE ALSO
|
38
|
+
|
39
|
+
memcached(1) libmemcached(3) memcached_strerror(3) memcached_behavior(3)
|
40
|
+
|
41
|
+
=cut
|
42
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_generate_hash_value - Hash a key value
|
4
|
+
|
5
|
+
=head1 LIBRARY
|
6
|
+
|
7
|
+
C Client Library for memcached (libmemcached, -lmemcached)
|
8
|
+
|
9
|
+
=head1 SYNOPSIS
|
10
|
+
|
11
|
+
#include <memcached.h>
|
12
|
+
|
13
|
+
uint32_t
|
14
|
+
memcached_generate_hash_value (const char *key,
|
15
|
+
size_t key_length,
|
16
|
+
memcached_hash hash_algorithm);
|
17
|
+
|
18
|
+
uint32_t
|
19
|
+
memcached_generate_hash (memcached_st *ptr,
|
20
|
+
const char *key,
|
21
|
+
size_t key_length);
|
22
|
+
|
23
|
+
=head1 DESCRIPTION
|
24
|
+
|
25
|
+
memcached_generate_hash_value() allows you to hash a key using one of
|
26
|
+
the hash fuctions defined in the library. This method is provided for
|
27
|
+
the convenience of higher-level language bindings and is not necessary
|
28
|
+
for normal memcache operations.
|
29
|
+
|
30
|
+
The allowed hash algorithm constants are listed in the manpage for
|
31
|
+
memcached_behavior_set().
|
32
|
+
|
33
|
+
memcached_generate_hash() takes a memcached_st struture and produces
|
34
|
+
the hash value that would have been generated based on the defaults
|
35
|
+
of the memcached_st structure.
|
36
|
+
|
37
|
+
=head1 RETURN
|
38
|
+
|
39
|
+
A 32-bit integer which is the result of hashing the given key.
|
40
|
+
For 64-bit hash algorithms, only the least-significant 32 bits are
|
41
|
+
returned.
|
42
|
+
|
43
|
+
=head1 HOME
|
44
|
+
|
45
|
+
To find out more information please check:
|
46
|
+
L<http://tangent.org/552/libmemcached.html>
|
47
|
+
|
48
|
+
=head1 AUTHOR
|
49
|
+
|
50
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
51
|
+
|
52
|
+
=head1 SEE ALSO
|
53
|
+
|
54
|
+
memcached(1) libmemcached(3) memcached_behavior_set(3)
|
55
|
+
|
56
|
+
=cut
|
57
|
+
|
@@ -0,0 +1,161 @@
|
|
1
|
+
=head1 NAME
|
2
|
+
|
3
|
+
memcached_get, memcached_get_len, memcached_mget, memcached_mget_len, memcached_fetch - Get a value
|
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_result_st *
|
14
|
+
memcached_fetch_result(memcached_st *ptr,
|
15
|
+
memcached_result_st *result,
|
16
|
+
memcached_return *error);
|
17
|
+
|
18
|
+
char *memcached_get(memcached_st *ptr,
|
19
|
+
const char *key, size_t key_length,
|
20
|
+
size_t *value_length,
|
21
|
+
uint32_t *flags,
|
22
|
+
memcached_return *error);
|
23
|
+
|
24
|
+
memcached_return
|
25
|
+
memcached_mget(memcached_st *ptr,
|
26
|
+
char **keys, size_t *key_length,
|
27
|
+
size_t number_of_keys);
|
28
|
+
char *
|
29
|
+
memcached_get_by_key(memcached_st *ptr,
|
30
|
+
const char *master_key, size_t master_key_length,
|
31
|
+
const char *key, size_t key_length,
|
32
|
+
uint32_t user_spec_len,
|
33
|
+
size_t *value_length,
|
34
|
+
uint32_t *flags,
|
35
|
+
memcached_return *error);
|
36
|
+
|
37
|
+
memcached_return
|
38
|
+
memcached_mget_by_key(memcached_st *ptr,
|
39
|
+
const char *master_key, size_t master_key_length,
|
40
|
+
char **keys, size_t *key_length,
|
41
|
+
size_t number_of_keys,
|
42
|
+
uint32_t user_spec_len);
|
43
|
+
|
44
|
+
char *memcached_fetch(memcached_st *ptr,
|
45
|
+
char *key, size_t *key_length,
|
46
|
+
size_t *value_length,
|
47
|
+
uint32_t *flags,
|
48
|
+
memcached_return *error);
|
49
|
+
memcached_return
|
50
|
+
memcached_fetch_execute(memcached_st *ptr,
|
51
|
+
memcached_return (*callback[])(memcached_st *ptr, memcached_result_st *result, void *context),
|
52
|
+
void *context,
|
53
|
+
unsigned int number_of_callbacks);
|
54
|
+
|
55
|
+
char *
|
56
|
+
memcached_get_len(memcached_st *ptr,
|
57
|
+
const char *key, size_t key_length,
|
58
|
+
uint32_t user_spec_len,
|
59
|
+
size_t *value_length,
|
60
|
+
uint32_t *flags,
|
61
|
+
memcached_return *error);
|
62
|
+
|
63
|
+
memcached_return
|
64
|
+
memcached_mget_len(memcached_st *ptr,
|
65
|
+
const char **keys, size_t *key_length,
|
66
|
+
size_t number_of_keys, uint32_t user_spec_len);
|
67
|
+
|
68
|
+
=head1 DESCRIPTION
|
69
|
+
|
70
|
+
memcached_get() is used to fetch an individual value from the server. You
|
71
|
+
must pass in a key and its length to fetch the object. You must supply
|
72
|
+
three pointer variables which will give you the state of the returned
|
73
|
+
object. A uint32_t pointer to contain whatever flags you stored with the value,
|
74
|
+
a size_t pointer which will be filled with size of of the object, and a
|
75
|
+
memcached_return pointer to hold any error. The object will be returned
|
76
|
+
upon success and NULL will be returned on failure. Any object returned by
|
77
|
+
memcached_get() must be released by the caller application.
|
78
|
+
|
79
|
+
memcached_get_len() is also used to fetch an individual value from the
|
80
|
+
server. The only difference when compared to memcached_get() is that
|
81
|
+
the server will only send back the first n bytes of the value where n is
|
82
|
+
specified by the user. Note that this command is only available when
|
83
|
+
using the ascii protocol.
|
84
|
+
|
85
|
+
memcached_mget() is used to select multiple keys at once. For multiple key
|
86
|
+
operations it is always faster to use this function. This function always
|
87
|
+
works asynchronously. memcached_fetch() is then used to retrieve any keys
|
88
|
+
found. No error is given on keys that are not found. You must call either
|
89
|
+
memcached_fetch() or memcached_fetch_result() after a successful call to
|
90
|
+
memcached_mget(). You should continue to call these functions until they
|
91
|
+
return NULL (aka no more values). If you need to quit in the middle of a
|
92
|
+
memcached_get() call, execute a memcached_quit(). After you do this, you can
|
93
|
+
issue new queries against the server.
|
94
|
+
|
95
|
+
memcached_mget_len() is also used to select multiple keys at once. The
|
96
|
+
only difference when compared to memcached_mget() is that the server
|
97
|
+
will only send back the first n bytes of each value where n is
|
98
|
+
specified by the user. Note that this command is only available when
|
99
|
+
using the ascii protocol.
|
100
|
+
|
101
|
+
memcached_fetch() is used to fetch an individual value from the server.
|
102
|
+
memcached_mget() or memcached_mget_len() must always be called before
|
103
|
+
using this method. You must pass in a key and its length to fetch the
|
104
|
+
object. You must supply three pointer variables which will give you the
|
105
|
+
state of the returned object. A uint32_t pointer to contain whatever
|
106
|
+
flags you stored with the value, a size_t pointer which will be filled
|
107
|
+
with size of of the object, and a memcached_return pointer to hold any
|
108
|
+
error. The object will be returned upon success and NULL will be returned
|
109
|
+
on failure. MEMCACHD_END is returned by the *error value when all objects
|
110
|
+
that have been found are returned. The final value upon MEMCACHED_END is
|
111
|
+
null. Values returned by memcached_fetch() musted be free'ed by the caller.
|
112
|
+
|
113
|
+
memcached_fetch_result() is used to return a memcached_result_st(3) structure
|
114
|
+
from a memcached server. The result object is forward compatible with changes
|
115
|
+
to the server. For more information please refer to the memcached_result_st(3)
|
116
|
+
help. This function will dynamically allocate a result structure for you
|
117
|
+
if you do not pass one to the function.
|
118
|
+
|
119
|
+
memcached_fetch_execute() is a callback function for result sets. Instead
|
120
|
+
of returning the results to you for processing, it passes each of the
|
121
|
+
result sets to the list of functions you provide. It passes to the function
|
122
|
+
a memcached_st that can be cloned for use in the called function (it can not
|
123
|
+
be used directly). It also passes a result set which does not need to be freed.
|
124
|
+
Finally it passes a "context". This is just a pointer to a memory reference
|
125
|
+
you supply the calling function. Currently only one value is being passed
|
126
|
+
to each function call. In the future there will be an option to allow this
|
127
|
+
to be an array.
|
128
|
+
|
129
|
+
memcached_get_by_key() and memcached_mget_by_key() behave in a similar nature
|
130
|
+
as memcached_get() and memcached_mget(). The difference is that they take
|
131
|
+
a master key that is used for determining which server an object was stored
|
132
|
+
if key partitioning was used for storage.
|
133
|
+
|
134
|
+
All of the above functions are not supported when the C<MEMCACHED_BEHAVIOR_USE_UDP>
|
135
|
+
has been set. Executing any of these functions with this behavior on will result in
|
136
|
+
C<MEMCACHED_NOT_SUPPORTED> being returned or, for those functions which do not return
|
137
|
+
a C<memcached_return>, the error function parameter will be set to
|
138
|
+
C<MEMCACHED_NOT_SUPPORTED>.
|
139
|
+
|
140
|
+
=head1 RETURN
|
141
|
+
|
142
|
+
All objects returned must be freed by the calling application.
|
143
|
+
memcached_get(), memcached_get_len(), and memcached_fetch() will return
|
144
|
+
NULL on error. You must look at the value of error to determine what
|
145
|
+
the actual error was.
|
146
|
+
|
147
|
+
=head1 HOME
|
148
|
+
|
149
|
+
To find out more information please check:
|
150
|
+
L<http://tangent.org/552/libmemcached.html>
|
151
|
+
|
152
|
+
=head1 AUTHOR
|
153
|
+
|
154
|
+
Brian Aker, E<lt>brian@tangent.orgE<gt>
|
155
|
+
|
156
|
+
=head1 SEE ALSO
|
157
|
+
|
158
|
+
memcached(1) libmemcached(3) memcached_strerror(3)
|
159
|
+
|
160
|
+
=cut
|
161
|
+
|