The tree contains various changes to make the beta 1 release possible.
Changed all of the Robodoc header documentation to comply with the
latest version of the Robodoc.
autodist.log
makedist.log
Makefile
+Makefile.in
Makefile.defines
Makefile.defines_int
acconfig.h
stamp-h*.in
*.o
*.lo
-*.am
-*.in
+TAGS
Quick Installation
==================
- To configure and compile SILC package give the commands:
+ To configure and compile SILC Runtime Toolkit give the commands:
./configure
- make (or gmake)
+ make
make install
- This will install the SILC binaries and configuration files into the
-/usr/local/silc/ directory. System wide configuration files are installed
-into the /etc/silc/ directory.
-
-You may need to add the /usr/local/silc path to your PATH environment
-variable after the installation.
-
Configuration Options
=====================
few options that you might want to use. Please refer to the rest of this
file for more generic installation instructions.
-`--with-gmp[=DIR]'
-
- If you wish to use GMP library for arbitrary precision arithmetic
-library instead of using the MPI library included in the package, you can
-give the --with-gmp[=DIR] option to the `configure'. The DIR is the upper
-path in your system which contains lib/ and include/ for GMP library.
- Note that MPI is the prefered arbitrary precision arithmetic library and
-GMP can be used as a fall-back if you have problems with the MPI library
-included within this package.
-
`--with-iconv[=DIR]'
If your system doesn't provide iconv() function in its native libraries
option to the `configure' script. This will assure that assembler
optimized code is not compiled in.
-`--enabled-shared'
-
- If you wish to compile and install shared libraries then enable this
-option. By default all libraries are compiled as static libraries.
-
`--enable-debug'
If you would like to enable the debugging for the compiled programs
However, if it fails, but you still want to compile in the IPv6 support
you can give --enable-ipv6 option to force the IPv6 support.
+`--disable-cpu-optimizations'
+
+ By default the configure script will attempt to detect the type of your
+CPU and enable any features specific to your CPU that could optimize the
+performance of the Toolkit. If you are creating binary package that should
+work on any CPU (and not only your CPU) you should diable these
+optimizations. If you compile it for yourself only, keeping the
+optimizations enabled is recommended.
+
+
Basic Installation
==================
doc
EXTRA_DIST = \
+ srt.m4 \
+ srt.spec \
silcdefs.h.in \
symbian \
CHANGES CREDITS
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2001 - 2005 Pekka Riikonen
+# Copyright (C) 2001 - 2005, 2008 Pekka Riikonen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# All packages in the SILC source tree that include the Makefile.defines.in
# must also include the following two lines in their configure.in file.
#
-# INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
+# INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
# AC_SUBST(INCLUDE_DEFINES_INT)
#
# (See the Makefile.defines_int.pre for all different definitions but DO NOT
-I$(silc_top_srcdir) $(SILC_LIB_INCLUDES) \
-I$(silc_top_srcdir)/includes \
-I$(silc_top_srcdir)/doc
-
-#
-#includes-install: Makefile
-# for i in $(include_HEADERS); do s=$(srcdir)/$$i;
-#d=$(silc_top_srcdir)/includes/$$i; \
-# ln $$s $$d 2>/dev/null || (rm -f $$d; cp -p $$s $$d;); \
-# done;
-#
-#all-local: includes-install
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2000 - 2007 Pekka Riikonen
+# Copyright (C) 2000 - 2008 Pekka Riikonen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
helpdir = $(DESTDIR)$(silc_helpdir)
docdir = $(DESTDIR)$(silc_docdir)
mandir = $(DESTDIR)@mandir@
-#ifdef SILC_DIST_SERVER
-silc_logsdir=@LOGSDIR@
-logsdir = $(DESTDIR)$(silc_logsdir)
-#endif SILC_DIST_SERVER
fi
+##
+## Native WIN32 compilation under cygwin
+##
+AC_MSG_CHECKING(whether to compile native WIN32 code)
+AC_ARG_WITH(win32,
+ [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
+ win32_support=true
+ CFLAGS="-mno-cygwin $CFLAGS"
+ LIBS="$LIBS -lwsock32"
+ ],
+ [
+ AC_MSG_RESULT(no)
+ win32_support=false
+ ])
+AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
+
+
##
## Outputs and substitutions
##
AC_SUBST(__SILC_HAVE_PTHREAD)
AC_SUBST(__RUNTIME_PACKAGE_VERSION)
-# Native Windows support (disabled by default)
-AM_CONDITIONAL(SILC_WIN32, test xfalse = xtrue)
-
# Native Symbian OS support (disabled by default)
AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
AC_SUBST(INCLUDE_DEFINES_INT)
+DATE=`date`
+AC_SUBST(DATE)
+
#
# Makefile outputs
AC_CONFIG_FILES(
Makefile
doc/Makefile
+doc/runtime.in/index.html
Makefile.defines
Makefile.defines_int
includes/Makefile
-includes/silcversion.h
-includes/silc.h
apps/Makefile
win32/Makefile
)
-The SILC Toolkit distribution is dual-licensed distribution. The
+The SILC Runtime Toolkit distribution is dual-licensed distribution. The
following licenses govern this distribution, and you are free to choose
either one of the licenses:
NOTE: The files under the subdirectory apps/ are only GNU GPL licensed
example application code. They are not compiled by default in SILC
-Toolkit, and not delivered into the any compiled binary or library. They
-are not dual-licensed code.
+Runtime Toolkit, and not delivered into the any compiled binary or
+library. They are not dual-licensed code.
Always verify the license from the file you are using.
release=$5
if test -z $release; then
- release="0.fc7"
+ release="0.fc8"
fi
sed -e "s/SILC_VERSION/$dist_version/" -e "s/SILC_RELEASE/$release/" \
- silc-toolkit.spec.in > silc-toolkit.spec
+ srt.spec.in > srt.spec
./configure
cd doc
-make dist-hook
-rm -rf toolkit
make toolkit-ref-html
-cp ../lib/doc/*.gif toolkit
cd ..
+++ /dev/null
-Makefile
-Makefile.in
-Makefile.am
-example_silcd.conf
-*.txt
#
# Author: Pekka Riikonen <priikone@silcnet.org>
#
-# Copyright (C) 2000 - 2007 Pekka Riikonen
+# Copyright (C) 2000 - 2008 Pekka Riikonen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-#ifdef SILC_DIST_TOOLKIT
-all:
- touch draft-riikonen-silc-spec-09.txt
- touch draft-riikonen-silc-pp-09.txt
- touch draft-riikonen-silc-ke-auth-09.txt
- touch draft-riikonen-silc-commands-07.txt
- touch draft-riikonen-silc-flags-payloads-04.txt
- touch draft-riikonen-silc-multimedia-session-00.txt
- touch draft-riikonen-presence-attrs-04.txt
-
-makerfc = $(SILC_TOP_SRCDIR)/scripts/makerfc
-
toolkit-ref-html:
- -@if test -f $(SILC_TOP_SRCDIR)/util/robodoc/Source/robodoc ; then \
- echo Generating Toolkit Reference Manual ; \
- rm -rf toolkit ; mkdir toolkit ; cd ../scripts/silcdoc ; \
- ./silcdoc HTML ../../lib/ $(SILC_TOP_SRCDIR)/doc/toolkit \
- $(SILC_TOP_SRCDIR)/util/robodoc/Source/robodoc ; \
- else \
- echo ROBODoc is not compiled! Cannot generate documentation! ; \
- fi
+ rm -rf runtime
+ mkdir runtime
+ cp runtime.in/* runtime/
+ cd runtime && robodoc --rc runtime.rc
toolkit-ref-pdf:
- -@if test -f $(SILC_TOP_SRCDIR)/util/robodoc/Source/robodoc ; then \
- echo Generating Toolkit Reference Manual ; \
- cd ../scripts/silcdoc ; \
- ./silcdoc PS ../../lib/ $(SILC_TOP_SRCDIR)/doc/toolkit.ps \
- $(SILC_TOP_SRCDIR)/util/robodoc/Source/robodoc ; \
- ps2pdf $(SILC_TOP_SRCDIR)/doc/toolkit.ps $(SILC_TOP_SRCDIR)/doc/toolkit.pdf; \
- rm -rf $(SILC_TOP_SRCDIR)/doc/toolkit.ps; \
- else \
- echo ROBODoc is not compiled! Cannot generate documentation! ; \
- fi
-
-dist-hook:
- touch draft-riikonen-silc-spec-09.txt
- touch draft-riikonen-silc-pp-09.txt
- touch draft-riikonen-silc-ke-auth-09.txt
- touch draft-riikonen-silc-commands-07.txt
- touch draft-riikonen-silc-flags-payloads-04.txt
- touch draft-riikonen-silc-multimedia-session-00.txt
- touch draft-riikonen-presence-attrs-04.txt
- $(makerfc) draft-riikonen-silc-spec-09.nroff \
- draft-riikonen-silc-spec-09.txt
- $(makerfc) draft-riikonen-silc-pp-09.nroff \
- draft-riikonen-silc-pp-09.txt
- $(makerfc) draft-riikonen-silc-ke-auth-09.nroff \
- draft-riikonen-silc-ke-auth-09.txt
- $(makerfc) draft-riikonen-silc-commands-07.nroff \
- draft-riikonen-silc-commands-07.txt
- $(makerfc) draft-riikonen-silc-flags-payloads-04.nroff \
- draft-riikonen-silc-flags-payloads-04.txt
- $(makerfc) draft-riikonen-silc-multimedia-session-00.nroff \
- draft-riikonen-silc-multimedia-session-00.txt
- $(makerfc) draft-riikonen-presence-attrs-04.nroff \
- draft-riikonen-presence-attrs-04.txt
-
-#else !SILC_DIST_TOOLKIT
-dist-hook:
- $(SILC_TOP_SRCDIR)/scripts/manpages.pl
-#endif SILC_DIST_TOOLKIT
doc-install:
-mkdir -p $(docdir)
-#ifdef SILC_DIST_TOOLKIT
+ -mkdir -p $(docdir)/runtime
-$(INSTALL_DATA) $(top_srcdir)/doc/CodingStyle $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/GPL $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/BSD $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/doc/*.txt $(docdir)/
-#endif SILC_DIST_TOOLKIT
- -$(INSTALL_DATA) $(top_srcdir)/doc/FAQ $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/COPYING $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/CHANGES $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/CREDITS $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/README* $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/INSTALL $(docdir)/
- -$(INSTALL_DATA) $(top_srcdir)/TODO $(docdir)/
+ -$(INSTALL_DATA) $(top_srcdir)/doc/runtime/* $(docdir)/runtime
-install-data-hook: \
+install-data-hook: \
doc-install
-EXTRA_DIST = \
-#ifdef SILC_DIST_CLIENT
- silc.1 \
-#endif SILC_DIST_CLIENT
-#ifdef SILC_DIST_SERVER
- examples silcd.8 silcd.conf.5 \
- example_silcd.conf \
- silcalgs.conf \
-#endif SILC_DIST_SERVER
-#ifdef SILC_DIST_TOOLKIT
- toolkit \
- CodingStyle \
- draft-riikonen*.txt \
- silcalgs.conf \
-#endif SILC_DIST_TOOLKIT
- FAQ
+clean:
+ rm -rf runtime
+
+EXTRA_DIST = runtime CodingStyle
include $(top_srcdir)/Makefile.defines.in
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
+<link rel="stylesheet" href="./runtime.css" type="text/css" />
+<title>SILC Runtime Toolkit</title>
+</head>
+<body>
+
+<div id="logo">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+<div id="contentwrapper">
+<div id="navigation">
+</div> <!-- navigation -->
+<div id="content">
+
+<big><b>Building the Toolkit</b></big>
+
+<br /> <br />
+SILC Runtime Toolkit works on various platforms, such as on several Unix
+systems and on Windows. Building of the Toolkit on some platform may
+differ from the other. This document describes how to build the Toolkit
+from the sources, to create linkable libraries and binaries, on all
+platforms the Toolkit support.
+
+<br /> <br />
+The building instructions for all platforms are also included in the Toolkit
+package. Please refer to the INSTALL file for general building instructions
+for Unix systems, README.WIN32 for building on Windows systems, and
+README.MACOSX for building on Mac OS X.
+
+<br /> <br />
+<li><a href="#unix">Building on Unix & Linux</a><br />
+<li><a href="#windows">Building on Windows</a><br />
+<li><a href="#macosx">Building on Mac OS X</a>
+<li><a href="#symbian">Building on Symbian OS</a>
+
+<br /> <br /> <br />
+<b><a name="unix"></a>Building on Unix & Linux</b>
+
+<br /> <br />
+On Unix systems both statically and dynamically linkable libraries are
+built by default.
+
+<br /> <br />
+To build Toolkit on Unix systems, give commands:
+
+<br /> <br />
+<tt>
+./configure<br />
+make
+</tt>
+
+<br /> <br />
+On some systems you may need to give "gmake" command instead of "make". The
+./configure can take several options as arguments. To see them all give
+command:
+
+<br /> <br />
+<tt>./configure --help</tt>
+
+<br /> <br />
+The most important configuration options you may consider to use are:
+
+<br /> <br />
+<tt>--enable-debug</tt>
+
+<br /> <br />
+If you would like to enable the debugging for the compiled binaries
+you can give this option to the `configure'. It is recommended to use
+this option when you are doing development with Toolkit. It is helpful
+to enable run-time debugging.
+
+<br /> <br />
+<tt>--with-iconv[=DIR]</tt>
+
+<br /> <br />
+If your system doesn't provide iconv() function in its native libraries
+(usually libc) or if this function is broken (e.g. older Solaris systems),
+you may want to use libiconv instead. The DIR is the upper path in your
+system which contains lib/ and include/ for libiconv (e.g. /usr/local).
+
+<br /> <br />
+<tt>--without-pthreads</tt>
+
+<br /> <br />
+If you do not want to compile the programs with POSIX multi-threads support
+you can give --without-pthreads option. This will disable the SILC Thread
+API and SILC Mutex API. Furthermore if SILC Thread API is used when this
+option is used, the routines work, but do not work in threads (are run
+in the calling process and can block the process).
+
+<br /> <br />
+<tt>--disable-asm</tt>
+
+<br /> <br />
+If you have trouble compiling the assembler optimized code in the
+package or does not want to use them, you can give the --disable-asm
+option to the `configure' script. This will assure that assembler
+optimized code is not compiled in.
+
+<br /> <br />
+<tt>--enable-ipv6</tt>
+
+<br /> <br />
+The `configure' will attempt to check for IPv6 support in your system.
+However, if it fails, but you still want to compile in the IPv6 support
+you can give --enable-ipv6 option to force the IPv6 support.
+
+<br /> <br />
+<tt>--disable-cpu-optimizations</tt>
+
+<br /> <br />
+By default the configure script will attempt to detect the type of your
+CPU and enable any features specific to your CPU that could optimize the
+performance of the Toolkit. If you are creating binary package that
+should work on any CPU (and not only your CPU) you should diable these
+optimizations. If you compile it for yourself only, keeping the
+optimizations enabled is recommended.
+
+<br /> <br />
+After compilation you can install the Toolkit into your system by giving
+the command:
+
+<br /> <br />
+<tt>make install</tt>
+
+
+<br /> <br /> <br />
+<b><a name="windows"></a>Building on Windows</b>
+
+<br /> <br />
+The Toolkit can be compiled several different ways on Windows. However,
+this document describes the method to build the Toolkit to produce native
+Win32 binaries. The Toolkit package can also be compiled on Cygwin and
+MinGW. For these systems please refer to the README.WIN32 file in the
+Toolkit package.
+
+<br /> <br />
+The Toolkit package includes ready MSVC++ Workspace files, that will
+automatically compile the Toolkit. The MSVC++ workspace and project files
+resides in the win32/ subdirectory of the Toolkit package. The `srt.dsw'
+file is the workspace file that automatically supports compiling the Toolkit
+and to generate the SILC Runtime DLL (libsrt.dll). You may also compile
+debug version by selecteing the Debug compilation method.
+
+<br /> <br /> <br />
+<b><a name="macosx"></a>Building on Mac OS X</b>
+
+<br /> <br />
+Building the Toolkit on Mac OS X is almost identical on compiling on Unix
+system. The reason for this is that the Mac OS X is Unix based operating
+system. To build the Toolkit on Mac OS X, give the following commands:
+
+<br /> <br />
+<tt>
+setenv CFLAGS -no-cpp-precomp<br />
+./configure powerpc<br />
+make
+</tt>
+
+<br /> <br />
+The ./configure can take several options as arguments. To see them all give
+command:
+
+<br /> <br />
+<tt>./configure --help</tt>
+
+<br /> <br />
+To compile, give:
+
+<br /> <br />
+<tt>
+make
+</tt>
+
+<br /> <br />
+After compilation you can install the Toolkit into your system by giving
+the command:
+
+<br /> <br />
+<tt>make install</tt>
+
+<br /> <br /> <br />
+<b><a name="symbian"></a>Building on Symbian OS</b>
+
+<br /> <br />
+The build environment for Symbian OS requires Carbide.c++ and MS Windows.
+
+<br /> <br />
+Download the freely available Carbide.c++ from Nokia at
+<a href="http://forum.nokia.com">http://forum.nokia.com</a>. The exact
+hyperlink location changes often, so it is not referenced here. It is
+usually under "Tools and SDKs" link.
+
+<br /> <br />
+After installation a web browser is opened automatically by the
+Carbide.c++ installer. Follow its instructions by installing the Perl,
+CTags and the SDK. Perl and the SDK are required, but CTags is
+optional and if necessary can be omitted.
+
+<br /> <br />
+The Toolkit is generic C and C++ code and should work with any
+SDK. If you don't have SDK already installed, install the latest
+version you can find. The links to SDKs are found in the Carbide.c++
+instructions after installation. If you already have SDK in your
+system, you should use that.
+
+<br /> <br />
+After installation import the Toolkit project to Carbide.c++ from the
+symbian/ subdirectory in the Toolkit package.
+
+<br /> <br />
+Please read the README.SYMBIAN from the SILC Runtime Toolkit package for
+complete building instructions.
+
+</div> <!-- content -->
+
+</div> <!-- contentwrapper -->
+<div id="footer">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+</body>
+</html>
+
--- /dev/null
+</div> <!-- contentwrapper -->
+<div id="footer">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
--- /dev/null
+<div id="logo">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+<div id="contentwrapper">
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
+<link rel="stylesheet" href="./runtime.css" type="text/css" />
+<title>SILC Runtime Toolkit</title>
+</head>
+<body>
+
+<div id="logo">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+<div id="contentwrapper">
+<div id="navigation">
+</div> <!-- navigation -->
+<div id="content">
+<h2>SILC Runtime Toolkit Reference Manual</h2>
+<p>
+Version: @VERSION@<br />
+Copyright © 1997 - 2008 The SILC Project<br />
+Updated: @DATE@
+</p>
+<p>
+Welcome to the SILC Runtime Toolkit Reference Manual. The manual is a
+complete developer guide and reference for the application programmer.
+The manual is intended for programmers who would like to use the SILC
+Runtime Toolkit as their primary runtime in their application.</p>
+<p>
+The application programming interfaces are automatically generated from the
+Toolkit sources, and the documentation is constantly evolving. New versions
+of the Toolkit always delivers the latest version of this reference manual.
+</p>
+
+<p class="item_name">GUIDES</p>
+<ul class="toc_entries">
+
+<li class="toc_entries"><a href="intro_reference.html">Introduction to the Manual</a><br />
+<li class="toc_entries"><a href="platforms.html">Supported Platforms</a>
+<li class="toc_entries"><a href="building.html">Building the Toolkit</a>
+</ul>
+
+<p class="item_name">TOOLKIT REFERENCE</p>
+<ul class="toc_entries">
+
+<li class="toc_entries"><a href="./silcruntime_hsilcutil2FRuntime20Toolkit20Interface.html" >Runtime Toolkit Interface</a>
+<li class="toc_entries"><a href="./silcasync_hsilcutil2FAsync20Operation20Interface.html" >Async Operation Interface</a>
+<li class="toc_entries"><a href="./silcatomic_hsilcutil2FAtomic20Operations20Interface.html" >Atomic Operations Interface</a>
+<li class="toc_entries"><a href="./silcbase64_hsilcutil2FBase6420Interface.html" >Base64 Interface</a>
+<li class="toc_entries"><a href="./silcbitops_hsilcutil2FBit20Operations20Interface.html" >Bit Operations Interface</a>
+<li class="toc_entries"><a href="./silcbuffmt_hsilcutil2FBuffer20Format20Interface.html" >Buffer Format Interface</a>
+<li class="toc_entries"><a href="./silcbuffer_hsilcutil2FBuffer20Interface.html" >Buffer Interface</a>
+<li class="toc_entries"><a href="./silccond_hsilcutil2FCondition20Variable20Interface.html" >Condition Variable Interface</a>
+<li class="toc_entries"><a href="./silcconfig_hsilcutil2FConfig20File20Interface.html" >Config File Interface</a>
+<li class="toc_entries"><a href="./silcdir_hsilcutil2FDirectory20Interface.html" >Directory Interface</a>
+<li class="toc_entries"><a href="./silcdlist_hsilcutil2FDynamic20List20Interface.html" >Dynamic List Interface</a>
+<li class="toc_entries"><a href="./silcenv_hsilcutil2FEnvironment20Interface.html" >Environment Interface</a>
+<li class="toc_entries"><a href="./silcerrno_hsilcutil2FErrno20Interface.html" >Errno Interface</a>
+<li class="toc_entries"><a href="./silcfdstream_hsilcutil2FFd20Stream20Interface.html" >Fd Stream Interface</a>
+<li class="toc_entries"><a href="./silcfileutil_hsilcutil2FFile20Util20Interface.html" >File Util Interface</a>
+<li class="toc_entries"><a href="./silcfsm_hsilcutil2FFinite20State20Machine.html" >Finite State Machine</a>
+<li class="toc_entries"><a href="./silcgetopt_hsilcutil2FGetOpt20Interface.html" >GetOpt Interface</a>
+<li class="toc_entries"><a href="./silcglobal_hsilcutil2FGlobal20Variable20Interface.html" >Global Variable Interface</a>
+<li class="toc_entries"><a href="./silchashtable_hsilcutil2FHash20Table20Interface.html" >Hash Table Interface</a>
+<li class="toc_entries"><a href="./silclist_hsilcutil2FList20Interface.html" >List Interface</a>
+<li class="toc_entries"><a href="./silclog_hsilcutil2FLogging20Interface.html" >Logging Interface</a>
+<li class="toc_entries"><a href="./silcmemory_hsilcutil2FMemory20Interface.html" >Memory Interface</a>
+<li class="toc_entries"><a href="./silcstack_hsilcutil2FMemory20Pool20Interface.html" >Memory Pool Interface</a>
+<li class="toc_entries"><a href="./silcmime_hsilcutil2FMIME20Interface.html" >MIME Interface</a>
+<li class="toc_entries"><a href="./silcutil_hsilcutil2FMisc20Utilities.html" >Misc Utilities</a>
+<li class="toc_entries"><a href="./silcmutex_hsilcutil2FMutex20Interface.html" >Mutex Interface</a>
+<li class="toc_entries"><a href="./silcnet_hsilcutil2FNetwork20Interface.html" >Network Interface</a>
+<li class="toc_entries"><a href="./silcrand_hsilcutil2FRandom20Number20Interface.html" >Random Number Interface</a>
+<li class="toc_entries"><a href="./silcregex_hsilcutil2FRegex20Interface.html" >Regex Interface</a>
+<li class="toc_entries"><a href="./silcschedule_hsilcutil2FScheduler20Interface.html" >Scheduler Interface</a>
+<li class="toc_entries"><a href="./silcdll_hsilcutil2FShared20Object20Interface.html" >Shared Object Interface</a>
+<li class="toc_entries"><a href="./silcsnprintf_hsilcutil2FSnprintf20Interface.html" >Snprintf Interface</a>
+<li class="toc_entries"><a href="./silcsocketstream_hsilcutil2FSocket20Stream20Interface.html" >Socket Stream Interface</a>
+<li class="toc_entries"><a href="./silcstream_hsilcutil2FStream20Interface.html" >Stream Interface</a>
+<li class="toc_entries"><a href="./silcstrutil_hsilcutil2FString20Utilities.html" >String Utilities</a>
+<li class="toc_entries"><a href="./silcstringprep_hsilcutil2FStringprep20Interface.html" >Stringprep Interface</a>
+<li class="toc_entries"><a href="./silcthread_hsilcutil2FThread20Interface.html" >Thread Interface</a>
+<li class="toc_entries"><a href="./silcthreadqueue_hsilcutil2FThread20Queue20Interface.html" >Thread Queue Interface</a>
+<li class="toc_entries"><a href="./silctime_hsilcutil2FTime20Interface.html" >Time Interface</a>
+<li class="toc_entries"><a href="./silctimer_hsilcutil2FTimer20Interface.html" >Timer Interface</a>
+<li class="toc_entries"><a href="./silctypes_hsilcutil2FTypes20and20Definitions.html" >Types and Definitions</a>
+<li class="toc_entries"><a href="./silcutf8_hsilcutil2FUTF2D820Interface.html" >UTF-8 Interface</a>
+
+<li class="toc_entries"><a href="masterindex.html">Toolkit Index</a><br />
+</ul>
+
+</div> <!-- content -->
+
+</div> <!-- contentwrapper -->
+<div id="footer">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+</body>
+</html>
--- /dev/null
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Style-Type" content="text/css" />
+<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-1" />
+<link rel="stylesheet" href="./runtime.css" type="text/css" />
+<title>SILC Runtime Toolkit</title>
+</head>
+<body>
+
+<div id="logo">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+<div id="contentwrapper">
+<div id="navigation">
+</div> <!-- navigation -->
+<div id="content">
+
+<big><b>Platform Implementations</b></big>
+
+<br /> <br />
+This document describes the implementation issues with different platforms
+that the SILC Runtime Toolkit support. Some of the supported platforms
+does not support all the features delivered with the Toolkit or they may
+behave differently from other platforms.
+
+<br /> <br />
+<li><a href="#unix">Unix & Linux Implementation</a><br />
+<li><a href="#windows">Windows Implementation</a><br />
+<li><a href="#macosx">Mac OS X Implementation</a>
+<li><a href="#symbian">Symbian OS Implementation</a>
+
+<br /> <br /> <br />
+<b>Supported Platforms</b>
+
+<br /> <br />
+The Toolkit supports by default all Unix and Linux platforms, Windows
+platforms from Windows 2000 and newer, Mac OS X and Symbian OS.
+
+<br /> <br /> <br />
+<b><a name="unix"></a>Unix Implementation</b>
+
+<br /> <br />
+All features and components delivered with the Toolkit work on all
+Unix and Linux platforms. There are no special Unix platform related
+implementation issues with current version of Toolkit.
+
+
+<br /> <br /> <br />
+<b><a name="windows"></a>Windows Implementation</b>
+
+<br /> <br />
+By default all features and components delivered with Toolkit are
+supported on Windows. However, there are some certain issues with the
+Windows version of the Toolkit.
+
+<br /> <br />
+<li>Some of the network routines do not support IPv6.
+
+
+<br /> <br /> <br />
+<b><a name="macosx"></a>Mac OS X Implementation</b>
+
+<br /> <br />
+All features and components delivered with the Toolkit work on Mac
+OS X platform. There are no special Mac OS X platform related
+implementation issues with current version of Toolkit.
+
+
+<br /> <br /> <br />
+<b><a name="symbian"></a>Symbian OS Implementation</b>
+
+<br /> <br />
+Symbian OS support in Toolkit is still experimental. By default all
+features and components delivered with the Toolkit are supported and
+should work on Symbian. However, there are some issues with the Symbian
+version of the Toolkit of what Symbian developers need to be aware.
+
+<br /> <br />
+<li>The function <tt>silc_schedule</tt> on Symbian will allocate new Active
+Scheduler Waiter and will block the calling thread. The caller should
+allocate Active Scheduler before calling <tt>silc_schedule</tt>.
+
+<li>When adding timeout tasks to SILC Scheduler the SILC Scheduler is woken
+up after the timeout task has been added. This allows adding of the
+timeout tasks from Symbian active objects outside the SILC Scheduler loop.
+On other platforms this wakeup operation is not performed.
+
+<li>Adding fd task to SILC Scheduler will not schedule the fd for any
+operation. Instead, programmer should use SILC Socket Stream API and SILC
+Fd Stream API on Symbian when dealing with file descriptors and sockets.
+These APIs provide asynchronous notification when data is available and can
+be written.
+
+<li>The function <tt>silc_thread_create</tt> on Symbian will install Active
+Scheduler and allocate Cleanup Stack for the new thread. The created
+thread always shares heap with the parent thread.
+
+</div> <!-- content -->
+
+</div> <!-- contentwrapper -->
+<div id="footer">
+<table border="0" cellspacing="0" cellpadding="6" width="100%">
+ <tr valign="top">
+ <td>Copyright © 2001 - 2008 SILC Project<br />
+ <a href="http://silcnet.org">SILC Project Website</a></td>
+ <td align="right">
+ <a href="index.html">SILC Runtime Toolkit Manual</a><br />
+ <a href="masterindex.html">Index</a></small></td>
+ </td>
+ </tr>
+</table>
+</div>
+
+</body>
+</html>
+
--- /dev/null
+body {
+ width: 100%;
+ background-color: #fff;
+ font: normal 90% Arial, Helvetica, Verdana;
+ color: #454545;
+ margin-top: 0;
+ margin-left: 0;
+ margin-right: 0;
+}
+
+#logo {
+ font-size: 100%;
+ background-color: #eeeeee;
+ height: 46px;
+ margin-top: 0;
+ border-bottom: 1px solid #cacaca;
+}
+
+#logo a {
+ color: #9f7e40;
+ text-decoration: none;
+}
+
+#logo a:hover, #logo a:active {
+ color: #afaf77;
+}
+
+#contentwrapper {
+ float: left;
+ width: 100%;
+}
+
+#content {
+ font-size: 100%;
+ padding: 5px 5px 2px 10px;
+ margin-right: 245px;
+ border-right: 1px dotted #cacaca;
+}
+
+/* The content margin-right is 245 px. To get navigation's dotted border
+ to same position as contents dotted border we have width 231 + right
+ border padding 4 + left border padding 10 == 245 px. */
+#navigation {
+ border-left: 1px dotted #cacaca;
+ width: 231px;
+ min-height: 590px;
+ position: relative;
+ float: right;
+ padding: 5px 4px 2px 10px;
+}
+
+#footer {
+ background-color: #eeeeee;
+ clear: left;
+ width: 100%;
+ font-size: 100%;
+ border-top: 1px solid #cacaca;
+}
+
+#footer a {
+ color: #9f7e40;
+ text-decoration: none;
+}
+
+#footer a:hover, #footer a:active {
+ color: #afaf77;
+}
+
+pre {
+ font-family: monospace;
+ margin: 12px;
+ padding: 5px;
+ white-space: pre;
+ color: #000;
+}
+
+pre.source {
+ background-color: #ffe;
+ border: dashed #aa9 1px;
+}
+
+p {
+ margin: 15px;
+}
+
+p.item_name {
+ font-weight: bolder;
+ margin: 5px;
+ font-size: 110%;
+}
+
+ul.toc_entries {
+ list-style-image: url(./arrow.png);
+}
+
+a.menuitem {
+ font-size: 90%;
+ color: #9f7e40;
+ padding: 4px 1px 1px 5px;
+ background: url(./arrow.png) no-repeat center left;
+ text-align: left;
+ padding-left: 20px;
+}
+
+
+#extra, #extra a
+{
+}
+
+#content a {
+ color: #9f7e40;
+ text-decoration: none;
+}
+
+#content a:hover, #content a:active {
+ color: #afaf77;
+}
+
+a.indexitem {
+ display: block;
+}
+
+h1
+{
+ font-size: 220%;
+ margin-top: 0px;
+}
+
+h2
+{
+ font-size: 180%;
+ margin-top: 0px;
+}
+
+h3
+{
+ font-size: 133%;
+ margin-top: 0px;
+}
+
+h4
+{
+ font-size: 124%;
+ margin-top: 0px;
+}
+
+h5
+{
+ font-size: 115%;
+ margin-top: 0px;
+}
+
+h6
+{
+ font-size: 106%;
+ margin-top: 0px;
+}
+
+#navigation a {
+ text-decoration: none;
+}
+
+.menuitem:hover {
+ color: #afaf77;
+ text-decoration: none;
+}
+
+#extra a
+{
+ text-decoration: none;
+}
+
+#logo a
+{
+ text-decoration: none;
+}
+
+#extra a:hover
+{
+}
+
+
+.menuitem {width: auto;}
+#content {width: auto;}
+.menuitem {display: block;}
+
+span.keyword
+{
+ color: #00F;
+}
+
+span.comment
+{
+ color: #080;
+}
+
+span.quote
+{
+ color: #F00;
+}
+
+span.squote
+{
+ color: #F0F;
+}
+
+span.sign
+{
+ color: #008B8B;
+}
+
+
+@media print
+{
+ #navigation {display: none;}
+ #content {padding: 0px;}
+ #content a {text-decoration: underline;}
+}
--- /dev/null
+options:
+ --src ../../lib/silcutil
+ --doc .
+ --html
+ --sectionnameonly
+ --syntaxcolors
+ --nopre
+ --nodesc
+ --no_subdirectories
+ --index
+ --documenttitle "SILC Runtime Toolkit"
+ --nosort
+ --multidoc
+ --one_file_per_header
+ --header_toc
+ --module_index_menu
+ --document_header header
+ --document_footer footer
+ --css runtime.css
+
+preformatted items:
+ EXAMPLE
+ SYNOPSIS
+ NAME
+
+ignore files:
+ Makefile*
+ tests
+ win32
+ symbian
+ *.c
+ *.in
+++ /dev/null
-Makefile
-Makefile.in
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-#ifdef SILC_DIST_TOOLKIT
include_HEADERS = \
- silc.h \
silcwin32.h \
- silcsymbian.h \
- silcversion.h
-#endif SILC_DIST_TOOLKIT
+ silcsymbian.h
EXTRA_DIST = \
- silc.h \
silcwin32.h \
silcsymbian.h \
- silcversion.h.in \
+ silccompile.h \
silcdistdefs.h
+++ /dev/null
-/*
-
- silc.h
-
- Author: Pekka Riikonen <priikone@silcnet.org>
-
- Copyright (C) 1997 - 2008 Pekka Riikonen
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
-*/
-/*
- This file includes common definitions for SILC. This file MUST be included
- by all files in SILC (directly or through other global include file).
-*/
-
-#ifndef SILCINCLUDES_H
-#define SILCINCLUDES_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Compilation time defines, for third-party software */
-@__SILC_HAVE_SIM@
-@__SILC_ENABLE_DEBUG@
-
-#if defined(HAVE_SILCDEFS_H)
-
-/* Automatically generated configuration header */
-#ifndef SILC_SYMBIAN
-#include "silcdefs.h"
-#else
-#include "../symbian/silcdefs.h"
-#endif /* SILC_SYMBIAN */
-#include "silcdistdefs.h"
-
-#else
-
-/* Autodetect CPU so that inline assembly in headers are enabled */
-
-#if defined(__i386__)
-#undef SILC_I386
-#define SILC_I386
-#undef SILC_I486
-#define SILC_I486
-#endif /* __i386__ */
-
-#if defined(__x86_64__)
-#undef SILC_X86_64
-#define SILC_X86_64
-#endif /* __x86_64__ */
-
-#if defined(__ia64__)
-#undef SILC_IA64
-#define SILC_IA64
-#endif /* __ia64__ */
-
-#if defined(__ppc__) || defined(__ppc64__)
-#undef SILC_POWERPC
-#define SILC_POWERPC
-#endif /* __ppc__ || __ppc64__ */
-
-#ifndef SILC_ALIGNMENT
-#define SILC_ALIGNMENT SILC_SIZEOF_VOID_P
-#endif /* SILC_ALIGNMENT */
-
-#endif /* HAVE_SILCDEFS_H */
-
-/* Platform specific includes */
-
-#if defined(SILC_WIN32)
-#include "silcwin32.h"
-#endif
-
-#if defined(SILC_SYMBIAN)
-#include "silcsymbian.h"
-#endif
-
-#ifndef DLLAPI
-#define DLLAPI
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <dirent.h>
-
-#ifdef HAVE_SIGNAL_H
-#include <signal.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-
-#ifdef HAVE_ASSERT_H
-#include <assert.h>
-#endif
-
-#if !defined(SILC_WIN32)
-
-#include <unistd.h>
-#include <sys/time.h>
-#include <pwd.h>
-#include <sys/times.h>
-
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
-
-#ifdef SOCKS5
-#include "socks.h"
-#endif
-
-#include <sys/socket.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-
-#ifdef HAVE_XTI_H
-#include <xti.h>
-#else
-#ifdef HAVE_NETINET_TCP_H
-#include <netinet/tcp.h>
-#endif
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifdef SILC_HAVE_PTHREAD
-#include <pthread.h>
-#endif
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-
-#ifdef HAVE_UTIME_H
-#include <utime.h>
-#endif
-
-#ifdef HAVE_ICONV_H
-#include <iconv.h>
-#endif
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-
-#ifdef HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
-
-#ifdef HAVE_SYS_RESOURCE_H
-#include <sys/resource.h>
-#endif
-
-#endif /* !SILC_WIN32 */
-
-/* Include generic SILC type definitions */
-#include "silcerrno.h"
-#include "silctypes.h"
-#include "silcbitops.h"
-#include "silcmutex.h"
-#include "silcatomic.h"
-#include "silcversion.h"
-
-/* SILC util library includes */
-#include "silcgetopt.h"
-#include "silclist.h"
-#include "silcstack.h"
-#include "silcmemory.h"
-#include "silcsnprintf.h"
-
-/* Math library includes */
-#include "silcmp.h"
-#include "silcmath.h"
-
-/* More SILC util library includes */
-#include "silctime.h"
-#include "silctimer.h"
-#include "silccond.h"
-#include "silcthread.h"
-#include "silcschedule.h"
-#include "silclog.h"
-#include "silcdir.h"
-#include "silcfileutil.h"
-#include "silcbuffer.h"
-#include "silcbuffmt.h"
-#include "silcasync.h"
-#include "silcdlist.h"
-
-/* Crypto library includes */
-#include "silccrypto.h"
-#include "silccipher.h"
-#include "silchash.h"
-#include "silchmac.h"
-#include "silcrng.h"
-#include "silcpkcs.h"
-#include "silcpk.h"
-#include "silcpkcs1.h"
-#ifdef SILC_DIST_ACC
-#include "silcacc.h"
-#endif /* SILC_DIST_ACC */
-#ifdef SILC_DIST_SSH
-#include "silcssh.h"
-#endif /* SILC_DIST_SSH */
-
-/* More SILC util library includes */
-#include "silcregex.h"
-#include "silcenv.h"
-#include "silcdll.h"
-#include "silchashtable.h"
-#include "silcstream.h"
-#include "silcnet.h"
-#include "silcbase64.h"
-#include "silcstrutil.h"
-#include "silcutf8.h"
-#include "silcstringprep.h"
-#include "silcutil.h"
-#include "silcconfig.h"
-#include "silcfsm.h"
-#include "silcsocketstream.h"
-#include "silcfdstream.h"
-#include "silcmime.h"
-
-#ifdef SILC_DIST_VCARD
-#include "silcvcard.h"
-#endif /* SILC_DIST_VCARD */
-
-#ifdef SILC_DIST_ASN1
-#include "silcasn1.h"
-#include "silcber.h"
-#endif /* SILC_DIST_ASN1 */
-
-/* SILC core library includes */
-#include "silcargument.h"
-#include "silcstatus.h"
-#include "silcid.h"
-#include "silccommand.h"
-#include "silcauth.h"
-#include "silcmessage.h"
-#include "silcchannel.h"
-#include "silcpacket.h"
-#include "silcnotify.h"
-#include "silcmode.h"
-#include "silcattrs.h"
-#include "silcpubkey.h"
-
-/* Application utility includes */
-#include "silcapputil.h"
-#ifdef SILC_DIST_IDCACHE
-#include "silcidcache.h"
-#endif /* SILC_DIST_IDCACHE */
-
-#ifdef SILC_DIST_SKR
-#include "silcskr.h"
-#endif /* SILC_DIST_SKR */
-
-#if defined(SILC_SIM)
-/* SILC Module library includes */
-#include "silcsim.h"
-#include "silcsimutil.h"
-#endif
-
-/* SILC Key Exchange library includes */
-#include "silcske.h"
-#include "silcske_payload.h"
-#include "silcske_groups.h"
-#include "silcconnauth.h"
-
-#ifdef SILC_DIST_SFTP
-/* SILC SFTP library */
-#include "silcsftp.h"
-#include "silcsftp_fs.h"
-#endif /* SILC_DIST_SFTP */
-
-#ifdef SILC_DIST_HTTP
-/* SILC HTTP library */
-#include "silchttpserver.h"
-#include "silchttpphp.h"
-#endif /* SILC_DIST_HTTP */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SILCINCLUDES_H */
+++ /dev/null
-/*
-
- silcversion.h
-
- Author: Pekka Riikonen <priikone@silcnet.org>
-
- Copyright (C) 1997 - 2007 Pekka Riikonen
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
-*/
-
-#ifndef SILCVERSION_H
-#define SILCVERSION_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Version check macro. Use this to check that package is of specific
- version compile time. Use the __SILC_XXX_VERSION below in comparison. */
-#define SILC_VERSION(a, b, c) (((a) << 24) + ((b) << 16) + ((c) << 8)
-@__SILC_PACKAGE_VERSION@
-
-#define SILC_VERSION_STRING "@VERSION@"
-#define SILC_DIST_VERSION_STRING "@VERSION@"
-#define SILC_PROTOCOL_VERSION_STRING "SILC-1.2-@VERSION@ @PACKAGE@"
-#define SILC_NAME "SILC @PACKAGE_NAME@"
-
-/* SILC Protocol version number */
-#define SILC_PROTOCOL_VERSION_CURRENT 12
-
-/* SILC version string */
-#define silc_version SILC_VERSION_STRING
-#define silc_dist_version SILC_DIST_VERSION_STRING
-#define silc_version_string SILC_PROTOCOL_VERSION_STRING
-#define silc_name SILC_NAME
-#define silc_fullname "Secure Internet Live Conferencing"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* SILCVERSION_H */
+++ /dev/null
-Makefile
-*.in
-*.am
-*.o
-*.lo
-*.la
-*.a
-*.pc
AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
-SUBDIRS=
+RUNTIME_BASE_VERSION=@RUNTIME_BASE_VERSION@
+RUNTIME_CURRENT=@RUNTIME_CURRENT@
+RUNTIME_REVISION=@RUNTIME_REVISION@
+RUNTIME_AGE=@RUNTIME_AGE@
-include Makefile.runtime
+# SILC Library dirs
+RUNTIME_DIRS = \
+ contrib \
+ silcutil
+
+if SILC_ENABLE_SHARED
+if SILC_WIN32
+LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir) \
+ -export-dynamic -no-undefined
+else
+LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
+endif
+LIBTOOL_RUNTIME_VERSION = \
+ -version-info $(RUNTIME_CURRENT):$(RUNTIME_REVISION):$(RUNTIME_AGE)
+else
+LIBTOOL_OPTS=
+LIBTOOL_RUNTIME_VERSION =
+endif
+if SILC_WIN32
+RUNTIME_LINK_LIBS=$(LIBS)
+else
+RUNTIME_LINK_LIBS=
+endif
+
+RUNTIME_LIB = libsrt.a
+
+SUBDIRS = $(RUNTIME_DIRS)
+
+CLEANFILES = $(RUNTIME_LIB)
+DISTCLEANFILES = $(RUNTIME_LIB)
+
+remove:
+ -rm -f $(CLEANFILES)
+
+all:
+ $(MAKE) remove $(RUNTIME_LIB)
+
+install-exec-hook:
+ -mkdir -p $(DESTDIR)$(libdir)
+ -$(LIBTOOL) $(INSTALL) libsrt.la $(DESTDIR)$(libdir)/
+
+libsrt.a:
+ find $(RUNTIME_DIRS) -type f -name *.lo | xargs \
+ $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
+ $(RUNTIME_LINK_LIBS) \
+ $(LIBTOOL_RUNTIME_VERSION) \
+ $(LIBTOOL_OPTS) -o libsrt.la
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = srt.pc
+
+EXTRA_DIST = srt.pc.in
+
+#srt-install:
+# -mkdir -p $(docdir)/toolkit/
+# -$(INSTALL_DATA) $(top_srcdir)/doc/toolkit/* $(docdir)/toolkit
+# -$(INSTALL_DATA) $(top_srcdir)/lib/doc/*.gif $(docdir)/toolkit
+# -cp -R $(top_srcdir)/tutorial $(docdir)
+
+#install-data-hook: \
+# srt-install
include $(top_srcdir)/Makefile.defines.in
+++ /dev/null
-#
-# Makefile.runtime.am
-#
-# Author: Pekka Riikonen <priikone@silcnet.org>
-#
-# Copyright (C) 2008 Pekka Riikonen
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-
-RUNTIME_BASE_VERSION=@RUNTIME_BASE_VERSION@
-RUNTIME_CURRENT=@RUNTIME_CURRENT@
-RUNTIME_REVISION=@RUNTIME_REVISION@
-RUNTIME_AGE=@RUNTIME_AGE@
-
-# SILC Library dirs
-RUNTIME_DIRS = \
- contrib \
- silcutil
-
-if SILC_ENABLE_SHARED
-if SILC_WIN32
-LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir) \
- -export-dynamic -no-undefined
-else
-LIBTOOL_OPTS= -release $(RUNTIME_BASE_VERSION) -rpath $(DESTDIR)$(libdir)
-endif
-LIBTOOL_RUNTIME_VERSION = \
- -version-info $(RUNTIME_CURRENT):$(RUNTIME_REVISION):$(RUNTIME_AGE)
-else
-LIBTOOL_OPTS=
-LIBTOOL_RUNTIME_VERSION =
-endif
-if SILC_WIN32
-RUNTIME_LINK_LIBS=$(LIBS)
-else
-RUNTIME_LINK_LIBS=
-endif
-
-RUNTIME_LIB = libsrt.a
-
-SUBDIRS += $(RUNTIME_DIRS)
-
-CLEANFILES = $(RUNTIME_LIB)
-DISTCLEANFILES = $(RUNTIME_LIB)
-
-remove:
- -rm -f $(CLEANFILES)
-
-all:
- $(MAKE) remove $(RUNTIME_LIB)
-
-install-exec-hook:
- -mkdir -p $(DESTDIR)$(libdir)
- -$(LIBTOOL) $(INSTALL) libsrt.la $(DESTDIR)$(libdir)/
-
-libsrt.a:
- find $(RUNTIME_DIRS) -type f -name *.lo | xargs \
- $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) \
- $(RUNTIME_LINK_LIBS) \
- $(LIBTOOL_RUNTIME_VERSION) \
- $(LIBTOOL_OPTS) -o libsrt.la
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = srt.pc
-
-EXTRA_DIST = srt.pc.in
-
-#srt-install:
-# -mkdir -p $(docdir)/toolkit/
-# -$(INSTALL_DATA) $(top_srcdir)/doc/toolkit/* $(docdir)/toolkit
-# -$(INSTALL_DATA) $(top_srcdir)/lib/doc/*.gif $(docdir)/toolkit
-# -cp -R $(top_srcdir)/tutorial $(docdir)
-
-#install-data-hook: \
-# srt-install
+++ /dev/null
-Makefile
-Makefile.in
<!--
- Index file for SILC Toolkit Reference Manual. This file is processed with
- the SILC Document generator.
+ Index file for SILC Runtime Toolkit Reference Manual. This file is
+ processed with the SILC Document generator.
-->
<big><b>SILC Toolkit Reference Manual</b></big>
<br />
<small>
Version: @VERSION@<br />
-Copyright © 1997 - 2007 The SILC Project<br />
+Copyright © 1997 - 2008 The SILC Project<br />
Updated: @DATE@
</small>
<br /><br /><br />
<big><b>Building the Toolkit</b></big>
<br /> <br />
-SILC Toolkit works on various platforms, such as on several Unix systems and
-on Windows. Building of the Toolkit on some platform may differ from the
-other. This document describes how to build the Toolkit from the sources,
-to create linkable libraries and binaries, on all platforms the Toolkit
-support.
+SILC Runtime Toolkit works on various platforms, such as on several Unix
+systems and on Windows. Building of the Toolkit on some platform may
+differ from the other. This document describes how to build the Toolkit
+from the sources, to create linkable libraries and binaries, on all
+platforms the Toolkit support.
<br /> <br />
The building instructions for all platforms are also included in the Toolkit
<b><a name="unix"></a>Building on Unix & Linux</b>
<br /> <br />
-Building the Toolkit on Unix will produce binaries of all libraries, and
-SILC Client and SILC Server. The Toolkit package includes also Client and
-Server as an example applications, and they are compiled automatically.
-The libraries are compiled to provide staticly linkable libraries. Two
-libraries are produced: libsilc.a and libsilcclient.a. The libsilc.a includes
-everything else except the Client library. The libsilcclient.a includes
-only the Client library.
+On Unix systems both statically and dynamically linkable libraries are
+built by default.
<br /> <br />
To build Toolkit on Unix systems, give commands:
this option when you are doing development with Toolkit. It is helpful
to enable run-time debugging.
-<br /> <br />
-<tt>--with-gmp[=DIR]</tt>
-
-<br /> <br />
-If you wish to use GMP library for arbitrary precision arithmetic
-library instead of using the MPI library included in the package, you can
-give the --with-gmp[=DIR] option to the `configure'. The DIR is the upper
-path in your system which contains lib/ and include/ for GMP library.
-
<br /> <br />
<tt>--with-iconv[=DIR]</tt>
However, if it fails, but you still want to compile in the IPv6 support
you can give --enable-ipv6 option to force the IPv6 support.
+<br /> <br />
+<tt>--disable-cpu-optimizations</tt>
+
+<br /> <br />
+By default the configure script will attempt to detect the type of your
+CPU and enable any features specific to your CPU that could optimize the
+performance of the Toolkit. If you are creating binary package that
+should work on any CPU (and not only your CPU) you should diable these
+optimizations. If you compile it for yourself only, keeping the
+optimizations enabled is recommended.
+
<br /> <br />
After compilation you can install the Toolkit into your system by giving
the command:
<br /> <br />
The Toolkit package includes ready MSVC++ Workspace files, that will
automatically compile the Toolkit. The MSVC++ workspace and project files
-resides in the win32/ subdirectory of the Toolkit package. The `silc.dsw'
+resides in the win32/ subdirectory of the Toolkit package. The `srt.dsw'
file is the workspace file that automatically supports compiling the Toolkit
-and to generate the SILC Core DLL and SILC Client DLL libraries.
-
-<br /> <br />
-The SILC Core DLL is named as libsilc and will generate libsilc.dll, and
-the SILC Client DLL is named as libsilcclient and will generate
-libsilcclient.dll. Both of the projects also automatically generates
-libsilc.lib and libsilcclient.lib import libraries that may be used to
-link against a client application.
-
-<br /> <br />
-Generally you do not need to do any specific settings to compile the
-Toolkit. However, you must compile the libsilc before compiling the
-libsilclient, since the SILC Client DLL depends on the SILC Core DLL.
-You may compile the DLLs as either Release or Debug version. Just select
-the preferred method of compilation. The Debug version will compile the
-SILC Toolkit with run-time debugging support, which is recommended when
-doing development with the Toolkit.
+and to generate the SILC Runtime DLL (libsrt.dll). You may also compile
+debug version by selecteing the Debug compilation method.
<br /> <br /> <br />
<b><a name="macosx"></a>Building on Mac OS X</b>
<tt>./configure --help</tt>
<br /> <br />
-If you do not want to compile the applications, or they do not compile on
-your system, you can also choose to compile only the libraries, and skip
-all applications. In this case, before giving the "make" command, go
-to the lib/ subdirectory, and give "make" command there:
+To compile, give:
<br /> <br />
<tt>
-cd lib/<br />
make
</tt>
optional and if necessary can be omitted.
<br /> <br />
-The SILC Toolkit is generic C and C++ code and should work with any
+The Toolkit is generic C and C++ code and should work with any
SDK. If you don't have SDK already installed, install the latest
version you can find. The links to SDKs are found in the Carbide.c++
instructions after installation. If you already have SDK in your
system, you should use that.
<br /> <br />
-After installation import the SILC Toolkit project to Carbide.c++ from the
-symbian/ subdirectory in the SILC Toolkit package.
+After installation import the Toolkit project to Carbide.c++ from the
+symbian/ subdirectory in the Toolkit package.
<br /> <br />
-Please read the README.SYMBIAN from the SILC Toolkit package for complete
-building instructions.
+Please read the README.SYMBIAN from the SILC Runtime Toolkit package for
+complete building instructions.
<big><b>Platform Implementations</b></big>
<br /> <br />
-This document describes the implementation issues with different platforms
-that the SILC Toolkit support. Some of the supported platforms does not
-support all the features delivered with the Toolkit or they may behave
-differently from other platforms.
+This document describes the implementation issues with different platforms
+that the SILC Runtime Toolkit support. Some of the supported platforms
+does not support all the features delivered with the Toolkit or they may
+behave differently from other platforms.
<br /> <br />
<li><a href="#unix">Unix & Linux Implementation</a><br />
<b>Supported Platforms</b>
<br /> <br />
-SILC Toolkit supports by default all Unix and Linux platforms, Windows
+The Toolkit supports by default all Unix and Linux platforms, Windows
platforms from Windows 2000 and newer, Mac OS X and Symbian OS.
<br /> <br /> <br />
<b><a name="unix"></a>Unix Implementation</b>
<br /> <br />
-All features and components delivered with the SILC Toolkit work on all
+All features and components delivered with the Toolkit work on all
Unix and Linux platforms. There are no special Unix platform related
-implementation issues with current version of SILC Toolkit.
+implementation issues with current version of Toolkit.
<br /> <br /> <br />
<b><a name="windows"></a>Windows Implementation</b>
<br /> <br />
-By default all features and components delivered with SILC Toolkit are
+By default all features and components delivered with Toolkit are
supported on Windows. However, there are some certain issues with the
-Windows version of the SILC Toolkit.
+Windows version of the Toolkit.
<br /> <br />
<li>Some of the network routines do not support IPv6.
<b><a name="macosx"></a>Mac OS X Implementation</b>
<br /> <br />
-All features and components delivered with the SILC Toolkit work on Mac
+All features and components delivered with the Toolkit work on Mac
OS X platform. There are no special Mac OS X platform related
-implementation issues with current version of SILC Toolkit.
+implementation issues with current version of Toolkit.
<br /> <br /> <br />
<b><a name="symbian"></a>Symbian OS Implementation</b>
<br /> <br />
-Symbian OS support in SILC Toolkit is still experimental. By default all
-features and components delivered with SILC Toolkit are supported and
+Symbian OS support in Toolkit is still experimental. By default all
+features and components delivered with the Toolkit are supported and
should work on Symbian. However, there are some issues with the Symbian
-version of the SILC Toolkit of what Symbian developers need to be aware.
+version of the Toolkit of what Symbian developers need to be aware.
<br /> <br />
<li>The function <tt>silc_schedule</tt> on Symbian will allocate new Active
+++ /dev/null
-<big><b>Porting from Toolkit 1.0 to 1.1</b></big>
-
-<br /> <br />
-This documents describes the differences between the SILC Toolkit 1.0 and
-1.1 and should help application programmers to port their SILC applications
-to the new Toolkit version.
-
-<br /> <br />
-<li><a href="#general">General</a><br />
-<li><a href="#platform">Platform changes</a>
-<li><a href="#client">Client library</a><br />
-<li><a href="#util">Utility library</a><br />
-<li><a href="#apputil">Application utility library</a>
-<li><a href="#crypto">Crypto library</a>
-<li><a href="#skr">Key Repository library</a>
-<li><a href="#vcard">VCard library</a>
-<li><a href="#http">HTTP library</a>
-<li><a href="#asn1">ASN.1 library</a>
-
-<br /> <br />
-<h3><a name="general"></a>General changes</h3>
-
-The main SILC Toolkit header file has changed its name from silcincludes.h
-to silc.h. The first task in porting from 1.0 to 1.1 is to change these
-filenames in your source tree.
-
-
-<br /> <br />
-<h3><a name="platform"></a>Platform changes</h3>
-
-The Windows support has been made better by improving the SILC scheduler
-and network routines. Calling silc_net_win32_init and silc_net_win32_uninit
-is not needed anymore. The network routines on Windows are enabled
-automatically.
-
-
-<br /> <br />
-<h3><a name="client"></a>Client library, lib/silcclient/</h3>
-
-The client library in Toolkit 1.1 has been partially rewritten. It was
-rewritten to work out some technical issues and to increase performance
-and decrease memory consumption. The client library API has also faced
-some changes, altough most of it has remained the same. Most major change
-in the client library is that is now fully supports multiple threads. In
-the past making multithreaded SILC client application was always a bit hard
-but with Toolkit 1.1 it should be relatively straightforward.
-
-<h4>SilcClientOperations structure</h4>
-
-The SilcClientOperations structure has changed significantly. It no longer
-has `connected', `disconnected' and `failure' function pointers. Instead a
-new SilcClientConnectCallback has been defined that is given as argument to
-functions like silc_client_connect_to_server, silc_client_connect_to_client
-and silc_client_key_exchange (last two being entirely new functions in the
-API). That callback is called when connection is established and when it
-is disconnected, or if a protocol failure occurred during connecting. That
-callback also delivers a detailed error information when error occurs. New
-connection related status types in SilcClientConnectionStatus has also been
-added, see the API for the details.
-
-<br /> <br />
-Also the `detach' client operation function pointer has been removed. Instead
-the detachment data is now simply delivered in the SILC_COMMAND_DETACH
-command reply.
-
-<br /> <br />
-Some of the remaining client operation function pointers have changed a bit.
-Most major change is the `command' operation now having the arguments that
-user gave on the user interface sent back to application. The `command_reply'
-does not anymore include the SilcCommandPayload as an argument. Also the
-variable argument lis is now delivered as va_list. Also the boolean
-success indicator is removed and SilcStatus error argument instead is telling
-the exact error if the SilcStatus status is other than SILC_STATUS_OK.
-
-<br /> <br />
-The `get_auth_method' client operation now includes the authentication method
-that has been resolved from the remote server. The application no longer
-needs to resolve it and the function silc_client_request_authentication_method
-has been removed from the API.
-
-<br /> <br />
-The `verify_public_key' client operation now include the SilcPublicKey pointer
-instead of the public key in raw encoded form. Also the connection type
-argument has changed to SilcConnectionType.
-
-<br /> <br />
-The `key_agreement' client operation now includes a new protocol argument
-which tells whether the key agremeent is supposed to be done on TCP or on
-UDP transport. The new Toolkit 1.1 supports both.
-
-<h4>SilcClient</h4>
-
-The SilcClientParams includes new fields and some fields have been removed
-or moved to other places. All connection timeout related fields have been
-moved to SilcClientConnectionParams. The nickname_parse callback pointer has
-also been removed from SilcClientParams. The Toolkit 1.1 now automatically
-parses formatted nicknames.
-
-<br /> <br />
-The new field boolean `threads' can be used to tell whether the new SilcClient
-is to use multiple threads or not. If threads support has been compiled in
-and that field is set to TRUE then the client library will create new thread
-for each new connection to a remote host. If you are going to use several
-connections or some of the connections are high throughput connections (like
-multimedia connections) then using threads is recommended for performance.
-Note that your application needs to be multithreaded and, if necessary to,
-perform concurrencly control in client operation callbacks which may be
-called from multiple threads at the same time for different connections.
-However, it is always guaranteed that for one connection the client
-operations cannot be called from multiple threads. The multithreads
-support in Toolkit 1.1 client library means that each new connection and
-everything related to that connection is handled in own dedicated thread.
-
-<br /> <br />
-The silc_client_init function now takes several new arguments. It now takes
-the username, hostname and realname as argument that used to be required
-by the application to update directly to SilcClient pointer. This is not
-longer required. Also the nickname is no longer required to be put to
-SilcClient context as it has been made SilcClientConnection specific.
-The function also takes a SilcClientRunning callback as argument which will
-be called when the client library is running. Only after the callback is
-delivered may the application start using other client library API functions.
-For example, connecting to a server will fail if it is performed before
-the SilcClientRunning callback is called. The callback is called after the
-silc_client_run or silc_client_run_one has been called.
-
-<br /> <br />
-The silc_client_stop function takes new SilcClientStopped callback as
-argument, and it will be called after the client library has been completely
-stopped. The application should not quit before that is called in order
-to clean up all resources allocation by the client library.
-
-<br /> <br />
-It is also not required to put the public key pair (SilcPublicKey and
-SilcPrivateKey) into SilcClient. They have been made connection specific so
-you simply give them as argument when you create new connection. This way
-it is now possible to use different key pairs with different connections,
-one that was not possible in Toolkit 1.0 without creating new SilcClient
-instance for each new connection.
-
-<h4>SilcClientConnection</h4>
-
-The SilcClientConnection represents connection to a remote host. In new
-Toolkit 1.1 this structure now includes all connection related data and
-no connection related data is anymore included in SilcClient. For this
-reason it is no longer necessary to create multiple SilcClient instances
-just because you want to create multiple connections.
-
-<br /> <br />
-The SilcClientConnectionParams structure has many new fields. This structure
-is given as argument to any function that is able to create a new connection
-or to create a network listener or to create a new SILC sessions. See the
-API documentation for all the details but the following one field of special
-relevance when creating new SILC server connections. The nickname field is
-now included in this structure and it is the nickname user would like to
-initially use in the SILC network.
-
-<br /> <br />
-The functions silc_client_connect_to_server, silc_client_connect_to_client
-and silc_client_key_exchange can all be used to create new SILC session with
-a remote. To connect SILC server use silc_client_connect_to_server. You
-now give the SilcClientConnectionParams as argument which includes the
-nicknameuser wants to use, you now can give the public key pair as argument that is
-to be used in the connecting. The new SilcClientConnectCallback will be
-called once the connection has been established and it delivers the
-SilcClientConection context to the application. It will be later called
-again to indicated disconnection from the remote host. These functions
-now return SilcAsyncOperation context which can be used to cancel the
-connecting, if necessary. In the past canceling connection was not possible.
-
-<br /> <br />
-<pre>
-SilcAsyncOperation op;
-SilcClientConnectionParams params;
-
-memset(¶ms, 0, sizeof(params));
-
-/* Set nickname user wants to use */
-params.nickname = nickname;
-
-/* Set perfect forward secery for key exchange */
-params.pfs = TRUE;
-
-/* Example of creating, and then canceling a connection */
-op = silc_client_connect_to_server(client, params, public_key, private_key,
- remote_host, remote_port, connection_cb,
- app_context);
-if (!op) {
- fatal("Connecting failed immediately"));
- exit(1);
-}
-
-...
-
-/* Cancel connecting. After canceling the `connection_cb' will not be
- called. */
-silc_async_abort(op);
-</pre>
-
-<br /> <br />
-The old function silc_client_start_key_exchange has been replaced with
-silc_client_key_exchange function. Semantically it is equivalent to
-silc_client_connect_to_server but it does not create new connection. Instead,
-it accepts SilcStream as argument which is already established connection
-to a remote host and it merely starts the key exchange. See an example
-in the API documentation on how to use the silc_client_key_exchange, if
-your application wishes itself to create connection instead of using the
-client library to do it.
-
-The functions silc_client_add_connection, silc_client_del_connection and
-silc_client_del_socket has been removed. They are no longer needed.
-
-<h4>Entries</h4>
-
-Just like in Toolkit 1.0 we now have SilcClientEntry to represent user,
-SilcChannelEntry to represent channel and SilcServerEntry to represent
-server. In the past these structures and all API functions that dealt
-with them were in <a href="silcclient.html">silcclient.h</a> file. They
-are now in <a href="silcclient_entry.html">silcclient_entry.h</a> in
-Toolkit 1.1.
-
-<br /> <br />
-As an general convention each of these new entries now are reference
-counted and they have locks when using them in multithreaded application.
-Even in one-threaded application the application must always acquire a
-reference of the entry if it wishes to save the entry pointer in the
-application. The reference must be released once the entry pointer is
-not needed anymore. This ensures that the library cannot free the entry
-pointer underneath the application. An own API for taking and releasing
-the reference is in Toolkit 1.1.
-
-<br /> <br />
-<pre>
-/* Take reference of the client entry I save to my own context. */
-my_context->client_entry = silc_client_ref_client(client, conn, client_entry);
-</pre>
-
-<br /> <br />
-If multiple threads are used and application wants to access the entry it
-must always first lock the entry. After application has read the information
-it needs from the entry it must release the entry lock. The entry lock
-should be held only for short periods of time and failure to release the
-lock will result into deadlock. An own API for taking and releasing the
-entry lock is in Toolkit 1.1. If you application is not multithreaded
-you do not need to use the entry locking.
-
-<br /> <br />
-<pre>
-/* Read data from client entry in multithreaded environment */
-silc_client_lock_client(client_entry);
-fprintf(stdout, "%s\n", client_entry->nickname);
-fprintf(stdout, "%s\n", silc_id_render(SILC_ID_CLIENT, &client_entry->id));
-silc_client_unlock_client(client_entry);
-</pre>
-
-<br /> <br />
-From the entries all unnecessary information for application has been either
-removed or moved to internal structure that is not accessible by the
-application. As a result the entry structures are much smaller and cleaner.
-
-<br /> <br />
-The SilcClientEntry now includes nickname_normalized field and it is the
-normalized version of the user's nickname, in case application needs it.
-It is also guaranteed in Toolkit 1.1 that the nickname inside SilcCientEntry
-is always valid nickname.
-
-<br /> <br />
-The SilcChannelEntry now includes new channel_pubkeys list, which includes
-the channel public keys if they have added to the channel. This information
-was not present in Toolkit 1.0.
-
-<br /> <br />
-The SilcServerEntry now includes new field public_key, which is the server's
-public key if we have resolved it. This information was not present in
-Toolkit 1.0.
-
-<br /> <br />
-In Toolkit 1.1 it is now easier to search and resolve entries. As a new
-feature it now also possible to search and resolve server entries from the
-SILC network. See the API documentation for all the details on searching
-entries from the client library cache and from the SILC network.
-
-<h4>Sending/Receiving messages</h4>
-
-Sending messages has not much changed from the Toolkit 1.1. In Toolkit 1.1
-the message may now safely be sent in from multiple threads for same client
-or for same channel. In case the message are digitally signed the hash
-function used in the signature computation must now be given as argument.
-If this is done in multiple threads, each thread must use different SilcHash
-context because SilcHash does not support multiple threads. Simply allocate
-new SilcHash for each thread where you send digitally signed messages.
-
-<br /> <br />
-Receiving message is same as in Toolkit 1.0. You receive private_message
-or channel_message client operation. It is always guaranteed that even in
-multithreaded application the messages are received in one thread. You need
-concurrency control in your application only if you access shared data in
-your client operation callbacks.
-
-<br /> <br />
-In Toolkit 1.1 as a new feature it is also possible to wait for incoming
-private messages in a thread. New function silc_client_private_message_wait
-can be used to block the calling process or thread until private message
-for the specified client is received.
-
-<h4>Calling and sending commands</h4>
-
-Just like in Toolkit 1.0 in Toolkit 1.1 you can call command implemented
-inside the client library with silc_client_command_call. The command_reply
-client operation will be called once the command reply has arrived.
-
-<br /> <br />
-As a major change in semantics of sending commands with the
-silc_client_command_send function is the way the command reply is handled
-in Toolkit 1.1. In the new Toolkit the command_reply client operation will
-not be anymore called for commands that has been sent with
-silc_client_command_send. The command_reply client operation is called only
-when silc_client_command_call function is used. With silc_client_command_send
-you can give the command reply callback, SilcClientCommandReply, as argument,
-and it will be called for each command reply that is received from the
-server.
-
-<br /> <br />
-Just likein 1.0 in 1.1 it is also possible to attach to pending commands
-by using silc_client_command_pending. As a difference to 1.0 the command
-identifier is not anymore available to application from the
-SilcClientConnection context. Instead the silc_client_command_call and
-silc_client_command_send return the command identifier, and application needs
-to save it in order to be able to attach to it at later time. However,
-this feature is not expected to be very important for application
-programmers as the new silc_client_command_send already includes the
-command reply callback.
-
-<br /> <br />
-<pre>
-Comparison between 1.0 and 1.1
-
-Toolkit 1.0:
-/* Send ping command. The reply will be in the attached command reply
- and in the command_reply client operation. */
-silc_client_command_send(client, conn, SILC_COMMAND_PING, ++conn->cmd_ident,
- 1, 1, server_id, server_id_len);
-silc_client_command_pending(conn, SILC_COMMAND_PING, conn->cmd_ident,
- ping_command_reply, context);
-
-Toolkit 1.1:
-/* Send ping command. The reply will be ping_command_reply function. */
-silc_client_command_send(client, conn, SILC_COMMAND_PING,
- ping_command_reply, context,
- 1, 1, server_id, server_id_len);
-
-</pre>
-
-<h4>Notify arguments</h4>
-
-In Toolkit 1.1 the following notify arguments have had changes. See
-the <a href="notifyargs.html">Notify Arguments</a> for details. You should
-go through your application and change the handling of the following notify
-messages for Toolkit 1.1.
-
-<br /> <br />
-SILC_NOTIFY_TYPE_NICK_CHANGE<br />
-SILC_NOTIFY_TYPE_CMODE_CHANGE<br />
-SILC_NOTIFY_TYPE_SIGNOFF<br />
-SILC_NOTIFY_TYPE_SERVER_SIGNOFF<br />
-
-<br /> <br />
-The basic changes in notify arguments from Toolkit 1.0 is that the
-Toolkit 1.1 parses various lists and other raw data for the application as
-opposed to sending them in the raw format. This makes programming easier.
-
-<h4>Command reply arguments</h4>
-
-In Toolkit 1.1 the following command reply arguments have had changes. See
-the <a href="command_reply_args.html">Command Reply Arguments</a> for
-details. You should go through your application and change the handling
-of the following command replies for Toolkit 1.1.
-
-<br /> <br />
-SILC_COMMAND_WHOIS<br />
-SILC_COMMAND_INVITE<br />
-SILC_COMMAND_STATS<br />
-SILC_COMMAND_JOIN<br />
-SILC_COMMAND_CMODE<br />
-SILC_COMMAND_BAN<br />
-SILC_COMMAND_DETACH<br />
-SILC_COMMAND_USERS<br />
-
-<br /> <br />
-The basic changes in command reply arguments from Toolkit 1.0 is that the
-Toolkit 1.1 parses various lists and other raw data for the application as
-opposed to sending them in the raw format.. This makes programming easier.
-
-<h4>Other changes in client library</h4>
-
-There are many other smaller changes in Toolkit 1.1 that require you to
-change your application when porting from Toolkit 1.0. We are not listing
-all of them here but briefly mention some API changes.
-
-<br /> <br />
-Listing channel private keys now return SilcDList instead of an array.
-
-<br /> <br />
-The key agreement API has changed a little bit and is now more cleaner and
-supports all the features that are needed in full featured key agreement.
-The silc_client_peform_key_agreement_fd has been replaced by
-silc_client_perform_key_agreement_stream.
-
-<br /> <br />
-The private message key API has slight changes also. It is no longer
-necessary for the caller to specify whether the private message key is for
-responder or initiator use.
-
-<br /> <br />
-The file transfer API has changed a little bit and is now more cleaner and
-supports all the features that are needed in full featured file transfer.
-It is now easier to send files when you are behind NAT when you can
-specifically define the IPs that are used in both file sending and
-receiving.
-
-<br /> <br />
-As a new function silc_client_nickname_format can now be used to format
-the nickname of a client entry. The client library automatically formats
-the nicknames but in some cases application might like to change the
-nickname of a certain client entry.
-
-
-<br /> <br />
-<h3><a name="util"></a>Utility library, lib/silcutil/</h3>
-
-The Utility library (runtime library) has had several changes and has several
-new interfaces. Some interfaces has also been removed or moved to some
-other library. Removed interfaces rae: silcprotocol.h and silcsockconn.h.
-Moved interfaces are: <a href="silcapputil.html">silcapputil.h</a> and
-<a href="silcvcard.html">silcvcard.h</a>.
-
-<h4>SILC Async Operation Interface</h4>
-
-A new asynchronous operation API (<a href="silcasync.html">silcasync.h</a>)
-has been added. It can be used to control asynchronous operations, like
-to cancel them. Many asynchronous routines in SILC Toolkit now return
-SilcAsyncOperation context so that the operation can be controlled by the
-caller. It especiallly provides a generic way to cancel asynchronous
-operations which can be difficult.
-
-<h4>SILC Atomic Operations Interface</h4>
-
-A new atomic operations API (<a href="silcatomic.html">silcatomic.h</a>)
-has been added. It provides routines to perform various operations on
-integeres and pointers atomically.
-
-<h4>SILC Data Stack Interface</h4>
-
-A new data stack (memory pool system) API
-(<a href="silcstack.html">silcstack.h</a>) has been added.
-It provides a fast memory allocation system. Many routines in the SILC Toolkit
-are SilcStack aware thus enabling them to use the SilcStack as their source
-for memory allocation. All routines that are SilcStack aware automatically
-revert back to normal memory allocation if SilcStack is not given as
-argument. See silcstack.h for list of utility routines that support SilcStack
-by default.
-
-<h4>SILC Condition Variable Interface</h4>
-
-A new condition variable API (<a href="silccond.html">silccond.h</a>)
-has been added. It provides condition variables for multithreaded
-applications.
-
-<h4>SILC Stream Interface</h4>
-
-A new abstract stream API (<a href="silcstream.html">silcstream.h</a>)
-has been added. The SilcStream
-provides an abstract way of representing different kinds of streams. The
-API provides functions that can be used to read, write, control and destroy
-streams. The API is not used to create streams but separate interfaces
-exist for streams that use the SilcStream abstraction. For example,
-socket stream and file descriptor stream exist.
-
-<h4>SILC FD Stream Interface</h4>
-
-A new file descriptor stream API
-(<a href="silcfdstream.html">silcfdstream.h</a>) has been added. It
-provides a blocking and non-blocking file descriptor stream through the
-SilcStream abstraction.
-
-<h4>SILC Socket Stream Interface</h4>
-
-A new socket stream API
-(<a href="silcsocketstream.html">silcsocketstream.h</a>) has been added.
-It provides a blocking and non-blocking socket stream through the SilcStream
-abstraction.
-
-<h4>SILC FSM Interface</h4>
-
-A new Finite State Machine API
-(<a href="silcfsm.html">silcfsm.h</a>) has been added. It provides
-an FSM that can be used to implement all kinds of machines and protocols.
-The machine also supports threads, and threads that are actually executed
-in real system threads. The SILC FSM API also supports asynchronous
-events.
-
-<h4>SILC Time Interface</h4>
-
-A new SILC Time API
-(<a href="silctime.html">silctime.h</a>) has been added. It provides utility
-functions to retrieve and represent time in different ways. It supports
-Universal and Generalized time string creation and parsing and adds a new
-SilcTime structure to represent time.
-
-<h4>SILC Snprintf Interface</h4>
-
-A new snprintf API
-(<a href="silcsnprintf.html">silcsnprintf.h</a>) has been added. It
-provides snprintf and other string formatting routines.
-
-<h4>SILC Mutex Interface changes</h4>
-
-The SILC Mutex API (<a href="silcmutex.html">silcmutex.h</a>)
-has several changes. A support for read/write locks has been added
-(SilcRwLock). Also silc_mutex_assert_locked function is added.
-
-<h4>SILC Network Interface changes</h4>
-
-The SILC Network API
-(<a href="silcnet.html">silcnet.h</a>) has several changes. The API is almost
-entirely rewritten and most of the old functions have been removed. The
-API has now both TCP and UDP support, and as previously supports IPv4
-and IPv6. New functions are silc_net_tcp_create_listener,
-silc_net_listener_get_port, silc_net_close_listener, silc_net_tcp_connnect,
-silc_net_udp_connect, silc_net_udp_receive, silc_net_udp_send.
-
-<h4>SILC Scheduler Interface changes</h4>
-
-The SILC Schedule API
-(<a href="silcschedule.html">silcschedule.h</a>) has several changes. The
-scheduler has been entirely rewritten but most of the API remains the same.
-The SILC_TASK_GENERIC and SILC_TASK_CALLBACK_GLOCAL have been removed.
-The way signal are dispatched has been changed. The SILC Schedule is now
-able to itself dispatch all signals. New functions are
-silc_schedule_task_add_fd, silc_schedule_task_add_timeout,
-silc_schedule_task_add_signal, silc_task_del_by_all,
-silc_schedule_get_fd_events. The functions silc_schedule_signal_register,
-silc_schedule_signal_unregister and silc_schedule_signal_call have been
-removed.
-
-<h4>SILC Types Interface changes</h4>
-
-The SILC Type API (<a href="silctypes.html">silctypes.h</a>) has several
-changes. The bool type is replaced with SilcBool. Sockets are now
-represented by SilcSocket.
-
-<h4>SILC String util Interface changes</h4>
-
-The SILC string utility API
-(<a href="silcstrutil.html">silcstrutil.h</a>) has changes. The PEM encoding
-and decoding routines has been renamed, silc_base64_encode,
-silc_base64_encode_file and silc_base64_decode. The silc_mime_parse has
-been removed. A new silc_string_split function has been added.
-
-<h4>SILC Utility Interface changes</h4>
-
-
-<h4>SILC File Util Interface changes</h4>
-
-The SILC file utility API (<a href="silcfileutil.html">silcfileutil.h</a>)
-has changes. A new function silc_file_set_nonblock has been added.
-
-<h4>SILC List and Dynamic List Interface changes</h4>
-
-The SILC List (<a href="silclist.html">silclist.h</a>) and SILC Dynamic List
-(silcdlist.h) APIs have changes. New functions silc_list_insert and
-silc_dlist_insert have been added.
-
-<h4>SILC Buffer Interface changes</h4>
-
-The SILC Buffer API (<a href="silcbuffer.html">silcbuffer.h</a>) has several
-changes. The SilcBuffer
-structure no longer contain the buffer length and true length fields
-but silc_buffer_len() and silc_buffr_truelen() macros are available
-instead. Also silc_buffer_data(), silc_buffer_datalen(), silc_buffer_purge(),
-silc_buffer_reset(), silc_buffer_start(), silc_buffer_end() and
-silc_buffer_enlarge() has been added. The API also supports SilcStack.
-
-<h4>SILC Buffer Formatting Interface changes</h4>
-
-The SILC Buffer Formatting API
-(<a href="silcbuffmt.html">silcbuffmt.h</a>) has several changes. The
-silc_buffer_format now automatically allocates memory to the destination
-buffer if it does not have space. Also new the following new formatters
-have been added: SILC_STR_DATA (replaces SILC_STR_UI_XNSTRING),
-SILC_STR_BUFFER, SILC_STR_FUNC, SILC_STF_OFFSET and SILC_STR_ADVANCE.
-The API also supports SilcStack.
-
-<h4>SILC Memory Interface changes</h4>
-
-The memory allocation API (<a href="silcmemory.html">silcmemory.h</a>) has
-several changes. It supports now SilcStack as memory source. Also all
-memory allocation routines can now fail and return NULL as opposed to fatally
-failing when memory allocation fails.
-
-<br /> <br />
-<h3><a name="apputil"></a>SILC Application Utility library, lib/silcapputil/</h3>
-
-A new SILC Application Utility library has been added. It provides
-various application specific utility libraries that are not part of
-the runtime library (lib/silcutil/). The interfaces in the Application
-utility library were in other libraries in Toolkit 1.0 and the library
-does not contain any entirely new interfaces.
-
-<h4>SILC Application Utility Interface</h4>
-
-The <a href="silcapputil.html">silcapputil.h</a> contains various application
-utility functions. It
-existed in Toolkit 1.0 but some of the APIs has been changed. The
-silc_create_key_pair, silc_load_key_pair and silc_show_public_key APIs
-has changed. A new silc_show_public_key_file has been added. Functions
-silc_identifier_check, silc_identifier_verify, silc_channel_name_check,
-silc_channel_name_verify, silc_get_mode_list silc_get_status_message,
-silc_get_packet_name, silc_get_command_name, silc_parse_version_string,
-silc_version_to_num, silc_client_chmode, silc_client_chumode,
-silc_client_chumode_char and silc_id_render has been moved from other
-libraries into this interface in Toolkit 1.1.
-
-<h4>SILC ID Cache Interface</h4>
-
-The ID Cache interface (<a href="silcidcache.html">silcidcache.h</a>) has
-been moved from lib/silccore into lib/silcapputil/.
-
-<br /> <br />
-<h3><a name="skr"></a>SILC Key Repository library, lib/silcskr/</h3>
-
-A new SILC Key Repository library has been added. The library provides
-a SILC Key Repository API (<a href="silcskr.html">silcskr.h</a>) which provides
-a repository for storing and retrieving public keys.
-
-<br /> <br />
-<h3><a name="vcard"></a>SILC VCard library, lib/silcvcard/</h3>
-
-A new SILC VCard library has been added. The SILC VCard API has been
-moved from utility library to own library in lib/silcvcard/.
-
-<br /> <br />
-<h3><a name="http"></a>SILC HTTP library, lib/silchttp/</h3>
-
-A new SILC HTTP library has been added. The library includes SILC HTTP
-Server Interface and SILC HTTP PHP Translator Interface.
-
-<h4>SILC HTTP Server Interface</h4>
-
-The SILC HTTP Server API (<a href="silchttpserver.html">silchttpservder.h</a>)
-provides a simple HTTP server implementation for applications that want to
-integrate a small HTTP server.
-
-<h4>SILC HTTP PHP Translator Interface</h4>
-
-The SILC HTTP PHP Translator API (<a href="silchttpphp.html">silchttpphp.h</a>)
- provides PHP translates PHP code into HTML. It can be used to serve PHP
-pages in HTTP server.
-
-<br /> <br />
-<h3><a name="asn1"></a>SILC ASN.1 library, lib/silcasn1/</h3>
-
-A new Abstract Syntax Notation One (ASN.1) library has been added. The
-library provides SILC ASN.1 encoder and decoder interface and SILC BER
-encoder and decoder interface.
-
-<h4>SILC ASN.1 Interface</h4>
-
-The SILC ASN.1 API (<a href="silcasn1.html">silcasn1.h</a>) provides ASN.1
-encoder and decoder. The interface provides efficient encoder and decoder
-and is support SilcStack as memory source. The interface is simple and it
-supports almost all ASN.1 features.
-
-<h4>SILC BER Interface</h4>
-
-The SILC BER API (<a href="silcber.html">silcber.h</a>) provides BER/DER
-encoder and decoder. It is integral part of the ASN.1 library and the ASN.1
-encoder and decoder.
+++ /dev/null
-Makefile
-*.in
-*.am
-*.o
-*.lo
-*.la
-*.a
-*.pc
silcregex.h \
silcthreadqueue.h \
silcrand.h \
- silcglobal.h
+ silcglobal.h \
+ silcruntime.h
SILC_EXTRA_DIST =
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Async Operation Interface
+/****h* silcutil/Async Operation Interface
*
* DESCRIPTION
*
#ifndef SILCASYNC_H
#define SILCASYNC_H
-/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperation
+/****s* silcutil/SilcAsyncOperation
*
* NAME
*
***/
typedef struct SilcAsyncOperationObject *SilcAsyncOperation;
-/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationStruct
+/****s* silcutil/SilcAsyncOperationStruct
*
* NAME
*
***/
typedef struct SilcAsyncOperationObject SilcAsyncOperationStruct;
-/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationAbort
+/****f* silcutil/SilcAsyncOperationAbort
*
* SYNOPSIS
*
typedef void (*SilcAsyncOperationAbort)(SilcAsyncOperation op,
void *context);
-/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationPause
+/****f* silcutil/SilcAsyncOperationPause
*
* SYNOPSIS
*
that has received SilcAsyncOperation context can control the async
operation with these functions. */
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_halt
+/****f* silcutil/silc_async_halt
*
* SYNOPSIS
*
***/
SilcBool silc_async_halt(SilcAsyncOperation op);
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_resume
+/****f* silcutil/silc_async_resume
*
* SYNOPSIS
*
***/
SilcBool silc_async_resume(SilcAsyncOperation op);
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_abort
+/****f* silcutil/silc_async_abort
*
* SYNOPSIS
*
/* The operation layer functions. The layer that performs the async
operation use these functions. */
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_alloc
+/****f* silcutil/silc_async_alloc
*
* SYNOPSIS
*
SilcAsyncOperationPause pause_cb,
void *context);
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_init
+/****f* silcutil/silc_async_init
*
* SYNOPSIS
*
SilcAsyncOperationPause pause_cb,
void *context);
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_free
+/****f* silcutil/silc_async_free
*
* SYNOPSIS
*
***/
void silc_async_free(SilcAsyncOperation op);
-/****f* silcutil/SilcAsyncOperationAPI/silc_async_get_context
+/****f* silcutil/silc_async_get_context
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2006 - 2007 Pekka Riikonen
+ Copyright (C) 2006 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Atomic Operations Interface
+/****h* silcutil/Atomic Operations Interface
*
* DESCRIPTION
*
#define SILC_SMP_LOCK
#endif /* SILC_SMP */
-/****s* silcutil/SilcAtomicAPI/SilcAtomic32
+/****s* silcutil/SilcAtomic32
*
* NAME
*
*
***/
-/****s* silcutil/SilcAtomicAPI/SilcAtomic16
+/****s* silcutil/SilcAtomic16
*
* NAME
*
*
***/
-/****s* silcutil/SilcAtomicAPI/SilcAtomic8
+/****s* silcutil/SilcAtomic8
*
* NAME
*
*
***/
-/****s* silcutil/SilcAtomicAPI/SilcAtomicPointer
+/****s* silcutil/SilcAtomicPointer
*
* NAME
*
} SilcAtomic8;
#endif
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init32
+/****f* silcutil/silc_atomic_init32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init16
+/****f* silcutil/silc_atomic_init16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init8
+/****f* silcutil/silc_atomic_init8
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_init_pointer
+/****f* silcutil/silc_atomic_init_pointer
*
* SYNOPSIS
*
SILC_ATOMIC_INIT(32, 32, SilcUInt32)
SILC_ATOMIC_INIT(_pointer, Pointer, void *)
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit32
+/****f* silcutil/silc_atomic_uninit32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit16
+/****f* silcutil/silc_atomic_uninit16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit8
+/****f* silcutil/silc_atomic_uninit8
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit_pointer
+/****f* silcutil/silc_atomic_uninit_pointer
*
* SYNOPSIS
*
SILC_ATOMIC_UNINIT(32, 32)
SILC_ATOMIC_UNINIT(_pointer, Pointer)
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int32
+/****f* silcutil/silc_atomic_set_int32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int16
+/****f* silcutil/silc_atomic_set_int16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int8
+/****f* silcutil/silc_atomic_set_int8
*
* SYNOPSIS
*
SILC_ATOMIC_SET_INT(16, "w", "w")
SILC_ATOMIC_SET_INT(32, "l", "")
-/****f* silcutil/SilcAtomicAPI/silc_atomic_set_pointer
+/****f* silcutil/silc_atomic_set_pointer
*
* SYNOPSIS
*
#endif
}
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int32
+/****f* silcutil/silc_atomic_get_int32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int16
+/****f* silcutil/silc_atomic_get_int16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int8
+/****f* silcutil/silc_atomic_get_int8
*
* SYNOPSIS
*
SILC_ATOMIC_GET_INT(16)
SILC_ATOMIC_GET_INT(32)
-/****f* silcutil/SilcAtomicAPI/silc_atomic_get_pointer
+/****f* silcutil/silc_atomic_get_pointer
*
* SYNOPSIS
*
#endif
}
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int32
+/****f* silcutil/silc_atomic_add_int32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int16
+/****f* silcutil/silc_atomic_add_int16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int8
+/****f* silcutil/silc_atomic_add_int8
*
* SYNOPSIS
*
SILC_ATOMIC_ADD_INT(16, "w")
SILC_ATOMIC_ADD_INT(32, "l")
-/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int32
+/****f* silcutil/silc_atomic_sub_int32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int16
+/****f* silcutil/silc_atomic_sub_int16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int8
+/****f* silcutil/silc_atomic_sub_int8
*
* SYNOPSIS
*
#define silc_atomic_sub_int16(a, v) silc_atomic_add_int16(a, (-v))
#define silc_atomic_sub_int32(a, v) silc_atomic_add_int32(a, (-v))
-/****f* silcutil/SilcAtomicAPI/silc_atomic_inc32
+/****f* silcutil/silc_atomic_inc32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_inc16
+/****f* silcutil/silc_atomic_inc16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_inc8
+/****f* silcutil/silc_atomic_inc8
*
* SYNOPSIS
*
SILC_ATOMIC_INC(16, "w")
SILC_ATOMIC_INC(32, "l")
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec32
+/****f* silcutil/silc_atomic_dec32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec16
+/****f* silcutil/silc_atomic_dec16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_dec8
+/****f* silcutil/silc_atomic_dec8
*
* SYNOPSIS
*
SILC_ATOMIC_DEC(16, "w")
SILC_ATOMIC_DEC(32, "l")
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas32
+/****f* silcutil/silc_atomic_cas32
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas16
+/****f* silcutil/silc_atomic_cas16
*
* SYNOPSIS
*
*
***/
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas8
+/****f* silcutil/silc_atomic_cas8
*
* SYNOPSIS
*
SILC_ATOMIC_CAS(16, "w")
SILC_ATOMIC_CAS(32, "l")
-/****f* silcutil/SilcAtomicAPI/silc_atomic_cas_pointer
+/****f* silcutil/silc_atomic_cas_pointer
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Base64 API
+/****h* silcutil/Base64 Interface
*
* DESCRIPTION
*
#ifndef SILCBASE64_H
#define SILCBASE64_H
-/****f* silcutil/SilcBase64API/silc_base64_encode
+/****f* silcutil/silc_base64_encode
*
* SYNOPSIS
*
***/
char *silc_base64_encode(SilcStack stack, unsigned char *data, SilcUInt32 len);
-/****f* silcutil/SilcBase64API/silc_base64_encode_file
+/****f* silcutil/silc_base64_encode_file
*
* SYNOPSIS
*
char *silc_base64_encode_file(SilcStack stack,
unsigned char *data, SilcUInt32 data_len);
-/****f* silcutil/SilcBase64API/silc_base_decode
+/****f* silcutil/silc_base_decode
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Bit Operations Interface
+/****h* silcutil/Bit Operations Interface
*
* DESCRIPTION
*
* find bits in an arbitrarily large bitmap. The interface does not support
* setting the bits atomically.
*
+ * EXAMPLE
+ *
* Example with a pre-allocated bitmap:
*
* // Declare bitmap of size of 500 bits
#define SILC_BIT_SIZE (SILC_SIZEOF_LONG * 8)
-/****d* silcutil/SilcBitOpAPI/SILC_BITMAP_DECLARE
+/****d* silcutil/SILC_BITMAP_DECLARE
*
* NAME
*
#define SILC_BITMAP_DECLARE(name, bits) \
unsigned long name[SILC_BITMAP_SIZE(bits)]
-/****d* silcutil/SilcBitOpAPI/SILC_BITMAP_SIZE
+/****d* silcutil/SILC_BITMAP_SIZE
*
* NAME
*
***/
#define SILC_BITMAP_SIZE(bits) (((bits) + SILC_BIT_SIZE) / SILC_BIT_SIZE)
-/****f* silcutil/SilcBitOpAPI/silc_bit_set
+/****f* silcutil/silc_bit_set
*
* SYNOPSIS
*
SilcBool silc_bit_set(volatile unsigned long *bitmap, SilcUInt32 bitmap_size,
SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_clear
+/****f* silcutil/silc_bit_clear
*
* SYNOPSIS
*
SilcBool silc_bit_clear(volatile unsigned long *bitmap, SilcUInt32 bitmap_size,
SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_toggle
+/****f* silcutil/silc_bit_toggle
*
* SYNOPSIS
*
SilcBool silc_bit_toggle(volatile unsigned long *bitmap,
SilcUInt32 bitmap_size, SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_test_and_set
+/****f* silcutil/silc_bit_test_and_set
*
* SYNOPSIS
*
int silc_bit_test_and_set(volatile unsigned long *bitmap,
SilcUInt32 bitmap_size, SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_test_and_clear
+/****f* silcutil/silc_bit_test_and_clear
*
* SYNOPSIS
*
int silc_bit_test_and_clear(volatile unsigned long *bitmap,
SilcUInt32 bitmap_size, SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_test_and_toggle
+/****f* silcutil/silc_bit_test_and_toggle
*
* SYNOPSIS
*
int silc_bit_test_and_toggle(volatile unsigned long *bitmap,
SilcUInt32 bitmap_size, SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_get
+/****f* silcutil/silc_bit_get
*
* SYNOPSIS
*
int silc_bit_get(volatile unsigned long *bitmap, SilcUInt32 bitmap_size,
SilcUInt32 bit);
-/****f* silcutil/SilcBitOpAPI/silc_bit_ffs
+/****f* silcutil/silc_bit_ffs
*
* SYNOPSIS
*
***/
int silc_bit_ffs(volatile unsigned long *bitmap, SilcUInt32 bitmap_size);
-/****f* silcutil/SilcBitOpAPI/silc_bit_ffz
+/****f* silcutil/silc_bit_ffz
*
* SYNOPSIS
*
***/
int silc_bit_ffz(volatile unsigned long *bitmap, SilcUInt32 bitmap_size);
-/****f* silcutil/SilcBitOpAPI/silc_bit_fns
+/****f* silcutil/silc_bit_fns
*
* SYNOPSIS
*
int silc_bit_fns(volatile unsigned long *bitmap, SilcUInt32 bitmap_size,
SilcUInt32 offset);
-/****f* silcutil/SilcBitOpAPI/silc_bit_fnz
+/****f* silcutil/silc_bit_fnz
*
* SYNOPSIS
*
int silc_bit_fnz(volatile unsigned long *bitmap, SilcUInt32 bitmap_size,
SilcUInt32 offset);
-/****f* silcutil/SilcBitOpAPI/silc_bit_clear_bitmap
+/****f* silcutil/silc_bit_clear_bitmap
*
* SYNOPSIS
*
GNU General Public License for more details.
*/
-/* $Id: silcbuffer.h,v 1.43 2008/01/15 06:36:54 priikone Exp $ */
-/****h* silcutil/SILC Buffer Interface
+/****h* silcutil/Buffer Interface
*
* DESCRIPTION
*
- * SilcBuffer is very simple and easy to use, yet you can do to the
- * buffer almost anything you want with its method functions. The buffer
+ * Data buffer interface that provides buffer allocation and manipulation
+ * routines. SilcBuffer is simple and easy to use, yet you can do to the
+ * buffer almost anything you want with its method functions. The buffer
* is constructed of four different data sections that in whole creates
- * the allocated data area.
+ * the allocated data area. See the SilcBuffer context for more information.
+ *
+ * The SilcBuffer context is not thread-safe and if same context must be
+ * used from multiple threads concurrency control must be employed.
*
***/
#ifndef SILCBUFFER_H
#define SILCBUFFER_H
-/****s* silcutil/SilcBufferAPI/SilcBuffer
+/****s* silcutil/SilcBuffer
*
* NAME
*
* SILC Buffer object. Following short description of the fields
* of the buffer.
*
- * EXAMPLE
- *
- * unsiged char *head;
+ * unsiged char *head;
*
* Head of the allocated buffer. This is the start of the allocated
* data area and remains as same throughout the lifetime of the buffer.
* However, the end of the head area or the start of the currently valid
- * data area is variable.
+ * data area is variable. Reallocating the buffer may change the
+ * pointer.
*
* --------------------------------
* | head | data | tail |
*
* Current head section in the buffer is sb->data - sb->head.
*
- * unsigned char *data;
+ * unsigned char *data;
*
* Currently valid data area. This is the start of the currently valid
* main data area. The data area is variable in all directions.
*
* Current valid data area in the buffer is sb->tail - sb->data.
*
- * unsigned char *tail;
+ * unsigned char *tail;
*
* Tail of the buffer. This is the end of the currently valid data area
* or start of the tail area. The start of the tail area is variable.
*
* Current tail section in the buffer is sb->end - sb->tail.
*
- * unsigned char *end;
+ * unsigned char *end;
*
* End of the allocated buffer. This is the end of the allocated data
* area and remains as same throughout the lifetime of the buffer.
*
* Length of the entire buffer is (ie. truelen) sb->end - sb->head.
*
- * Currently valid data area is considered to be the main data area in
- * the buffer. However, the entire buffer is of course valid data and can
- * be used as such. Usually head section of the buffer includes different
- * kind of headers or similar. Data section includes the main data of
- * the buffer. Tail section can be seen as a reserve space of the data
- * section. Tail section can be pulled towards end, and thus the data
- * section becomes larger.
- *
- * SILC Buffer is not thread-safe. If the same SilcBuffer context must be
- * used in multithreaded environment concurrency control must be employed.
+ * Currently valid data area is considered to be the main data area in
+ * the buffer. However, the entire buffer is of course valid data and can
+ * be used as such. Usually head section of the buffer includes different
+ * kind of headers or similar. Data section includes the main data of
+ * the buffer. Tail section can be seen as a reserve space of the data
+ * section. Tail section can be pulled towards end, and thus the data
+ * section becomes larger.
*
* SOURCE
*/
typedef struct SilcBufferObject {
- unsigned char *head;
- unsigned char *data;
- unsigned char *tail;
- unsigned char *end;
+ unsigned char *head; /* Head of the allocated buffer area */
+ unsigned char *data; /* Start of the data area */
+ unsigned char *tail; /* Start of the tail area */
+ unsigned char *end; /* End of the buffer */
} *SilcBuffer, SilcBufferStruct;
/***/
/* Macros */
-/****f* silcutil/SilcBufferAPI/silc_buffer_data
+/****f* silcutil/silc_buffer_data
*
* NAME
*
#define silc_buffer_data(x) (x)->data
/***/
-/****f* silcutil/SilcBufferAPI/silc_buffer_tail
+/****f* silcutil/silc_buffer_tail
*
* NAME
*
#define silc_buffer_tail(x) (x)->tail
/***/
-/****f* silcutil/SilcBufferAPI/silc_buffer_datalen
+/****f* silcutil/silc_buffer_datalen
*
* NAME
*
/* Inline functions */
-/****d* silcutil/SilcBufferAPI/silc_buffer_truelen
+/****d* silcutil/silc_buffer_truelen
*
* NAME
*
return (SilcUInt32)(x->end - x->head);
}
-/****d* silcutil/SilcBufferAPI/silc_buffer_len
+/****d* silcutil/silc_buffer_len
*
* NAME
*
return (SilcUInt32)(x->tail - x->data);
}
-/****d* silcutil/SilcBufferAPI/silc_buffer_headlen
+/****d* silcutil/silc_buffer_headlen
*
* NAME
*
return (SilcUInt32)(x->data - x->head);
}
-/****d* silcutil/SilcBufferAPI/silc_buffer_taillen
+/****d* silcutil/silc_buffer_taillen
*
* NAME
*
return (SilcUInt32)(x->end - x->tail);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_alloc
+/****f* silcutil/silc_buffer_alloc
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_salloc
+/****f* silcutil/silc_buffer_salloc
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_free
+/****f* silcutil/silc_buffer_free
*
* SYNOPSIS
*
}
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_sfree
+/****f* silcutil/silc_buffer_sfree
*
* SYNOPSIS
*
silc_buffer_free(sb);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_steal
+/****f* silcutil/silc_buffer_steal
*
* SYNOPSIS
*
return buf;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_purge
+/****f* silcutil/silc_buffer_purge
*
* SYNOPSIS
*
silc_free(silc_buffer_steal(sb, NULL));
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_spurge
+/****f* silcutil/silc_buffer_spurge
*
* SYNOPSIS
*
silc_buffer_purge(sb);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_set
+/****f* silcutil/silc_buffer_set
*
* SYNOPSIS
*
sb->tail = sb->end = data + data_len;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_pull
+/****f* silcutil/silc_buffer_pull
*
* SYNOPSIS
*
return old_data;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_push
+/****f* silcutil/silc_buffer_push
*
* SYNOPSIS
*
return old_data;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_pull_tail
+/****f* silcutil/silc_buffer_pull_tail
*
* SYNOPSIS
*
return old_tail;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_push_tail
+/****f* silcutil/silc_buffer_push_tail
*
* SYNOPSIS
*
return old_tail;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_put_head
+/****f* silcutil/silc_buffer_put_head
*
* SYNOPSIS
*
return (unsigned char *)memcpy(sb->head, data, len);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_put
+/****f* silcutil/silc_buffer_put
*
* SYNOPSIS
*
return (unsigned char *)memcpy(sb->data, data, len);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_put_tail
+/****f* silcutil/silc_buffer_put_tail
*
* SYNOPSIS
*
return (unsigned char *)memcpy(sb->tail, data, len);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_alloc_size
+/****f* silcutil/silc_buffer_alloc_size
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_salloc_size
+/****f* silcutil/silc_buffer_salloc_size
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_reset
+/****f* silcutil/silc_buffer_reset
*
* SYNOPSIS
*
sb->data = sb->tail = sb->head;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_clear
+/****f* silcutil/silc_buffer_clear
*
* SYNOPSIS
*
silc_buffer_reset(sb);
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_start
+/****f* silcutil/silc_buffer_start
*
* SYNOPSIS
*
sb->data = sb->head;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_end
+/****f* silcutil/silc_buffer_end
*
* SYNOPSIS
*
sb->tail = sb->end;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_copy
+/****f* silcutil/silc_buffer_copy
*
* SYNOPSIS
*
return sb_new;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_scopy
+/****f* silcutil/silc_buffer_scopy
*
* SYNOPSIS
*
return sb_new;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_clone
+/****f* silcutil/silc_buffer_clone
*
* SYNOPSIS
*
return sb_new;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_sclone
+/****f* silcutil/silc_buffer_sclone
*
* SYNOPSIS
*
return sb_new;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_realloc
+/****f* silcutil/silc_buffer_realloc
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc
+/****f* silcutil/silc_buffer_srealloc
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_realloc_size
+/****f* silcutil/silc_buffer_realloc_size
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc_size
+/****f* silcutil/silc_buffer_srealloc_size
*
* SYNOPSIS
*
return sb;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_enlarge
+/****f* silcutil/silc_buffer_enlarge
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_senlarge
+/****f* silcutil/silc_buffer_senlarge
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_append
+/****f* silcutil/silc_buffer_append
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_append
+/****f* silcutil/silc_buffer_sappend
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_strchr
+/****f* silcutil/silc_buffer_strchr
*
* SYNOPSIS
*
return NULL;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_equal
+/****f* silcutil/silc_buffer_equal
*
* SYNOPSIS
*
return memcmp(sb1->data, sb2->data, silc_buffer_len(sb1)) == 0;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_memcmp
+/****f* silcutil/silc_buffer_memcmp
*
* SYNOPSIS
*
return memcmp(buffer->data, data, data_len) == 0;
}
-/****f* silcutil/SilcBufferAPI/silc_buffer_printf
+/****f* silcutil/silc_buffer_printf
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Buffer Format Interface
+/****h* silcutil/Buffer Format Interface
*
* DESCRIPTION
*
* macro provides many different flags that can change the behavior of the
* matching, with capabilities to also mimic Sed behavior.
*
- * As the SilcBuffer API is not thread-safe these routines may not be used
+ * As the SilcBuffer context is not thread-safe these routines may not be used
* in multithreaded environment with a same SilcBuffer context without
* concurrency control.
*
*
* SilcBufferStruct buffer;
*
+ * // Encode buffer
* memset(&buffer, 0, sizeof(buffer));
* ret = silc_buffer_format(&buffer,
* SILC_STR_UINT32(intval),
#ifndef SILCBUFFMT_H
#define SILCBUFFMT_H
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferFormatFunc
+/****f* silcutil/SilcBufferFormatFunc
*
* SYNOPSIS
*
typedef int (*SilcBufferFormatFunc)(SilcStack stack, SilcBuffer buffer,
void *value, void *context);
-/****f* silcutil/SilcBufferFormatAPI/SilcBufferUnformatFunc
+/****f* silcutil/SilcBufferUnformatFunc
*
* SYNOPSIS
*
/* Prototypes */
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format
+/****f* silcutil/silc_buffer_format
*
* SYNOPSIS
*
* silc_buffer_purge(&buffer);
*
* // Dynamically allocated zero size buffer
- * SilcBuffer buf;
+ * SilcBuffer buf;
* buf = silc_buffer_alloc(0);
* ret = silc_buffer_format(buf,
* SILC_STR_UINT32(intval),
***/
int silc_buffer_format(SilcBuffer dst, ...);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat
+/****f* silcutil/silc_buffer_sformat
*
* SYNOPSIS
*
***/
int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format_vp
+/****f* silcutil/silc_buffer_format_vp
*
* SYNOPSIS
*
***/
int silc_buffer_format_vp(SilcBuffer dst, va_list ap);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat_vp
+/****f* silcutil/silc_buffer_sformat_vp
*
* SYNOPSIS
*
***/
int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat
+/****f* silcutil/silc_buffer_unformat
*
* SYNOPSIS
*
***/
int silc_buffer_unformat(SilcBuffer src, ...);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat
+/****f* silcutil/silc_buffer_sunformat
*
* SYNOPSIS
*
***/
int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat_vp
+/****f* silcutil/silc_buffer_unformat_vp
*
* SYNOPSIS
*
***/
int silc_buffer_unformat_vp(SilcBuffer src, va_list ap);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat_vp
+/****f* silcutil/silc_buffer_sunformat_vp
*
* SYNOPSIS
*
***/
int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_strformat
+/****f* silcutil/silc_buffer_strformat
*
* SYNOPSIS
*
***/
int silc_buffer_strformat(SilcBuffer dst, ...);
-/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sstrformat
+/****f* silcutil/silc_buffer_sstrformat
*
* SYNOPSIS
*
***/
int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...);
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT8
+/****d* silcutil/SILC_STR_SINT8
*
* NAME
*
*
* One 8-bit signed integer.
*
- * Formatting: SILC_STR_SINT8(SilcInt8)
- * Unformatting: SILC_STR_SINT8(SilcInt8 *)
+ * Formatting: SILC_STR_SINT8(SilcInt8)
+ * Unformatting: SILC_STR_SINT8(SilcInt8 *)
*
***/
#define SILC_STR_SINT8(x) SILC_PARAM_SINT8, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT8
+/****d* silcutil/SILC_STR_UINT8
*
* NAME
*
*
* One 8-bit unsigned integer.
*
- * Formatting: SILC_STR_UINT8(SilcUInt8)
- * Unformatting: SILC_STR_UINT8(SilcUInt8 *)
+ * Formatting: SILC_STR_UINT8(SilcUInt8)
+ * Unformatting: SILC_STR_UINT8(SilcUInt8 *)
*
***/
#define SILC_STR_UINT8(x) SILC_PARAM_UINT8, (x)
#define SILC_STR_SI_CHAR(x) SILC_PARAM_SINT8, (x)
#define SILC_STR_UI_CHAR(x) SILC_PARAM_UINT8, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT16
+/****d* silcutil/SILC_STR_SINT16
*
* NAME
*
*
* SilcInt16.
*
- * Formatting: SILC_STR_SINT16(SilcInt16)
- * Unformatting: SILC_STR_SINT16(SilcInt16 *)
+ * Formatting: SILC_STR_SINT16(SilcInt16)
+ * Unformatting: SILC_STR_SINT16(SilcInt16 *)
*
***/
#define SILC_STR_SINT16(x) SILC_PARAM_SINT16, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT16
+/****d* silcutil/SILC_STR_UINT16
*
* NAME
*
*
* SilcUInt16.
*
- * Formatting: SILC_STR_UINT16(SilcUInt16)
- * Unformatting: SILC_STR_UINT16(SilcUInt16 *)
+ * Formatting: SILC_STR_UINT16(SilcUInt16)
+ * Unformatting: SILC_STR_UINT16(SilcUInt16 *)
*
***/
#define SILC_STR_UINT16(x) SILC_PARAM_UINT16, (x)
#define SILC_STR_SI_SHORT(x) SILC_PARAM_SINT16, (x)
#define SILC_STR_UI_SHORT(x) SILC_PARAM_UINT16, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT32
+/****d* silcutil/SILC_STR_SINT32
*
* NAME
*
*
* SilcInt32.
*
- * Formatting: SILC_STR_SINT32(SilcInt32)
- * Unformatting: SILC_STR_SINT32(SilcInt32 *)
+ * Formatting: SILC_STR_SINT32(SilcInt32)
+ * Unformatting: SILC_STR_SINT32(SilcInt32 *)
*
***/
#define SILC_STR_SINT32(x) SILC_PARAM_SINT32, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT32
+/****d* silcutil/SILC_STR_UINT32
*
* NAME
*
*
* SilcUInt32.
*
- * Formatting: SILC_STR_UINT32(SilcUInt32)
- * Unformatting: SILC_STR_UINT32(SilcUInt32 *)
+ * Formatting: SILC_STR_UINT32(SilcUInt32)
+ * Unformatting: SILC_STR_UINT32(SilcUInt32 *)
*
***/
#define SILC_STR_UINT32(x) SILC_PARAM_UINT32, (x)
#define SILC_STR_SI_INT(x) SILC_PARAM_SINT32, (x)
#define SILC_STR_UI_INT(x) SILC_PARAM_UINT32, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT64
+/****d* silcutil/SILC_STR_SINT64
*
* NAME
*
*
* SilcInt64.
*
- * Formatting: SILC_STR_SINT64(SilcInt64)
- * Unformatting: SILC_STR_SINT64(SilcInt64 *)
+ * Formatting: SILC_STR_SINT64(SilcInt64)
+ * Unformatting: SILC_STR_SINT64(SilcInt64 *)
*
***/
#define SILC_STR_SI_INT64(x) SILC_PARAM_SINT64, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_UINT64
+/****d* silcutil/SILC_STR_UINT64
*
* NAME
*
*
* SilcUInt64.
*
- * Formatting: SILC_STR_UINT64(SilcUInt64)
- * Unformatting: SILC_STR_UINT64(SilcUInt64 *)
+ * Formatting: SILC_STR_UINT64(SilcUInt64)
+ * Unformatting: SILC_STR_UINT64(SilcUInt64 *)
*
***/
#define SILC_STR_UI_INT64(x) SILC_PARAM_UINT64, (x)
#define SILC_STR_SI_INT64(x) SILC_PARAM_SINT64, (x)
#define SILC_STR_UI_INT64(x) SILC_PARAM_UINT64, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_STRING
+/****d* silcutil/SILC_STR_STRING
*
* NAME
*
*
* Encode NULL terminated string. Use this only for formatting.
*
- * Formatting: SILC_STR_STRING(char *)
+ * Formatting: SILC_STR_STRING(char *)
*
* For unformatting use one of the SILC_STR_*_STRING macros, which
* automatically gets the length of the string from the buffer. Note
* SILC_STR_STRING does not save the length of the string into the buffer.
* The caller must do that in order for the unformatting macros to work.
*
- * Example:
+ * EXAMPLE
*
* Formatting: ..., SILC_STR_UINT32(strlen(string)),
* SILC_STR_STRING(string), ...
***/
#define SILC_STR_STRING(x) SILC_PARAM_UI8_STRING, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_STRING
+/****d* silcutil/SILC_STR_*_STRING
*
* NAME
*
* NULL terminated because strlen() will be used to get the length of
* the string.
*
- * Formatting: SILC_STR_UI32_STRING(unsigned char *)
- * Unformatting: SILC_STR_UI32_STRING(unsigned char **)
+ * Formatting: SILC_STR_UI32_STRING(unsigned char *)
+ * Unformatting: SILC_STR_UI32_STRING(unsigned char **)
*
* Unformatting procedure will check for length of the string from the
* buffer before trying to get the string out. Thus, one *must* format the
* length of the string because unformatting procedure will take it
* automatically.
*
- * Example:
+ * EXAMPLE
*
* Formatting: ..., SILC_STR_UINT32(strlen(string)),
* SILC_STR_UI32_STRING(string), ...
#define SILC_STR_UI32_STRING(x) SILC_PARAM_UI32_STRING, (x)
#define SILC_STR_UI32_STRING_ALLOC(x) SILC_PARAM_UI32_STRING | SILC_PARAM_ALLOC, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_NSTRING
+/****d* silcutil/SILC_STR_*_NSTRING
*
* NAME
*
*
* Unsigned string. Second argument is the length of the string.
*
- * Formatting: SILC_STR_UI32_NSTRING(unsigned char *, SilcUInt32)
- * Unformatting: SILC_STR_UI32_NSTRING(unsigned char **, SilcUInt32 *)
+ * Formatting: SILC_STR_UI32_NSTRING(unsigned char *, SilcUInt32)
+ * Unformatting: SILC_STR_UI32_NSTRING(unsigned char **, SilcUInt32 *)
*
* Unformatting procedure will check for length of the string from the
* buffer before trying to get the string out. Thus, one *must* format the
* length of the string because unformatting procedure will take it
* automatically.
*
- * Example:
+ * EXAMPLE
*
* Formatting: ..., SILC_STR_UINT32(strlen(string)),
* SILC_STR_UI32_NSTRING(string, strlen(string)), ...
#define SILC_STR_UI32_NSTRING_ALLOC(x, l) \
SILC_PARAM_UI32_NSTRING | SILC_PARAM_ALLOC, (x), (l)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_DATA
+/****d* silcutil/SILC_STR_DATA
*
* NAME
*
*
* Binary data formatting. Second argument is the length of the data.
*
- * Formatting: SILC_STR_DATA(unsigned char *, SilcUInt32)
- * Unformatting: SILC_STR_DATA(unsigned char **, SilcUInt32)
+ * Formatting: SILC_STR_DATA(unsigned char *, SilcUInt32)
+ * Unformatting: SILC_STR_DATA(unsigned char **, SilcUInt32)
*
* This type can be used to take arbitrary size data block from the buffer
* by sending the requested amount of bytes as argument.
#define SILC_STR_UI_XNSTRING(x, l) SILC_PARAM_UICHAR, (x), (l)
#define SILC_STR_UI_XNSTRING_ALLOC(x, l) SILC_PARAM_UICHAR | SILC_PARAM_ALLOC, (x), (l)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_BUFFER
+/****d* silcutil/SILC_STR_BUFFER
*
* NAME
*
*
* SilcBuffer formatting.
*
- * Formatting: SILC_STR_BUFFER(SilcBuffer)
- * Unformatting: SILC_STR_BUFFER(SilcBuffer)
+ * Formatting: SILC_STR_BUFFER(SilcBuffer)
+ * Unformatting: SILC_STR_BUFFER(SilcBuffer)
*
* This type can be used to format and unformat SilcBuffer. Note that, the
* length of the buffer will be automatically encoded into the buffer as
#define SILC_STR_BUFFER(x) SILC_PARAM_BUFFER, (x)
#define SILC_STR_BUFFER_ALLOC(x) SILC_PARAM_BUFFER | SILC_PARAM_ALLOC, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_REPLACE
+/****d* silcutil/SILC_STR_REPLACE
*
* NAME
*
*
* Use this only for formatting.
*
- * Formatting: SILC_STR_REPLACE(unsigned char *, SilcUInt32)
+ * Formatting: SILC_STR_REPLACE(unsigned char *, SilcUInt32)
*
- * Example:
+ * EXAMPLE
*
* Before replacing
* -------------------------
***/
#define SILC_STR_REPLACE(x, l) SILC_PARAM_UICHAR | SILC_PARAM_REPLACE, (x), (l)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_FUNC
+/****d* silcutil/SILC_STR_FUNC
*
* NAME
*
*
* Formatting and unformatting of arbitrary data.
*
- * Formatting: SILC_STR_FUNC(function, void *value, void *context)
- * Unformatting: SILC_STR_FUNC(function, void **value, void *context)
+ * Formatting: SILC_STR_FUNC(function, void *value, void *context)
+ * Unformatting: SILC_STR_FUNC(function, void **value, void *context)
*
* This type can be used to call the `function' of the type
* SilcBufferFormatFunc or SilcBufferUnformatFunc to encode or decode
#define SILC_STR_FUNC(func, val, context) SILC_PARAM_FUNC, \
func, (val), (context)
-/****d* silcutil/SilcBufferFormatAPI/SilcBufferRegexFlags
+/****d* silcutil/SilcBufferRegexFlags
*
* NAME
*
} SilcBufferRegexFlags;
/***/
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_REGEX
+/****d* silcutil/SILC_STR_REGEX
*
* NAME
*
*
* Regular expression matching within the buffer.
*
- * Formatting: SILC_STR_REGEX(char *regex, SilcBufferRegexFlags flags)
- * Unformatting: SILC_STR_REGEX(char *regex, SilcBufferRegexFlags flags)
+ * Formatting: SILC_STR_REGEX(char *regex, SilcBufferRegexFlags flags)
+ * Unformatting: SILC_STR_REGEX(char *regex, SilcBufferRegexFlags flags)
*
* SILC_STR_REGEX can be used to do regular expression matching within
* the SilcBuffer. When the string in the buffer matches the regular
***/
#define SILC_STR_REGEX(regex, flags) SILC_PARAM_REGEX, (regex), (flags)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_DELETE
+/****d* silcutil/SILC_STR_DELETE
*
* NAME
*
*
* Use this only for formatting.
*
- * Formatting: SILC_STR_DELETE(int bytes)
+ * Formatting: SILC_STR_DELETE(int bytes)
*
***/
#define SILC_STR_DELETE(x) SILC_PARAM_DELETE, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET
+/****d* silcutil/SILC_STR_OFFSET
*
* NAME
*
* or backwards (negative offset). It can be used to for example skip
* some types during unformatting.
*
- * Example:
+ * EXAMPLE
*
* ..., SILC_STR_OFFSET(5), ...
* ..., SILC_STR_OFFSET(-3), ...
***/
#define SILC_STR_OFFSET(x) SILC_PARAM_OFFSET, (x)
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET_START
+/****d* silcutil/SILC_STR_OFFSET_START
*
* NAME
*
*
* Moves the buffer position to the start of the data area.
*
- * Example:
+ * EXAMPLE
*
* ..., SILC_STR_OFFSET_START, ...
*
***/
#define SILC_STR_OFFSET_START SILC_PARAM_OFFSET_START
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET_END
+/****d* silcutil/SILC_STR_OFFSET_END
*
* NAME
*
*
* Moves the buffer position to the end of the data area.
*
- * Example:
+ * EXAMPLE
*
* ..., SILC_STR_OFFSET_END, ...
*
***/
#define SILC_STR_OFFSET_END SILC_PARAM_OFFSET_END
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_ADVANCE
+/****d* silcutil/SILC_STR_ADVANCE
*
* NAME
*
***/
#define SILC_STR_ADVANCE SILC_PARAM_ADVANCE
-/****d* silcutil/SilcBufferFormatAPI/SILC_STR_END
+/****d* silcutil/SILC_STR_END
*
* NAME
*
***/
#define SILC_STR_END SILC_PARAM_END
-/****d* silcutil/SilcBufferFormatAPI/SILC_STRFMT_END
+/****d* silcutil/SILC_STRFMT_END
*
* NAME
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2006 - 2007 Pekka Riikonen
+ Copyright (C) 2006 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Condition Variable Interface
+/****h* silcutil/Condition Variable Interface
*
* DESCRIPTION
*
#ifndef SILCCOND_H
#define SILCCOND_H
-/****s* silcutil/SilcCondAPI/SilcCond
+/****s* silcutil/SilcCond
*
* NAME
*
***/
typedef struct SilcCondStruct *SilcCond;
-/****s* silcutil/SilcCondAPI/silc_cond_alloc
+/****f* silcutil/silc_cond_alloc
*
* SYNOPSIS
*
***/
SilcBool silc_cond_alloc(SilcCond *cond);
-/****s* silcutil/SilcCondAPI/silc_cond_free
+/****f* silcutil/silc_cond_free
*
* SYNOPSIS
*
***/
void silc_cond_free(SilcCond cond);
-/****s* silcutil/SilcCondAPI/silc_cond_wait
+/****f* silcutil/silc_cond_wait
*
* SYNOPSIS
*
***/
void silc_cond_wait(SilcCond cond, SilcMutex mutex);
-/****s* silcutil/SilcCondAPI/silc_cond_timedwait
+/****f* silcutil/silc_cond_timedwait
*
* SYNOPSIS
*
***/
SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex, int timeout);
-/****s* silcutil/SilcCondAPI/silc_cond_signal
+/****f* silcutil/silc_cond_signal
*
* SYNOPSIS
*
***/
void silc_cond_signal(SilcCond cond);
-/****s* silcutil/SilcCondAPI/silc_cond_broadcast
+/****f* silcutil/silc_cond_broadcast
*
* SYNOPSIS
*
Author: Giovanni Giacobbi <giovanni@giacobbi.net>
- Copyright (C) 2002 - 2003 Giovanni Giacobbi
+ Copyright (C) 2002 - 2003, 2008 Giovanni Giacobbi
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Config Interface
+/****h* silcutil/Config File Interface
*
* DESCRIPTION
*
#ifndef SILCCONFIG_H
#define SILCCONFIG_H
-/****d* silcutil/SilcConfigAPI/SilcConfigErrno
+/****d* silcutil/SilcConfigErrno
*
* NAME
*
};
/***/
-/****d* silcutil/SilcConfigAPI/SilcConfigType
+/****d* silcutil/SilcConfigType
*
* NAME
*
} SilcConfigType;
/***/
-/****f* silcutil/SilcConfigAPI/SilcConfigCallback
+/****f* silcutil/SilcConfigCallback
*
* SYNOPSIS
*
typedef int (*SilcConfigCallback)(SilcConfigType type, const char *name,
SilcUInt32 line, void *val, void *context);
-/****s* silcutil/SilcConfigAPI/SilcConfigTable
+/****s* silcutil/SilcConfigTable
*
* SYNOPSIS
*
const struct SilcConfigTableStruct *subtable;
} SilcConfigTable;
-/****s* silcutil/SilcConfigAPI/SilcConfigFile
+/****s* silcutil/SilcConfigFile
*
* SYNOPSIS
*
***/
typedef struct SilcConfigFileObject SilcConfigFile;
-/****s* silcutil/SilcConfigAPI/SilcConfigEntity
+/****s* silcutil/SilcConfigEntity
*
* SYNOPSIS
*
/* Macros */
-/****d* silcutil/SilcConfigAPI/SILC_CONFIG_CALLBACK
+/****d* silcutil/SILC_CONFIG_CALLBACK
*
* NAME
*
/* Prototypes */
-/****f* silcutil/SilcConfigAPI/silc_config_open
+/****f* silcutil/silc_config_open
*
* SYNOPSIS
*
***/
SilcConfigFile *silc_config_open(const char *configfile);
-/****f* silcutil/SilcConfigAPI/silc_config_close
+/****f* silcutil/silc_config_close
*
* SYNOPSIS
*
***/
void silc_config_close(SilcConfigFile *file);
-/****f* silcutil/SilcConfigAPI/silc_config_init
+/****f* silcutil/silc_config_init
*
* SYNOPSIS
*
***/
SilcConfigEntity silc_config_init(SilcConfigFile *file);
-/****f* silcutil/SilcConfigAPI/silc_config_strerror
+/****f* silcutil/silc_config_strerror
*
* SYNOPSIS
*
***/
char *silc_config_strerror(int errnum);
-/****f* silcutil/SilcConfigAPI/silc_config_get_filename
+/****f* silcutil/silc_config_get_filename
*
* SYNOPSIS
*
***/
char *silc_config_get_filename(SilcConfigFile *file);
-/****f* silcutil/SilcConfigAPI/silc_config_get_line
+/****f* silcutil/silc_config_get_line
*
* SYNOPSIS
*
***/
SilcUInt32 silc_config_get_line(SilcConfigFile *file);
-/****f* silcutil/SilcConfigAPI/silc_config_read_line
+/****f* silcutil/silc_config_read_line
*
* SYNOPSIS
*
***/
char *silc_config_read_line(SilcConfigFile *file, SilcUInt32 line);
-/****f* silcutil/SilcConfigAPI/silc_config_read_current_line
+/****f* silcutil/silc_config_read_current_line
*
* SYNOPSIS
*
***/
char *silc_config_read_current_line(SilcConfigFile *file);
-/****f* silcutil/SilcConfigAPI/silc_config_register
+/****f* silcutil/silc_config_register
*
* SYNOPSIS
*
SilcConfigType type, SilcConfigCallback cb,
const SilcConfigTable *subtable, void *context);
-/****f* silcutil/SilcConfigAPI/silc_config_register_table
+/****f* silcutil/silc_config_register_table
*
* SYNOPSIS
*
SilcBool silc_config_register_table(SilcConfigEntity ent,
const SilcConfigTable table[], void *context);
-/****f* silcutil/SilcConfigAPI/silc_config_main
+/****f* silcutil/silc_config_main
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Directory Interface
+/****h* silcutil/Directory Interface
*
* DESCRIPTION
*
* dir = silc_dir_open("foodir");
*
* while ((entry = silc_dir_read(dir, NULL)))
- * printf("File name: %s", silc_dir_entry_name(entry));
+ * printf("File name: %s\n", silc_dir_entry_name(entry));
*
* silc_dir_close(dir);
*
#ifndef SILCDIR_H
#define SILCDIR_H
-/****s* silcutil/SilcDirAPI/SilcDir
+/****s* silcutil/SilcDir
*
* NAME
*
***/
typedef struct SilcDirStruct *SilcDir;
-/****s* silcutil/SilcDirAPI/SilcDirEntry
+/****s* silcutil/SilcDirEntry
*
* NAME
*
***/
typedef struct SilcDirEntryStruct *SilcDirEntry;
-/****d* silcutil/SilcDirAPI/SilcDirEntryMode
- *
- * NAME
- *
- * typedef enum { ... } SilcDirEntryMode;
- *
- * DESCRIPTION
- *
- * The directory entry mode bits. These bits specify the entry mode,
- * type and protection.
- *
- ***/
-typedef enum {
- /* Type */
- SILC_DIR_ENTRY_IFDIR = 0x00000001, /* Entry is directory */
- SILC_DIR_ENTRY_IFCHR = 0x00000002, /* Entry is character device */
- SILC_DIR_ENTRY_IFBLK = 0x00000004, /* Entry is block device */
- SILC_DIR_ENTRY_IFREG = 0x00000008, /* Entry is regular file */
- SILC_DIR_ENTRY_IFIFO = 0x00000010, /* Entry is FIFO */
- SILC_DIR_ENTRY_IFLNK = 0x00000020, /* Entry is symbolic link */
- SILC_DIR_ENTRY_IFSOCK = 0x00000040, /* Entry is socket */
-
- /* Protection */
- SILC_DIR_ENTRY_IRUSR = 0x00000080, /* Owner has read permission */
- SILC_DIR_ENTRY_IWUSR = 0x00000100, /* Owner has write permission */
- SILC_DIR_ENTRY_IXUSR = 0x00000200, /* Owner has execute permission */
- SILC_DIR_ENTRY_IRGRP = 0x00000400, /* Group has read permission */
- SILC_DIR_ENTRY_IWGRP = 0x00000800, /* Group has write permission */
- SILC_DIR_ENTRY_IXGRP = 0x00001000, /* Group has execute permission */
- SILC_DIR_ENTRY_IROTH = 0x00002000, /* Others have read permission */
- SILC_DIR_ENTRY_IWOTH = 0x00004000, /* Others have write permission */
- SILC_DIR_ENTRY_IXOTH = 0x00008000, /* Others have execute permission */
-} SilcDirEntryMode;
-
-/****s* silcutil/SilcDirAPI/SilcDirEntryStat
- *
- * NAME
- *
- * typedef struct SilcDirEntryObject { ... } *SilcDirEntryStat,
- * SilcDirEntryStatStruct;
- *
- * DESCRIPTION
- *
- * The directory entry status information structure. The structure
- * contains various information about the entry in the directory.
- * This context is returned by silc_dir_read or silc_dir_entry_stat.
- *
- ***/
-typedef struct SilcDirEntryStatObject {
- SilcTimeStruct last_access; /* Time of last access */
- SilcTimeStruct last_mod; /* Time of last modification */
- SilcTimeStruct last_change; /* Time of last status change */
- SilcUInt64 size; /* Entry size in bytes */
- SilcUInt32 uid; /* Owner ID of the entry */
- SilcUInt32 gid; /* Group owner ID of the entry */
- SilcUInt32 dev; /* Entry device number */
- SilcUInt32 nlink; /* Number of hard links */
- SilcDirEntryMode mode; /* Entry mode */
-} *SilcDirEntryStat, SilcDirEntryStatStruct;
-
-/****f* silcutil/SilcDirAPI/silc_dir_open
+/****f* silcutil/silc_dir_open
*
* SYNOPSIS
*
***/
SilcDir silc_dir_open(const char *name);
-/****f* silcutil/SilcDirAPI/silc_dir_close
+/****f* silcutil/silc_dir_close
*
* SYNOPSIS
*
***/
void silc_dir_close(SilcDir dir);
-/****f* silcutil/SilcDirAPI/silc_dir_read
+/****f* silcutil/silc_dir_read
*
* SYNOPSIS
*
- * SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status);
+ * SilcDirEntry silc_dir_read(SilcDir dir, SilcFileStat status);
*
* DESCRIPTION
*
* next entry context or NULL if there are no more entries or error occurs.
* In case of error the silc_errno is also set.
*
- * If the `status' is non-NULL this will also call silc_dir_entry_stat
- * and returns the status into the `status' pointer.
+ * If the `status' is non-NULL this will also call silc_file_stat and
+ * returns the status into the `status' pointer.
*
* The returned context remains valid until the silc_dir_read is called
* again.
*
***/
-SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status);
+SilcDirEntry silc_dir_read(SilcDir dir, SilcFileStat status);
-/****f* silcutil/SilcDirAPI/silc_dir_rewind
+/****f* silcutil/silc_dir_rewind
*
* SYNOPSIS
*
***/
void silc_dir_rewind(SilcDir dir);
-/****f* silcutil/SilcDirAPI/silc_dir_name
+/****f* silcutil/silc_dir_name
*
* SYNOPSIS
*
***/
const char *silc_dir_name(SilcDir dir);
-/****f* silcutil/SilcDirAPI/silc_dir_entry_name
+/****f* silcutil/silc_dir_entry_name
*
* SYNOPSIS
*
***/
const char *silc_dir_entry_name(SilcDirEntry entry);
-/****f* silcutil/SilcDirAPI/silc_dir_entry_stat
- *
- * SYNOPSIS
- *
- * SilcDirEntryStat silc_dir_entry_stat(SilcDir dir, SilcDirEntry entry);
- *
- * DESCRIPTION
- *
- * Returns the status of the entry. The status context contains details
- * of the entry (file) in the directory. Returns NULL on error and sets
- * the silc_errno.
- *
- * The returned contest is valid until the silc_dir_read is called again.
- *
- ***/
-SilcDirEntryStat silc_dir_entry_stat(SilcDir dir, SilcDirEntry entry);
-
#endif /* SILCDIR_H */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2000 - 2007 Pekka Riikonen
+ Copyright (C) 2000 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "silclist.h"
-/****h* silcutil/SILC Dynamic List Interface
+/****h* silcutil/Dynamic List Interface
*
* DESCRIPTION
*
*
***/
-/****s* silcutil/SilcDListAPI/SilcDList
+/****s* silcutil/SilcDList
*
* NAME
*
struct SilcDListEntryStruct *prev;
} *SilcDListEntry;
-/****f* silcutil/SilcDListAPI/silc_dlist_init
+/****f* silcutil/silc_dlist_init
*
* SYNOPSIS
*
return list;
}
-/****f* silcutil/SilcDListAPI/silc_dlist_sinit
+/****f* silcutil/silc_dlist_sinit
*
* SYNOPSIS
*
return list;
}
-/****f* silcutil/SilcDListAPI/silc_dlist_uninit
+/****f* silcutil/silc_dlist_uninit
*
* SYNOPSIS
*
}
}
-/****f* silcutil/SilcDListAPI/silc_dlist_count
+/****f* silcutil/silc_dlist_count
*
* SYNOPSIS
*
return silc_list_count(list->list);
}
-/****f* silcutil/SilcDListAPI/silc_dlist_start
+/****f* silcutil/silc_dlist_start
*
* SYNOPSIS
*
list->current = list->prev = NULL;
}
-/****f* silcutil/SilcDListAPI/silc_dlist_end
+/****f* silcutil/silc_dlist_end
*
* SYNOPSIS
*
list->current = list->prev = NULL;
}
-/****f* silcutil/SilcDListAPI/silc_dlist_add
+/****f* silcutil/silc_dlist_add
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcDList/silc_dlist_insert
+/****f* silcutil/silc_dlist_insert
*
* SYNOPSIS
*
return TRUE;
}
-/****f* silcutil/SilcDListAPI/silc_dlist_del
+/****f* silcutil/silc_dlist_del
*
* SYNOPSIS
*
}
}
-/****f* silcutil/SilcDListAPI/silc_dlist_get
+/****f* silcutil/silc_dlist_get
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef SILCDLL_H
#define SILCDLL_H
-/****s* silcutil/SilcDLLAPI/SilcDll
+/****s* silcutil/SilcDll
*
* NAME
*
typedef void *SilcDll;
#endif /* SILC_UNIX */
-/****f* silcutil/SilcDLLAPI/silc_dll_load
+/****f* silcutil/silc_dll_load
*
* SYNOPSIS
*
***/
SilcDll silc_dll_load(const char *object_path);
-/****f* silcutil/SilcDLLAPI/silc_dll_close
+/****f* silcutil/silc_dll_close
*
* SYNOPSIS
*
***/
void silc_dll_close(SilcDll dll);
-/****f* silcutil/SilcDLLAPI/silc_dll_getsym
+/****f* silcutil/silc_dll_getsym
*
* SYNOPSIS
*
***/
void *silc_dll_getsym(SilcDll dll, const char *symbol);
-/****f* silcutil/SilcDLLAPI/silc_dll_error
+/****f* silcutil/silc_dll_error
*
* SYNOPSIS
*
*/
-/****h* silcutil/Environment Manipulation Interface
+/****h* silcutil/Environment Interface
*
* DESCRIPTION
*
#ifndef SILCENV_H
#define SILCENV_H
-/****f* silcutil/SilcEnvAPI/silc_setenv
+/****f* silcutil/silc_setenv
*
* SYNOPSIS
*
***/
SilcBool silc_setenv(const char *variable, const char *value);
-/****f* silcutil/SilcEnvAPI/silc_getenv
+/****f* silcutil/silc_getenv
*
* SYNOPSIS
*
***/
const char *silc_getenv(const char *variable);
-/****f* silcutil/SilcEnvAPI/silc_unsetenv
+/****f* silcutil/silc_unsetenv
*
* SYNOPSIS
*
***/
SilcBool silc_unsetenv(const char *variable);
-/****f* silcutil/SilcEnvAPI/silc_clearenv
+/****f* silcutil/silc_clearenv
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Errno
+/****h* silcutil/Errno Interface
*
* DESCRIPTION
*
#ifndef SILCERRNO_H
#define SILCERRNO_H
-/****d* silcutil/SilcErrnoAPI/SilcResult
+/****d* silcutil/SilcResult
*
* NAME
*
} SilcResult;
/***/
-/****d* silcutil/SilcErrnoAPI/silc_errno
+/****d* silcutil/silc_errno
*
* NAME
*
***/
#define silc_errno silc_get_errno()
-/****f* silcutil/SilcErrnoAPI/silc_errno_string
+/****f* silcutil/silc_errno_string
*
* NAME
*
***/
const char *silc_errno_string(SilcResult error);
-/****d* silcutil/SilcErrnoAPI/silc_errno_string
+/****d* silcutil/silc_errno_reason
*
* NAME
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC File Descriptor Stream Interface
+/****h* silcutil/Fd Stream Interface
*
* DESCRIPTION
*
#ifndef SILCFDSTREAM_H
#define SILCFDSTREAM_H
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create
+/****f* silcutil/silc_fd_stream_create
*
* SYNOPSIS
*
***/
SilcStream silc_fd_stream_create(int fd, SilcStack stack);
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create2
+/****f* silcutil/silc_fd_stream_create2
*
* SYNOPSIS
*
***/
SilcStream silc_fd_stream_create2(int read_fd, int write_fd, SilcStack stack);
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_file
+/****f* silcutil/silc_fd_stream_file
*
* SYNOPSIS
*
SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
SilcBool writing, SilcStack stack);
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_file2
+/****f* silcutil/silc_fd_stream_file2
*
* SYNOPSIS
*
SilcStream silc_fd_stream_file2(const char *read_file, const char *write_file,
SilcStack stack);
-/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_info
+/****f* silcutil/silc_fd_stream_get_info
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005, 2006, 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Finite State Machine
+/****h* silcutil/Finite State Machine
*
* DESCRIPTION
*
#ifndef SILCFSM_H
#define SILCFSM_H
-/****s* silcutil/SilcFSMAPI/SilcFSM
+/****s* silcutil/SilcFSM
*
* NAME
*
***/
typedef struct SilcFSMObject *SilcFSM;
-/****s* silcutil/SilcFSMAPI/SilcFSMStruct
+/****s* silcutil/SilcFSMStruct
*
* NAME
*
***/
typedef struct SilcFSMObject SilcFSMStruct;
-/****s* silcutil/SilcFSMAPI/SilcFSMThread
+/****s* silcutil/SilcFSMThread
*
* NAME
*
***/
typedef struct SilcFSMObject *SilcFSMThread;
-/****s* silcutil/SilcFSMAPI/SilcFSMThreadStruct
+/****s* silcutil/SilcFSMThreadStruct
*
* NAME
*
***/
typedef struct SilcFSMObject SilcFSMThreadStruct;
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CONTINUE
+/****d* silcutil/SILC_FSM_CONTINUE
*
* NAME
*
#define SILC_FSM_CONTINUE SILC_FSM_ST_CONTINUE;
#endif /* SILC_DEBUG */
-/****d* silcutil/SilcFSMAPI/SILC_FSM_YIELD
+/****d* silcutil/SILC_FSM_YIELD
*
* NAME
*
***/
#define SILC_FSM_YIELD SILC_FSM_ST_YIELD;
-/****d* silcutil/SilcFSMAPI/SILC_FSM_WAIT
+/****d* silcutil/SILC_FSM_WAIT
*
* NAME
*
***/
#define SILC_FSM_WAIT SILC_FSM_ST_WAIT
-/****d* silcutil/SilcFSMAPI/SILC_FSM_FINISH
+/****d* silcutil/SILC_FSM_FINISH
*
* NAME
*
***/
#define SILC_FSM_FINISH SILC_FSM_ST_FINISH
-/****f* silcutil/SilcFSMAPI/SilcFSMDestructor
+/****f* silcutil/SilcFSMDestructor
*
* SYNOPSIS
*
typedef void (*SilcFSMDestructor)(SilcFSM fsm, void *fsm_context,
void *destructor_context);
-/****f* silcutil/SilcFSMAPI/SilcFSMThreadDestructor
+/****f* silcutil/SilcFSMThreadDestructor
*
* SYNOPSIS
*
void *thread_context,
void *destructor_context);
-/****d* silcutil/SilcFSMAPI/SILC_FSM_STATE
+/****d* silcutil/SILC_FSM_STATE
*
* NAME
*
void *fsm_context,
void *state_context);
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL
+/****d* silcutil/SILC_FSM_CALL
*
* NAME
*
return SILC_FSM_WAIT; \
} while(0)
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE
+/****d* silcutil/SILC_FSM_CALL_CONTINUE
*
* NAME
*
silc_fsm_continue(fsm); \
} while(0)
-/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE_SYNC
+/****d* silcutil/SILC_FSM_CALL_CONTINUE_SYNC
*
* NAME
*
silc_fsm_continue_sync(fsm); \
} while(0)
-/****d* silcutil/SilcFSMAPI/SILC_FSM_THREAD_WAIT
+/****d* silcutil/SILC_FSM_THREAD_WAIT
*
* NAME
*
return SILC_FSM_WAIT; \
} while(0)
-/****f* silcutil/SilcFSMAPI/silc_fsm_alloc
+/****f* silcutil/silc_fsm_alloc
*
* SYNOPSIS
*
void *destructor_context,
SilcSchedule schedule);
-/****f* silcutil/SilcFSMAPI/silc_fsm_init
+/****f* silcutil/silc_fsm_init
*
* SYNOPSIS
*
void *destructor_context,
SilcSchedule schedule);
-/****f* silcutil/SilcFSMAPI/silc_fsm_thread_alloc
+/****f* silcutil/silc_fsm_thread_alloc
*
* SYNOPSIS
*
void *destructor_context,
SilcBool real_thread);
-/****f* silcutil/SilcFSMAPI/silc_fsm_thread_init
+/****f* silcutil/silc_fsm_thread_init
*
* SYNOPSIS
*
void *destructor_context,
SilcBool real_thread);
-/****f* silcutil/SilcFSMAPI/silc_fsm_free
+/****f* silcutil/silc_fsm_free
*
* SYNOPSIS
*
***/
void silc_fsm_free(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_start
+/****f* silcutil/silc_fsm_start
*
* SYNOPSIS
*
***/
void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state);
-/****f* silcutil/SilcFSMAPI/silc_fsm_start_sync
+/****f* silcutil/silc_fsm_start_sync
*
* SYNOPSIS
*
***/
void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state);
-/****f* silcutil/SilcFSMAPI/silc_fsm_next
+/****f* silcutil/silc_fsm_next
*
* SYNOPSIS
*
***/
void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state);
-/****f* silcutil/SilcFSMAPI/silc_fsm_next_later
+/****f* silcutil/silc_fsm_next_later
*
* SYNOPSIS
*
void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state,
SilcUInt32 seconds, SilcUInt32 useconds);
-/****f* silcutil/SilcFSMAPI/silc_fsm_continue
+/****f* silcutil/silc_fsm_continue
*
* SYNOPSIS
*
***/
void silc_fsm_continue(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_continue_sync
+/****f* silcutil/silc_fsm_continue_sync
*
* SYNOPSIS
*
***/
void silc_fsm_continue_sync(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_finish
+/****f* silcutil/silc_fsm_finish
*
* SYNOPSIS
*
***/
void silc_fsm_finish(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_set_context
+/****f* silcutil/silc_fsm_set_context
*
* SYNOPSIS
*
***/
void silc_fsm_set_context(void *fsm, void *fsm_context);
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_context
+/****f* silcutil/silc_fsm_get_context
*
* SYNOPSIS
*
***/
void *silc_fsm_get_context(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_set_state_context
+/****f* silcutil/silc_fsm_set_state_context
*
* SYNOPSIS
*
***/
void silc_fsm_set_state_context(void *fsm, void *state_context);
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_state_context
+/****f* silcutil/silc_fsm_get_state_context
*
* SYNOPSIS
*
***/
void *silc_fsm_get_state_context(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_schedule
+/****f* silcutil/silc_fsm_get_schedule
*
* SYNOPSIS
*
***/
SilcSchedule silc_fsm_get_schedule(void *fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_get_machine
+/****f* silcutil/silc_fsm_get_machine
*
* SYNOPSIS
*
***/
SilcFSM silc_fsm_get_machine(SilcFSMThread thread);
-/****f* silcutil/SilcFSMAPI/silc_fsm_is_started
+/****f* silcutil/silc_fsm_is_started
*
* SYNOPSIS
*
/* FSM Events */
-/****s* silcutil/SilcFSMAPI/SilcFSMEvent
+/****s* silcutil/SilcFSMEvent
*
* NAME
*
***/
typedef struct SilcFSMEventObject *SilcFSMEvent;
-/****s* silcutil/SilcFSMAPI/SilcFSMEventStruct
+/****s* silcutil/SilcFSMEventStruct
*
* NAME
*
***/
typedef struct SilcFSMEventObject SilcFSMEventStruct;
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_alloc
+/****f* silcutil/silc_fsm_event_alloc
*
* SYNOPSIS
*
***/
SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_init
+/****f* silcutil/silc_fsm_event_init
*
* SYNOPSIS
*
***/
void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm);
-/****f* silcutil/SilcFSMAPI/silc_fsm_event_free
+/****f* silcutil/silc_fsm_event_free
*
* SYNOPSIS
*
***/
void silc_fsm_event_free(SilcFSMEvent event);
-/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_WAIT
+/****d* silcutil/SILC_FSM_EVENT_WAIT
*
* NAME
*
return SILC_FSM_WAIT; \
} while(0)
-/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_TIMEDWAIT
+/****d* silcutil/SILC_FSM_EVENT_TIMEDWAIT
*
* NAME
*
return SILC_FSM_WAIT; \
} while(0)
-/****f* silcutil/SilcFSMAPI/SILC_FSM_EVENT_SIGNAL
+/****f* silcutil/SILC_FSM_EVENT_SIGNAL
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
+/****h* silcutil/GetOpt Interface
+ *
+ * DESCRIPTION
+ *
+ * SILC GetOpt Interface provides portable interface to handle command
+ * line options.
+ *
+ ***/
+
#ifndef SILCGETOPT_H
#define SILCGETOPT_H
-/****s* silcutil/SilcGetOptAPI/SilcGetOpt
+/****s* silcutil/SilcGetOpt
*
* NAME
*
} *SilcGetOpt, SilcGetOptStruct;
/***/
-/****d* silcutil/SilcGetOptAPI/SILC_GETOPT_INIT
+/****d* silcutil/SILC_GETOPT_INIT
*
* NAME
*
***/
#define SILC_GETOPT_INIT { 1, 0, NULL, TRUE, 1 }
-/****f* silcutil/SilcGetOptAPI/silc_getopt
+/****f* silcutil/silc_getopt
*
* SYNOPSIS
*
* EXAMPLE
*
* // Initialize global buffer
- * unsigned char buffer[256];
- * silc_global_set_va("somebuf", sizeof(buffer), NULL, FALSE);
+ * silc_global_set_var("somebuf", 256, NULL, FALSE);
*
* // Retrieve the buffer
* unsigned char *buf = silc_global_get_var("somebuf", FALSE);
* If `tls' is FALSE the variable is visible to all threads in the process.
* If it is TRUE the variable is visible only in the current thread. The
* variable can be retrieved using the same name by calling the
- * silc_thread_global_get_var.
+ * silc_global_get_var.
*
* Returns NULL and sets silc_errno if the variable could not be added, or
* a pointer to the added variable otherwise.
* EXAMPLE
*
* // Initialize global buffer
- * unsigned char buffer[256];
- * silc_global_set_va("somebuf", sizeof(buffer), NULL, FALSE);
+ * silc_global_set_var("somebuf", 256, NULL, FALSE);
*
* // Retrieve the buffer
* unsigned char *buf = silc_global_get_var("somebuf", FALSE);
* *intptr = 200;
*
* // Set structure as global in the thread
- * silc_global_set_va("somestruct", sizeof(*context), NULL, TRUE);
+ * silc_global_set_var("somestruct", sizeof(*context), NULL, TRUE);
*
* // Retrieve the context
* context = silc_global_get_var("somestruct", TRUE);
* deleted, FALSE if such variable does not exist and sets silc_errno.
*
* If variable is not deleted before the process or thread is destroyed
- * it will be deleted and freed automatically.
+ * it will be deleted and freed automatically when the process or thread
+ * is destroyed.
*
***/
SilcBool silc_global_del_var(const char *name, SilcBool tls);
*
* DESCRIPTION
*
- * Implementation of collision resistant hash table. This is a hash table
- * that provides a reliable (what you add there stays there, and duplicate
- * keys are allowed) with as fast reference to the key as possible. If
- * there are a lot of duplicate keys in the hash table the lookup slows down.
- * However, this is reliable and no data is lost at any point. If you know
- * that you never have duplicate keys then this is as fast as any simple hash
- * table.
+ * A collision resistant hash table API. This is a hash table that provides
+ * a reliable hash table (what you add there stays there, and duplicate keys
+ * are allowed) with as fast reference to the key as possible. If there are
+ * a lot of duplicate keys in the hash table the lookup slows down. However,
+ * this is reliable and no data is lost at any point. If you know that you
+ * never have duplicate keys then this is as fast as any simple hash table.
*
* The interface provides many ways to search the hash table including
* an extended interface where caller can specify their own hash and comparison
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 - 2007 Pekka Riikonen
+ Copyright (C) 2002 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC List Interface
+/****h* silcutil/List Interface
*
* DESCRIPTION
*
#ifndef SILCLIST_H
#define SILCLIST_H
-/****s* silcutil/SilcList/SilcList
+/****s* silcutil/SilcList
*
* NAME
*
unsigned int count : 30; /* Number of entries in the list */
} SilcList;
-/****d* silcutil/SilcList/SILC_LIST_END
+/****d* silcutil/SILC_LIST_END
*
* NAME
*
- * #define SILC_LIST_END ...
+ * #define SILC_LIST_END NULL
*
* DESCRIPTION
*
#define SILC_LIST_END NULL
/***/
-/****f* silcutil/SilcList/silc_list_init
+/****f* silcutil/silc_list_init
*
* SYNOPSIS
*
(list).head = (list).tail = (list).current = NULL; \
} while(0)
-/****f* silcutil/SilcList/silc_list_init_prev
+/****f* silcutil/silc_list_init_prev
*
* SYNOPSIS
*
(list).head = (list).tail = (list).current = NULL; \
} while(0)
-/****f* silcutil/SilcList/silc_list_count
+/****f* silcutil/silc_list_count
*
* SYNOPSIS
*
***/
#define silc_list_count(list) (list).count
-/****f* silcutil/SilcList/silc_list_start
+/****f* silcutil/silc_list_start
*
* SYNOPSIS
*
#define silc_list_start(list) \
((list).current = (list).head, (list).end_set = 0)
-/****f* silcutil/SilcList/silc_list_end
+/****f* silcutil/silc_list_end
*
* SYNOPSIS
*
#define __silc_list_prev(list, pos) \
((void **)((unsigned char *)(pos) + (list).prev_offset))
-/****f* silcutil/SilcList/silc_list_add
+/****f* silcutil/silc_list_add
*
* SYNOPSIS
*
(list).count++; \
} while(0)
-/****f* silcutil/SilcList/silc_list_insert
+/****f* silcutil/silc_list_insert
*
* SYNOPSIS
*
(list).count++; \
} while(0)
-/****f* silcutil/SilcList/silc_list_del
+/****f* silcutil/silc_list_del
*
* SYNOPSIS
*
(list).tail = prev; \
} while(0)
-/****f* silcutil/SilcList/silc_list_get
+/****f* silcutil/silc_list_get
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Logging Interface
+/****h* silcutil/Logging Interface
*
* DESCRIPTION
*
#ifndef SILCLOG_H
#define SILCLOG_H
-/****d* silcutil/SilcLogAPI/SilcLogType
+/****d* silcutil/SilcLogType
*
* NAME
*
#include "silclog_i.h"
-/****f* silcutil/SilcLogAPI/SilcLogCb
+/****f* silcutil/SilcLogCb
*
* SYNOPSIS
*
***/
typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context);
-/****f* silcutil/SilcLogAPI/SilcLogDebugCb
+/****f* silcutil/SilcLogDebugCb
*
* SYNOPSIS
*
typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
char *message, void *context);
-/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
+/****f* silcutil/SilcLogHexdumpCb
*
* SYNOPSIS
*
/* Macros */
-/****d* silcutil/SilcLogAPI/SILC_LOG_INFO
+/****d* silcutil/SILC_LOG_INFO
*
* NAME
*
#define SILC_LOG_INFO(fmt) silc_log_output(SILC_LOG_INFO, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_WARNING
+/****d* silcutil/SILC_LOG_WARNING
*
* NAME
*
#define SILC_LOG_WARNING(fmt) silc_log_output(SILC_LOG_WARNING, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_ERROR
+/****d* silcutil/SILC_LOG_ERROR
*
* NAME
*
#define SILC_LOG_ERROR(fmt) silc_log_output(SILC_LOG_ERROR, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_FATAL
+/****d* silcutil/SILC_LOG_FATAL
*
* NAME
*
#define SILC_LOG_FATAL(fmt) silc_log_output(SILC_LOG_FATAL, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_DEBUG
+/****d* silcutil/SILC_LOG_DEBUG
*
* NAME
*
#endif /* SILC_DEBUG */
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_HEXDUMP
+/****d* silcutil/SILC_LOG_HEXDUMP
*
* NAME
*
#endif /* SILC_DEBUG */
/***/
-/****d* silcutil/SilcLogAPI/SILC_ASSERT
- *
- * NAME
- *
- * #define SILC_ASSERT(experssion)
- *
- * DESCRIPTION
- *
- * Assert macro that prints error message to stderr and calls abort()
- * if the `expression' is false (ie. compares equal to zero). If
- * SILC_DEBUG is not defined this macro has no effect.
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_ASSERT(expr) assert((expr));
-#else
-#define SILC_ASSERT(expr) do { } while(0)
-#endif /* SILC_DEBUG */
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_VERIFY
- *
- * NAME
- *
- * #define SILC_VERIFY(experssion)
- *
- * DESCRIPTION
- *
- * Verification macro that prints error message to stderr and calls
- * abort() if the `expression' is false (ie. compares equal to zero)
- * on debug builds (SILC_DEBUG defined), and prints error message to
- * stderr on release builds (SILC_DEBUG undefined) but does not abort().
- * This macro is always compiled even if debugging (SILC_DEBUG) is not
- * defined.
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_VERIFY(expr) assert((expr));
-#else
-#define SILC_VERIFY(expr) \
- if (silc_unlikely(!(expr))) { \
- SILC_LOG_ERROR(("SILC_VERIFY %s:%s:%d", \
- __FILE__, __FUNCTION__, __LINE__)); \
- silc_set_errno_reason_nofail(SILC_ERR_ASSERT, "SILC_VERIFY %s:%s:%d", \
- __FILE__, __FUNCTION__, __LINE__); \
- }
-#endif /* SILC_DEBUG */
-/***/
-
/* Prototypes */
-/****f* silcutil/SilcLogAPI/silc_log_set_file
+/****f* silcutil/silc_log_set_file
*
* SYNOPSIS
*
SilcBool silc_log_set_file(SilcLogType type, char *filename,
SilcUInt32 maxsize, SilcSchedule scheduler);
-/****f* silcutil/SilcLogAPI/silc_log_get_file
+/****f* silcutil/silc_log_get_file
*
* SYNOPSIS
*
***/
char *silc_log_get_file(SilcLogType type);
-/****f* silcutil/SilcLogAPI/silc_log_set_callback
+/****f* silcutil/silc_log_set_callback
*
* SYNOPSIS
*
***/
void silc_log_set_callback(SilcLogType type, SilcLogCb cb, void *context);
-/****f* silcutil/SilcLogAPI/silc_log_reset_callbacks
+/****f* silcutil/silc_log_reset_callbacks
*
* SYNOPSIS
*
***/
void silc_log_reset_callbacks(void);
-/****f* silcutil/SilcLogAPI/silc_log_flush_all
+/****f* silcutil/silc_log_flush_all
*
* SYNOPSIS
*
***/
void silc_log_flush_all(void);
-/****f* silcutil/SilcLogAPI/silc_log_reset_all
+/****f* silcutil/silc_log_reset_all
*
* SYNOPSIS
*
***/
void silc_log_reset_all(void);
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_callbacks
+/****f* silcutil/silc_log_set_debug_callbacks
*
* SYNOPSIS
*
SilcLogHexdumpCb hexdump_cb,
void *hexdump_context);
-/****f* silcutil/SilcLogAPI/silc_log_reset_debug_callbacks
+/****f* silcutil/silc_log_reset_debug_callbacks
*
* SYNOPSIS
*
***/
void silc_log_reset_debug_callbacks(void);
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_string
+/****f* silcutil/silc_log_set_debug_string
*
* SYNOPSIS
*
***/
void silc_log_set_debug_string(const char *debug_string);
-/****f* silcutil/SilcLogAPI/silc_log_timestamp
+/****f* silcutil/silc_log_timestamp
*
* NAME
*
***/
void silc_log_timestamp(SilcBool enable);
-/****f* silcutil/SilcLogAPI/silc_log_flushdelay
+/****f* silcutil/silc_log_flushdelay
*
* NAME
*
***/
void silc_log_flushdelay(SilcUInt32 flushdelay);
-/****f* silcutil/SilcLogAPI/silc_log_quick
+/****f* silcutil/silc_log_quick
*
* NAME
*
***/
void silc_log_quick(SilcBool enable);
-/****v* silcutil/SilcLogAPI/silc_log_debug
+/****v* silcutil/silc_log_debug
*
* NAME
*
***/
void silc_log_debug(SilcBool enable);
-/****v* silcutil/SilcLogAPI/silc_log_debug_hexdump
+/****v* silcutil/silc_log_debug_hexdump
*
* NAME
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1999 - 2007 Pekka Riikonen
+ Copyright (C) 1999 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Memory Interface
+/****h* silcutil/Memory Interface
*
* DESCRIPTION
*
- * Basic utility functions for allocating memory. All SILC routines, and
- * applications use these functions when they need to allocate, manipulate
- * and free memory.
+ * Routines for allocating and freeing memory.
*
***/
#ifndef SILC_STACKTRACE
-/****f* silcutil/SilcMemoryAPI/silc_malloc
+/****f* silcutil/silc_malloc
*
* SYNOPSIS
*
***/
void *silc_malloc(size_t size);
-/****f* silcutil/SilcMemoryAPI/silc_calloc
+/****f* silcutil/silc_calloc
*
* SYNOPSIS
*
***/
void *silc_calloc(size_t items, size_t size);
-/****f* silcutil/SilcMemoryAPI/silc_realloc
+/****f* silcutil/silc_realloc
*
* SYNOPSIS
*
***/
void *silc_realloc(void *ptr, size_t size);
-/****f* silcutil/SilcMemoryAPI/silc_free
+/****f* silcutil/silc_free
*
* SYNOPSIS
*
***/
void silc_free(void *ptr);
-/****f* silcutil/SilcMemoryAPI/silc_memdup
+/****f* silcutil/silc_memdup
*
* SYNOPSIS
*
***/
void *silc_memdup(const void *ptr, size_t size);
-/****f* silcutil/SilcMemoryAPI/silc_strdup
+/****f* silcutil/silc_strdup
*
* SYNOPSIS
*
/* Following functions that use SilcStack as memory source. */
-/****f* silcutil/SilcMemoryAPI/silc_smalloc
+/****f* silcutil/silc_smalloc
*
* SYNOPSIS
*
***/
void *silc_smalloc(SilcStack stack, SilcUInt32 size);
-/****f* silcutil/SilcMemoryAPI/silc_scalloc
+/****f* silcutil/silc_scalloc
*
* SYNOPSIS
*
***/
void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size);
-/****f* silcutil/SilcMemoryAPI/silc_srealloc
+/****f* silcutil/silc_srealloc
*
* SYNOPSIS
*
void *silc_srealloc(SilcStack stack, SilcUInt32 old_size,
void *ptr, SilcUInt32 size);
-/****f* silcutil/SilcMemoryAPI/silc_smemdup
+/****f* silcutil/silc_smemdup
*
* SYNOPSIS
*
***/
void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size);
-/****f* silcutil/SilcMemoryAPI/silc_sfree
+/****f* silcutil/silc_sfree
*
* SYNOPSIS
*
***/
void silc_sfree(SilcStack stack, void *ptr);
-/****f* silcutil/SilcMemoryAPI/silc_sstrdup
+/****f* silcutil/silc_sstrdup
*
* SYNOPSIS
*
/************************ Static utility functions **************************/
-/* MIME fields destructor */
-
-static void silc_mime_field_dest(void *key, void *context, void *user_context)
-{
- silc_free(key);
- silc_free(context);
-}
-
/* Assembler fragment destructor */
static void silc_mime_assembler_dest(void *key, void *context,
mime->fields = silc_hash_table_alloc(NULL, 0, silc_hash_string_case, mime,
silc_hash_string_case_compare, mime,
- silc_mime_field_dest, mime, TRUE);
+ silc_hash_destructor, mime, TRUE);
if (!mime->fields) {
silc_mime_free(mime);
return NULL;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2005 - 2007 Pekka Riikonen
+ Copyright (C) 2005 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC MIME Interface
+/****h* silcutil/MIME Interface
*
* DESCRIPTION
*
#ifndef SILCMIME_H
#define SILCMIME_H
-/****s* silcutil/SILCMIMEAPI/SilcMime
+/****s* silcutil/SilcMime
*
* NAME
*
***/
typedef struct SilcMimeStruct *SilcMime;
-/****s* silcutil/SILCMIMEAPI/SilcMimeAssembler
+/****s* silcutil/SilcMimeAssembler
*
* NAME
*
***/
typedef struct SilcMimeAssemblerStruct *SilcMimeAssembler;
-/****f* silcutil/SILCMIMEAPI/silc_mime_alloc
+/****f* silcutil/silc_mime_alloc
*
* SYNOPSIS
*
***/
SilcMime silc_mime_alloc(void);
-/****f* silcutil/SILCMIMEAPI/silc_mime_free
+/****f* silcutil/silc_mime_free
*
* SYNOPSIS
*
***/
void silc_mime_free(SilcMime mime);
-/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_alloc
+/****f* silcutil/silc_mime_assembler_alloc
*
* SYNOPSIS
*
***/
SilcMimeAssembler silc_mime_assembler_alloc(void);
-/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_free
+/****f* silcutil/silc_mime_assembler_free
*
* SYNOPSIS
*
***/
void silc_mime_assembler_free(SilcMimeAssembler assembler);
-/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_purge
+/****f* silcutil/silc_mime_assembler_purge
*
* SYNOPSIS
*
void silc_mime_assembler_purge(SilcMimeAssembler assembler,
SilcUInt32 purge_minutes);
-/****f* silcutil/SILCMIMEAPI/silc_mime_decode
+/****f* silcutil/silc_mime_decode
*
* SYNOPSIS
*
SilcMime silc_mime_decode(SilcMime mime, const unsigned char *data,
SilcUInt32 data_len);
-/****f* silcutil/SILCMIMEAPI/silc_mime_encode
+/****f* silcutil/silc_mime_encode
*
* SYNOPSIS
*
***/
unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len);
-/****f* silcutil/SILCMIMEAPI/silc_mime_assemble
+/****f* silcutil/silc_mime_assemble
*
* SYNOPSIS
*
***/
SilcMime silc_mime_assemble(SilcMimeAssembler assembler, SilcMime partial);
-/****f* silcutil/SILCMIMEAPI/silc_mime_encode_partial
+/****f* silcutil/silc_mime_encode_partial
*
* SYNOPSIS
*
***/
SilcDList silc_mime_encode_partial(SilcMime mime, int max_size);
-/****f* silcutil/SILCMIMEAPI/silc_mime_partial_free
+/****f* silcutil/silc_mime_partial_free
*
* SYNOPSIS
*
***/
void silc_mime_partial_free(SilcDList partials);
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_field
+/****f* silcutil/silc_mime_add_field
*
* SYNOPSIS
*
***/
void silc_mime_add_field(SilcMime mime, const char *field, const char *value);
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_field
+/****f* silcutil/silc_mime_get_field
*
* SYNOPSIS
*
***/
const char *silc_mime_get_field(SilcMime mime, const char *field);
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_data
+/****f* silcutil/silc_mime_add_data
*
* SYNOPSIS
*
void silc_mime_add_data(SilcMime mime, const unsigned char *data,
SilcUInt32 data_len);
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_data
+/****f* silcutil/silc_mime_get_data
*
* SYNOPSIS
*
***/
const unsigned char *silc_mime_get_data(SilcMime mime, SilcUInt32 *data_len);
-/****f* silcutil/SILCMIMEAPI/silc_mime_steal_data
+/****f* silcutil/silc_mime_steal_data
*
* SYNOPSIS
*
***/
unsigned char *silc_mime_steal_data(SilcMime mime, SilcUInt32 *data_len);
-/****f* silcutil/SILCMIMEAPI/silc_mime_is_partial
+/****f* silcutil/silc_mime_is_partial
*
* SYNOPSIS
*
***/
SilcBool silc_mime_is_partial(SilcMime mime);
-/****f* silcutil/SILCMIMEAPI/silc_mime_set_multipart
+/****f* silcutil/silc_mime_set_multipart
*
* SYNOPSIS
*
void silc_mime_set_multipart(SilcMime mime, const char *type,
const char *boundary);
-/****f* silcutil/SILCMIMEAPI/silc_mime_add_multipart
+/****f* silcutil/silc_mime_add_multipart
*
* SYNOPSIS
*
***/
SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part);
-/****f* silcutil/SILCMIMEAPI/silc_mime_is_multipart
+/****f* silcutil/silc_mime_is_multipart
*
* SYNOPSIS
*
***/
SilcBool silc_mime_is_multipart(SilcMime mime);
-/****f* silcutil/SILCMIMEAPI/silc_mime_get_multiparts
+/****f* silcutil/silc_mime_get_multiparts
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Mutex Interface
+/****h* silcutil/Mutex Interface
*
* DESCRIPTION
*
#ifndef SILCMUTEX_H
#define SILCMUTEX_H
-/****s* silcutil/SilcMutexAPI/SilcMutex
+/****s* silcutil/SilcMutex
*
* NAME
*
***/
typedef struct SilcMutexStruct *SilcMutex;
-/****s* silcutil/SilcMutexAPI/SilcRwLock
+/****s* silcutil/SilcRwLock
*
* NAME
*
***/
typedef struct SilcRwLockStruct *SilcRwLock;
-/****f* silcutil/SilcMutexAPI/silc_mutex_alloc
+/****f* silcutil/silc_mutex_alloc
*
* SYNOPSIS
*
***/
SilcBool silc_mutex_alloc(SilcMutex *mutex);
-/****f* silcutil/SilcMutexAPI/silc_mutex_free
+/****f* silcutil/silc_mutex_free
*
* SYNOPSIS
*
***/
void silc_mutex_free(SilcMutex mutex);
-/****f* silcutil/SilcMutexAPI/silc_mutex_lock
+/****f* silcutil/silc_mutex_lock
*
* SYNOPSIS
*
***/
void silc_mutex_lock(SilcMutex mutex);
-/****f* silcutil/SilcMutexAPI/silc_mutex_unlock
+/****f* silcutil/silc_mutex_unlock
*
* SYNOPSIS
*
***/
void silc_mutex_unlock(SilcMutex mutex);
-/****f* silcutil/SilcMutexAPI/silc_mutex_assert_locked
+/****f* silcutil/silc_mutex_assert_locked
*
* SYNOPSIS
*
***/
void silc_mutex_assert_locked(SilcMutex mutex);
-/****f* silcutil/SilcMutexAPI/silc_rwlock_alloc
+/****f* silcutil/silc_rwlock_alloc
*
* SYNOPSIS
*
***/
SilcBool silc_rwlock_alloc(SilcRwLock *rwlock);
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_free
+/****f* silcutil/silc_rwlock_free
*
* SYNOPSIS
*
***/
void silc_rwlock_free(SilcRwLock rwlock);
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_rdlock
+/****f* silcutil/silc_rwlock_rdlock
*
* SYNOPSIS
*
***/
void silc_rwlock_rdlock(SilcRwLock rwlock);
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_wrlock
+/****f* silcutil/silc_rwlock_wrlock
*
* SYNOPSIS
*
***/
void silc_rwlock_wrlock(SilcRwLock rwlock);
-/****f* silcutil/SilcRwLockAPI/silc_rwlock_unlock
+/****f* silcutil/silc_rwlock_unlock
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Net Interface
+/****h* silcutil/Network Interface
*
* DESCRIPTION
*
- * SILC Net API provides various network routines for applications. It
- * can be used to create TCP/IP and UDP/IP connections and listeners.
- * Various utility functions for resolving various information is also
- * provided.
+ * SILC Net API provides various network routines for applications. It can
+ * be used to create TCP/IP and UDP/IP connections and listeners. Various
+ * utility functions for resolving various information is also provided.
+ * The interface supports both IPv4 and IPv6.
+ *
+ * EXAMPLE
+ *
+ * // Create TCP connection to example.com at port 25
+ * silc_net_tcp_connect(NULL, "example.com", 25, schedule, connected_cb, ctx);
+ *
+ * // Create UDP listener on local interface 10.2.1.7 on port 500
+ * SilcStream udpstream;
+ *
+ * udpstream = silc_net_udp_connect("10.2.1.7", 500, NULL, 0, schedule);
+ * silc_stream_set_notifier(udpstream, schedule, receive_callback, ctx);
*
***/
/* Prototypes */
-/****s* silcutil/SilcNetAPI/SilcNetListener
+/****s* silcutil/SilcNetListener
*
* NAME
*
***/
typedef struct SilcNetListenerStruct *SilcNetListener;
-/****f* silcutil/SilcNetAPI/SilcNetCallback
+/****f* silcutil/SilcNetCallback
*
* SYNOPSIS
*
typedef void (*SilcNetCallback)(SilcResult status,
SilcStream stream, void *context);
-/****f* silcutil/SilcNetAPI/silc_net_tcp_create_listener
+/****f* silcutil/silc_net_tcp_create_listener
*
* SYNOPSIS
*
SilcSchedule schedule,
SilcNetCallback callback, void *context);
-/****f* silcutil/SilcNetAPI/silc_net_tcp_create_listener2
+/****f* silcutil/silc_net_tcp_create_listener2
*
* SYNOPSIS
*
SilcSchedule schedule,
SilcNetCallback callback, void *context);
-/****f* silcutil/SilcNetAPI/silc_net_listener_get_port
+/****f* silcutil/silc_net_listener_get_port
*
* SYNOPSIS
*
- * SilcUInt16 silc_net_listener_get_port(SilcNetListener listener);
+ * SilcUInt16 *silc_net_listener_get_port(SilcNetListener listener,
+ * SilcUInt32 *port_count);
*
* DESCRIPTION
*
* Returns an array of ports of size of `port_count'. The caller must
* free the array with silc_free. There are as many ports in the array
* as there were IP addresses provided in silc_net_tcp_create_listener,
- * as there were ports provided in silc_net_tcp_create_listener2.
+ * or as there were ports provided in silc_net_tcp_create_listener2.
*
***/
SilcUInt16 *silc_net_listener_get_port(SilcNetListener listener,
SilcUInt32 *port_count);
-/****f* silcutil/SilcNetAPI/silc_net_listener_get_ip
+/****f* silcutil/silc_net_listener_get_ip
*
* SYNOPSIS
*
* DESCRIPTION
*
* Returns the IP's to where the `listener' is bound. Returns an array
- * of IP addresses of size of `port_count'. The caller must free the
+ * of IP addresses of size of `ip_count'. The caller must free the
* array and its strings with silc_free.
*
***/
char **silc_net_listener_get_ip(SilcNetListener listener,
SilcUInt32 *ip_count);
-/****f* silcutil/SilcNetAPI/silc_net_listener_get_hostname
+/****f* silcutil/silc_net_listener_get_hostname
*
* SYNOPSIS
*
* DESCRIPTION
*
* Returns the hostnames to where the `listener' is bound. Returns an
- * array of hostnames of size of `port_count'. The caller must free the
- * array and its strings with silc_free.
+ * array of hostnames of size of `hostname_count'. The caller must free
+ * the array and its strings with silc_free.
*
***/
char **silc_net_listener_get_hostname(SilcNetListener listener,
SilcUInt32 *hostname_count);
-/****f* silcutil/SilcNetAPI/silc_net_close_listener
+/****f* silcutil/silc_net_close_listener
*
* SYNOPSIS
*
***/
void silc_net_close_listener(SilcNetListener listener);
-/****f* silcutil/SilcNetAPI/silc_net_tcp_connect
+/****f* silcutil/silc_net_tcp_connect
*
* SYNOPSIS
*
SilcNetCallback callback,
void *context);
-/****f* silcutil/SilcNetAPI/silc_net_udp_connect
+/****f* silcutil/silc_net_udp_connect
*
* SYNOPSIS
*
*
* To receive packets the silc_stream_set_notifier must be called for the
* returned SilcStream. The packets are always received in the notifier
- * callback when the SILC_STREAM_CAN_READ is returned to the callback
- * To read the packet use silc_stream_read if the remote address was
+ * callback when the SILC_STREAM_CAN_READ is returned to the callback.
+ * To read the packet use silc_stream_read if the `remote_ip_addr' was
* provided, and silc_net_udp_receive if it was not.
*
* Supports IPv6 if the platform supports it. If `schedule' is NULL this
const char *remote_ip_addr, int remote_port,
SilcSchedule schedule);
-/****f* silcutil/SilcNetAPI/silc_net_udp_receive
+/****f* silcutil/silc_net_udp_receive
*
* SYNOPSIS
*
* pointer. The packet data is returned into the `ret_data' buffer.
*
* Returns the length of the packet, or -1 on error or 0 in case of EOF.
+ * In case of error the silc_errno will indicate the error. If the
+ * error is SILC_ERR_WOULD_BLOCK data is not currently available from the
+ * `stream'.
*
***/
int silc_net_udp_receive(SilcStream stream, char *remote_ip_addr,
SilcUInt32 remote_ip_addr_size, int *remote_port,
unsigned char *ret_data, SilcUInt32 data_size);
-/****f* silcutil/SilcNetAPI/silc_net_udp_send
+/****f* silcutil/silc_net_udp_send
*
* SYNOPSIS
*
*
* Sends an UDP packet to remote host `remote_ip_addr' on `remote_port'.
* This may be used with UDP streams that are not connected to any
- * specific remote host. With those stream silc_stream_write cannot be
- * used. In those cases, this function must be used. This may also be
- * used even if the stream is connected.
+ * specific remote host. With those streams silc_stream_write cannot be
+ * used. In those cases, this function must be used. However, this may
+ * also be used even if the stream is in connected state.
+ *
+ * You can create the `stream' by calling silc_net_udp_connect.
*
* Returns the amount of data written, -1 if data could not be written
* at this moment, or -2 if error occurred. If -1 is returned the
const char *remote_ip_addr, int remote_port,
const unsigned char *data, SilcUInt32 data_len);
-/****f* silcutil/SilcNetAPI/silc_net_close_connection
+/****f* silcutil/silc_net_close_connection
*
* SYNOPSIS
*
***/
void silc_net_close_connection(int sock);
-/****f* silcutil/SilcNetAPI/silc_net_accept_connection
+/****f* silcutil/silc_net_accept_connection
*
* SYNOPSIS
*
***/
int silc_net_accept_connection(int sock);
-/****f* silcutil/SilcNetAPI/silc_net_set_socket_opt
+/****f* silcutil/silc_net_set_socket_opt
*
* SYNOPSIS
*
***/
int silc_net_set_socket_opt(int sock, int level, int option, int on);
-/****f* silcutil/SilcNetAPI/silc_net_get_socket_opt
+/****f* silcutil/silc_net_get_socket_opt
*
* SYNOPSIS
*
int silc_net_get_socket_opt(int sock, int level, int option,
void *optval, int *opt_len);
-/****f* silcutil/SilcNetAPI/silc_net_set_socket_nonblock
+/****f* silcutil/silc_net_set_socket_nonblock
*
* SYNOPSIS
*
***/
int silc_net_set_socket_nonblock(SilcSocket sock);
-/****f* silcutil/SilcNetAPI/silc_net_is_ip4
+/****f* silcutil/silc_net_is_ip4
*
* SYNOPSIS
*
***/
SilcBool silc_net_is_ip4(const char *addr);
-/****f* silcutil/SilcNetAPI/silc_net_is_ip6
+/****f* silcutil/silc_net_is_ip6
*
* SYNOPSIS
*
***/
SilcBool silc_net_is_ip6(const char *addr);
-/****f* silcutil/SilcNetAPI/silc_net_is_ip
+/****f* silcutil/silc_net_is_ip
*
* SYNOPSIS
*
***/
SilcBool silc_net_is_ip(const char *addr);
-/****f* silcutil/SilcNetAPI/silc_net_addr2bin
+/****f* silcutil/silc_net_addr2bin
*
* SYNOPSIS
*
***/
SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len);
-/****f* silcutil/SilcNetAPI/SilcNetResolveCallback
+/****f* silcutil/SilcNetResolveCallback
*
* SYNOPSIS
*
***/
typedef void (*SilcNetResolveCallback)(const char *result, void *context);
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyname
+/****f* silcutil/silc_net_gethostbyname
*
* SYNOPSIS
*
SilcBool silc_net_gethostbyname(const char *name, SilcBool prefer_ipv6,
char *address, SilcUInt32 address_len);
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyname_async
+/****f* silcutil/silc_net_gethostbyname_async
*
* SYNOPSIS
*
SilcNetResolveCallback completion,
void *context);
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr
+/****f* silcutil/silc_net_gethostbyaddr
*
* SYNOPSIS
*
SilcBool silc_net_gethostbyaddr(const char *addr, char *name,
SilcUInt32 name_len);
-/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr_async
+/****f* silcutil/silc_net_gethostbyaddr_async
*
* SYNOPSIS
*
SilcNetResolveCallback completion,
void *context);
-/****f* silcutil/SilcNetAPI/silc_net_check_host_by_sock
+/****f* silcutil/silc_net_check_host_by_sock
*
* SYNOPSIS
*
SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname,
char **ip);
-/****f* silcutil/SilcNetAPI/silc_net_check_local_by_sock
+/****f* silcutil/silc_net_check_local_by_sock
*
* SYNOPSIS
*
SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname,
char **ip);
-/****f* silcutil/SilcNetAPI/silc_net_get_remote_port
+/****f* silcutil/silc_net_get_remote_port
*
* SYNOPSIS
*
***/
SilcUInt16 silc_net_get_remote_port(SilcSocket sock);
-/****f* silcutil/SilcNetAPI/silc_net_get_local_port
+/****f* silcutil/silc_net_get_local_port
*
* SYNOPSIS
*
***/
SilcUInt16 silc_net_get_local_port(SilcSocket sock);
-/****f* silcutil/SilcNetAPI/silc_net_localhost
+/****f* silcutil/silc_net_localhost
*
* SYNOPSIS
*
***/
char *silc_net_localhost(void);
-/****f* silcutil/SilcNetAPI/silc_net_localip
+/****f* silcutil/silc_net_localip
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Regular Expression Interface
+/****h* silcutil/Regex Interface
*
* DESCRIPTION
*
* // Free the compiled regular expression
* silc_regex_free(®);
*
+ * // Simple match
+ * if (!silc_regex("foobar", "foo.", NULL))
+ * no_match;
+ *
+ * // Replace all foos with bar on all lines in the buffer
+ * silc_subst(buffer, "s/foo/bar/g");
+ *
***/
#ifndef SILCREGEX_H
#define SILCREGEX_H
-/****s* silcutil/SilcRegexAPI/SilcRegex
+/****s* silcutil/SilcRegex
*
* NAME
*
char anchor; /* anchor: 0=none 1=begline 2=begbuf */
} *SilcRegex, SilcRegexStruct;
-/****s* silcutil/SilcRegexAPI/SilcRegexMatch
+/****s* silcutil/SilcRegexMatch
*
* NAME
*
} *SilcRegexMatch, SilcRegexMatchStruct;
/***/
-/****d* silcutil/SilcRegexAPI/SilcRegexFlags
+/****d* silcutil/SilcRegexFlags
*
* NAME
*
} SilcRegexFlags;
/***/
-/****f* silcutil/SilcRegexAPI/silc_regex_compile
+/****f* silcutil/silc_regex_compile
*
* SYNOPSIS
*
SilcBool silc_regex_compile(SilcRegex regexp, const char *regex,
SilcRegexFlags flags);
-/****f* silcutil/SilcRegexAPI/silc_regex_compile
+/****f* silcutil/silc_regex_match
*
* SYNOPSIS
*
SilcUInt32 string_len, SilcUInt32 num_match,
SilcRegexMatch match, SilcRegexFlags flags);
-/****f* silcutil/SilcRegexAPI/silc_regex_free
+/****f* silcutil/silc_regex_free
*
* SYNOPSIS
*
***/
void silc_regex_free(SilcRegex regexp);
-/****f* silcutil/SilcRegexAPI/silc_regex
+/****f* silcutil/silc_regex
*
* SYNOPSIS
*
SilcBool silc_regex(const char *string, const char *regex,
SilcBuffer match, ...);
-/****f* silcutil/SilcRegexAPI/silc_regex_buffer
+/****f* silcutil/silc_regex_buffer
*
* SYNOPSIS
*
SilcBool silc_regex_buffer(SilcBuffer buffer, const char *regex,
SilcBuffer match, ...);
-/****f* silcutil/SilcRegexAPI/silc_subst
+/****f* silcutil/silc_subst
*
* SYNOPSIS
*
* Sed (Stream Editor) style substitution interface. The `subst' may
* be of following formats:
*
- * 's/REGEXP/REPLACEMENT/FLAGS'
+ * 's/REGEXP/REPLACEMENT/FLAGS'
*
* Matches regular expression REGEXP in each line in the buffer and
* substitutes the match with REPLACEMENT.
*
- * 'ADDRs/REGEXP/REPLACEMENT/FLAGS'
+ * 'ADDRs/REGEXP/REPLACEMENT/FLAGS'
*
* Selects lines in the buffer matching the address ADDR and matches the
* regular expression REGEXP in the line and substitutes the match with
*
* The ADDR may be of following format:
*
- * /REGEXP/ Matches only lines matching the regular expression
- * NUMBER Matches only the specified line number (1-n)
- * $ Matches only the last line
+ * /REGEXP/ Matches only lines matching the regular expression
+ * NUMBER Matches only the specified line number (1-n)
+ * $ Matches only the last line
*
* The FLAGS may be of following format:
*
- * no FLAGS Finds first match in the line and replaces that
- * g Finds and replaces all matches in the line
+ * no FLAGS Finds first match in the line and replaces that
+ * g Finds and replaces all matches in the line
*
* An '!' may precede the 's'. In that case the ADDR is not matched.
*
*/
+/****h* silcutil/Runtime Toolkit Interface
+ *
+ * DESCRIPTION
+ *
+ * The SILC Runtime Toolkit API is used to initialize and uninitialize the
+ * Runtime Toolkit. The application should call silc_runtime_init at the
+ * very start of the application and the silc_runtime_uninit at the very end
+ * of the application before it is exited.
+ *
+ ***/
+
#ifndef SILCRUNTIME_H
#define SILCRUNTIME_H
#include <silcmime.h>
#include <silcrand.h>
+/* Runtime Toolkit API */
+
+/****f* silcutil/silc_runtime_init
+ *
+ * SYNOPSIS
+ *
+ * static inline void silc_runtime_init(void)
+ *
+ * DESCRIPTION
+ *
+ * Initializes the Runtime Toolkit. Application should call this as the
+ * very first call to the Runtime Toolkit. The function initializes some
+ * of the Toolkit features.
+ *
+ ***/
+static inline
+void silc_runtime_init(void)
+{
+ /* For now we don't have much here. Strictly speaking, calling this
+ currently isn't required. But in the future we may have something that
+ really must be initialized at the very start. Even the Tls doesn't
+ actually require initialization since any routine using Tls currently
+ takes care of that. */
+
+ /* Initialize Tls for this thread (probably main process thread). */
+ silc_thread_tls_init();
+}
+
+/****f* silcutil/silc_runtime_uninit
+ *
+ * SYNOPSIS
+ *
+ * static inline void silc_runtime_uninit(void)
+ *
+ * DESCRIPTION
+ *
+ * Uninitializes the Runtime Toolkit. Application should call this as the
+ * very last call to the Runtime Toolkit. The function uninitializes and
+ * frees all allocated resources.
+ *
+ ***/
+static inline
+void silc_runtime_uninit(void)
+{
+ /* Uninitialize the whole Tls system (not just one thread). */
+ silc_thread_tls_uninit();
+}
+
#ifdef __cplusplus
}
#endif
*/
-/****h* silcutil/SILC Schedule Interface
+/****h* silcutil/Scheduler Interface
*
* DESCRIPTION
*
* the application's main loop that can handle incoming data, outgoing data,
* timeouts and dispatch different kind of tasks.
*
- * The SILC Scheduler supports file descriptor based tasks and timeout tasks.
- * File descriptor tasks are tasks that perform some operation over the
- * specified file descriptor. These include network connections, for example.
- * The timeout tasks are timeouts that are executed after the specified
- * timeout has elapsed.
+ * The SILC Scheduler supports file descriptor based tasks, timeout tasks and
+ * asynchronous event tasks. File descriptor tasks are tasks that perform
+ * some operation over the specified file descriptor or socket. The timeout
+ * tasks are timeouts that are executed after the specified timeout has
+ * elapsed. Asynchronous event tasks are tasks that can be connected to
+ * and signalled to deliver messages and data to all connected entities.
*
* The SILC Scheduler is designed to be the sole main loop of the application
* so that the application does not need any other main loop. However,
* that the scheduler does not block, and thus providing a possiblity that some
* external main loop is run over the SILC Scheduler.
*
- * Typical application first initializes the scheduler and then register
- * the very first tasks to the scheduler and then run the scheduler. After
- * the scheduler's run function returns the application is considered to be
- * ended.
- *
* On Windows systems the SILC Scheduler is too designed to work as the main
* loop of the GUI application. It can handle all Windows messages and
* it dispatches them from the scheduler, and thus makes it possible to
* WSAEVENT handle objects created by Winsock2 routines and arbitrary
* WIN32 HANDLE objects.
*
- * The SILC Scheduler supports multi-threads as well. The actual scheduler
- * must be run in single-thread but other threads may register new tasks
- * and unregister old tasks. However, it is enforced that the actual
- * task is always run in the main thread. The scheduler is context based
- * which makes it possible to allocate several schedulers for one application.
- * Since the scheduler must be run in single-thread, a multi-threaded
- * application could be created by allocating own scheduler for each of the
- * worker threads. Each scheduler in worker thread should be a child
- * scheduler created from the main thread's parent schedule.
+ * On Symbian OS the SILC Scheduler can work in cooperation with the Active
+ * Scheduler. However, the Symbian OS Active Scheduler must be started
+ * before starting SILC Scheduler.
+ *
+ * The SILC Scheduler supports multi-threads. Each thread can have their
+ * own scheduler. Tasks registered to a scheduler are always executed in
+ * that same thread. However, tasks may be added to and removed from any
+ * scheduler from any thread. Each scheduler in worker thread should be
+ * a child scheduler created from the main thread's parent scheduler.
*
***/
#ifndef SILCSCHEDULE_H
#define SILCSCHEDULE_H
-/****s* silcutil/SilcScheduleAPI/SilcSchedule
+/****s* silcutil/SilcSchedule
*
* NAME
*
***/
typedef struct SilcScheduleStruct *SilcSchedule;
-/****s* silcutil/SilcScheduleAPI/SilcTask
+/****s* silcutil/SilcTask
*
* NAME
*
***/
typedef struct SilcTaskStruct *SilcTask;
-/****d* silcutil/SilcScheduleAPI/SilcTaskEvent
+/****d* silcutil/SilcTaskEvent
*
* NAME
*
} SilcTaskEvent;
/***/
-/****f* silcutil/SilcScheduleAPI/SilcTaskCallback
+/****f* silcutil/SilcTaskCallback
*
* SYNOPSIS
*
SilcTaskEvent type, SilcUInt32 fd,
void *context);
-/****f* silcutil/SilcScheduleAPI/SilcTaskEventCallback
+/****f* silcutil/SilcTaskEventCallback
*
* SYNOPSIS
*
SilcTask task, void *context,
va_list va);
-/****f* silcutil/SilcScheduleAPI/SilcTaskNotifyCb
+/****f* silcutil/SilcTaskNotifyCb
*
* SYNOPSIS
*
/* Macros */
-/****d* silcutil/SilcScheduleAPI/SILC_ALL_TASKS
+/****d* silcutil/SILC_ALL_TASKS
*
* NAME
*
#define SILC_ALL_TASKS ((SilcTask)1)
/***/
-/****d* silcutil/SilcScheduleAPI/SILC_TASK_CALLBACK
+/****d* silcutil/SILC_TASK_CALLBACK
*
* NAME
*
SilcUInt32 fd, void *context)
/***/
-/****d* silcutil/SilcScheduleAPI/SILC_TASK_EVENT_CALLBACK
+/****d* silcutil/SILC_TASK_EVENT_CALLBACK
*
* NAME
*
#include "silcschedule_i.h"
-/****f* silcutil/SilcScheduleAPI/silc_schedule_init
+/****f* silcutil/silc_schedule_init
*
* SYNOPSIS
*
SilcSchedule silc_schedule_init(int max_tasks, void *app_context,
SilcStack stack, SilcSchedule parent);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_uninit
+/****f* silcutil/silc_schedule_uninit
*
* SYNOPSIS
*
***/
SilcBool silc_schedule_uninit(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_stop
+/****f* silcutil/silc_schedule_stop
*
* SYNOPSIS
*
***/
void silc_schedule_stop(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule
+/****f* silcutil/silc_schedule
*
* SYNOPSIS
*
***/
void silc_schedule(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_one
+/****f* silcutil/silc_schedule_one
*
* SYNOPSIS
*
***/
SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_wakeup
+/****f* silcutil/silc_schedule_wakeup
*
* SYNOPSIS
*
***/
void silc_schedule_wakeup(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_parent
+/****f* silcutil/silc_schedule_get_parent
*
* SYNOPSIS
*
***/
SilcSchedule silc_schedule_get_parent(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_context
+/****f* silcutil/silc_schedule_get_context
*
* SYNOPSIS
*
***/
void *silc_schedule_get_context(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_stack
+/****f* silcutil/silc_schedule_get_stack
*
* SYNOPSIS
*
***/
SilcStack silc_schedule_get_stack(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_set_notify
+/****f* silcutil/silc_schedule_set_notify
*
* SYNOPSIS
*
void silc_schedule_set_notify(SilcSchedule schedule,
SilcTaskNotifyCb notify, void *context);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_set_global
+/****f* silcutil/silc_schedule_set_global
*
* SYNOPSIS
*
***/
void silc_schedule_set_global(SilcSchedule schedule);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_global
+/****f* silcutil/silc_schedule_get_global
*
* SYNOPSIS
*
***/
SilcSchedule silc_schedule_get_global(void);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_fd
+/****f* silcutil/silc_schedule_task_add_fd
*
* SYNOPSIS
*
#define silc_schedule_task_add_fd(schedule, fd, callback, context) \
silc_schedule_task_add(schedule, fd, callback, context, 0, 0, SILC_TASK_FD)
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_timeout
+/****f* silcutil/silc_schedule_task_add_timeout
*
* SYNOPSIS
*
silc_schedule_task_add(schedule, 0, callback, context, s, u, \
SILC_TASK_TIMEOUT)
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_signal
+/****f* silcutil/silc_schedule_task_add_signal
*
* SYNOPSIS
*
silc_schedule_task_add(schedule, sig, callback, context, 0, 0, \
SILC_TASK_SIGNAL)
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_event
+/****f* silcutil/silc_schedule_task_add_event
*
* SYNOPSIS
*
*
* The variable argument list is used to describe the arguments of the
* event. The variable arguments are a list of zero or more SilcParam
- * values. This function returns the event task context or NULL on error.
+ * values. The list must be ended with SILC_PARAM_END. This function
+ * returns the event task context or NULL on error.
*
* EXAMPLE
*
* // Register 'connected' event
* silc_schedule_task_add_event(schedule, "connected",
* SILC_PARAM_UINT32,
- * SILC_PARAM_BUFFER);
+ * SILC_PARAM_BUFFER,
+ * SILC_PARAM_END);
*
* // Connect to 'connected' event
* silc_schedule_event_connect(schedule, "connected", NULL,
SilcTask silc_schedule_task_add_event(SilcSchedule schedule,
const char *event, ...);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del
+/****f* silcutil/silc_schedule_task_del
*
* SYNOPSIS
*
***/
SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_fd
+/****f* silcutil/silc_schedule_task_del_by_fd
*
* SYNOPSIS
*
***/
SilcBool silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_callback
+/****f* silcutil/silc_schedule_task_del_by_callback
*
* SYNOPSIS
*
SilcBool silc_schedule_task_del_by_callback(SilcSchedule schedule,
SilcTaskCallback callback);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_context
+/****f* silcutil/silc_schedule_task_del_by_context
*
* SYNOPSIS
*
SilcBool silc_schedule_task_del_by_context(SilcSchedule schedule,
void *context);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_by_all
+/****f* silcutil/silc_schedule_task_del_by_all
*
* SYNOPSIS
*
SilcTaskCallback callback,
void *context);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_event
+/****f* silcutil/silc_schedule_task_del_event
*
* SYNOPSIS
*
SilcBool silc_schedule_task_del_event(SilcSchedule schedule,
const char *event);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_set_listen_fd
+/****f* silcutil/silc_schedule_set_listen_fd
*
* SYNOPSIS
*
SilcBool silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd,
SilcTaskEvent mask, SilcBool send_events);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_get_fd_events
+/****f* silcutil/silc_schedule_get_fd_events
*
* SYNOPSIS
*
SilcTaskEvent silc_schedule_get_fd_events(SilcSchedule schedule,
SilcUInt32 fd);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_unset_listen_fd
+/****f* silcutil/silc_schedule_unset_listen_fd
*
* SYNOPSIS
*
***/
void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_event_connect
+/****f* silcutil/silc_schedule_event_connect
*
* SYNOPSIS
*
SilcTaskEventCallback callback,
void *context);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_event_disconnect
+/****f* silcutil/silc_schedule_event_disconnect
*
* SYNOPSIS
*
SilcTaskEventCallback callback,
void *context);
-/****f* silcutil/SilcScheduleAPI/silc_schedule_event_signal
+/****f* silcutil/silc_schedule_event_signal
*
* SYNOPSIS
*
*
* Signals an event task. The `event' or `task' must be non-NULL. If
* `event' is non-NULL it is the name of the event to signal. If the `task'
- * is non-NULL it is the task to be signalled. It is marginally faster
- * to use the `task' pointer directly instead of `event' to send the signal.
+ * is non-NULL it is the event task to be signalled. It is marginally
+ * faster to use the `task' pointer directly instead of `event' to send
+ * the signal.
*
* The variable arguments are the arguments to be sent in the signal to
* the connected entities. The silc_schedule_task_add_event defines what
- * arguments must be sent to each signal.
+ * arguments must be sent to each signal. The variable argument list
+ * must not be ended with SILC_PARAM_END even though it is ended with that
+ * in silc_schedule_task_add_event.
*
* Signal delivery is synchronous; the signal is delivered inside this
* function. If a receiver was originally in another thread, the signal
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/Snprintf
+/****h* silcutil/Snprintf Interface
*
* DESCRIPTION
*
#ifndef SILCSNPRINTF_H
#define SILCSNPRINTF_H
-/****f* silcutil/SilcSnprintf/SilcSnprintfRender
+/****f* silcutil/SilcSnprintfRender
*
* SYNOPSIS
*
***/
typedef char *(*SilcSnprintfRender)(void *data);
-/****f* silcutil/SilcSnprintf/silc_snprintf
+/****f* silcutil/silc_snprintf
*
* SYNOPSIS
*
***/
int silc_snprintf(char *str, size_t count, const char *fmt, ...);
-/****f* silcutil/SilcSnprintf/silc_vsnprintf
+/****f* silcutil/silc_vsnprintf
*
* SYNOPSIS
*
***/
int silc_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
-/****f* silcutil/SilcSnprintf/silc_asprintf
+/****f* silcutil/silc_asprintf
*
* SYNOPSIS
*
***/
int silc_asprintf(char **ptr, const char *format, ...);
-/****f* silcutil/SilcSnprintf/silc_vasprintf
+/****f* silcutil/silc_vasprintf
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Socket Stream Interface
+/****h* silcutil/Socket Stream Interface
*
* DESCRIPTION
*
#ifndef SILCSOCKETSTREAM_H
#define SILCSOCKETSTREAM_H
-/****f* silcutil/SilcSocketStreamAPI/SilcSocketStreamCallback
+/****f* silcutil/SilcSocketStreamCallback
*
* SYNOPSIS
*
typedef void (*SilcSocketStreamCallback)(SilcResult status,
SilcStream stream, void *context);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_tcp_stream_create
+/****f* silcutil/silc_socket_tcp_stream_create
*
* SYNOPSIS
*
SilcSocketStreamCallback callback,
void *context);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_udp_stream_create
+/****f* silcutil/silc_socket_udp_stream_create
*
* SYNOPSIS
*
SilcBool connected,
SilcSchedule schedule);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_is_udp
+/****f* silcutil/silc_socket_stream_is_udp
*
* SYNOPSIS
*
***/
SilcBool silc_socket_stream_is_udp(SilcStream stream, SilcBool *connected);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_get_info
+/****f* silcutil/silc_socket_stream_get_info
*
* SYNOPSIS
*
SilcSocket *sock, const char **hostname,
const char **ip, SilcUInt16 *port);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_set_info
+/****f* silcutil/silc_socket_stream_set_info
*
* SYNOPSIS
*
const char *hostname,
const char *ip, SilcUInt16 port);
-/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_set_qos
+/****f* silcutil/silc_socket_stream_set_qos
*
* SYNOPSIS
*
*/
-/****h* silcutil/SilcStack Interface
+/****h* silcutil/Memory Pool Interface
*
* DESCRIPTION
*
- * Data stack interface which can be used to do fast allocations from
- * the stack. Basically SilcStack is a pre-allocated memory pool system
- * which allows fast memory allocation for routines and applications that
- * frequently allocate small amounts of memory. Other advantage of this
- * system is that there are no memory leaks, as long as the stack is
- * freed eventually. Since the stack is usually allocated only once this
- * is not an issue.
+ * SilcStack is a pre-allocated memory pool system which allows fast memory
+ * allocation for routines and applications that frequently allocate small
+ * amounts of memory. Other advantage of this system is that there are no
+ * memory leaks, as long as the stack is freed eventually. Since the stack
+ * is usually allocated only once this is not an issue.
*
* SilcStack supports stack pushing and popping allowing to push the stack,
* allocate memory and then pop it to free the allocated memory. The freeing
*
* A basic set of utility functions are provided for application that wish
* to use the SilcStack as their primary memory allocation source. The
- * following functions support SilcStack:
+ * following functions (among many others) support SilcStack:
*
* silc_smalloc, silc_smalloc, silc_scalloc, silc_srealloc, silc_smemdup,
* silc_sfree, silc_sstrdup, silc_buffer_salloc, silc_buffer_salloc_size,
* silc_buffer_srealloc, silc_buffer_srealloc_size, silc_buffer_scopy,
* silc_buffer_sclone, silc_buffer_sformat, silc_buffer_sformat_vp,
- * silc_buffer_sstrformat, silc_buffer_senlarge, silc_mp_sinit,
- * silc_dlist_sinit, silc_hash_table_alloc
+ * silc_buffer_sstrformat, silc_buffer_senlarge, silc_dlist_sinit,
+ * silc_hash_table_alloc
*
* The SilcStack is not thread-safe so that same context could be used for
* allocations from multiple threads. It is however safe to create and use
#ifndef SILCSTACK_H
#define SILCSTACK_H
-/****s* silcutil/SilcStackAPI/SilcStack
+/****s* silcutil/SilcStack
*
* NAME
*
***/
typedef struct SilcStackStruct *SilcStack;
-/****s* silcutil/SilcStackAPI/SilcStackFrame
+/****s* silcutil/SilcStackFrame
*
* NAME
*
***/
typedef struct SilcStackFrameStruct SilcStackFrame;
-/****f* silcutil/SilcStackAPI/SilcStackOomHandler
+/****f* silcutil/SilcStackOomHandler
*
* SYNOPSIS
*
***/
typedef void (*SilcStackOomHandler)(SilcStack stack, void *context);
-/****f* silcutil/SilcStackAPI/silc_stack_alloc
+/****f* silcutil/silc_stack_alloc
*
* SYNOPSIS
*
* that, even though child allocates memory from the parent, the parent's
* stack is not consumed.
*
- * Returns NULL on error.
+ * Returns NULL on error and sets silc_errno.
*
***/
SilcStack silc_stack_alloc(SilcUInt32 stack_size, SilcStack parent);
-/****f* silcutil/SilcStackAPI/silc_stack_free
+/****f* silcutil/silc_stack_free
*
* SYNOPSIS
*
***/
void silc_stack_free(SilcStack stack);
-/****f* silcutil/SilcStackAPI/silc_stack_push
+/****f* silcutil/silc_stack_push
*
* SYNOPSIS
*
***/
SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame);
-/****f* silcutil/SilcStackAPI/silc_stack_pop
+/****f* silcutil/silc_stack_pop
*
* SYNOPSIS
*
***/
SilcUInt32 silc_stack_pop(SilcStack stack);
-/****f* silcutil/SilcStackAPI/silc_stack_malloc
+/****f* silcutil/silc_stack_malloc
*
* SYNOPSIS
*
***/
void *silc_stack_malloc(SilcStack stack, SilcUInt32 size);
-/****f* silcutil/SilcStackAPI/silc_stack_realloc
+/****f* silcutil/silc_stack_realloc
*
* SYNOPSIS
*
void *silc_stack_realloc(SilcStack stack, SilcUInt32 old_size,
void *ptr, SilcUInt32 size);
-/****f* silcutil/SilcStackAPI/silc_stack_set_oom_handler
+/****f* silcutil/silc_stack_set_oom_handler
*
* SYNOPSIS
*
SilcStackOomHandler oom_handler,
void *context);
-/****f* silcutil/SilcStackAPI/silc_stack_set_alignment
+/****f* silcutil/silc_stack_set_alignment
*
* SYNOPSIS
*
***/
void silc_stack_set_alignment(SilcStack stack, SilcUInt32 alignment);
-/****f* silcutil/SilcStackAPI/silc_stack_get_alignment
+/****f* silcutil/silc_stack_get_alignment
*
* SYNOPSIS
*
***/
SilcUInt32 silc_stack_get_alignment(SilcStack stack);
-/****f* silcutil/SilcStackAPI/silc_stack_purge
+/****f* silcutil/silc_stack_purge
*
* SYNOPSIS
*
***/
SilcBool silc_stack_purge(SilcStack stack);
-/****f* silcutil/SilcStackAPI/silc_stack_set_global
+/****f* silcutil/silc_stack_set_global
*
* SYNOPSIS
*
***/
void silc_stack_set_global(SilcStack stack);
-/****f* silcutil/SilcStackAPI/silc_stack_get_global
+/****f* silcutil/silc_stack_get_global
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Stream Interface
+/****h* silcutil/Stream Interface
*
* DESCRIPTION
*
* other stream API derived from this API can use this same interface for
* reading and writing.
*
- * The SilcStream is an abstraction. It can represent any stream, socket
- * stream, file descriptor stream, packet stream, etc.
+ * The SilcStream is an abstraction. It can represent any stream; socket
+ * stream, file descriptor stream, packet stream, etc. See examples in
+ * silcsocketstream.h and silcfdstream.h.
*
* Note that stream implementations usually are not thread-safe. Always
* verify whether a stream implementation is thread-safe by checking their
#ifndef SILCSTREAM_H
#define SILCSTREAM_H
-/****s* silcutil/SilcStreamAPI/SilcStream
+/****s* silcutil/SilcStream
*
* NAME
*
***/
typedef void *SilcStream;
-/****d* silcutil/SilcStreamAPI/SilcStreamStatus
+/****d* silcutil/SilcStreamStatus
*
* NAME
*
} SilcStreamStatus;
/***/
-/****f* silcutil/SilcStreamAPI/SilcStreamNotifier
+/****f* silcutil/SilcStreamNotifier
*
* SYNOPSIS
*
SilcStreamStatus status,
void *context);
-/****s* silcutil/SilcStreamAPI/SilcStreamOps
+/****s* silcutil/SilcStreamOps
*
* NAME
*
* } *SilcFooStream;
*
* SilcFooStream foo;
- * silc_stream_write(foo, data, data_len);
+ * silc_stream_write((SilcStream)foo, data, data_len);
*
* SOURCE
*/
} SilcStreamOps;
/***/
-/****f* silcutil/SilcStreamAPI/silc_stream_read
+/****f* silcutil/silc_stream_read
*
* SYNOPSIS
*
int silc_stream_read(SilcStream stream, unsigned char *buf,
SilcUInt32 buf_len);
-/****f* silcutil/SilcStreamAPI/silc_stream_write
+/****f* silcutil/silc_stream_write
*
* SYNOPSIS
*
int silc_stream_write(SilcStream stream, const unsigned char *data,
SilcUInt32 data_len);
-/****f* silcutil/SilcStreamAPI/silc_stream_close
+/****f* silcutil/silc_stream_close
*
* SYNOPSIS
*
***/
SilcBool silc_stream_close(SilcStream stream);
-/****f* silcutil/SilcStreamAPI/silc_stream_destroy
+/****f* silcutil/silc_stream_destroy
*
* SYNOPSIS
*
***/
void silc_stream_destroy(SilcStream stream);
-/****f* silcutil/SilcStreamAPI/silc_stream_set_notifier
+/****f* silcutil/silc_stream_set_notifier
*
* SYNOPSIS
*
SilcBool silc_stream_set_notifier(SilcStream stream, SilcSchedule schedule,
SilcStreamNotifier notifier, void *context);
-/****f* silcutil/SilcStreamAPI/silc_stream_get_schedule
+/****f* silcutil/silc_stream_get_schedule
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2004 - 2005 Pekka Riikonen
+ Copyright (C) 2004 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Stringprep
+/****h* silcutil/Stringprep Interface
*
* DESCRIPTION
*
#ifndef SILCSTRINGPREP_H
#define SILCSTRINGPREP_H
-/****d* silcutil/SilcStringprep/SilcStringprepStatus
+/****d* silcutil/SilcStringprepStatus
*
* NAME
*
} SilcStringprepStatus;
/***/
-/****d* silcutil/SilcStringprep/SilcStringprepFlags
+/****d* silcutil/SilcStringprepFlags
*
* NAME
*
#define SILC_IDENTIFIER_CH_PREP "silc-identifier-ch-prep"
#define SILC_CASEFOLD_PREP "silc-casefold-prep"
-/****f* silcutil/SilcStringprep/silc_stringprep
+/****f* silcutil/silc_stringprep
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2002 - 2007 Pekka Riikonen
+ Copyright (C) 2002 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC String Utilities
+/****h* silcutil/String Utilities
*
* DESCRIPTION
*
#ifndef SILCSTRUTIL_H
#define SILCSTRUTIL_H
-/****d* silcutil/SilcStrUtilAPI/SilcStringEncoding
+/****d* silcutil/SilcStringEncoding
*
* NAME
*
} SilcStringEncoding;
/***/
-/****f* silcutil/SilcStrStrUtilAPI/silc_strncat
+/****f* silcutil/silc_strncat
*
* SYNOPSIS
*
char *silc_strncat(char *dest, SilcUInt32 dest_size,
const char *src, SilcUInt32 src_len);
-/****f* silcutil/SilcStrUtilAPI/silc_string_regexify
+/****f* silcutil/silc_string_regexify
*
* SYNOPSIS
*
***/
char *silc_string_regexify(const char *string);
-/****f* silcutil/SilcStrUtilAPI/silc_string_match
+/****f* silcutil/silc_string_match
*
* SYNOPSIS
*
***/
int silc_string_match(const char *string1, const char *string2);
-/****f* silcutil/SilcStrUtilAPI/silc_string_compare
+/****f* silcutil/silc_string_compare
*
* SYNOPSIS
*
***/
int silc_string_compare(char *string1, char *string2);
-/****f* silcutil/SilcStrUtilAPI/silc_string_split
+/****f* silcutil/silc_string_split
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Thread Interface
+/****h* silcutil/Thread Interface
*
* DESCRIPTION
*
/* Prototypes */
-/****s* silcutil/SilcThreadAPI/SilcThread
+/****s* silcutil/SilcThread
*
* NAME
*
***/
typedef void *SilcThread;
-/****f* silcutil/SilcThreadAPI/SilcThreadStart
+/****f* silcutil/SilcThreadStart
*
* SYNOPSIS
*
***/
typedef void *(*SilcThreadStart)(void *context);
-/****f* silcutil/SilcThreadAPI/silc_thread_create
+/****f* silcutil/silc_thread_create
*
* SYNOPSIS
*
SilcThread silc_thread_create(SilcThreadStart start_func, void *context,
SilcBool waitable);
-/****f* silcutil/SilcThreadAPI/silc_thread_exit
+/****f* silcutil/silc_thread_exit
*
* SYNOPSIS
*
***/
void silc_thread_exit(void *exit_value);
-/****f* silcutil/SilcThreadAPI/silc_thread_self
+/****f* silcutil/silc_thread_self
*
* SYNOPSIS
*
***/
SilcThread silc_thread_self(void);
-/****f* silcutil/SilcThreadAPI/silc_thread_wait
+/****f* silcutil/silc_thread_wait
*
* SYNOPSIS
*
***/
SilcBool silc_thread_wait(SilcThread thread, void **exit_value);
-/****f* silcutil/SilcThreadAPI/silc_thread_yield
+/****f* silcutil/silc_thread_yield
*
* SYNOPSIS
*
***/
void silc_thread_yield(void);
-/****s* silcutil/SilcThreadAPI/SilcThreadPool
+/****s* silcutil/SilcThreadPool
*
* NAME
*
***/
typedef struct SilcThreadPoolStruct *SilcThreadPool;
-/****f* silcutil/SilcThreadAPI/SilcThreadPoolFunc
+/****f* silcutil/SilcThreadPoolFunc
*
* SYNOPSIS
*
***/
typedef void (*SilcThreadPoolFunc)(SilcSchedule schedule, void *context);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_alloc
+/****f* silcutil/silc_thread_pool_alloc
*
* SYNOPSIS
*
SilcUInt32 max_threads,
SilcBool start_min_threads);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_free
+/****f* silcutil/silc_thread_pool_free
*
* SYNOPSIS
*
***/
void silc_thread_pool_free(SilcThreadPool tp, SilcBool wait_unfinished);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_run
+/****f* silcutil/silc_thread_pool_run
*
* SYNOPSIS
*
SilcTaskCallback completion,
void *completion_context);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_set_max_threads
+/****f* silcutil/silc_thread_pool_set_max_threads
*
* SYNOPSIS
*
void silc_thread_pool_set_max_threads(SilcThreadPool tp,
SilcUInt32 max_threads);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_get_max_threads
+/****f* silcutil/silc_thread_pool_get_max_threads
*
* SYNOPSIS
*
***/
SilcUInt32 silc_thread_pool_get_max_threads(SilcThreadPool tp);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_num_free_threads
+/****f* silcutil/silc_thread_pool_num_free_threads
*
* SYNOPSIS
*
***/
SilcUInt32 silc_thread_pool_num_free_threads(SilcThreadPool tp);
-/****f* silcutil/SilcThreadAPI/silc_thread_pool_purge
+/****f* silcutil/silc_thread_pool_purge
*
* SYNOPSIS
*
***/
void silc_thread_pool_purge(SilcThreadPool tp);
-/****f* silcutil/SilcThreadAPI/silc_thread_tls_set
+/****f* silcutil/silc_thread_tls_set
*
* SYNOPSIS
*
***/
void silc_thread_tls_set(void *context);
-/****f* silcutil/SilcThreadAPI/silc_thread_tls_get
+/****f* silcutil/silc_thread_tls_get
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Thread Queue Interface
+/****h* silcutil/Thread Queue Interface
*
* DESCRIPTION
*
#ifndef SILCTHREADQUEUE_H
#define SILCTHREADQUEUE_H
-/****s* silcutil/SilcThreadQueueAPI/SilcThreadQueue
+/****s* silcutil/SilcThreadQueue
*
* NAME
*
***/
typedef struct SilcThreadQueueStruct *SilcThreadQueue;
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_alloc
+/****f* silcutil/silc_thread_queue_alloc
*
* SYNOPSIS
*
***/
SilcThreadQueue silc_thread_queue_alloc(void);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_connect
+/****f* silcutil/silc_thread_queue_connect
*
* SYNOPSIS
*
***/
void silc_thread_queue_connect(SilcThreadQueue queue);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_disconnect
+/****f* silcutil/silc_thread_queue_disconnect
*
* SYNOPSIS
*
***/
void silc_thread_queue_disconnect(SilcThreadQueue queue);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_push
+/****f* silcutil/silc_thread_queue_push
*
* SYNOPSIS
*
***/
void silc_thread_queue_push(SilcThreadQueue queue, void *data);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_pop
+/****f* silcutil/silc_thread_queue_pop
*
* SYNOPSIS
*
***/
void *silc_thread_queue_pop(SilcThreadQueue queue, SilcBool block);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_timed_pop
+/****f* silcutil/silc_thread_queue_timed_pop
*
* SYNOPSIS
*
void *silc_thread_queue_timed_pop(SilcThreadQueue queue,
int timeout_msec);
-/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_pop_list
+/****f* silcutil/silc_thread_queue_pop_list
*
* SYNOPSIS
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2003 - 2007 Pekka Riikonen
+ Copyright (C) 2003 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Time Interface
+/****h* silcutil/Time Interface
*
* DESCRIPTION
*
#ifndef SILCTIME_H
#define SILCTIME_H
-/****s* silcutil/SilcTimeAPI/SilcTime
+/****s* silcutil/SilcTime
*
* NAME
*
*
* SOURCE
*
- ***/
+ */
typedef struct SilcTimeObject {
unsigned int year : 15; /* Year, 0 - 32768 */
unsigned int month : 4; /* Month, 1 - 12 */
} *SilcTime, SilcTimeStruct;
/***/
-/****f* silcutil/SilcTimeAPI/silc_time
+/****f* silcutil/silc_time
*
* SYNOPSIS
*
***/
SilcInt64 silc_time(void);
-/****f* silcutil/SilcTimeAPI/silc_time_msec
+/****f* silcutil/silc_time_msec
*
* SYNOPSIS
*
***/
SilcInt64 silc_time_msec(void);
-/****f* silcutil/SilcTimeAPI/silc_time_usec
+/****f* silcutil/silc_time_usec
*
* SYNOPSIS
*
***/
SilcInt64 silc_time_usec(void);
-/****f* silcutil/SilcTimeAPI/silc_time_string
+/****f* silcutil/silc_time_string
*
* SYNOPSIS
*
***/
const char *silc_time_string(SilcInt64 time_val_sec);
-/****f* silcutil/SilcTimeAPI/silc_time_value
+/****f* silcutil/silc_time_value
*
* SYNOPSIS
*
***/
SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time);
-/****f* silcutil/SilcTimeAPI/silc_timezone
+/****f* silcutil/silc_timezone
*
* SYNOPSIS
*
***/
SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size);
-/****f* silcutil/SilcTimeAPI/silc_time_universal
+/****f* silcutil/silc_time_universal
*
* SYNOPSIS
*
***/
SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time);
-/****f* silcutil/SilcTimeAPI/silc_time_universal_string
+/****f* silcutil/silc_time_universal_string
*
* SYNOPSIS
*
SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string,
SilcUInt32 ret_string_size);
-/****f* silcutil/SilcTimeAPI/silc_time_generalized
+/****f* silcutil/silc_time_generalized
*
* SYNOPSIS
*
SilcBool
silc_time_generalized(const char *generalized_time, SilcTime ret_time);
-/****f* silcutil/SilcTimeAPI/silc_time_generalized_string
+/****f* silcutil/silc_time_generalized_string
*
* SYNOPSIS
*
SilcBool silc_time_generalized_string(SilcTime time_val, char *ret_string,
SilcUInt32 ret_string_size);
-/****f* silcutil/SilcTimeAPI/silc_compare_timeval
+/****f* silcutil/silc_compare_timeval
*
* SYNOPSIS
*
***/
int silc_compare_timeval(struct timeval *t1, struct timeval *t2);
-/****f* silcutil/SilcTimeAPI/silc_gettimeofday
+/****f* silcutil/silc_gettimeofday
*
* SYNOPSIS
*
***/
int silc_gettimeofday(struct timeval *p);
-/****f* silcutil/SilcTimeAPI/silc_usleep
- *
- * SYNOPSIS
- *
- * void silc_usleep(unsigned long microseconds);
- *
- * DESCRIPTION
- *
- * Delays the execution of process/thread for the specified amount of
- * time, which is in microseconds.
- *
- * NOTES
- *
- * The delay is only approximate and on some platforms the resolution is
- * in fact milliseconds.
- *
- ***/
-static inline
-void silc_usleep(unsigned long microseconds)
-{
-#ifdef SILC_UNIX
-#ifdef HAVE_NANOSLEEP
- struct timespec tv;
- tv.tv_sec = 0;
- tv.tv_nsec = microseconds * 1000;
-#endif /* HAVE_NANOSLEEP */
-#endif /* SILC_UNIX */
-
-#ifdef SILC_UNIX
-#ifdef HAVE_NANOSLEEP
- nanosleep(&tv, NULL);
-#else
- usleep(microseconds);
-#endif /* HAVE_NANOSLEEP */
-#endif /* SILC_UNIX */
-#ifdef SILC_WIN32
- Sleep(microseconds / 1000);
-#endif /* SILC_WIN32 */
-#ifdef SILC_SYMBIAN
- silc_symbian_usleep(microseconds);
-#endif /* SILC_SYMBIAN */
-}
-
#endif /* SILCTIME_H */
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Timer Interface
+/****h* silcutil/Timer Interface
*
* DESCRIPTION
*
* SILC Timer interface provides a simple way to measure time intervals.
* The SILC Timer works with microsecond resolution, depending on platform.
*
+ * The interface also provides utility functions to get currenet CPU tick
+ * count and to delay process/thread execution.
+ *
* EXAMPLE
*
* SilcTimerStruct timer;
#ifndef SILCTIMER_H
#define SILCTIMER_H
-/****s* silcutil/SilcTimerAPI/SilcTimer
+/****s* silcutil/SilcTimer
*
* NAME
*
***/
typedef struct SilcTimerObject *SilcTimer, SilcTimerStruct;
-/****f* silcutil/SilcTimerAPI/silc_timer_start
+/****f* silcutil/silc_timer_start
*
* SYNOPSIS
*
***/
void silc_timer_start(SilcTimer timer);
-/****f* silcutil/SilcTimerAPI/silc_timer_stop
+/****f* silcutil/silc_timer_stop
*
* SYNOPSIS
*
***/
void silc_timer_stop(SilcTimer timer);
-/****f* silcutil/SilcTimerAPI/silc_timer_continue
+/****f* silcutil/silc_timer_continue
*
* SYNOPSIS
*
***/
void silc_timer_continue(SilcTimer timer);
-/****f* silcutil/SilcTimerAPI/silc_timer_value
+/****f* silcutil/silc_timer_value
*
* SYNOPSIS
*
SilcUInt64 *elapsed_time_seconds,
SilcUInt32 *elapsed_time_microseconds);
-/****f* silcutil/SilcTimerAPI/silc_timer_value_time
+/****f* silcutil/silc_timer_value_time
*
* SYNOPSIS
*
***/
void silc_timer_value_time(SilcTimer timer, SilcTime ret_time);
-/****f* silcutil/SilcTimerAPI/silc_timer_start_time
+/****f* silcutil/silc_timer_start_time
*
* SYNOPSIS
*
***/
void silc_timer_start_time(SilcTimer timer, SilcTime ret_start_time);
-/****f* silcutil/SilcTimerAPI/silc_timer_is_running
+/****f* silcutil/silc_timer_is_running
*
* SYNOPSIS
*
#include "silctimer_i.h"
-/****f* silcutil/SilcTimerAPI/silc_timer_tick
+/****f* silcutil/silc_timer_tick
*
* SYNOPSIS
*
* tick count. If the `adjust' is TRUE and the silc_timer_synchronize
* has been called the returned value is adjusted to be more accurate.
*
- * EXAMPLES
+ * EXAMPLE
*
* // Synchronize timer for more accurate CPU tick counts
* silc_timer_synchronize(&timer);
#endif /* __GNUC__ || __ICC */
}
-/****f* silcutil/SilcTimerAPI/silc_timer_synchronize
+/****f* silcutil/silc_timer_synchronize
*
* SYNOPSIS
*
timer->sync_tdiff += (int)(t2 - t1);
}
+/****f* silcutil/silc_usleep
+ *
+ * SYNOPSIS
+ *
+ * void silc_usleep(unsigned long microseconds);
+ *
+ * DESCRIPTION
+ *
+ * Delays the execution of process/thread for the specified amount of
+ * time, which is in microseconds.
+ *
+ * NOTES
+ *
+ * The delay is only approximate and on some platforms the resolution is
+ * in fact milliseconds.
+ *
+ ***/
+static inline
+void silc_usleep(unsigned long microseconds)
+{
+#ifdef SILC_UNIX
+#ifdef HAVE_NANOSLEEP
+ struct timespec tv;
+ tv.tv_sec = 0;
+ tv.tv_nsec = microseconds * 1000;
+#endif /* HAVE_NANOSLEEP */
+#endif /* SILC_UNIX */
+
+#ifdef SILC_UNIX
+#ifdef HAVE_NANOSLEEP
+ nanosleep(&tv, NULL);
+#else
+ usleep(microseconds);
+#endif /* HAVE_NANOSLEEP */
+#endif /* SILC_UNIX */
+#ifdef SILC_WIN32
+ Sleep(microseconds / 1000);
+#endif /* SILC_WIN32 */
+#ifdef SILC_SYMBIAN
+ silc_symbian_usleep(microseconds);
+#endif /* SILC_SYMBIAN */
+}
+
#endif /* SILCTIMER_H */
*/
-/****h* silcutil/SILC Types
+/****h* silcutil/Types and Definitions
*
* DESCRIPTION
*
#error "size of the short must be 2 bytes"
#endif
-/******************************* Public API *********************************/
-
-/****d* silcutil/SILCTypes/SilcBool
+/****d* silcutil/SilcBool
*
* NAME
*
***/
typedef unsigned char SilcBool;
-/****d* silcutil/SILCTypes/TRUE
+/****d* silcutil/TRUE
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/FALSE
+/****d* silcutil/FALSE
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SilcUInt8
+/****d* silcutil/SilcUInt8
*
* NAME
*
typedef unsigned char SilcUInt8;
/***/
-/****d* silcutil/SILCTypes/SilcInt8
+/****d* silcutil/SilcInt8
*
* NAME
*
typedef signed char SilcInt8;
/***/
-/****d* silcutil/SILCTypes/SilcUInt16
+/****d* silcutil/SilcUInt16
*
* NAME
*
typedef unsigned short SilcUInt16;
/***/
-/****d* silcutil/SILCTypes/SilcInt16
+/****d* silcutil/SilcInt16
*
* NAME
*
typedef signed short SilcInt16;
/***/
-/****d* silcutil/SILCTypes/SilcUInt32
+/****d* silcutil/SilcUInt32
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SilcInt32
+/****d* silcutil/SilcInt32
*
* NAME
*
*
***/
-/****d* silcutil/SILCTypes/SilcUInt64
+/****d* silcutil/SilcUInt64
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SilcInt64
+/****d* silcutil/SilcInt64
*
* NAME
*
typedef SilcUInt32 * void *;
#endif
-/****d* silcutil/SILCTypes/SilcSocket
+/****d* silcutil/SilcSocket
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SilcParam
+/****d* silcutil/SilcParam
*
* NAME
*
| ((SilcUInt32)(SilcUInt8)(cp)[3])
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
-/****d* silcutil/SILCTypes/SILC_GET16_MSB
+/****d* silcutil/SILC_GET16_MSB
*
* NAME
*
#endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_GET32_MSB
+/****d* silcutil/SILC_GET32_MSB
*
* NAME
*
| ((SilcUInt32)(SilcUInt8)(cp)[3]);
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
-/****d* silcutil/SILCTypes/SILC_GET64_MSB
+/****d* silcutil/SILC_GET64_MSB
*
* NAME
*
#endif /* SILC_X86_64 && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_GET16_LSB
+/****d* silcutil/SILC_GET16_LSB
*
* NAME
*
#endif /* SILC_I386 || SILC_X86_64 */
/***/
-/****d* silcutil/SILCTypes/SILC_GET32_LSB
+/****d* silcutil/SILC_GET32_LSB
*
* NAME
*
| ((SilcUInt32)(SilcUInt8)(cp)[3] << 24)
#endif /* SILC_I386 || SILC_X86_64 */
-/****d* silcutil/SILCTypes/SILC_PUT16_MSB
+/****d* silcutil/SILC_PUT16_MSB
*
* NAME
*
#endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_PUT32_MSB
+/****d* silcutil/SILC_PUT32_MSB
*
* NAME
*
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_PUT64_MSB
+/****d* silcutil/SILC_PUT64_MSB
*
* NAME
*
#endif /* SILC_X86_64 && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_PUT16_LSB
+/****d* silcutil/SILC_PUT16_LSB
*
* NAME
*
#endif /* SILC_I386 || SILC_X86_64 */
/***/
-/****d* silcutil/SILCTypes/SILC_PUT32_LSB
+/****d* silcutil/SILC_PUT32_LSB
*
* NAME
*
#endif /* SILC_I386 || SILC_X86_64 */
/***/
-/****d* silcutil/SILCTypes/SILC_SWAB_16
+/****d* silcutil/SILC_SWAB_16
*
* NAME
*
#endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_SWAB_32
+/****d* silcutil/SILC_SWAB_32
*
* NAME
*
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
/***/
-/****d* silcutil/SILCTypes/SILC_PTR_TO_32
+/****d* silcutil/SILC_PTR_TO_32
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SILC_PTR_TO_64
+/****d* silcutil/SILC_PTR_TO_64
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SILC_32_TO_PTR
+/****d* silcutil/SILC_32_TO_PTR
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/SILC_64_TO_PTR
+/****d* silcutil/SILC_64_TO_PTR
*
* NAME
*
#endif
/***/
-/****d* silcutil/SILCTypes/silc_rol
+/****d* silcutil/SILC_ASSERT
+ *
+ * NAME
+ *
+ * #define SILC_ASSERT(experssion)
+ *
+ * DESCRIPTION
+ *
+ * Assert macro that prints error message to stderr and calls abort()
+ * if the `expression' is false (ie. compares equal to zero). If
+ * SILC_DEBUG is not defined this macro has no effect.
+ *
+ * SOURCE
+ */
+#if defined(SILC_DEBUG)
+#define SILC_ASSERT(expr) assert((expr));
+#else
+#define SILC_ASSERT(expr) do { } while(0)
+#endif /* SILC_DEBUG */
+/***/
+
+/****d* silcutil/SILC_VERIFY
+ *
+ * NAME
+ *
+ * #define SILC_VERIFY(experssion)
+ *
+ * DESCRIPTION
+ *
+ * Verification macro that prints error message to stderr and calls
+ * abort() if the `expression' is false (ie. compares equal to zero)
+ * on debug builds (SILC_DEBUG defined), and prints error message to
+ * stderr on release builds (SILC_DEBUG undefined) but does not abort().
+ * This macro is always compiled even if debugging (SILC_DEBUG) is not
+ * defined.
+ *
+ * SOURCE
+ */
+#if defined(SILC_DEBUG)
+#define SILC_VERIFY(expr) assert((expr));
+#else
+#define SILC_VERIFY(expr) \
+ if (silc_unlikely(!(expr))) { \
+ SILC_LOG_ERROR(("SILC_VERIFY %s:%s:%d", \
+ __FILE__, __FUNCTION__, __LINE__)); \
+ silc_set_errno_reason_nofail(SILC_ERR_ASSERT, "SILC_VERIFY %s:%s:%d", \
+ __FILE__, __FUNCTION__, __LINE__); \
+ }
+#endif /* SILC_DEBUG */
+/***/
+
+/****d* silcutil/silc_rol
*
* NAME
*
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
}
-/****d* silcutil/SILCTypes/silc_ror
+/****d* silcutil/silc_ror
*
* NAME
*
#endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */
}
-/****d* silcutil/SILCTypes/silc_rol64
+/****d* silcutil/silc_rol64
*
* NAME
*
#endif /* SILC_X86_64 && __GNUC__ */
}
-/****d* silcutil/SILCTypes/silc_ror64
+/****d* silcutil/silc_ror64
*
* NAME
*
#endif /* SILC_X86_64 && __GNUC__ */
}
-/****d* silcutil/SILCTypes/silc_offsetof
+/****d* silcutil/silc_offsetof
*
* NAME
*
***/
#define silc_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-/****d* silcutil/SILCTypes/silc_attribute
+/****d* silcutil/silc_attribute
*
* NAME
*
#define silc_attribute(attrlist)
#endif /* __GNUC__ */
-/****d* silcutil/SILCTypes/silc_likely
+/****d* silcutil/silc_likely
*
* NAME
*
*
***/
-/****d* silcutil/SILCTypes/silc_unlikely
+/****d* silcutil/silc_unlikely
*
* NAME
*
reading or writing if you think that the data will be needed soon after
prefetching. */
-/****d* silcutil/SILCTypes/silc_prefetch
+/****d* silcutil/silc_prefetch
*
* NAME
*
#endif /* __GNUC__ */
}
-/****d* silcutil/SILCTypes/silc_prefetch_block
+/****d* silcutil/silc_prefetch_block
*
* NAME
*
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2004 - 2007 Pekka Riikonen
+ Copyright (C) 2004 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC UTF-8 Interface
+/****h* silcutil/UTF-8 Interface
*
* DESCRIPTION
*
#ifndef SILCUTF8_H
#define SILCUTF8_H
-/****f* silcutil/SilcUTF8API/silc_utf8_encode
+/****f* silcutil/silc_utf8_encode
*
* SYNOPSIS
*
SilcStringEncoding bin_encoding,
unsigned char *utf8, SilcUInt32 utf8_size);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_decode
+/****f* silcutil/silc_utf8_decode
*
* SYNOPSIS
*
SilcStringEncoding bin_encoding,
unsigned char *bin, SilcUInt32 bin_size);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_c2w
+/****f* silcutil/silc_utf8_c2w
*
* SYNOPSIS
*
SilcUInt32 silc_utf8_c2w(const unsigned char *utf8, SilcUInt32 utf8_len,
SilcUInt16 *utf8_wide, SilcUInt32 utf8_wide_size);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_w2c
+/****f* silcutil/silc_utf8_w2c
*
* SYNOPSIS
*
SilcUInt32 silc_utf8_w2c(const SilcUInt16 *wide_str, SilcUInt32 wide_str_len,
unsigned char *utf8, SilcUInt32 utf8_size);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_encoded_len
+/****f* silcutil/silc_utf8_encoded_len
*
* SYNOPSIS
*
SilcUInt32 silc_utf8_encoded_len(const unsigned char *bin, SilcUInt32 bin_len,
SilcStringEncoding bin_encoding);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_decoded_len
+/****f* silcutil/silc_utf8_decoded_len
*
* SYNOPSIS
*
SilcUInt32 silc_utf8_decoded_len(const unsigned char *bin, SilcUInt32 bin_len,
SilcStringEncoding bin_encoding);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_valid
+/****f* silcutil/silc_utf8_valid
*
* SYNOPSIS
*
***/
SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_strcasecmp
+/****f* silcutil/silc_utf8_strcasecmp
*
* SYNOPSIS
*
***/
SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2);
-/****f* silcutil/SilcStrUtilAPI/silc_utf8_strncasecmp
+/****f* silcutil/silc_utf8_strncasecmp
*
* SYNOPSIS
*
*/
-/****h* silcutil/SILC Utilities
+/****h* silcutil/Misc Utilities
*
* DESCRIPTION
*
#ifndef SILCUTIL_H
#define SILCUTIL_H
-/****f* silcutil/SilcUtilAPI/silc_gets
+/****f* silcutil/silc_gets
*
* SYNOPSIS
*
***/
int silc_gets(char *dest, int destlen, const char *src, int srclen, int begin);
-/****f* silcutil/SilcUtilAPI/silc_to_upper
+/****f* silcutil/silc_to_upper
*
* SYNOPSIS
*
***/
SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size);
-/****f* silcutil/SilcUtilAPI/silc_to_lower
+/****f* silcutil/silc_to_lower
*
* SYNOPSIS
*
***/
SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size);
-/****f* silcutil/SilcUtilAPI/silc_parse_userfqdn
+/****f* silcutil/silc_parse_userfqdn
*
* SYNOPSIS
*
char *user, SilcUInt32 user_size,
char *fqdn, SilcUInt32 fqdn_size);
-/****f* silcutil/SilcUtilAPI/silc_parse_command_line
+/****f* silcutil/silc_parse_command_line
*
* SYNOPSIS
*
SilcUInt32 *parsed_num,
SilcUInt32 max_args);
-/****f* silcutil/SilcUtilAPI/silc_format
+/****f* silcutil/silc_format
*
* SYNOPSIS
*
***/
char *silc_format(char *fmt, ...);
-/****f* silcutil/SilcUtilAPI/silc_fingerprint
+/****f* silcutil/silc_fingerprint
*
* SYNOPSIS
*
***/
char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len);
-/****f* silcutil/SilcUtilAPI/silc_string_is_ascii
+/****f* silcutil/silc_string_is_ascii
*
* SYNOPSIS
*
***/
SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len);
-/****f* silcutil/SilcUtilAPI/silc_get_input
+/****f* silcutil/silc_get_input
*
* SYNOPSIS
*
/* System dependant prototypes */
-/****f* silcutil/SilcUtilAPI/silc_get_username
+/****f* silcutil/silc_get_username
*
* SYNOPSIS
*
***/
char *silc_get_username();
-/****f* silcutil/SilcUtilAPI/silc_get_real_name
+/****f* silcutil/silc_get_real_name
*
* SYNOPSIS
*
***/
char *silc_get_real_name();
-/****f* silcutil/SilcUtilAPI/silc_va_copy
+/****f* silcutil/silc_va_copy
*
* SYNOPSIS
*
#define silc_va_copy(dest, src) dest = src;
#endif
-/****f* silcutil/SilcUtilAPI/silc_hexdump
+/****f* silcutil/silc_hexdump
*
* SYNOPSIS
*
void silc_hexdump(const unsigned char *data, SilcUInt32 data_len,
FILE *output);
-/****f* silcutil/SilcUtilAPI/silc_hex2data
+/****f* silcutil/silc_hex2data
*
* SYNOPSIS
*
SilcBool silc_hex2data(const char *hex, unsigned char *data,
SilcUInt32 data_size, SilcUInt32 *ret_data_len);
-/****f* silcutil/SilcUtilAPI/silc_data2hex
+/****f* silcutil/silc_data2hex
*
* SYNOPSIS
*
+++ /dev/null
-Makefile
-*.in
-*.am
-*.o
-*.lo
-*.la
-*.a
-*.pc
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2006 - 2007 Pekka Riikonen
+ Copyright (C) 2006 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include "silc.h"
+#include "silcruntime.h"
#include "silcsymbiansocketstream.h"
/************************ Static utility functions **************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include "silc.h"
+#include "silcruntime.h"
#include <e32base.h>
/* The SILC Scheduler for Symbian handles only timeout tasks. Fd tasks are
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2006 - 2007 Pekka Riikonen
+ Copyright (C) 2006 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
socket, which is done automatically by the Active Scheduler in blocking
mode. */
-#include "silc.h"
+#include "silcruntime.h"
#include "silcsymbiansocketstream.h"
/***************************** Socket Classes *******************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2006 - 2007 Pekka Riikonen
+ Copyright (C) 2006 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include "silc.h"
+#include "silcruntime.h"
#include <e32std.h>
#include <e32svr.h>
SilcBool success = FALSE;
unsigned char *vbuf, *vbuf2;
unsigned char init[20];
+ SilcUInt32 gint, *gintptr;
if (argc > 1 && !strcmp(argv[1], "-d")) {
silc_log_debug(TRUE);
silc_log_set_debug_string("*global*");
}
+ SILC_LOG_DEBUG(("Set global var"));
+ gint = 100;
+ if (!silc_global_set_var("gint", 4, &gint, FALSE))
+ goto err;
+
+ SILC_LOG_DEBUG(("Retrieve var"));
+ gintptr = silc_global_get_var("gint", FALSE);
+ if (!gintptr)
+ goto err;
+ if (*gintptr != 100)
+ goto err;
+
SILC_LOG_DEBUG(("Set global var"));
if (!silc_global_set_var("vbuf", 10, NULL, FALSE))
goto err;
+++ /dev/null
-Makefile
-*.in
-*.am
-*.o
-*.lo
-*.la
-*.a
-*.pc
+++ /dev/null
-Makefile
-*.in
-*.am
-*.o
-*.lo
-*.la
-*.a
-*.pc
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
/************************** Types and definitions ***************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
const SilcScheduleOps schedule_ops;
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2007 Pekka Riikonen
+ Copyright (C) 2007 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-#include "silc.h"
+#include "silcruntime.h"
/************************ Static utility functions **************************/
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
GNU General Public License for more details.
*/
-/* $Id$ */
-#include "silc.h"
+#include "silcruntime.h"
#define FILETIME_1970 0x019db1ded53e8000
const BYTE DWLEN = sizeof(DWORD) * 8;
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: @PACKAGE@
+Description: SILC Runtime Toolkit
+Version: @VERSION@
+Libs: -L${libdir} -lsrt @LIBS@
+Cflags: -I${includedir}
-Summary: SILC Toolkit
-Name: silc-toolkit
+Summary: SILC Runtime Toolkit
+Name: srt
Version: SILC_VERSION
Release: SILC_RELEASE
License: GPL/BSD dual licensed
Group: System Environment/Libraries
URL: http://silcnet.org/
-Source0: silc-toolkit-%{version}.tar.gz
+Source0: srt-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: pkgconfig
-Obsoletes: libsilc
-Obsoletes: libsilc-devel
-Obsoletes: libsilc-doc
-Provides: libsilc
-Provides: libsilc-devel
-Provides: libsilc-doc
Epoch: 0
%description
-SILC Toolkit providing SILC Protocol Core Library, SILC Client Library,
-runtime library and many other libraries. SILC Toolkit enables SILC
-application development. SILC (Secure Internet Live Conferencing) is a
-secure conferencing protocol.
+SILC Runtime Toolkit provides a full featured runtime library for
+applications. It provides the application's main loop, threads, locks,
+file utilities, file streams, socket streams, TCP and UDP network routines,
+a finite state machine, lists, a hash table, UTF-8 routines and other string
+utilities, and many other utility routines. The library works on multiple
+platforms.
%package devel
Group: Development/Libraries
-Summary: SILC Toolkit providing headers, libraries and documentation
-Requires: silc-toolkit = %{epoch}:%{version}-%{release}
+Summary: SILC Runtime Toolkit providing headers, libraries and documentation
+Requires: srt = %{epoch}:%{version}-%{release}
Requires: pkgconfig
%description devel
-The SILC Toolkit development libraries, headers and documentation. SILC
-Toolkit enables SILC application development.
+SILC Runtime Toolkit development libraries, headers and documentation.
+SILC Runtime Toolkit provides a full featured runtime library for
+applications. It provides the application's main loop, threads, locks,
+file utilities, file streams, socket streams, TCP and UDP network routines,
+a finite state machine, lists, a hash table, UTF-8 routines and other string
+utilities, and many other utility routines. The library works on multiple
+platforms.
%prep
-%setup -q -n silc-toolkit-%{version}
+%setup -q -n srt-%{version}
%build
%configure --libdir=%{_libdir} \
- --includedir=%{_includedir}/silc \
- --with-simdir=%{_libdir}/silc/modules \
+ --includedir=%{_includedir}/srt \
--docdir=%{_docdir}/%{name}-%{version}
make -j4
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
chmod 0755 ${RPM_BUILD_ROOT}%{_libdir}/lib*
-chmod 0755 ${RPM_BUILD_ROOT}%{_libdir}/silc/modules/*.so
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(0755, root, root, 0755)
-%{_libdir}/libsilc-1.1.so*
-%{_libdir}/libsilcclient-1.1.so*
-%dir %_libdir/silc
-%dir %_libdir/silc/modules
-%{_libdir}/silc/modules/*.so
+%{_libdir}/libsrt-1.2.so*
+%dir %_libdir/srt
%defattr(0644, root, root, 0755)
%doc CHANGES COPYING GPL BSD
%files devel
%defattr(0644, root, root, 0755)
-%doc CHANGES COPYING GPL BSD doc/toolkit
-%{_libdir}/libsilc.so
-%{_libdir}/libsilc.*a
-%{_libdir}/libsilcclient.so
-%{_libdir}/libsilcclient.*a
-%{_libdir}/pkgconfig/silc.pc
-%{_libdir}/pkgconfig/silcclient.pc
-%dir %_includedir/silc
-%{_includedir}/silc/*.h
+%doc CHANGES COPYING GPL BSD doc/runtime
+%{_libdir}/libsrt.so
+%{_libdir}/libsrt.*a
+%{_libdir}/pkgconfig/srt.pc
+%dir %_includedir/srt
+%{_includedir}/srt/*.h
%changelog
-* Wed May 30 2007 Pekka Riikonen <priikone@silcnet.org>
-- Rewrote .spec for SILC Toolkit 1.1. Obsoletes libsilc. Renamed to
- silc-toolkit.
-
-* Tue Sep 1 2004 Toni Willberg <toniw@iki.fi>
-- 0.9.12-0.fdr.6 - Had to remove smp_mflags because build fails with them
- (Michael Schwendt)
-
-* Tue Aug 31 2004 Toni Willberg <toniw@iki.fi>
-- 0.9.12-0.fdr.5 - corrections to lib and include path (from Michael Schwendt)
-
-* Tue Aug 31 2004 Toni Willberg <toniw@iki.fi>
-- 0.9.12-0.fdr.4 - post/postun /sbin/ldconfig
- (Patch 823 from Stu Tomlinson)
-
-* Tue Aug 31 2004 Toni Willberg <toniw@iki.fi>
-- 0.9.12-0.fdr.3 - Move libs to %{_libdir} and add a silc.pc
- (Patch 815 from Stu Tomlinson)
-
-* Tue Aug 17 2004 Toni Willberg <toniw@iki.fi>
-- fix so permissions and hardcoded paths (patch from Michael Schwendt)
-
-* Mon Jul 5 2004 Toni Willberg <toniw@iki.fi>
-- Fixed various errors
-
-* Sun Jul 4 2004 Toni Willberg <toniw@iki.fi>
+* Sun Jan 27 2008 Pekka Riikonen <priikone@silcnet.org>
- Initial version for Fedora
SUBDIRS =
EXTRA_DIST = \
- silcdefs.h silc.dsw copy_dll \
- tests all.dsp clean_dist.pl README \
- libsilc_static
+ silcdefs.h *.dsw copy_dll \
+ tests *.dsp clean_dist.pl README
include $(top_srcdir)/Makefile.defines.in
-Compiling SILC Toolkit for Win32
-================================
+Compiling SILC Runtime Toolkit for Win32
+========================================
-- The MSVC++ 6.0 is required to compile the SILC Toolkit.
+- The MSVC++ 6.0 or newer is required to compile the SILC Runtime Toolkit.
-- Load the silc.dsw workspace file and build the libsilc and
- libsilcclient libraries. Both Debug and Release versions can
- be compiled.
+- Load the srt.dsw workspace file and build all versions of the Toolkit.
-- The include/ directory includes all include files from the
- SILC Toolkit. Use that directory as your include source for
- SILC include files when you are programming new application.
+- The include/ directory includes all include files from the SILC Runtime
+ Toolkit. Use that directory as your include source for when programming
+ new application.