packages icon

Tar Archive: /hpux/Misc/libmemcached-0.46/libmemcached-0.46-hppa_32-11.23.depot.gz
Filename:    libmemcached/libmemcached-MAN/usr/local/share/man/man3/memcached_get.3
.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.ie \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.el \{\
.    de IX
..
.\}
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "memcached_get.pop 3"
.TH memcached_get.pop 3 "2010-06-28" "" "memcached_get"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
memcached_get, memcached_mget, memcached_fetch, memcached_mget_execute,
memcached_mget_execute_by_key \- Get a value
.SH "LIBRARY"
.IX Header "LIBRARY"
C Client Library for memcached (libmemcached, \-lmemcached)
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 1
\&  #include 
\&
\&  memcached_result_st *
\&    memcached_fetch_result (memcached_st *ptr,
\&                            memcached_result_st *result,
\&                            memcached_return_t *error);
\&
\&  char *
\&    memcached_get (memcached_st *ptr,
\&                   const char *key, size_t key_length,
\&                   size_t *value_length,
\&                   uint32_t *flags,
\&                   memcached_return_t *error);
\&
\&  memcached_return_t
\&    memcached_mget (memcached_st *ptr,
\&                  const char * const *keys,
\&                  const size_t *key_length,
\&                  size_t number_of_keys);
\&  char *
\&    memcached_get_by_key (memcached_st *ptr,
\&                          const char *master_key, size_t master_key_length,
\&                          const char *key, size_t key_length,
\&                          size_t *value_length,
\&                          uint32_t *flags,
\&                          memcached_return_t *error);
\&
\&  memcached_return_t
\&    memcached_mget_by_key (memcached_st *ptr,
\&                           const char *master_key, size_t master_key_length,
\&                           const char * const *keys,
\&                           const size_t *key_length,
\&                           size_t number_of_keys);
\&
\&  char *
\&    memcached_fetch (memcached_st *ptr,
\&                     char *key, size_t *key_length,
\&                     size_t *value_length,
\&                     uint32_t *flags,
\&                     memcached_return_t *error);
\&
\&  memcached_return_t
\&    memcached_fetch_execute (memcached_st *ptr,
\&                             memcached_execute_fn *callback,
\&                             void *context,
\&                             uint32_t number_of_callbacks);
\&
\&
\&  memcached_return_t
\&    memcached_mget_execute (memcached_st *ptr,
\&                            const char * const *keys,
\&                            const size_t *key_length,
\&                            size_t number_of_keys,
\&                            memcached_execute_fn *callback,
\&                            void *context,
\&                            uint32_t number_of_callbacks);
\&
\&  memcached_return_t
\&    memcached_mget_execute_by_key (memcached_st *ptr,
\&                                   const char *master_key,
\&                                   size_t master_key_length,
\&                                   const char * const *keys,
\&                                   const size_t *key_length,
\&                                   size_t number_of_keys,
\&                                   memcached_execute_fn *callback,
\&                                   void *context,
\&                                   uint32_t number_of_callbacks);
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
\&\fImemcached_get()\fR is used to fetch an individual value from the server. You
must pass in a key and its length to fetch the object. You must supply
three pointer variables which will give you the state of the returned
object.  A uint32_t pointer to contain whatever flags you stored with the value,
a size_t pointer which will be filled with size of of the object, and a
memcached_return_t pointer to hold any error. The object will be returned
upon success and \s-1NULL\s0 will be returned on failure. Any object returned by
\&\fImemcached_get()\fR must be released by the caller application.
.PP
\&\fImemcached_mget()\fR is used to select multiple keys at once. For multiple key
operations it is always faster to use this function. This function always
works asynchronously. \fImemcached_fetch()\fR is then used to retrieve any keys
found. No error is given on keys that are not found. You must call either
\&\fImemcached_fetch()\fR or \fImemcached_fetch_result()\fR after a successful call to
\&\fImemcached_mget()\fR. You should continue to call these functions until they
return \s-1NULL\s0 (aka no more values). If you need to quit in the middle of a
\&\fImemcached_get()\fR call, execute a \fImemcached_quit()\fR. After you do this, you can
issue new queries against the server.
.PP
\&\fImemcached_fetch()\fR is used to fetch an individual value from the server.
\&\fImemcached_mget()\fR must always be called before using this method.  You
must pass in a key and its length to fetch the object. You must supply
three pointer variables which will give you the state of the returned
object.  A uint32_t pointer to contain whatever flags you stored with the value,
a size_t pointer which will be filled with size of of the object, and a
memcached_return_t pointer to hold any error. The object will be returned
upon success and \s-1NULL\s0 will be returned on failure. \s-1MEMCACHD_END\s0 is returned
by the *error value when all objects that have been found are returned.
The final value upon \s-1MEMCACHED_END\s0 is null. Values returned by
\&\fImemcached_fetch()\fR musted be free'ed by the caller. \fImemcached_fetch()\fR will
be \s-1DEPRECATED\s0 in the near future, \fImemcached_fetch_result()\fR should be used
instead.
.PP
\&\fImemcached_fetch_result()\fR is used to return a \fImemcached_result_st\fR\|(3) structure
from a memcached server. The result object is forward compatible with changes
to the server. For more information please refer to the \fImemcached_result_st\fR\|(3)
help. This function will dynamically allocate a result structure for you
if you do not pass one to the function.
.PP
\&\fImemcached_fetch_execute()\fR is a callback function for result sets. Instead
of returning the results to you for processing, it passes each of the
result sets to the list of functions you provide. It passes to the function
a memcached_st that can be cloned for use in the called function (it can not
be used directly). It also passes a result set which does not need to be freed.
Finally it passes a \*(L"context\*(R". This is just a pointer to a memory reference
you supply the calling function. Currently only one value is being passed
to each function call. In the future there will be an option to allow this
to be an array.
.PP
\&\fImemcached_mget_execute()\fR and \fImemcached_mget_execute_by_key()\fR is
similar to \fImemcached_mget()\fR, but it may trigger the supplied callbacks
with result sets while sending out the queries. If you try to perform
a really large multiget with \fImemcached_mget()\fR you may encounter a
deadlock in the \s-1OS\s0 kernel (we fail to write data to the socket because
the input buffer is full). \fImemcached_mget_execute()\fR solves this
problem by processing some of the results before continuing sending
out requests. Please note that this function is only available in the
binary protocol.
.PP
\&\fImemcached_get_by_key()\fR and \fImemcached_mget_by_key()\fR behave in a similar nature
as \fImemcached_get()\fR and \fImemcached_mget()\fR. The difference is that they take
a master key that is used for determining which server an object was stored
if key partitioning was used for storage.
.PP
All of the above functions are not supported when the \f(CW\*(C`MEMCACHED_BEHAVIOR_USE_UDP\*(C'\fR
has been set. Executing any of these functions with this behavior on will result in
\&\f(CW\*(C`MEMCACHED_NOT_SUPPORTED\*(C'\fR being returned or, for those functions which do not return
a \f(CW\*(C`memcached_return_t\*(C'\fR, the error function parameter will be set to
\&\f(CW\*(C`MEMCACHED_NOT_SUPPORTED\*(C'\fR.
.SH "RETURN"
.IX Header "RETURN"
All objects returned must be freed by the calling application.
\&\fImemcached_get()\fR and \fImemcached_fetch()\fR will return \s-1NULL\s0 on error. You must
look at the value of error to determine what the actual error was.
.PP
\&\s-1MEMCACHED_KEY_TOO_BIG\s0 is set to error whenever \fImemcached_fetch()\fR was used
and the key was set larger then \s-1MEMCACHED_MAX_KEY\s0, which was the largest
key allowed for the original memcached ascii server.
.SH "HOME"
.IX Header "HOME"
To find out more information please check:

.SH "AUTHOR"
.IX Header "AUTHOR"
Brian Aker, 
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fImemcached\fR\|(1) \fIlibmemcached\fR\|(3) \fImemcached_strerror\fR\|(3)