Commit 00ff09a7 authored by Marek Vavruša's avatar Marek Vavruša

Merge branch 'doc_modules'

parents 68812887 45c1c0d8
......@@ -8,9 +8,12 @@ CASE_SENSE_NAMES = NO
INPUT = ../lib
FILE_PATTERNS = *.h
QUIET = YES
RECURSIVE = YES
JAVADOC_AUTOBRIEF = YES
AUTOLINK_SUPPORT = YES
XML_OUTPUT = doxyxml
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
OPTIMIZE_OUTPUT_FOR_C = YES
ENABLE_PREPROCESSING = YES
PREDEFINED = NDEBUG
......@@ -8,7 +8,7 @@ if os.environ.get('READTHEDOCS', None) == 'True':
subprocess.call('doxygen')
# Add any Sphinx extension module names here, as strings.
extensions = ['sphinx.ext.todo', 'breathe']
extensions = ['sphinx.ext.todo', 'sphinx.ext.viewcode', 'breathe']
# Breathe configuration
breathe_projects = { "libkresolve": "doxyxml" }
......
......@@ -11,6 +11,7 @@ Modular architecture of the library keeps the core tiny and efficient, and provi
build
daemon
lib
modules
Indices and tables
......
.. _lib_index:
.. include:: ../lib/README.rst
Library layout
......@@ -10,27 +12,39 @@ you an idea about the API and the library layout.
Name resolution
~~~~~~~~~~~~~~~
.. _lib_rplan:
Resolution plan
~~~~~~~~~~~~~~~
.. _lib_cache:
Cache
~~~~~
.. _lib_nameservers:
Nameservers
~~~~~~~~~~~
.. _lib_modules:
Modules
~~~~~~~
Utilities
~~~~~~~~~
.. _lib_api:
API reference
-------------
.. doxygengroup:: resolution
:project: libkresolve
.. _lib_api_rplan:
.. doxygengroup:: rplan
:project: libkresolve
......
.. include:: ../modules/README.rst
Implemented modules
-------------------
.. include:: ../modules/hints/README.rst
.. include:: ../modules/cachectl/README.rst
......@@ -16,7 +16,7 @@
#pragma once
/** \addtogroup modules
/** \addtogroup rplan
* @{
*/
......@@ -37,8 +37,8 @@ struct kr_layer_param {
knot_pkt_t *answer;
};
/** \internal Print a debug message related to resolution. */
#ifndef NDEBUG
/** @internal Print a debug message related to resolution. */
#define QRDEBUG(query, cls, fmt, ...) do { \
unsigned _ind = 0; \
for (struct kr_query *q = (query); q; q = q->parent, _ind += 2); \
......
......@@ -32,3 +32,6 @@ int rr_update_parent(const knot_rrset_t *rr, unsigned hint, struct kr_layer_para
* @note When \a hint is KNOT_PF_FREE, RR is treated as a copy and answer takes its ownership.
*/
int rr_update_answer(const knot_rrset_t *rr, unsigned hint, struct kr_layer_param *param);
/* Processing module implementation. */
const knot_layer_api_t *iterate_layer(void);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Cache control
~~~~~~~~~~~~~
Module providing an interface to cache database, for inspection, manipulation and purging.
Properties
..........
``get_size``
Return number of cached records.
:Input: N/A
:Output: ``{ size: int }``
``prune``
Prune expired/invalid records.
:Input: N/A
:Output: ``{ pruned: int }``
``clear``
Clear all cache records.
:Input: N/A
:Output: ``{ result: bool }``
......@@ -39,7 +39,7 @@
* Return number of cached records.
*
* Input: N/A
* Output: { result: [int] size }
* Output: { size: int }
*
*/
static char* get_size(struct kr_context *ctx, struct kr_module *module, const char *args)
......@@ -51,7 +51,7 @@ static char* get_size(struct kr_context *ctx, struct kr_module *module, const ch
namedb_txn_t txn;
int ret = kr_cache_txn_begin(ctx->cache, &txn, NAMEDB_RDONLY);
if (ret == 0) {
asprintf(&result, "{ \"result\": %d }", storage->count(&txn));
asprintf(&result, "{ \"size\": %d }", storage->count(&txn));
kr_cache_txn_abort(&txn);
}
......@@ -80,7 +80,7 @@ static int is_expired(struct kr_cache_rrset *rr, uint32_t drift)
* Prune expired/invalid records.
*
* Input: N/A
* Output: { result: [int] nr_pruned }
* Output: { pruned: int }
*
*/
static char* prune(struct kr_context *ctx, struct kr_module *module, const char *args)
......@@ -116,9 +116,9 @@ static char* prune(struct kr_context *ctx, struct kr_module *module, const char
/* Commit and format result. */
char *result = NULL;
if (kr_cache_txn_commit(&txn) != 0) {
asprintf(&result, "{ \"result\": %d, \"error\": \"%s\" }", pruned, knot_strerror(ret));
asprintf(&result, "{ \"pruned\": %d, \"error\": \"%s\" }", pruned, knot_strerror(ret));
} else {
asprintf(&result, "{ \"result\": %d }", pruned);
asprintf(&result, "{ \"pruned\": %d }", pruned);
}
return result;
......@@ -128,7 +128,7 @@ static char* prune(struct kr_context *ctx, struct kr_module *module, const char
* Clear all records.
*
* Input: N/A
* Output: { result: [bool] success }
* Output: { result: bool }
*
*/
static char* clear(struct kr_context *ctx, struct kr_module *module, const char *args)
......
Static hints
~~~~~~~~~~~~
This is a module providing static hints from ``/etc/hosts``, document me.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment