diff options
Diffstat (limited to 'doc/libskarnet.html')
-rw-r--r-- | doc/libskarnet.html | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/doc/libskarnet.html b/doc/libskarnet.html new file mode 100644 index 0000000..9c29514 --- /dev/null +++ b/doc/libskarnet.html @@ -0,0 +1,100 @@ +<html> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <meta http-equiv="Content-Language" content="en" /> + <title>skalibs: the skarnet library interface</title> + <meta name="Description" content="skalibs: the skarnet library interface" /> + <meta name="Keywords" content="skalibs skarnet libskarnet library interface" /> + <!-- <link rel="stylesheet" type="text/css" href="http://skarnet.org/default.css" /> --> + </head> +<body> + +<p> +<a href="index.html">skalibs</a><br /> +<a href="http://skarnet.org/software/">Software</a><br /> +<a href="http://skarnet.org/">skarnet.org</a> +</p> + +<h1> The <tt>skarnet</tt> library interface </h1> + +<p> + <em>libskarnet</em> is the library exported by skalibs; both a static +library and a shared library (if they are supported on your system) are +available. Every skarnet.org binary needs this library. +</p> + +<h2> Compiling </h2> + +<ul> + <li> Make sure the place you installed the skalibs header files in is in +your header directory list; the default is <tt>/usr/include</tt>, +which is normally browsed by default by your C preprocessor. </li> + <li> Use <tt>#include <skalibs/<em>foobar.h</em>></tt> where +<em>foobar.h</em> is the header you need. + <ul> + <li> The <tt>skalibs/skalibs.h</tt> header is the general entry +point that will declare the near-entirety of the functions, variables +and constants in skalibs. Including this header +in your source files whenever you need a skalibs function will work; +however, it is rather heavy, and you might want to include lower-level +headers instead to reduce compilation time. </li> + </ul> + </li> +</ul> + +<h2> Linking </h2> + +<ul> + <li> For static linking: + add <tt>/usr/lib/skalibs</tt>, or wherever you installed +your .a files, to your library directory list. </li> + <li> For dynamic linking: + make sure the place you installed the libskarnet.so shared library in +is in your shared library directory list; the default is <tt>/lib</tt>, +which is normally browsed by default by your build-time and run-time linker. +If you are using another place than the default (for instance, if you are +using the slashpackage convention), make sure to +edit your <tt>ld.so.conf</tt> file so your linker can find this place, and +to run <tt>ldconfig</tt> if needed. </li> + <li> Take note of the place where your sysdeps directory has been +installed: by default, it's <tt>/usr/lib/skalibs/sysdeps</tt>. Let's call +it <tt>$sysdeps</tt>. </li> + <li> Link with <tt>-lskarnet</tt>. If you are using socket functions, you +will also need to link with <tt>-l$sysdeps/socket.lib</tt>. If you are using +time functions such as <tt>tain_now()</tt>, you will also need to link with +<tt>-l$sysdeps/tainnow.lib</tt>. </li> +</ul> + +<p> + The <em>skarnet</em> library as a whole is big (833k for libskarnet.a and +257k for libskarnet.so.2.0.0.0 on x86_64), but the utmost care has been +given to separate functions so that linkers never pull in any more than they +need. Linking against the static version of libskarnet actually produces +very small executables, and if your libc is suited for that, since skalibs +only uses very basic libc interfaces, it is very possible to produce small +static binaries - in many cases, a static program written with skalibs APIs +will be an order of magnitude smaller than the equivalent program written +using libc's or other utility libraries' APIs. +</p> + +<h2> Programming </h2> + +<p> + The skalibs source code is divided into several subdirectories, each +containing a logical unit of code implementing independent functions. +</p> + +<ul> +<li><a href="libstddjb/">libstddjb</a>: basic C API for system programming </li> +<li><a href="libdatastruct/">libdatastruct</a>: efficient C implementation of +basic data structures like sets or trees</li> +<li><a href="libstdcrypto/">libstdcrypto</a>: a few crypto primitives </li> +<li><a href="librandom/">librandom</a>: cryptographically secure random or +pseudorandom number generation </li> +<li><a href="libunixonacid/">libunixonacid</a>: more advanced C/Unix APIs, +mainly for safe asynchronous interprocess communication </li> +<li><a href="libbiguint/">libbiguint</a>: large integer arithmetic</li> +</ul> + +</body> +</html> |