From: Brian Aker Date: Sun, 19 Jun 2011 08:25:48 +0000 (-0700) Subject: Merge in docs. X-Git-Tag: 0.51~3^2~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=28adf7b936c6f5c25b7526ff56ec1256da1246d4;p=m6w6%2Flibmemcached Merge in docs. --- 28adf7b936c6f5c25b7526ff56ec1256da1246d4 diff --cc docs/conf.py.in index 84d6eccb,00000000..a6a1dfb7 mode 100644,000000..100644 --- a/docs/conf.py.in +++ b/docs/conf.py.in @@@ -1,354 -1,0 +1,355 @@@ +# -*- coding: utf-8 -*- +# +# libmemcached documentation build configuration file, created by +# sphinx-quickstart on Sun Mar 6 12:05:53 2011. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +extensions = ['sphinxcontrib.googleanalytics'] + +# Google +googleanalytics_id = 'UA-15307604-2' +googleanalytics_enabled = 'True' + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'libmemcached' +copyright = u'2011, Brian Aker DataDifferential, http://datadifferential.com/' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '@VERSION@' +# The full version, including alpha/beta/rc tags. +release = '@VERSION@' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +html_show_sourcelink = False + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'libmemcacheddoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'libmemcached.tex', u'libmemcached Documentation', + u'Brian Aker', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('hashkit_create', 'hashkit_clone', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_create', 'hashkit_create', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_create', 'hashkit_free', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_create', 'hashkit_is_allocated', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_crc32', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_fnv1_32', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_fnv1_64', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_fnv1a_32', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_fnv1a_64', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_functions', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_hsieh', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_jenkins', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_md5', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_functions', 'hashkit_murmur', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('hashkit_value', 'hashkit_value', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('libhashkit', 'libhashkit', u'libhashkit Documentation', [u'Brian Aker'], 3), + ('libmemcached', 'libmemcached', u'Introducing the C Client Library for memcached', [u'Brian Aker'], 3), + ('libmemcached_configuration', 'libmemcached_check_configuration', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('libmemcached_configuration', 'libmemcached_configuration', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('libmemcached_configuration', 'memcached', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('libmemcached_examples', 'libmemcached_examples', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('libmemcachedutil', 'libmemcachedutil', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memaslap', 'memaslap', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcached_analyze', 'memcached_analyze', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_append', 'memcached_append', u'Appending to or Prepending to data on the server', [u'Brian Aker'], 3), + ('memcached_append', 'memcached_append_by_key', u'Appending to or Prepending to data on the server', [u'Brian Aker'], 3), + ('memcached_append', 'memcached_prepend', u'Appending to or Prepending to data on the server', [u'Brian Aker'], 3), + ('memcached_append', 'memcached_prepend_by_key', u'Appending to or Prepending to data on the server', [u'Brian Aker'], 3), + ('memcached_auto', 'memcached_auto', u'Incrementing and Decrementing Values', [u'Brian Aker'], 3), + ('memcached_auto', 'memcached_decrement', u'Incrementing and Decrementing Values', [u'Brian Aker'], 3), + ('memcached_auto', 'memcached_decrement_with_initial', u'Incrementing and Decrementing Values', [u'Brian Aker'], 3), + ('memcached_auto', 'memcached_increment', u'Incrementing and Decrementing Values', [u'Brian Aker'], 3), + ('memcached_auto', 'memcached_increment_with_initial', u'Incrementing and Decrementing Values', [u'Brian Aker'], 3), + ('memcached_behavior', 'memcached_behavior', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_behavior', 'memcached_behavior_get', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_behavior', 'memcached_behavior_set', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_callback', 'memcached_callback', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_callback', 'memcached_callback_get', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_callback', 'memcached_callback_set', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_cas', 'memcached_cas', u'Working with data on the server in an atomic fashion', [u'Brian Aker'], 3), + ('memcached_cas', 'memcached_cas_by_key', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_create', 'memcached_clone', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_create', 'memcached_create', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_create', 'memcached_free', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_create', 'memcached_servers_reset', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_delete', 'memcached_delete', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_delete', 'memcached_delete_by_key', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_dump', 'memcached_dump', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_flush', 'memcached_flush', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_flush_buffers', 'memcached_flush_buffers', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_generate_hash_value', 'memcached_generate_hash', u'Generating hash values directly', [u'Brian Aker'], 3), + ('memcached_generate_hash_value', 'memcached_generate_hash_value', u'Generating hash values directly', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_fetch', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_fetch_execute', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_fetch_result', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_get', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_get_by_key', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_mget', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_mget_by_key', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_mget_execute', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_get', 'memcached_mget_execute_by_key', u'Retrieving data from the server', [u'Brian Aker'], 3), + ('memcached_memory_allocators', 'memcached_get_memory_allocators', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_memory_allocators', 'memcached_memory_allocators', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_memory_allocators', 'memcached_set_memory_allocators', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_memory_allocators', 'memcached_set_memory_allocators_context', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_behavior_get', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_behavior_set', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_create', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_destroy', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_pop', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_push', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_push', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_pool', 'memcached_pool_st', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_quit', 'memcached_quit', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_cas', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_create', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_flags', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_free', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_key_length', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_key_value', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_length', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_st', u'Working with result sets', [u'Brian Aker'], 3), + ('memcached_result_st', 'memcached_result_value', u'Working with result sets', [u'Brian Aker'], 3), ++ ('libmemcached/memcached_return_t', 'memcached_return_t', u'Return type values ', [u'Brian Aker'], 3), + ('memcached_sasl', 'memcached_destroy_sasl_auth_data', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_sasl', 'memcached_get_sasl_callbacks', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_sasl', 'memcached_sasl', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_sasl', 'memcached_sasl_set_auth_data', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_sasl', 'memcached_set_sasl_callbacks', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_server_st', 'memcached_server_list_append', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_server_st', 'memcached_server_list_count', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_server_st', 'memcached_server_list_free', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_server_st', 'memcached_servers_parse', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_add', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_add_unix_socket', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_count', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_cursor', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_list', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_push', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_server_st', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_servers', 'memcached_servers', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_add', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_add_by_key', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_replace', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_replace_by_key', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_set', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_set', 'memcached_set_by_key', u'Storing and Replacing Data', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stat', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stat_execute', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stat_get_keys', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stat_get_value', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stat_servername', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_stats', 'memcached_stats', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_strerror', 'memcached_strerror', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_user_data', 'memcached_get_user_data', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_user_data', 'memcached_set_user_data', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_user_data', 'memcached_user_data', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_verbosity', 'memcached_verbosity', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_version', 'memcached_lib_version', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcached_version', 'memcached_version', u'libmemcached Documentation', [u'Brian Aker'], 3), + ('memcapable', 'memcapable', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcapable', 'memcapable', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcat', 'memcat', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcat', 'memcat', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcp', 'memcp', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memcp', 'memcp', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memdump', 'memdump', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memdump', 'memdump', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memerror', 'memerror', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memerror', 'memerror', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memflush', 'memflush', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memrm', 'memrm', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memslap', 'memslap', u'libmemcached Documentation', [u'Brian Aker'], 1), + ('memstat', 'memstat', u'libmemcached Documentation', [u'Brian Aker'], 1), + ] diff --cc docs/hashkit_create.rst index f7aabac5,3b9a7acd..8935b2d0 --- a/docs/hashkit_create.rst +++ b/docs/hashkit_create.rst @@@ -10,6 -10,6 +10,8 @@@ SYNOPSI #include ++.. c:type:: hashkit_st ++ .. c:function:: hashkit_st *hashkit_create(hashkit_st *hash); .. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr); @@@ -19,26 -19,37 +21,25 @@@ .. c:function:: bool hashkit_is_allocated(const hashkit_st *hash); Compile and link with -lhashkit -======= - - -.. c:function:: perl - -.. c:function:: hashkit_st *hashkit_create(hashkit_st *hash); - -.. c:function:: hashkit_st *hashkit_clone(hashkit_st *destination, const hashkit_st *ptr); - -.. c:function:: void hashkit_free(hashkit_st *hash); - -.. c:function:: bool hashkit_is_allocated(const hashkit_st *hash); - ----------- DESCRIPTION ----------- --The hashkit_create() function initializes a hashkit object for use. If ++The :c:func:`hashkit_create()` function initializes a hashkit object for use. If you pass a NULL argument for hash, then the memory for the object is allocated. If you specify a pre-allocated piece of memory, that is initialized for use. --The hashkit_clone() function initializes a hashkit object much like --hashkit_create(), but instead of using default settings it will use ++The :c:func:`hashkit_clone()` function initializes a hashkit object much like ++:c:func:`hashkit_create()`, but instead of using default settings it will use the settings of the ptr hashkit object. --The hashkit_free() frees any resources being consumed by the hashkit --objects that were initialized with hashkit_create() or hashkit_clone(). ++The :c:func:`hashkit_free()` frees any resources being consumed by the hashkit ++objects that were initialized with :c:func:`hashkit_create()` or :c:func:`hashkit_clone()`. --The hashkit_is_allocated() reports where the memory was allocated ++The :c:func:`hashkit_is_allocated()` reports where the memory was allocated for a hashkit object. @@@ -47,11 -58,11 +48,11 @@@ RETURN VALU ------------ --hashkit_create() and hashkit_clone() will return NULL on failure or ++:c:func:`hashkit_create()` and :c:func:`hashkit_clone()` will return NULL on failure or non-NULL on success. --hashkit_is_allocated() returns true if the memory for the hashkit --object was allocated inside of hashkit_create() or hashkit_clone(), ++:c:func:`hashkit_is_allocated()` returns true if the memory for the hashkit ++object was allocated inside of :c:func:`hashkit_create()` or :c:func:`hashkit_clone()`, otherwise it is false and was user-supplied memory. diff --cc docs/index.rst index cef0830d,cef0830d..77b50600 --- a/docs/index.rst +++ b/docs/index.rst @@@ -53,6 -53,6 +53,7 @@@ Advanced Topic memcached_generate_hash_value memcached_memory_allocators memcached_quit ++ libmemcached/memcached_return_t memcached_sasl memcached_server_st memcached_servers diff --cc docs/libmemcached/memcached_return_t.rst index 00000000,00000000..3663c6df new file mode 100644 --- /dev/null +++ b/docs/libmemcached/memcached_return_t.rst @@@ -1,0 -1,0 +1,133 @@@ ++================================ ++Error Codes (memcached_return_t) ++================================ ++ ++-------- ++SYNOPSIS ++-------- ++ ++#include ++ ++.. c:type:: memcached_return_t ++ ++.. c:function:: const char *libmemcached_strerror(libmemcached_return_t rc) ++ ++.. c:function:: bool libmemcached_success(libmemcached_return_t rc) ++ ++.. c:function:: bool libmemcached_failure(libmemcached_return_t rc) ++ ++.. c:function:: bool libmemcache_continue(libmemcached_return_t rc) ++ ++ ++ ++:c:func:`memcached_success()` return true if :c:type:`MEMCACHED_SUCCESS` tested true. ++ ++:c:func:`memcached_failure()` return true if any value other then :c:type:`MEMCACHED_SUCCESS` was provided. ++ ++ ++ ++ ++.. c:type:: MEMCACHED_SUCCESS, ++ ++Success ++ ++.. c:type:: MEMCACHED_FAILURE, ++ ++.. c:type:: MEMCACHED_HOST_LOOKUP_FAILURE, // getaddrinfo() only ++ ++.. c:type:: MEMCACHED_CONNECTION_FAILURE, // DEPRECATED ++ ++.. c:type:: MEMCACHED_CONNECTION_BIND_FAILURE, // DEPRECATED ++ ++.. c:type:: MEMCACHED_WRITE_FAILURE, ++ ++.. c:type:: MEMCACHED_READ_FAILURE, ++ ++.. c:type:: MEMCACHED_UNKNOWN_READ_FAILURE, ++ ++.. c:type:: MEMCACHED_PROTOCOL_ERROR, ++ ++.. c:type:: MEMCACHED_CLIENT_ERROR, ++ ++.. c:type:: MEMCACHED_SERVER_ERROR, ++ ++.. c:type:: MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE, // DEPRECATED ++ ++.. c:type:: MEMCACHED_DATA_EXISTS, ++ ++.. c:type:: MEMCACHED_DATA_DOES_NOT_EXIST, ++ ++.. c:type:: MEMCACHED_NOTSTORED, ++ ++.. c:type:: MEMCACHED_STORED, ++ ++.. c:type:: MEMCACHED_NOTFOUND, ++ ++.. c:type:: MEMCACHED_MEMORY_ALLOCATION_FAILURE, ++ ++.. c:type:: MEMCACHED_PARTIAL_READ, ++ ++.. c:type:: MEMCACHED_SOME_ERRORS, ++ ++.. c:type:: MEMCACHED_NO_SERVERS, ++ ++.. c:type:: MEMCACHED_END, ++ ++.. c:type:: MEMCACHED_DELETED, ++ ++.. c:type:: MEMCACHED_VALUE, ++ ++.. c:type:: MEMCACHED_STAT, ++ ++.. c:type:: MEMCACHED_ITEM, ++ ++.. c:type:: MEMCACHED_ERRNO, ++ ++.. c:type:: MEMCACHED_FAIL_UNIX_SOCKET, // DEPRECATED ++ ++.. c:type:: MEMCACHED_NOT_SUPPORTED, ++ ++.. c:type:: MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */ ++ ++.. c:type:: MEMCACHED_FETCH_NOTFINISHED, ++ ++.. c:type:: MEMCACHED_TIMEOUT, ++ ++Connection to server timed out. ++ ++.. c:type:: MEMCACHED_BUFFERED, ++ ++.. c:type:: MEMCACHED_BAD_KEY_PROVIDED, ++ ++.. c:type:: MEMCACHED_INVALID_HOST_PROTOCOL, ++ ++.. c:type:: MEMCACHED_SERVER_MARKED_DEAD, ++ ++.. c:type:: MEMCACHED_UNKNOWN_STAT_KEY, ++ ++.. c:type:: MEMCACHED_E2BIG, ++ ++.. c:type:: MEMCACHED_INVALID_ARGUMENTS, ++ ++.. c:type:: MEMCACHED_KEY_TOO_BIG, ++ ++.. c:type:: MEMCACHED_AUTH_PROBLEM, ++ ++.. c:type:: MEMCACHED_AUTH_FAILURE, ++ ++.. c:type:: MEMCACHED_AUTH_CONTINUE, ++ ++.. c:type:: MEMCACHED_PARSE_ERROR, ++ ++.. c:type:: MEMCACHED_PARSE_USER_ERROR, ++ ++.. c:type:: MEMCACHED_DEPRECATED, ++ ++.. c:type:: MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ ++ ++-------- ++SEE ALSO ++-------- ++ ++:manpage:`memcached(8)` :manpage:`libmemcached(3)` :manpage:`memcached_client_error()` or :manpage:`memcached_worker_error()` ++ diff --cc docs/memaslap.rst index 02e2ab26,845d613f..3f9e62dd --- a/docs/memaslap.rst +++ b/docs/memaslap.rst @@@ -18,10 -18,10 +18,8 @@@ DESCRIPTIO ----------- - \ **memaslap**\ is a load generation and benchmark tool for memcached(1) - servers. It generates configurable workload such as threads, concurrencies, connections, - run time, overwrite, miss rate, key size, value size, get/set proportion, - expected throughput, and so on. Furthermore, it also testss data -.. c:func:: memaslap - -is a load generation and benchmark tool for memcached(1) ++memaslap is a load generation and benchmark tool for :program:`memcached()` + servers. It generates configurable workload such as threads, concurrencies, connections, run time, overwrite, miss rate, key size, value size, get/set proportion, expected throughput, and so on. Furthermore, it also testss data verification, expire-time verification, UDP, binary protocol, facebook test, replication test, multi-get and reconnection, etc. diff --cc docs/memcached_cas.rst index 9d2188a6,7ba33411..c2138bc8 --- a/docs/memcached_cas.rst +++ b/docs/memcached_cas.rst @@@ -23,33 -23,30 +23,30 @@@ Compile and link with -lmemcache DESCRIPTION ----------- - memcached_cas() overwrites data in the server as long as the "cas" value is - still the same in the server. You can get the cas value of a result by - calling memcached_result_cas() on a memcached_result_st(3) structure. At the point - that this note was written cas is still buggy in memached. Turning on tests - for it in libmemcached(3) is optional. Please see memcached_set() for - information on how to do this. - - memcached_cas_by_key() method behaves in a similar method as the non key - methods. The difference is that it uses the group_key parameter to map - objects to particular servers. - - memcached_cas() is testsed with the \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ - behavior enabled. However, when using these operations with this behavior on, there - are limits to the size of the payload being sent to the server. The reason for - these limits is that the Memcached Server does not allow multi-datagram requests - and the current server implementation sets a datagram size to 1400 bytes. Due - to protocol overhead, the actual limit of the user supplied data is less than - 1400 bytes and depends on the protocol in use as, well as the operation being - executed. When running with the binary protocol, \ `` MEMCACHED_BEHAVIOR_BINARY_PROTOCOL``\ , - the size of the key,value, flags and expiry combined may not exceed 1368 bytes. - When running with the ASCII protocol, the exact limit fluctuates depending on - which function is being executed and whether the function is a cas operation - or not. For non-cas ASCII set operations, there are at least 1335 bytes available - to split among the key, key_prefix, and value; for cas ASCII operations there are - at least 1318 bytes available to split among the key, key_prefix and value. If the - total size of the command, including overhead, exceeds 1400 bytes, a \ ``MEMCACHED_WRITE_FAILURE``\ - will be returned. -:cfunc:`memcached_cas()` overwrites data in the server as long as the "cas" ++:c:func:`memcached_cas()` overwrites data in the server as long as the "cas" + value is still the same in the server. You can get the cas value of a result + by calling :c:func:`memcached_result_cas()` on a memcached_result_st(3) + structure. At the point that this note was written cas is still buggy in memached. Turning on tests for it in libmemcached(3) is optional. Please see + :c:func:`memcached_set()` for information on how to do this. + + :c:func:`memcached_cas_by_key()` method behaves in a similar method as the non + key methods. The difference is that it uses the :c:type:`group_key` parameter + to map objects to particular servers. + + :c:func:`memcached_cas()` is testsed with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior enabled. However, when using these operations with this behavior + on, there are limits to the size of the payload being sent to the server. The + reason for these limits is that the Memcached Server does not allow + multi-datagram requests and the current server implementation sets a datagram + size to 1400 bytes. Due to protocol overhead, the actual limit of the user + supplied data is less than 1400 bytes and depends on the protocol in use as, + well as the operation being executed. When running with the binary protocol, + :c:type:`MEMCACHED_BEHAVIOR_BINARY_PROTOCOL`, the size of the key,value, + flags and expiry combined may not exceed 1368 bytes. When running with the + ASCII protocol, the exact limit fluctuates depending on which function is + being executed and whether the function is a cas operation or not. For + non-cas ASCII set operations, there are at least 1335 bytes available to + split among the key, key_prefix, and value; for cas ASCII operations there + are at least 1318 bytes available to split among the key, key_prefix and value. If the total size of the command, including overhead, exceeds 1400 bytes, a :c:type:`MEMCACHED_WRITE_FAILURE` will be returned. ------ diff --cc docs/memcached_flush.rst index 42453b35,fe251b4a..a5c273de --- a/docs/memcached_flush.rst +++ b/docs/memcached_flush.rst @@@ -24,8 -24,8 +24,8 @@@ DESCRIPTIO ----------- - :c:func::`memcached_flush()` is used to wipe clean the contents of memcached(1) servers. -:c:func:`memcached_flush()` is used to wipe clean the contents of memcached(1) -servers. It will either do this immediately or expire the content based on the ++:c:func::`memcached_flush()` is used to wipe clean the contents of :program:`memcached` servers. +It will either do this immediately or expire the content based on the expiration time passed to the method (a value of zero causes an immediate flush). The operation is not atomic to multiple servers, just atomic to a single server. That is, it will flush the servers in the order that they were @@@ -37,11 -37,12 +37,10 @@@ RETUR ------ - A value of type :c:type:`memcached_return_t` is returned + A value of type :c:type:`memcached_return_t` is returned On success that value will be :c:type:`MEMCACHED_SUCCESS`. -Use :c:func:`memcached_strerror()` to translate this value to a printable -string. - +Use :c:type:`memcached_strerror()` to translate this value to a printable string. - ---- HOME ---- diff --cc docs/memcached_get.rst index 2a87e913,0c8e8819..d3f5806f --- a/docs/memcached_get.rst +++ b/docs/memcached_get.rst @@@ -114,20 -106,13 +106,21 @@@ RETUR All objects returned must be freed by the calling application. - memcached_get() and memcached_fetch() will return NULL on error. You must - look at the value of error to determine what the actual error was. + :c:func:`memcached_get()` and :c:func:`memcached_fetch()` will return NULL on + error. You must look at the value of error to determine what the actual error + was. -:c:type:`MEMCACHED_KEY_TOO_BIG` is set to error whenever -:c:func:`memcached_fetch()` was used and the key was set larger then -:c:type:`MEMCACHED_MAX_KEY`, which was the largest key allowed for the original memcached ascii server. +:c:func:`memcached_fetch_execute()` return :c:type:`MEMCACHED_SUCCESS` if +all keys were successful. :c:type:`MEMCACHED_NOTFOUND` will be return if no +keys at all were found. + +:c:func:`memcached_fetch()` and :c:func:`memcached_fetch_result()` set error +to :c:type:`MEMCACHED_END` upon successful conclusion. +:c:type:`MEMCACHED_NOTFOUND` will be return if no keys at all were found. + - MEMCACHED_KEY_TOO_BIG is set to error whenever memcached_fetch() was used - and the key was set larger then MEMCACHED_MAX_KEY, which was the largest ++:c:type:`MEMCACHED_KEY_TOO_BIG` is set to error whenever :c::func:`memcached_fetch()` was used ++and the key was set larger then :c:type:`MEMCACHED_MAX_KEY`, which was the largest +key allowed for the original memcached ascii server. ---- diff --cc docs/memcached_result_st.rst index dbbbfd20,8bc43e26..295b2229 --- a/docs/memcached_result_st.rst +++ b/docs/memcached_result_st.rst @@@ -41,39 -44,39 +41,39 @@@ DESCRIPTIO ----------- - libmemcached(3) can optionally return a memcached_result_st which acts as a - result object. The result objects have added benefits over the character - pointer returns, in that they are forward compatible with new return items - that future memcached servers may implement (the best current example of - this is the CAS return item). The structures can also be reused, which will - save on calls to malloc(3). It is suggested that you use result objects over - char \* return functions. + libmemcached(3) can optionally return a :c:type:`memcached_result_st` which + acts as a result object. The result objects have added benefits over the + character pointer returns, in that they are forward compatible with new + return items that future memcached servers may implement (the best current + example of this is the CAS return item). The structures can also be reused, + which will save on calls to malloc(3). It is suggested that you use result + objects over char \* return functions. - The structure of memcached_result_st has been encapsulated, you should not - write code to directly access members of the structure. + The structure of :c:type:`memcached_result_st` has been encapsulated, you should + not write code to directly access members of the structure. - memcached_result_create() will either allocate memory for a - memcached_result_st or will initialize a structure passed to it. + :c:func:`memcached_result_create()` will either allocate memory for a + :c:type:`memcached_result_st` or will initialize a structure passed to it. - memcached_result_free() will deallocate any memory attached to the + :c:func:`memcached_result_free()` will deallocate any memory attached to the structure. If the structure was also allocated, it will deallocate it. - memcached_result_key_value() returns the key value associated with the + :c:func:`memcached_result_key_value()` returns the key value associated with the current result object. - memcached_result_key_length() returns the key length associated with the - current result object. + :c:func:`memcached_result_key_length()` returns the key length associated with + the current result object. - memcached_result_value() returns the result value associated with the + :c:func:`memcached_result_value()` returns the result value associated with the current result object. - memcached_result_length() returns the result length associated with the - current result object. + :c:func:`memcached_result_length()` returns the result length associated with + the current result object. - memcached_result_flags() returns the flags associated with the + :c:func:`memcached_result_flags()` returns the flags associated with the current result object. - memcached_result_cas() returns the cas associated with the -:c:cune:`memcached_result_cas()` returns the cas associated with the ++:c:func:`memcached_result_cas()` returns the cas associated with the current result object. This value will only be available if the server tests it. diff --cc docs/memcached_server_st.rst index e7ec65c9,f39c478b..9a8c8fc2 --- a/docs/memcached_server_st.rst +++ b/docs/memcached_server_st.rst @@@ -40,26 -39,21 +40,21 @@@ libmemcached(3) operates on a list of h directly. Functions are provided to modify these structures (and more can be added, just ask!). - :c:func:`memcached_server_list()` is used to provide an array of all defined hosts. - This was incorrectly documented as "requiring free()" up till version 0.39. + :c:func:`memcached_server_list()` is used to provide an array of all defined hosts. This was incorrectly documented as "requiring free()" up till version 0.39. - :c:func:`memcached_server_list_free()` deallocates all memory associated with the array - of memcached_server_st that you passed to it. + :c:func:`memcached_server_list_free()` deallocates all memory associated with the array of :c:type:`memcached_server_st` that you passed to it. :c:func:`memcached_server_list_append()` adds a server to the end of a - memcached_server_st array. On error null will be returned and the - memcached_return_t pointer you passed into the function will be set with the - appropriate error. If the value of port is zero, it is set to the default + :c:type:`memcached_server_st` array. On error null will be returned and the + :c:type:`memcached_return_t` pointer you passed into the function will be set with the appropriate error. If the value of port is zero, it is set to the default port of a memcached server. -DEPRECATED :c:func:`memcached_servers_parse()`, please see :manpage:`memcached(3)` +DEPRECATED :c:func:`memcached_servers_parse()`, please see :c:func:`memcached()` - :c:func:`memcached_server_error()` can be used to look at the text of the last error - message sent by the server to to the client. + :c:func:`memcached_server_error()` can be used to look at the text of the last error message sent by the server to to the client. - Before version 0.39 these functions used a memcache_server_st \*. In 0.39 - memcached_server_st \* was aliased to :c:type:`memcached_server_list_st`. This was - done for a style reason/to help clean up some concepts in the code. + Before version 0.39 theses functions used a memcache_server_st \*. In 0.39 + memcached_server_st \* was aliased to :c:type:`memcached_server_list_st`. This was done for a style reason to help clean up some concepts in the code. ------ diff --cc docs/memcached_servers.rst index e280071d,7331dbdd..72da2764 --- a/docs/memcached_servers.rst +++ b/docs/memcached_servers.rst @@@ -35,55 -35,48 +35,46 @@@ DESCRIPTIO ----------- -libmemcached(3) performs operations on a list of hosts. The order of these -hosts determine routing to keys. Functions are provided to add keys to +:doc:`libmemcached` performs operations on a list of hosts. The order of +these hosts determine routing to keys. Functions are provided to add keys to memcached_st structures. To manipulate lists of servers see - :c:type:`memcached_server_st()`. - - :c:func:`memcached_server_count()` provides you a count of the current - number of servers being used by a :c:type:`memcached_st` structure. - - :c:func:`memcached_server_add()` pushes a single TCP server into the - :c:type:`memcached_st` structure. This server will be placed at the end. - Duplicate servers are allowed, so duplication is not checked. Executing this - function with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set will - result in a :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. - - :c:func:`memcached_server_add_udp()` pushes a single UDP server into the - :c:type:`memcached_st` structure. This server will be placed at the end. - Duplicate servers are allowed, so duplication is not checked. Executing this - function with out setting the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior - will result in a :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. - - :c:func:`memcached_server_add_unix_socket()` pushes a single UNIX socket - into the :c:type:`memcached_st` structure. This UNIX socket will be placed - at the end. Duplicate servers are allowed, so duplication is not checked. - The length of the filename must be one character less then - :c:macro:`MEMCACHED_MAX_HOST_LENGTH`. - - :c:func:`memcached_server_push()` pushes an array of - :c:type:`memcached_server_st` into the :c:type:`memcached_st` structure. - These servers will be placed at the end. Duplicate servers are allowed, so - duplication is not checked. A copy is made of structure so the list provided - (and any operations on the list) are not saved. - - :c:func:`memcached_server_by_key()` allows you to provide a key and retrieve - the server which would be used for assignment. This structure is cloned from - its original structure and must be freed. If NULL is returned you should - consult \*error. The returning structure should be freed with + memcached_server_st(3). + + :c:func:`memcached_server_count()` provides you a count of the current number of + servers being used by a :c:type:`memcached_st` structure. + + :c:func:`memcached_server_add()` pushes a single TCP server into the :c:type:`memcached_st` structure. This server will be placed at the end. Duplicate servers - are allowed, so duplication is not checked. Executing this function with the -:c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set will result in a -:c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. ++ are allowed, so duplication is not checked. Executing this function with the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set will result in a :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. + + :c:func:`memcached_server_add_udp()` pushes a single UDP server into the :c:type:`memcached_st` structure. This server will be placed at the end. Duplicate + servers are allowed, so duplication is not checked. Executing this function with out setting the :c:type:`MEMCACHED_BEHAVIOR_USE_UDP` behavior will result in a + :c:type:`MEMCACHED_INVALID_HOST_PROTOCOL`. + + :c:func:`memcached_server_add_unix_socket()` pushes a single UNIX socket into the :c:type:`memcached_st` structure. This UNIX socket will be placed at the end. + Duplicate servers are allowed, so duplication is not checked. The length + of the filename must be one character less than :c:type:`MEMCACHED_MAX_HOST_LENGTH`. + + :c:func:`memcached_server_push()` pushes an array of :c:type:`memcached_server_st` into the :c:type:`memcached_st` structure. These servers will be placed at + the end. Duplicate servers are allowed, so duplication is not checked. A + copy is made of structure so the list provided (and any operations on + the list) are not saved. + + :c:func:`memcached_server_by_key()` allows you to provide a key and retrieve the + server which would be used for assignment. This structure is cloned + from its original structure and must be freed. If NULL is returned you + should consult \*error. The returning structure should be freed with :c:func:`memcached_server_free()`. - :c:func:`memcached_server_get_last_disconnect()` returns a pointer to the - last server for which there was a connection problem. It does not mean this - particular server is currently dead but if the library is reporting a server + :c:func:`memcached_server_get_last_disconnect()` returns a pointer to the last + server for which there was a connection problem. It does not mean this + particular server is currently dead but if the library is reporting a server is, the returned server is a very good candidate. - :c:func:`memcached_server_cursor()` takes a memcached_st and loops through - the list of hosts currently in the cursor calling the list of callback - functions provided. You can optionally pass in a value via context which - will be provided to each callback function. An error return from any - callback will terminate the loop. :c:func:`memcached_server_cursor()` is - passed the original caller memcached_st in its current state. + :c:func:`memcached_server_cursor()` takes a memcached_st and loops through the + list of hosts currently in the cursor calling the list of callback + functions provided. You can optionally pass in a value via + context which will be provided to each callback function. An error + return from any callback will terminate the loop. :c:func:`memcached_server_cursor()` is passed the original caller :c:type:`memcached_st` in its current state. ------ diff --cc docs/memcached_version.rst index ae983f4c,51a5a26f..6d81f5ea --- a/docs/memcached_version.rst +++ b/docs/memcached_version.rst @@@ -36,13 -33,15 +33,15 @@@ RETUR ------ - A string with the version of libmemcached driver is returned from - memcached_lib_version() -:c:function:`memcached_lib_version()` returns a string with the version of the libmemcached driver. ++:c:func:`memcached_lib_version()` returns a string with the version of the libmemcached driver. - A value of type \ ``memcached_return_t``\ is returned from memcached_version() - On success that value will be \ ``MEMCACHED_SUCCESS``\ . If called with the - \ ``MEMCACHED_BEHAVIOR_USE_UDP``\ behavior set, the value \ ``MEMCACHED_NOT_SUPPORTED``\ - will be returned. Use memcached_strerror() to translate this value to + A value of :c:type:`memcached_return_t` is returned from :c:func:'memcached_version()' + + On success that value will be :c:type:`MEMCACHED_SUCCESS`. + + If called with the :c:func:`MEMCACHED_BEHAVIOR_USE_UDP` behavior set, the value :c:type:`MEMCACHED_NOT_SUPPORTED` will be returned. + + Use :c:func:`memcached_strerror()` to translate this value to a printable string. diff --cc libmemcached/hosts.cc index 7dfd9d71,10af05c8..32bf8ce3 --- a/libmemcached/hosts.cc +++ b/libmemcached/hosts.cc @@@ -186,7 -186,7 +186,7 @@@ static memcached_return_t update_contin memcached_continuum_item_st *new_ptr; new_ptr= static_cast(libmemcached_realloc(ptr, ptr->ketama.continuum, -- sizeof(memcached_continuum_item_st) * (live_servers + MEMCACHED_CONTINUUM_ADDITION) * points_per_server)); ++ sizeof(memcached_continuum_item_st) * (live_servers + MEMCACHED_CONTINUUM_ADDITION) * points_per_server)); if (new_ptr == 0) return MEMCACHED_MEMORY_ALLOCATION_FAILURE;