Commit 1aa46744 authored by Geoff Simmons's avatar Geoff Simmons

Expand the documentation.

parent 7042f584
Pipeline #219 skipped
CONTRIBUTING
============
To contribute code or documentation, submit a pull request at the
`source repository website
<https://code.uplex.de/uplex-varnish/libvmod-blob>`_.
If you have a problem or discover a bug, you can post an `issue
<https://code.uplex.de/uplex-varnish/libvmod-blob/issues>`_ at
the website. You can also write to <varnish-support@uplex.de>.
For developers
--------------
The build specifies C99 conformance, all compiler warnings turned on,
and all warnings considered errors (compiler options ``-std=c99
-Werror -Wall -Wextra``).
The VMOD has been tested with both the gcc and clang compilers, and
should always compile and test successfully with both of them.
By default, ``CFLAGS`` is set to ``-g -O2``, so that symbols are
included in the shared library, and optimization is at level
``O2``. To change or disable these options, set ``CFLAGS`` explicitly
before calling ``make`` (it may be set to the empty string).
For development/debugging cycles, the ``configure`` option
``--enable-debugging`` is recommended (off by default). This will turn
off optimizations and function inlining, so that a debugger will step
through the code as expected.
INSTALLATION
============
The VMOD is built against a Varnish installation, and the autotools
use ``pkg-config(1)`` to locate the necessary header files and other
resources. This sequence will install the VMOD::
> ./autogen.sh # for builds from the git repo
> ./configure
> make
> make check # to run unit tests in src/tests/*.vtc
> sudo make install
The configure step requires code from the Autoconf Archive collection
of m4 macros. If you encounter difficulties in the ``configure`` step,
make sure that you have the archive installed (typically as the
package ``autoconf-archive`` on many distributions).
To configure the build for libgcrypt, ``configure.ac`` uses the macro
``AM_PATH_LIBGCRYPT`` from the Autoconf Archive, which in turn invokes
the ``libgcrypt-config`` utility. The macro specifies a minimum
library and API version number that is required, currently libgcrypt
version 1.6.3 and API version 1. If you want to build against a
version of libgcrypt at a non-standard location (that is, whose path
that differs from the one described by ``libgcrypt-config``), then use
the ``configure`` option
``--with-libgcrypt-prefix=$LIBGCRYPT_PREFIX``, where
``$LIBGCRYPT_PREFIX`` is the alternative path.
The ``make check`` step requires that the VMOD blobcode is installed
for the Varnish instance against which the build is executed.
If you have installed Varnish in a non-standard directory, call
``autogen.sh`` and ``configure`` with the ``PKG_CONFIG_PATH``
environment variable pointing to the appropriate path. For example,
when varnishd configure was called with ``--prefix=$PREFIX``, use::
> PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
> export PKG_CONFIG_PATH
By default, the vmod ``configure`` script installs the vmod in
the same directory as Varnish, determined via ``pkg-config(1)``. The
vmod installation directory can be overridden by passing the
``VMOD_DIR`` variable to ``configure``.
Other files such as the man-page are installed in the locations
determined by ``configure``, which inherits its default ``--prefix``
setting from Varnish.
......@@ -24,6 +24,26 @@ SYNOPSIS
import blob [from "path"] ;
::
BOOL blob.same(BLOB, BLOB)
BOOL blob.equal(BLOB, BLOB)
INT blob.length(BLOB)
INT blob.integer(BLOB [, ENUM padding])
STRING blob.version()
DESCRIPTION
===========
This Varnish Module (VMOD) provides a number of utility functions for
use with the data type BLOB, which denotes an arbitrary region of
memory.
BLOBs are not created by any part of native VCL, and can only be
created by other VMODs, so it is necessary to use this VMOD together
with another one that does so (such as VMOD ``blobcode`` for
binary-to-text encodings, see `SEE ALSO`_).
CONTENTS
========
......@@ -112,6 +132,21 @@ Example::
std.log("Using VMOD blob version " + blob.version());
INSTALLATION
============
See `INSTALL.rst <INSTALL.rst>`_ in the source repository.
SEE ALSO
========
* varnishd(1)
* vcl(7)
* source repository: https://code.uplex.de/uplex-varnish/libvmod-gcrypt
* VMOD blobcode: https://code.uplex.de/uplex-varnish/libvmod-blobcode
* developer contact: <varnish-support@uplex.de>, and at the source
repository site
COPYRIGHT
=========
......
......@@ -9,6 +9,26 @@
$Module blob 3 basic operations for the VCL blob type
::
BOOL blob.same(BLOB, BLOB)
BOOL blob.equal(BLOB, BLOB)
INT blob.length(BLOB)
INT blob.integer(BLOB [, ENUM padding])
STRING blob.version()
DESCRIPTION
===========
This Varnish Module (VMOD) provides a number of utility functions for
use with the data type BLOB, which denotes an arbitrary region of
memory.
BLOBs are not created by any part of native VCL, and can only be
created by other VMODs, so it is necessary to use this VMOD together
with another one that does so (such as VMOD ``blobcode`` for
binary-to-text encodings, see `SEE ALSO`_).
$Function BOOL same(BLOB, BLOB)
Returns true if and only if the two BLOB arguments are the same
......@@ -52,3 +72,18 @@ Returns the version string for this VMOD.
Example::
std.log("Using VMOD blob version " + blob.version());
INSTALLATION
============
See `INSTALL.rst <INSTALL.rst>`_ in the source repository.
SEE ALSO
========
* varnishd(1)
* vcl(7)
* source repository: https://code.uplex.de/uplex-varnish/libvmod-gcrypt
* VMOD blobcode: https://code.uplex.de/uplex-varnish/libvmod-blobcode
* developer contact: <varnish-support@uplex.de>, and at the source
repository site
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