Changeset ea3648
- Timestamp:
- 02/22/08 20:05:15 (4 years ago)
- Branches:
- master, ketama-compat
- Children:
- 34f10e
- Parents:
- 4767f2
- git-author:
- Tomash Brechko <tomash.brechko@…> (02/22/08 20:05:15)
- git-committer:
- Tomash Brechko <tomash.brechko@…> (02/22/08 20:05:15)
- Files:
-
- 1 added
- 6 edited
-
Changes (modified) (1 diff)
-
Fast.xs (modified) (1 diff)
-
MANIFEST (modified) (1 diff)
-
lib/Cache/Memcached/Fast.pm (modified) (1 diff)
-
src/client.c (modified) (1 diff)
-
src/client.h (modified) (1 diff)
-
t/namespace.t (added)
Legend:
- Unmodified
- Added
- Removed
-
Changes
rb995a3 rea3648 1 1 Revision history for Perl extension Cache::Memcached::Fast. 2 3 4 0.09 ??? 5 - ??? 6 7 Add method 'namespace' to get and/or set the namespace prefix. 8 This is handy when you "lease" C::M::F object for different 9 parts of your application that do unrelated things. 2 10 3 11 -
Fast.xs
r4767f2 rea3648 1230 1230 OUTPUT: 1231 1231 RETVAL 1232 1233 1234 SV * 1235 namespace(memd, ...) 1236 Cache_Memcached_Fast * memd 1237 PROTOTYPE: $;$ 1238 PREINIT: 1239 const char *ns; 1240 size_t len; 1241 CODE: 1242 ns = client_get_prefix(memd->c, &len); 1243 RETVAL = newSVpv(ns, len); 1244 if (items > 1) 1245 { 1246 ns = SvPV(ST(1), len); 1247 if (client_set_prefix(memd->c, ns, len) != MEMCACHED_SUCCESS) 1248 croak("Not enough memory"); 1249 } 1250 OUTPUT: 1251 RETVAL -
MANIFEST
rcdcc2e rea3648 15 15 t/encoding.t 16 16 t/key_ref.t 17 t/namespace.t 17 18 t/nowait.t 18 19 t/serialize.t -
lib/Cache/Memcached/Fast.pm
rc028bb rea3648 558 558 559 559 560 =item C<namespace> 561 562 $memd->namespace(); 563 $memd->namespace($string); 564 565 Get and/or set the namespace prefix. 566 567 I<Return:> scalar, the namespace prefix that was in effect before the 568 call. 569 570 =cut 571 572 # See Fast.xs. 573 574 560 575 =item C<set> 561 576 -
src/client.c
racf677 rea3648 507 507 508 508 509 const char * 510 client_get_prefix(struct client *c, size_t *ns_len) 511 { 512 *ns_len = c->prefix_len - 1; 513 514 return (c->prefix + 1); 515 } 516 517 509 518 static inline 510 519 ssize_t -
src/client.h
rff0698 rea3648 115 115 116 116 extern 117 const char * 118 client_get_prefix(struct client *c, size_t *ns_len); 119 120 extern 117 121 void 118 122 client_set_connect_timeout(struct client *c, int to);
Note: See TracChangeset
for help on using the changeset viewer.
