From 4d96aec5a0942c3b9bf66dcbec47c593f267c5ec Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 3 Feb 2008 18:43:05 +0200 Subject: [PATCH] SILC Runtime Toolkit 1.2 Beta 1 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. --- .gitignore | 4 +- INSTALL | 36 +- Makefile.ad | 2 + Makefile.defines.in | 13 +- Makefile.defines_int.in | 6 +- configure.ad | 29 +- distdir/RUNTIME | 6 +- distdir/pre-dist-runtime | 7 +- doc/.cvsignore | 5 - doc/Makefile.ad | 100 +-- doc/runtime.in/arrow.png | Bin 0 -> 179 bytes doc/runtime.in/building.html | 249 +++++++ doc/runtime.in/footer | 13 + doc/runtime.in/header | 14 + doc/runtime.in/index.html.in | 121 ++++ doc/runtime.in/platforms.html | 129 ++++ doc/runtime.in/runtime.css | 218 ++++++ doc/runtime.in/runtime.rc | 32 + includes/.cvsignore | 2 - includes/Makefile.ad | 9 +- includes/silc.h.in | 327 --------- includes/silcversion.h.in | 51 -- lib/.gitignore | 8 - lib/Makefile.ad | 67 +- lib/Makefile.runtime.ad | 83 --- lib/contrib/.gitignore | 2 - lib/doc/LIBINDEX | 6 +- lib/doc/building.html | 76 +- lib/doc/platforms.html | 28 +- lib/doc/porting.html | 678 ------------------ lib/silcutil/.gitignore | 8 - lib/silcutil/Makefile.ad | 3 +- lib/silcutil/silcasync.h | 26 +- lib/silcutil/silcatomic.h | 76 +- lib/silcutil/silcbase64.h | 10 +- lib/silcutil/silcbitops.h | 34 +- lib/silcutil/silcbuffer.h | 141 ++-- lib/silcutil/silcbuffmt.h | 155 ++-- lib/silcutil/silccond.h | 18 +- lib/silcutil/silcconfig.h | 40 +- lib/silcutil/silcdir.h | 105 +-- lib/silcutil/silcdlist.h | 26 +- lib/silcutil/silcdll.h | 12 +- lib/silcutil/silcenv.h | 10 +- lib/silcutil/silcerrno.h | 10 +- lib/silcutil/silcfdstream.h | 14 +- lib/silcutil/silcfsm.h | 88 +-- lib/silcutil/silcgetopt.h | 17 +- lib/silcutil/silcglobal.h | 13 +- lib/silcutil/silchashtable.h | 13 +- lib/silcutil/silclist.h | 28 +- lib/silcutil/silclog.h | 103 +-- lib/silcutil/silcmemory.h | 32 +- lib/silcutil/silcmime.c | 10 +- lib/silcutil/silcmime.h | 48 +- lib/silcutil/silcmutex.h | 28 +- lib/silcutil/silcnet.h | 113 +-- lib/silcutil/silcregex.h | 41 +- lib/silcutil/silcruntime.h.in | 59 ++ lib/silcutil/silcschedule.h | 125 ++-- lib/silcutil/silcsnprintf.h | 14 +- lib/silcutil/silcsocketstream.h | 16 +- lib/silcutil/silcstack.h | 52 +- lib/silcutil/silcstream.h | 29 +- lib/silcutil/silcstringprep.h | 10 +- lib/silcutil/silcstrutil.h | 16 +- lib/silcutil/silcthread.h | 40 +- lib/silcutil/silcthreadqueue.h | 18 +- lib/silcutil/silctime.h | 75 +- lib/silcutil/silctimer.h | 72 +- lib/silcutil/silctypes.h | 133 ++-- lib/silcutil/silcutf8.h | 22 +- lib/silcutil/silcutil.h | 32 +- lib/silcutil/symbian/.gitignore | 8 - lib/silcutil/symbian/silcsymbiannet.cpp | 4 +- lib/silcutil/symbian/silcsymbianscheduler.cpp | 4 +- .../symbian/silcsymbiansocketstream.cpp | 4 +- lib/silcutil/symbian/silcsymbianutil.cpp | 4 +- lib/silcutil/tests/test_silcglobal.c | 13 + lib/silcutil/unix/.gitignore | 8 - lib/silcutil/win32/.gitignore | 8 - lib/silcutil/win32/silcwin32net.c | 5 +- lib/silcutil/win32/silcwin32schedule.c | 5 +- lib/silcutil/win32/silcwin32socketstream.c | 4 +- lib/silcutil/win32/silcwin32util.c | 5 +- lib/srt.pc.in | 10 + srt.spec.in | 90 +-- win32/Makefile.am | 5 +- win32/README | 16 +- win32/{silc.dsw => srt.dsw} | 0 90 files changed, 1991 insertions(+), 2458 deletions(-) delete mode 100644 doc/.cvsignore create mode 100644 doc/runtime.in/arrow.png create mode 100644 doc/runtime.in/building.html create mode 100644 doc/runtime.in/footer create mode 100644 doc/runtime.in/header create mode 100644 doc/runtime.in/index.html.in create mode 100644 doc/runtime.in/platforms.html create mode 100644 doc/runtime.in/runtime.css create mode 100644 doc/runtime.in/runtime.rc delete mode 100644 includes/.cvsignore delete mode 100644 includes/silc.h.in delete mode 100644 includes/silcversion.h.in delete mode 100644 lib/.gitignore delete mode 100644 lib/Makefile.runtime.ad delete mode 100644 lib/contrib/.gitignore delete mode 100644 lib/doc/porting.html delete mode 100644 lib/silcutil/.gitignore delete mode 100644 lib/silcutil/symbian/.gitignore delete mode 100644 lib/silcutil/unix/.gitignore delete mode 100644 lib/silcutil/win32/.gitignore create mode 100644 lib/srt.pc.in rename win32/{silc.dsw => srt.dsw} (100%) diff --git a/.gitignore b/.gitignore index 67ff1f2f..44a62172 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ autodist.dist autodist.log makedist.log Makefile +Makefile.in Makefile.defines Makefile.defines_int acconfig.h @@ -27,5 +28,4 @@ stamp-h* stamp-h*.in *.o *.lo -*.am -*.in +TAGS diff --git a/INSTALL b/INSTALL index a6c12c07..370c1531 100644 --- a/INSTALL +++ b/INSTALL @@ -1,19 +1,12 @@ 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 ===================== @@ -22,16 +15,6 @@ give --help command to the `configure' to see all of them. Here is listed 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 @@ -52,11 +35,6 @@ 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. -`--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 @@ -68,6 +46,16 @@ you can give this option to the `configure'. 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 ================== diff --git a/Makefile.ad b/Makefile.ad index 611d85ae..b64a707c 100644 --- a/Makefile.ad +++ b/Makefile.ad @@ -25,6 +25,8 @@ SUBDIRS = \ doc EXTRA_DIST = \ + srt.m4 \ + srt.spec \ silcdefs.h.in \ symbian \ CHANGES CREDITS diff --git a/Makefile.defines.in b/Makefile.defines.in index c13aab23..2e9c9023 100644 --- a/Makefile.defines.in +++ b/Makefile.defines.in @@ -3,7 +3,7 @@ # # Author: Pekka Riikonen # -# 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 @@ -28,7 +28,7 @@ # 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 @@ -45,12 +45,3 @@ INCLUDES = $(ADD_INCLUDES) $(SILC_CFLAGS) -DHAVE_SILCDEFS_H \ -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 diff --git a/Makefile.defines_int.in b/Makefile.defines_int.in index 92fd95cd..3cb3d1e3 100644 --- a/Makefile.defines_int.in +++ b/Makefile.defines_int.in @@ -3,7 +3,7 @@ # # Author: Pekka Riikonen # -# 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 @@ -54,7 +54,3 @@ modulesdir = $(DESTDIR)$(silc_modulesdir) 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 diff --git a/configure.ad b/configure.ad index 3fad7429..dce30889 100644 --- a/configure.ad +++ b/configure.ad @@ -1186,6 +1186,26 @@ if test x$has_threads = xtrue; then 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 ## @@ -1199,9 +1219,6 @@ AC_SUBST(__SILC_ENABLE_DEBUG) 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) @@ -1219,6 +1236,9 @@ AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR]) INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int" AC_SUBST(INCLUDE_DEFINES_INT) +DATE=`date` +AC_SUBST(DATE) + # # Makefile outputs @@ -1226,11 +1246,10 @@ AC_SUBST(INCLUDE_DEFINES_INT) 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 ) diff --git a/distdir/RUNTIME b/distdir/RUNTIME index 1f5cdba5..331293e5 100644 --- a/distdir/RUNTIME +++ b/distdir/RUNTIME @@ -1,4 +1,4 @@ -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: @@ -13,8 +13,8 @@ commercial application. 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. diff --git a/distdir/pre-dist-runtime b/distdir/pre-dist-runtime index 12d05fd4..7955838d 100644 --- a/distdir/pre-dist-runtime +++ b/distdir/pre-dist-runtime @@ -7,17 +7,14 @@ distdir=$4 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 .. diff --git a/doc/.cvsignore b/doc/.cvsignore deleted file mode 100644 index 3a6da563..00000000 --- a/doc/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -Makefile -Makefile.in -Makefile.am -example_silcd.conf -*.txt diff --git a/doc/Makefile.ad b/doc/Makefile.ad index 1818fc1c..cbf42139 100644 --- a/doc/Makefile.ad +++ b/doc/Makefile.ad @@ -3,7 +3,7 @@ # # Author: Pekka Riikonen # -# 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 @@ -17,102 +17,26 @@ 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 diff --git a/doc/runtime.in/arrow.png b/doc/runtime.in/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..bba0330bf938183027cbfce7dccc56af37953c9c GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&DgizruK)l4fA#v!@l$92{Q0wE z&w(e;p08TBY395opFV%->Yx7N<*T1Re>OXBI}B9s<>}%W!Z9;Bp@G3oRY4#@fXQfP ztfWZ8lt#&pqO>&Tz?W>fJX|_YpB{CX*XWq)EZuBm{F&!js=~a3eW^T3cVuK%2T4X; cZct!gs1D%`aNv;i0h-F->FVdQ&MBb@0Mv9vP5=M^ literal 0 HcmV?d00001 diff --git a/doc/runtime.in/building.html b/doc/runtime.in/building.html new file mode 100644 index 00000000..c3f5f5fe --- /dev/null +++ b/doc/runtime.in/building.html @@ -0,0 +1,249 @@ + + + + + + + +SILC Runtime Toolkit + + + + + +
+ +
+ +Building the Toolkit + +
 
+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. + +
 
+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. + +
 
+
  • Building on Unix & Linux
    +
  • Building on Windows
    +
  • Building on Mac OS X +
  • Building on Symbian OS + +
     
     
    +Building on Unix & Linux + +
     
    +On Unix systems both statically and dynamically linkable libraries are +built by default. + +
     
    +To build Toolkit on Unix systems, give commands: + +
     
    + +./configure
    +make +
    + +
     
    +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: + +
     
    +./configure --help + +
     
    +The most important configuration options you may consider to use are: + +
     
    +--enable-debug + +
     
    +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. + +
     
    +--with-iconv[=DIR] + +
     
    +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). + +
     
    +--without-pthreads + +
     
    +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). + +
     
    +--disable-asm + +
     
    +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. + +
     
    +--enable-ipv6 + +
     
    +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. + +
     
    +--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. + +
     
    +After compilation you can install the Toolkit into your system by giving +the command: + +
     
    +make install + + +
     
     
    +Building on Windows + +
     
    +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. + +
     
    +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. + +
     
     
    +Building on Mac OS X + +
     
    +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: + +
     
    + +setenv CFLAGS -no-cpp-precomp
    +./configure powerpc
    +make +
    + +
     
    +The ./configure can take several options as arguments. To see them all give +command: + +
     
    +./configure --help + +
     
    +To compile, give: + +
     
    + +make + + +
     
    +After compilation you can install the Toolkit into your system by giving +the command: + +
     
    +make install + +
     
     
    +Building on Symbian OS + +
     
    +The build environment for Symbian OS requires Carbide.c++ and MS Windows. + +
     
    +Download the freely available Carbide.c++ from Nokia at +http://forum.nokia.com. The exact +hyperlink location changes often, so it is not referenced here. It is +usually under "Tools and SDKs" link. + +
     
    +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. + +
     
    +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. + +
     
    +After installation import the Toolkit project to Carbide.c++ from the +symbian/ subdirectory in the Toolkit package. + +
     
    +Please read the README.SYMBIAN from the SILC Runtime Toolkit package for +complete building instructions. + +
  • + +
    + + + + + diff --git a/doc/runtime.in/footer b/doc/runtime.in/footer new file mode 100644 index 00000000..f83c74ab --- /dev/null +++ b/doc/runtime.in/footer @@ -0,0 +1,13 @@ + + diff --git a/doc/runtime.in/header b/doc/runtime.in/header new file mode 100644 index 00000000..cf360411 --- /dev/null +++ b/doc/runtime.in/header @@ -0,0 +1,14 @@ + + +
    diff --git a/doc/runtime.in/index.html.in b/doc/runtime.in/index.html.in new file mode 100644 index 00000000..5d7d4dd1 --- /dev/null +++ b/doc/runtime.in/index.html.in @@ -0,0 +1,121 @@ + + + + + + + +SILC Runtime Toolkit + + + + + +
    + +
    +

    SILC Runtime Toolkit Reference Manual

    +

    +Version: @VERSION@
    +Copyright © 1997 - 2008 The SILC Project
    +Updated: @DATE@ +

    +

    +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.

    +

    +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. +

    + +

    GUIDES

    + + +

    TOOLKIT REFERENCE

    + + +
    + +
    + + + + diff --git a/doc/runtime.in/platforms.html b/doc/runtime.in/platforms.html new file mode 100644 index 00000000..a23a9551 --- /dev/null +++ b/doc/runtime.in/platforms.html @@ -0,0 +1,129 @@ + + + + + + + +SILC Runtime Toolkit + + + + + +
    + +
    + +Platform Implementations + +
     
    +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. + +
     
    +
  • Unix & Linux Implementation
    +
  • Windows Implementation
    +
  • Mac OS X Implementation +
  • Symbian OS Implementation + +
     
     
    +Supported Platforms + +
     
    +The Toolkit supports by default all Unix and Linux platforms, Windows +platforms from Windows 2000 and newer, Mac OS X and Symbian OS. + +
     
     
    +Unix Implementation + +
     
    +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. + + +
     
     
    +Windows Implementation + +
     
    +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. + +
     
    +
  • Some of the network routines do not support IPv6. + + +
     
     
    +Mac OS X Implementation + +
     
    +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. + + +
     
     
    +Symbian OS Implementation + +
     
    +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. + +
     
    +
  • The function silc_schedule on Symbian will allocate new Active +Scheduler Waiter and will block the calling thread. The caller should +allocate Active Scheduler before calling silc_schedule. + +
  • 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. + +
  • 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. + +
  • The function silc_thread_create on Symbian will install Active +Scheduler and allocate Cleanup Stack for the new thread. The created +thread always shares heap with the parent thread. + +
  • + +
    + + + + + diff --git a/doc/runtime.in/runtime.css b/doc/runtime.in/runtime.css new file mode 100644 index 00000000..ecb2b70a --- /dev/null +++ b/doc/runtime.in/runtime.css @@ -0,0 +1,218 @@ +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;} +} diff --git a/doc/runtime.in/runtime.rc b/doc/runtime.in/runtime.rc new file mode 100644 index 00000000..535fe48d --- /dev/null +++ b/doc/runtime.in/runtime.rc @@ -0,0 +1,32 @@ +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 diff --git a/includes/.cvsignore b/includes/.cvsignore deleted file mode 100644 index 282522db..00000000 --- a/includes/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/includes/Makefile.ad b/includes/Makefile.ad index b682a39c..17a55291 100644 --- a/includes/Makefile.ad +++ b/includes/Makefile.ad @@ -17,17 +17,12 @@ 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 diff --git a/includes/silc.h.in b/includes/silc.h.in deleted file mode 100644 index f573e3d3..00000000 --- a/includes/silc.h.in +++ /dev/null @@ -1,327 +0,0 @@ -/* - - silc.h - - Author: 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 - 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 -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_SIGNAL_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_ERRNO_H -#include -#endif - -#ifdef HAVE_ASSERT_H -#include -#endif - -#if !defined(SILC_WIN32) - -#include -#include -#include -#include - -#ifdef HAVE_GRP_H -#include -#endif - -#ifdef SOCKS5 -#include "socks.h" -#endif - -#include -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#ifdef HAVE_XTI_H -#include -#else -#ifdef HAVE_NETINET_TCP_H -#include -#endif -#endif - -#ifdef HAVE_NETDB_H -#include -#endif - -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#ifdef HAVE_SYS_MMAN_H -#include -#endif - -#ifdef HAVE_DLFCN_H -#include -#endif - -#ifdef HAVE_LIMITS_H -#include -#endif - -#ifdef SILC_HAVE_PTHREAD -#include -#endif - -#ifdef HAVE_STDDEF_H -#include -#endif - -#ifdef HAVE_TERMIOS_H -#include -#endif - -#ifdef HAVE_UTIME_H -#include -#endif - -#ifdef HAVE_ICONV_H -#include -#endif - -#ifdef HAVE_LOCALE_H -#include -#endif - -#ifdef HAVE_LANGINFO_H -#include -#endif - -#ifdef HAVE_SYS_RESOURCE_H -#include -#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 */ diff --git a/includes/silcversion.h.in b/includes/silcversion.h.in deleted file mode 100644 index 45a65c9f..00000000 --- a/includes/silcversion.h.in +++ /dev/null @@ -1,51 +0,0 @@ -/* - - silcversion.h - - Author: Pekka Riikonen - - 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 */ diff --git a/lib/.gitignore b/lib/.gitignore deleted file mode 100644 index a501f929..00000000 --- a/lib/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -*.in -*.am -*.o -*.lo -*.la -*.a -*.pc diff --git a/lib/Makefile.ad b/lib/Makefile.ad index 0fbdfd86..1408d693 100644 --- a/lib/Makefile.ad +++ b/lib/Makefile.ad @@ -17,8 +17,71 @@ 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 diff --git a/lib/Makefile.runtime.ad b/lib/Makefile.runtime.ad deleted file mode 100644 index c71f102f..00000000 --- a/lib/Makefile.runtime.ad +++ /dev/null @@ -1,83 +0,0 @@ -# -# Makefile.runtime.am -# -# Author: Pekka Riikonen -# -# 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 diff --git a/lib/contrib/.gitignore b/lib/contrib/.gitignore deleted file mode 100644 index 282522db..00000000 --- a/lib/contrib/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/lib/doc/LIBINDEX b/lib/doc/LIBINDEX index 93565e0b..97d75eba 100644 --- a/lib/doc/LIBINDEX +++ b/lib/doc/LIBINDEX @@ -1,13 +1,13 @@ SILC Toolkit Reference Manual
    Version: @VERSION@
    -Copyright © 1997 - 2007 The SILC Project
    +Copyright © 1997 - 2008 The SILC Project
    Updated: @DATE@



    diff --git a/lib/doc/building.html b/lib/doc/building.html index 35745dac..88c83b46 100644 --- a/lib/doc/building.html +++ b/lib/doc/building.html @@ -1,11 +1,11 @@ Building the Toolkit
     
    -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.
     
    The building instructions for all platforms are also included in the Toolkit @@ -23,13 +23,8 @@ README.MACOSX for building on Mac OS X. Building on Unix & Linux
     
    -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.
     
    To build Toolkit on Unix systems, give commands: @@ -60,15 +55,6 @@ 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. -
     
    ---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. -
     
    --with-iconv[=DIR] @@ -105,6 +91,17 @@ 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. +
     
    +--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. +
     
    After compilation you can install the Toolkit into your system by giving the command: @@ -126,25 +123,10 @@ Toolkit package.
     
    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. - -
     
    -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. - -
     
    -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.
     
     
    Building on Mac OS X @@ -169,14 +151,10 @@ command: ./configure --help
     
    -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:
     
    -cd lib/
    make
    @@ -206,16 +184,16 @@ CTags and the SDK. Perl and the SDK are required, but CTags is optional and if necessary can be omitted.
     
    -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.
     
    -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.
     
    -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. diff --git a/lib/doc/platforms.html b/lib/doc/platforms.html index c34c500d..bfa0996a 100644 --- a/lib/doc/platforms.html +++ b/lib/doc/platforms.html @@ -1,10 +1,10 @@ Platform Implementations
     
    -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.
     
  • Unix & Linux Implementation
    @@ -16,25 +16,25 @@ differently from other platforms. Supported Platforms
     
    -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.
     
     
    Unix Implementation
     
    -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.
     
     
    Windows Implementation
     
    -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.
     
  • Some of the network routines do not support IPv6. @@ -44,19 +44,19 @@ Windows version of the SILC Toolkit. Mac OS X Implementation
     
    -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.
     
     
    Symbian OS Implementation
     
    -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.
     
  • The function silc_schedule on Symbian will allocate new Active diff --git a/lib/doc/porting.html b/lib/doc/porting.html deleted file mode 100644 index 64a89f79..00000000 --- a/lib/doc/porting.html +++ /dev/null @@ -1,678 +0,0 @@ -Porting from Toolkit 1.0 to 1.1 - -
     
    -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. - -
     
    -
  • General
    -
  • Platform changes -
  • Client library
    -
  • Utility library
    -
  • Application utility library -
  • Crypto library -
  • Key Repository library -
  • VCard library -
  • HTTP library -
  • ASN.1 library - -
     
    -

    General changes

    - -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. - - -
     
    -

    Platform changes

    - -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. - - -
     
    -

    Client library, lib/silcclient/

    - -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. - -

    SilcClientOperations structure

    - -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -

    SilcClient

    - -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -

    SilcClientConnection

    - -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. - -
     
    -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. - -
     
    -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. - -
     
    -
    -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);
    -
    - -
     
    -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. - -

    Entries

    - -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 silcclient.h file. They -are now in silcclient_entry.h in -Toolkit 1.1. - -
     
    -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. - -
     
    -
    -/* Take reference of the client entry I save to my own context. */
    -my_context->client_entry = silc_client_ref_client(client, conn, client_entry);
    -
    - -
     
    -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. - -
     
    -
    -/* 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);
    -
    - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -

    Sending/Receiving messages

    - -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. - -
     
    -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. - -
     
    -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. - -

    Calling and sending commands

    - -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. - -
     
    -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. - -
     
    -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. - -
     
    -
    -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);
    -
    -
    - -

    Notify arguments

    - -In Toolkit 1.1 the following notify arguments have had changes. See -the Notify Arguments for details. You should -go through your application and change the handling of the following notify -messages for Toolkit 1.1. - -
     
    -SILC_NOTIFY_TYPE_NICK_CHANGE
    -SILC_NOTIFY_TYPE_CMODE_CHANGE
    -SILC_NOTIFY_TYPE_SIGNOFF
    -SILC_NOTIFY_TYPE_SERVER_SIGNOFF
    - -
     
    -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. - -

    Command reply arguments

    - -In Toolkit 1.1 the following command reply arguments have had changes. See -the Command Reply Arguments for -details. You should go through your application and change the handling -of the following command replies for Toolkit 1.1. - -
     
    -SILC_COMMAND_WHOIS
    -SILC_COMMAND_INVITE
    -SILC_COMMAND_STATS
    -SILC_COMMAND_JOIN
    -SILC_COMMAND_CMODE
    -SILC_COMMAND_BAN
    -SILC_COMMAND_DETACH
    -SILC_COMMAND_USERS
    - -
     
    -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. - -

    Other changes in client library

    - -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. - -
     
    -Listing channel private keys now return SilcDList instead of an array. - -
     
    -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. - -
     
    -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. - -
     
    -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. - -
     
    -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. - - -
     
    -

    Utility library, lib/silcutil/

    - -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: silcapputil.h and -silcvcard.h. - -

    SILC Async Operation Interface

    - -A new asynchronous operation API (silcasync.h) -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. - -

    SILC Atomic Operations Interface

    - -A new atomic operations API (silcatomic.h) -has been added. It provides routines to perform various operations on -integeres and pointers atomically. - -

    SILC Data Stack Interface

    - -A new data stack (memory pool system) API -(silcstack.h) 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. - -

    SILC Condition Variable Interface

    - -A new condition variable API (silccond.h) -has been added. It provides condition variables for multithreaded -applications. - -

    SILC Stream Interface

    - -A new abstract stream API (silcstream.h) -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. - -

    SILC FD Stream Interface

    - -A new file descriptor stream API -(silcfdstream.h) has been added. It -provides a blocking and non-blocking file descriptor stream through the -SilcStream abstraction. - -

    SILC Socket Stream Interface

    - -A new socket stream API -(silcsocketstream.h) has been added. -It provides a blocking and non-blocking socket stream through the SilcStream -abstraction. - -

    SILC FSM Interface

    - -A new Finite State Machine API -(silcfsm.h) 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. - -

    SILC Time Interface

    - -A new SILC Time API -(silctime.h) 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. - -

    SILC Snprintf Interface

    - -A new snprintf API -(silcsnprintf.h) has been added. It -provides snprintf and other string formatting routines. - -

    SILC Mutex Interface changes

    - -The SILC Mutex API (silcmutex.h) -has several changes. A support for read/write locks has been added -(SilcRwLock). Also silc_mutex_assert_locked function is added. - -

    SILC Network Interface changes

    - -The SILC Network API -(silcnet.h) 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. - -

    SILC Scheduler Interface changes

    - -The SILC Schedule API -(silcschedule.h) 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. - -

    SILC Types Interface changes

    - -The SILC Type API (silctypes.h) has several -changes. The bool type is replaced with SilcBool. Sockets are now -represented by SilcSocket. - -

    SILC String util Interface changes

    - -The SILC string utility API -(silcstrutil.h) 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. - -

    SILC Utility Interface changes

    - - -

    SILC File Util Interface changes

    - -The SILC file utility API (silcfileutil.h) -has changes. A new function silc_file_set_nonblock has been added. - -

    SILC List and Dynamic List Interface changes

    - -The SILC List (silclist.h) and SILC Dynamic List -(silcdlist.h) APIs have changes. New functions silc_list_insert and -silc_dlist_insert have been added. - -

    SILC Buffer Interface changes

    - -The SILC Buffer API (silcbuffer.h) 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. - -

    SILC Buffer Formatting Interface changes

    - -The SILC Buffer Formatting API -(silcbuffmt.h) 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. - -

    SILC Memory Interface changes

    - -The memory allocation API (silcmemory.h) 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. - -
     
    -

    SILC Application Utility library, lib/silcapputil/

    - -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. - -

    SILC Application Utility Interface

    - -The silcapputil.h 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. - -

    SILC ID Cache Interface

    - -The ID Cache interface (silcidcache.h) has -been moved from lib/silccore into lib/silcapputil/. - -
     
    -

    SILC Key Repository library, lib/silcskr/

    - -A new SILC Key Repository library has been added. The library provides -a SILC Key Repository API (silcskr.h) which provides -a repository for storing and retrieving public keys. - -
     
    -

    SILC VCard library, lib/silcvcard/

    - -A new SILC VCard library has been added. The SILC VCard API has been -moved from utility library to own library in lib/silcvcard/. - -
     
    -

    SILC HTTP library, lib/silchttp/

    - -A new SILC HTTP library has been added. The library includes SILC HTTP -Server Interface and SILC HTTP PHP Translator Interface. - -

    SILC HTTP Server Interface

    - -The SILC HTTP Server API (silchttpservder.h) -provides a simple HTTP server implementation for applications that want to -integrate a small HTTP server. - -

    SILC HTTP PHP Translator Interface

    - -The SILC HTTP PHP Translator API (silchttpphp.h) - provides PHP translates PHP code into HTML. It can be used to serve PHP -pages in HTTP server. - -
     
    -

    SILC ASN.1 library, lib/silcasn1/

    - -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. - -

    SILC ASN.1 Interface

    - -The SILC ASN.1 API (silcasn1.h) 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. - -

    SILC BER Interface

    - -The SILC BER API (silcber.h) provides BER/DER -encoder and decoder. It is integral part of the ASN.1 library and the ASN.1 -encoder and decoder. diff --git a/lib/silcutil/.gitignore b/lib/silcutil/.gitignore deleted file mode 100644 index a501f929..00000000 --- a/lib/silcutil/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -*.in -*.am -*.o -*.lo -*.la -*.a -*.pc diff --git a/lib/silcutil/Makefile.ad b/lib/silcutil/Makefile.ad index b1ce5fd0..d3dcb57b 100644 --- a/lib/silcutil/Makefile.ad +++ b/lib/silcutil/Makefile.ad @@ -121,7 +121,8 @@ include_HEADERS = \ silcregex.h \ silcthreadqueue.h \ silcrand.h \ - silcglobal.h + silcglobal.h \ + silcruntime.h SILC_EXTRA_DIST = diff --git a/lib/silcutil/silcasync.h b/lib/silcutil/silcasync.h index 6e746983..d1463354 100644 --- a/lib/silcutil/silcasync.h +++ b/lib/silcutil/silcasync.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Async Operation Interface +/****h* silcutil/Async Operation Interface * * DESCRIPTION * @@ -66,7 +66,7 @@ #ifndef SILCASYNC_H #define SILCASYNC_H -/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperation +/****s* silcutil/SilcAsyncOperation * * NAME * @@ -84,7 +84,7 @@ ***/ typedef struct SilcAsyncOperationObject *SilcAsyncOperation; -/****s* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationStruct +/****s* silcutil/SilcAsyncOperationStruct * * NAME * @@ -101,7 +101,7 @@ typedef struct SilcAsyncOperationObject *SilcAsyncOperation; ***/ typedef struct SilcAsyncOperationObject SilcAsyncOperationStruct; -/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationAbort +/****f* silcutil/SilcAsyncOperationAbort * * SYNOPSIS * @@ -122,7 +122,7 @@ typedef struct SilcAsyncOperationObject SilcAsyncOperationStruct; typedef void (*SilcAsyncOperationAbort)(SilcAsyncOperation op, void *context); -/****f* silcutil/SilcAsyncOperationAPI/SilcAsyncOperationPause +/****f* silcutil/SilcAsyncOperationPause * * SYNOPSIS * @@ -150,7 +150,7 @@ typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op, 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 * @@ -169,7 +169,7 @@ typedef SilcBool (*SilcAsyncOperationPause)(SilcAsyncOperation op, ***/ SilcBool silc_async_halt(SilcAsyncOperation op); -/****f* silcutil/SilcAsyncOperationAPI/silc_async_resume +/****f* silcutil/silc_async_resume * * SYNOPSIS * @@ -187,7 +187,7 @@ SilcBool silc_async_halt(SilcAsyncOperation op); ***/ SilcBool silc_async_resume(SilcAsyncOperation op); -/****f* silcutil/SilcAsyncOperationAPI/silc_async_abort +/****f* silcutil/silc_async_abort * * SYNOPSIS * @@ -214,7 +214,7 @@ void silc_async_abort(SilcAsyncOperation op, /* 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 * @@ -261,7 +261,7 @@ SilcAsyncOperation silc_async_alloc(SilcAsyncOperationAbort abort_cb, SilcAsyncOperationPause pause_cb, void *context); -/****f* silcutil/SilcAsyncOperationAPI/silc_async_init +/****f* silcutil/silc_async_init * * SYNOPSIS * @@ -291,7 +291,7 @@ SilcBool silc_async_init(SilcAsyncOperation op, SilcAsyncOperationPause pause_cb, void *context); -/****f* silcutil/SilcAsyncOperationAPI/silc_async_free +/****f* silcutil/silc_async_free * * SYNOPSIS * @@ -310,7 +310,7 @@ SilcBool silc_async_init(SilcAsyncOperation op, ***/ void silc_async_free(SilcAsyncOperation op); -/****f* silcutil/SilcAsyncOperationAPI/silc_async_get_context +/****f* silcutil/silc_async_get_context * * SYNOPSIS * diff --git a/lib/silcutil/silcatomic.h b/lib/silcutil/silcatomic.h index 77197fa0..a6cb2b51 100644 --- a/lib/silcutil/silcatomic.h +++ b/lib/silcutil/silcatomic.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Atomic Operations Interface +/****h* silcutil/Atomic Operations Interface * * DESCRIPTION * @@ -60,7 +60,7 @@ #define SILC_SMP_LOCK #endif /* SILC_SMP */ -/****s* silcutil/SilcAtomicAPI/SilcAtomic32 +/****s* silcutil/SilcAtomic32 * * NAME * @@ -88,7 +88,7 @@ * ***/ -/****s* silcutil/SilcAtomicAPI/SilcAtomic16 +/****s* silcutil/SilcAtomic16 * * NAME * @@ -116,7 +116,7 @@ * ***/ -/****s* silcutil/SilcAtomicAPI/SilcAtomic8 +/****s* silcutil/SilcAtomic8 * * NAME * @@ -144,7 +144,7 @@ * ***/ -/****s* silcutil/SilcAtomicAPI/SilcAtomicPointer +/****s* silcutil/SilcAtomicPointer * * NAME * @@ -227,7 +227,7 @@ typedef struct { } SilcAtomic8; #endif -/****f* silcutil/SilcAtomicAPI/silc_atomic_init32 +/****f* silcutil/silc_atomic_init32 * * SYNOPSIS * @@ -242,7 +242,7 @@ typedef struct { * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_init16 +/****f* silcutil/silc_atomic_init16 * * SYNOPSIS * @@ -257,7 +257,7 @@ typedef struct { * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_init8 +/****f* silcutil/silc_atomic_init8 * * SYNOPSIS * @@ -272,7 +272,7 @@ typedef struct { * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_init_pointer +/****f* silcutil/silc_atomic_init_pointer * * SYNOPSIS * @@ -313,7 +313,7 @@ SILC_ATOMIC_INIT(16, 16, SilcUInt16) SILC_ATOMIC_INIT(32, 32, SilcUInt32) SILC_ATOMIC_INIT(_pointer, Pointer, void *) -/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit32 +/****f* silcutil/silc_atomic_uninit32 * * SYNOPSIS * @@ -327,7 +327,7 @@ SILC_ATOMIC_INIT(_pointer, Pointer, void *) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit16 +/****f* silcutil/silc_atomic_uninit16 * * SYNOPSIS * @@ -341,7 +341,7 @@ SILC_ATOMIC_INIT(_pointer, Pointer, void *) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit8 +/****f* silcutil/silc_atomic_uninit8 * * SYNOPSIS * @@ -355,7 +355,7 @@ SILC_ATOMIC_INIT(_pointer, Pointer, void *) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_uninit_pointer +/****f* silcutil/silc_atomic_uninit_pointer * * SYNOPSIS * @@ -391,7 +391,7 @@ SILC_ATOMIC_UNINIT(16, 16) SILC_ATOMIC_UNINIT(32, 32) SILC_ATOMIC_UNINIT(_pointer, Pointer) -/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int32 +/****f* silcutil/silc_atomic_set_int32 * * SYNOPSIS * @@ -404,7 +404,7 @@ SILC_ATOMIC_UNINIT(_pointer, Pointer) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int16 +/****f* silcutil/silc_atomic_set_int16 * * SYNOPSIS * @@ -417,7 +417,7 @@ SILC_ATOMIC_UNINIT(_pointer, Pointer) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_set_int8 +/****f* silcutil/silc_atomic_set_int8 * * SYNOPSIS * @@ -493,7 +493,7 @@ SILC_ATOMIC_SET_INT(8, "b", "b") 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 * @@ -535,7 +535,7 @@ void silc_atomic_set_pointer(SilcAtomicPointer *atomic, void *pointer) #endif } -/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int32 +/****f* silcutil/silc_atomic_get_int32 * * SYNOPSIS * @@ -548,7 +548,7 @@ void silc_atomic_set_pointer(SilcAtomicPointer *atomic, void *pointer) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int16 +/****f* silcutil/silc_atomic_get_int16 * * SYNOPSIS * @@ -561,7 +561,7 @@ void silc_atomic_set_pointer(SilcAtomicPointer *atomic, void *pointer) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_get_int8 +/****f* silcutil/silc_atomic_get_int8 * * SYNOPSIS * @@ -632,7 +632,7 @@ SILC_ATOMIC_GET_INT(8) SILC_ATOMIC_GET_INT(16) SILC_ATOMIC_GET_INT(32) -/****f* silcutil/SilcAtomicAPI/silc_atomic_get_pointer +/****f* silcutil/silc_atomic_get_pointer * * SYNOPSIS * @@ -677,7 +677,7 @@ void *silc_atomic_get_pointer(SilcAtomicPointer *atomic) #endif } -/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int32 +/****f* silcutil/silc_atomic_add_int32 * * SYNOPSIS * @@ -691,7 +691,7 @@ void *silc_atomic_get_pointer(SilcAtomicPointer *atomic) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int16 +/****f* silcutil/silc_atomic_add_int16 * * SYNOPSIS * @@ -705,7 +705,7 @@ void *silc_atomic_get_pointer(SilcAtomicPointer *atomic) * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_add_int8 +/****f* silcutil/silc_atomic_add_int8 * * SYNOPSIS * @@ -804,7 +804,7 @@ SILC_ATOMIC_ADD_INT(8, "b") 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 * @@ -818,7 +818,7 @@ SILC_ATOMIC_ADD_INT(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int16 +/****f* silcutil/silc_atomic_sub_int16 * * SYNOPSIS * @@ -832,7 +832,7 @@ SILC_ATOMIC_ADD_INT(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_sub_int8 +/****f* silcutil/silc_atomic_sub_int8 * * SYNOPSIS * @@ -850,7 +850,7 @@ SILC_ATOMIC_ADD_INT(32, "l") #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 * @@ -863,7 +863,7 @@ SILC_ATOMIC_ADD_INT(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_inc16 +/****f* silcutil/silc_atomic_inc16 * * SYNOPSIS * @@ -876,7 +876,7 @@ SILC_ATOMIC_ADD_INT(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_inc8 +/****f* silcutil/silc_atomic_inc8 * * SYNOPSIS * @@ -956,7 +956,7 @@ SILC_ATOMIC_INC(8, "b") SILC_ATOMIC_INC(16, "w") SILC_ATOMIC_INC(32, "l") -/****f* silcutil/SilcAtomicAPI/silc_atomic_dec32 +/****f* silcutil/silc_atomic_dec32 * * SYNOPSIS * @@ -969,7 +969,7 @@ SILC_ATOMIC_INC(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_dec16 +/****f* silcutil/silc_atomic_dec16 * * SYNOPSIS * @@ -982,7 +982,7 @@ SILC_ATOMIC_INC(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_dec8 +/****f* silcutil/silc_atomic_dec8 * * SYNOPSIS * @@ -1062,7 +1062,7 @@ SILC_ATOMIC_DEC(8, "b") SILC_ATOMIC_DEC(16, "w") SILC_ATOMIC_DEC(32, "l") -/****f* silcutil/SilcAtomicAPI/silc_atomic_cas32 +/****f* silcutil/silc_atomic_cas32 * * SYNOPSIS * @@ -1079,7 +1079,7 @@ SILC_ATOMIC_DEC(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_cas16 +/****f* silcutil/silc_atomic_cas16 * * SYNOPSIS * @@ -1096,7 +1096,7 @@ SILC_ATOMIC_DEC(32, "l") * ***/ -/****f* silcutil/SilcAtomicAPI/silc_atomic_cas8 +/****f* silcutil/silc_atomic_cas8 * * SYNOPSIS * @@ -1190,7 +1190,7 @@ SILC_ATOMIC_CAS(8, "b") SILC_ATOMIC_CAS(16, "w") SILC_ATOMIC_CAS(32, "l") -/****f* silcutil/SilcAtomicAPI/silc_atomic_cas_pointer +/****f* silcutil/silc_atomic_cas_pointer * * SYNOPSIS * diff --git a/lib/silcutil/silcbase64.h b/lib/silcutil/silcbase64.h index 98effa13..0ef7760c 100644 --- a/lib/silcutil/silcbase64.h +++ b/lib/silcutil/silcbase64.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Base64 API +/****h* silcutil/Base64 Interface * * DESCRIPTION * @@ -28,7 +28,7 @@ #ifndef SILCBASE64_H #define SILCBASE64_H -/****f* silcutil/SilcBase64API/silc_base64_encode +/****f* silcutil/silc_base64_encode * * SYNOPSIS * @@ -45,7 +45,7 @@ ***/ 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 * @@ -63,7 +63,7 @@ char *silc_base64_encode(SilcStack stack, unsigned char *data, SilcUInt32 len); 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 * diff --git a/lib/silcutil/silcbitops.h b/lib/silcutil/silcbitops.h index 87bc85eb..8fec4042 100644 --- a/lib/silcutil/silcbitops.h +++ b/lib/silcutil/silcbitops.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Bit Operations Interface +/****h* silcutil/Bit Operations Interface * * DESCRIPTION * @@ -25,6 +25,8 @@ * 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 @@ -53,7 +55,7 @@ #define SILC_BIT_SIZE (SILC_SIZEOF_LONG * 8) -/****d* silcutil/SilcBitOpAPI/SILC_BITMAP_DECLARE +/****d* silcutil/SILC_BITMAP_DECLARE * * NAME * @@ -68,7 +70,7 @@ #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 * @@ -83,7 +85,7 @@ ***/ #define SILC_BITMAP_SIZE(bits) (((bits) + SILC_BIT_SIZE) / SILC_BIT_SIZE) -/****f* silcutil/SilcBitOpAPI/silc_bit_set +/****f* silcutil/silc_bit_set * * SYNOPSIS * @@ -99,7 +101,7 @@ 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 * @@ -115,7 +117,7 @@ SilcBool silc_bit_set(volatile unsigned long *bitmap, SilcUInt32 bitmap_size, 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 * @@ -131,7 +133,7 @@ SilcBool silc_bit_clear(volatile unsigned long *bitmap, SilcUInt32 bitmap_size, 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 * @@ -148,7 +150,7 @@ SilcBool silc_bit_toggle(volatile unsigned long *bitmap, 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 * @@ -165,7 +167,7 @@ int silc_bit_test_and_set(volatile unsigned long *bitmap, 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 * @@ -182,7 +184,7 @@ int silc_bit_test_and_clear(volatile unsigned long *bitmap, 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 * @@ -198,7 +200,7 @@ int silc_bit_test_and_toggle(volatile unsigned long *bitmap, 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 * @@ -213,7 +215,7 @@ int silc_bit_get(volatile unsigned long *bitmap, SilcUInt32 bitmap_size, ***/ int silc_bit_ffs(volatile unsigned long *bitmap, SilcUInt32 bitmap_size); -/****f* silcutil/SilcBitOpAPI/silc_bit_ffz +/****f* silcutil/silc_bit_ffz * * SYNOPSIS * @@ -228,7 +230,7 @@ int silc_bit_ffs(volatile unsigned long *bitmap, SilcUInt32 bitmap_size); ***/ int silc_bit_ffz(volatile unsigned long *bitmap, SilcUInt32 bitmap_size); -/****f* silcutil/SilcBitOpAPI/silc_bit_fns +/****f* silcutil/silc_bit_fns * * SYNOPSIS * @@ -245,7 +247,7 @@ int silc_bit_ffz(volatile unsigned long *bitmap, SilcUInt32 bitmap_size); 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 * @@ -262,7 +264,7 @@ int silc_bit_fns(volatile unsigned long *bitmap, SilcUInt32 bitmap_size, 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 * diff --git a/lib/silcutil/silcbuffer.h b/lib/silcutil/silcbuffer.h index 6083fbb8..7751f965 100644 --- a/lib/silcutil/silcbuffer.h +++ b/lib/silcutil/silcbuffer.h @@ -16,23 +16,26 @@ 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 * @@ -43,14 +46,13 @@ * 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 | @@ -59,7 +61,7 @@ * * 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. @@ -71,7 +73,7 @@ * * 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. @@ -83,7 +85,7 @@ * * 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. @@ -97,30 +99,27 @@ * * 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 * @@ -135,7 +134,7 @@ typedef struct SilcBufferObject { #define silc_buffer_data(x) (x)->data /***/ -/****f* silcutil/SilcBufferAPI/silc_buffer_tail +/****f* silcutil/silc_buffer_tail * * NAME * @@ -150,7 +149,7 @@ typedef struct SilcBufferObject { #define silc_buffer_tail(x) (x)->tail /***/ -/****f* silcutil/SilcBufferAPI/silc_buffer_datalen +/****f* silcutil/silc_buffer_datalen * * NAME * @@ -176,7 +175,7 @@ typedef struct SilcBufferObject { /* Inline functions */ -/****d* silcutil/SilcBufferAPI/silc_buffer_truelen +/****d* silcutil/silc_buffer_truelen * * NAME * @@ -193,7 +192,7 @@ SilcUInt32 silc_buffer_truelen(SilcBuffer x) return (SilcUInt32)(x->end - x->head); } -/****d* silcutil/SilcBufferAPI/silc_buffer_len +/****d* silcutil/silc_buffer_len * * NAME * @@ -210,7 +209,7 @@ SilcUInt32 silc_buffer_len(SilcBuffer x) return (SilcUInt32)(x->tail - x->data); } -/****d* silcutil/SilcBufferAPI/silc_buffer_headlen +/****d* silcutil/silc_buffer_headlen * * NAME * @@ -227,7 +226,7 @@ SilcUInt32 silc_buffer_headlen(SilcBuffer x) return (SilcUInt32)(x->data - x->head); } -/****d* silcutil/SilcBufferAPI/silc_buffer_taillen +/****d* silcutil/silc_buffer_taillen * * NAME * @@ -244,7 +243,7 @@ SilcUInt32 silc_buffer_taillen(SilcBuffer x) return (SilcUInt32)(x->end - x->tail); } -/****f* silcutil/SilcBufferAPI/silc_buffer_alloc +/****f* silcutil/silc_buffer_alloc * * SYNOPSIS * @@ -283,7 +282,7 @@ SilcBuffer silc_buffer_alloc(SilcUInt32 len) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_salloc +/****f* silcutil/silc_buffer_salloc * * SYNOPSIS * @@ -331,7 +330,7 @@ SilcBuffer silc_buffer_salloc(SilcStack stack, SilcUInt32 len) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_free +/****f* silcutil/silc_buffer_free * * SYNOPSIS * @@ -363,7 +362,7 @@ void silc_buffer_free(SilcBuffer sb) } } -/****f* silcutil/SilcBufferAPI/silc_buffer_sfree +/****f* silcutil/silc_buffer_sfree * * SYNOPSIS * @@ -394,7 +393,7 @@ void silc_buffer_sfree(SilcStack stack, SilcBuffer sb) silc_buffer_free(sb); } -/****f* silcutil/SilcBufferAPI/silc_buffer_steal +/****f* silcutil/silc_buffer_steal * * SYNOPSIS * @@ -422,7 +421,7 @@ unsigned char *silc_buffer_steal(SilcBuffer sb, SilcUInt32 *data_len) return buf; } -/****f* silcutil/SilcBufferAPI/silc_buffer_purge +/****f* silcutil/silc_buffer_purge * * SYNOPSIS * @@ -449,7 +448,7 @@ void silc_buffer_purge(SilcBuffer sb) silc_free(silc_buffer_steal(sb, NULL)); } -/****f* silcutil/SilcBufferAPI/silc_buffer_spurge +/****f* silcutil/silc_buffer_spurge * * SYNOPSIS * @@ -479,7 +478,7 @@ void silc_buffer_spurge(SilcStack stack, SilcBuffer sb) silc_buffer_purge(sb); } -/****f* silcutil/SilcBufferAPI/silc_buffer_set +/****f* silcutil/silc_buffer_set * * SYNOPSIS * @@ -509,7 +508,7 @@ void silc_buffer_set(SilcBuffer sb, unsigned char *data, SilcUInt32 data_len) sb->tail = sb->end = data + data_len; } -/****f* silcutil/SilcBufferAPI/silc_buffer_pull +/****f* silcutil/silc_buffer_pull * * SYNOPSIS * @@ -557,7 +556,7 @@ unsigned char *silc_buffer_pull(SilcBuffer sb, SilcUInt32 len) return old_data; } -/****f* silcutil/SilcBufferAPI/silc_buffer_push +/****f* silcutil/silc_buffer_push * * SYNOPSIS * @@ -605,7 +604,7 @@ unsigned char *silc_buffer_push(SilcBuffer sb, SilcUInt32 len) return old_data; } -/****f* silcutil/SilcBufferAPI/silc_buffer_pull_tail +/****f* silcutil/silc_buffer_pull_tail * * SYNOPSIS * @@ -652,7 +651,7 @@ unsigned char *silc_buffer_pull_tail(SilcBuffer sb, SilcUInt32 len) return old_tail; } -/****f* silcutil/SilcBufferAPI/silc_buffer_push_tail +/****f* silcutil/silc_buffer_push_tail * * SYNOPSIS * @@ -700,7 +699,7 @@ unsigned char *silc_buffer_push_tail(SilcBuffer sb, SilcUInt32 len) return old_tail; } -/****f* silcutil/SilcBufferAPI/silc_buffer_put_head +/****f* silcutil/silc_buffer_put_head * * SYNOPSIS * @@ -751,7 +750,7 @@ unsigned char *silc_buffer_put_head(SilcBuffer sb, return (unsigned char *)memcpy(sb->head, data, len); } -/****f* silcutil/SilcBufferAPI/silc_buffer_put +/****f* silcutil/silc_buffer_put * * SYNOPSIS * @@ -802,7 +801,7 @@ unsigned char *silc_buffer_put(SilcBuffer sb, return (unsigned char *)memcpy(sb->data, data, len); } -/****f* silcutil/SilcBufferAPI/silc_buffer_put_tail +/****f* silcutil/silc_buffer_put_tail * * SYNOPSIS * @@ -853,7 +852,7 @@ unsigned char *silc_buffer_put_tail(SilcBuffer sb, return (unsigned char *)memcpy(sb->tail, data, len); } -/****f* silcutil/SilcBufferAPI/silc_buffer_alloc_size +/****f* silcutil/silc_buffer_alloc_size * * SYNOPSIS * @@ -878,7 +877,7 @@ SilcBuffer silc_buffer_alloc_size(SilcUInt32 len) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_salloc_size +/****f* silcutil/silc_buffer_salloc_size * * SYNOPSIS * @@ -909,7 +908,7 @@ SilcBuffer silc_buffer_salloc_size(SilcStack stack, SilcUInt32 len) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_reset +/****f* silcutil/silc_buffer_reset * * SYNOPSIS * @@ -930,7 +929,7 @@ void silc_buffer_reset(SilcBuffer sb) sb->data = sb->tail = sb->head; } -/****f* silcutil/SilcBufferAPI/silc_buffer_clear +/****f* silcutil/silc_buffer_clear * * SYNOPSIS * @@ -951,7 +950,7 @@ void silc_buffer_clear(SilcBuffer sb) silc_buffer_reset(sb); } -/****f* silcutil/SilcBufferAPI/silc_buffer_start +/****f* silcutil/silc_buffer_start * * SYNOPSIS * @@ -971,7 +970,7 @@ void silc_buffer_start(SilcBuffer sb) sb->data = sb->head; } -/****f* silcutil/SilcBufferAPI/silc_buffer_end +/****f* silcutil/silc_buffer_end * * SYNOPSIS * @@ -993,7 +992,7 @@ void silc_buffer_end(SilcBuffer sb) sb->tail = sb->end; } -/****f* silcutil/SilcBufferAPI/silc_buffer_copy +/****f* silcutil/silc_buffer_copy * * SYNOPSIS * @@ -1021,7 +1020,7 @@ SilcBuffer silc_buffer_copy(SilcBuffer sb) return sb_new; } -/****f* silcutil/SilcBufferAPI/silc_buffer_scopy +/****f* silcutil/silc_buffer_scopy * * SYNOPSIS * @@ -1055,7 +1054,7 @@ SilcBuffer silc_buffer_scopy(SilcStack stack, SilcBuffer sb) return sb_new; } -/****f* silcutil/SilcBufferAPI/silc_buffer_clone +/****f* silcutil/silc_buffer_clone * * SYNOPSIS * @@ -1085,7 +1084,7 @@ SilcBuffer silc_buffer_clone(SilcBuffer sb) return sb_new; } -/****f* silcutil/SilcBufferAPI/silc_buffer_sclone +/****f* silcutil/silc_buffer_sclone * * SYNOPSIS * @@ -1121,7 +1120,7 @@ SilcBuffer silc_buffer_sclone(SilcStack stack, SilcBuffer sb) return sb_new; } -/****f* silcutil/SilcBufferAPI/silc_buffer_realloc +/****f* silcutil/silc_buffer_realloc * * SYNOPSIS * @@ -1167,7 +1166,7 @@ SilcBuffer silc_buffer_realloc(SilcBuffer sb, SilcUInt32 newsize) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc +/****f* silcutil/silc_buffer_srealloc * * SYNOPSIS * @@ -1226,7 +1225,7 @@ SilcBuffer silc_buffer_srealloc(SilcStack stack, return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_realloc_size +/****f* silcutil/silc_buffer_realloc_size * * SYNOPSIS * @@ -1251,7 +1250,7 @@ SilcBuffer silc_buffer_realloc_size(SilcBuffer sb, SilcUInt32 newsize) return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_srealloc_size +/****f* silcutil/silc_buffer_srealloc_size * * SYNOPSIS * @@ -1284,7 +1283,7 @@ SilcBuffer silc_buffer_srealloc_size(SilcStack stack, return sb; } -/****f* silcutil/SilcBufferAPI/silc_buffer_enlarge +/****f* silcutil/silc_buffer_enlarge * * SYNOPSIS * @@ -1317,7 +1316,7 @@ SilcBool silc_buffer_enlarge(SilcBuffer sb, SilcUInt32 size) return TRUE; } -/****f* silcutil/SilcBufferAPI/silc_buffer_senlarge +/****f* silcutil/silc_buffer_senlarge * * SYNOPSIS * @@ -1358,7 +1357,7 @@ SilcBool silc_buffer_senlarge(SilcStack stack, SilcBuffer sb, SilcUInt32 size) return TRUE; } -/****f* silcutil/SilcBufferAPI/silc_buffer_append +/****f* silcutil/silc_buffer_append * * SYNOPSIS * @@ -1404,7 +1403,7 @@ SilcBool silc_buffer_append(SilcBuffer sb, SilcUInt32 size) return TRUE; } -/****f* silcutil/SilcBufferAPI/silc_buffer_append +/****f* silcutil/silc_buffer_sappend * * SYNOPSIS * @@ -1458,7 +1457,7 @@ SilcBool silc_buffer_sappend(SilcStack stack, SilcBuffer sb, SilcUInt32 size) return TRUE; } -/****f* silcutil/SilcBufferAPI/silc_buffer_strchr +/****f* silcutil/silc_buffer_strchr * * SYNOPSIS * @@ -1511,7 +1510,7 @@ unsigned char *silc_buffer_strchr(SilcBuffer sb, int c, SilcBool first) return NULL; } -/****f* silcutil/SilcBufferAPI/silc_buffer_equal +/****f* silcutil/silc_buffer_equal * * SYNOPSIS * @@ -1533,7 +1532,7 @@ SilcBool silc_buffer_equal(SilcBuffer sb1, SilcBuffer sb2) return memcmp(sb1->data, sb2->data, silc_buffer_len(sb1)) == 0; } -/****f* silcutil/SilcBufferAPI/silc_buffer_memcmp +/****f* silcutil/silc_buffer_memcmp * * SYNOPSIS * @@ -1558,7 +1557,7 @@ SilcBool silc_buffer_memcmp(SilcBuffer buffer, const unsigned char *data, return memcmp(buffer->data, data, data_len) == 0; } -/****f* silcutil/SilcBufferAPI/silc_buffer_printf +/****f* silcutil/silc_buffer_printf * * SYNOPSIS * diff --git a/lib/silcutil/silcbuffmt.h b/lib/silcutil/silcbuffmt.h index 50ab1907..60d61124 100644 --- a/lib/silcutil/silcbuffmt.h +++ b/lib/silcutil/silcbuffmt.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Buffer Format Interface +/****h* silcutil/Buffer Format Interface * * DESCRIPTION * @@ -36,7 +36,7 @@ * 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. * @@ -44,6 +44,7 @@ * * SilcBufferStruct buffer; * + * // Encode buffer * memset(&buffer, 0, sizeof(buffer)); * ret = silc_buffer_format(&buffer, * SILC_STR_UINT32(intval), @@ -66,7 +67,7 @@ #ifndef SILCBUFFMT_H #define SILCBUFFMT_H -/****f* silcutil/SilcBufferFormatAPI/SilcBufferFormatFunc +/****f* silcutil/SilcBufferFormatFunc * * SYNOPSIS * @@ -97,7 +98,7 @@ typedef int (*SilcBufferFormatFunc)(SilcStack stack, SilcBuffer buffer, void *value, void *context); -/****f* silcutil/SilcBufferFormatAPI/SilcBufferUnformatFunc +/****f* silcutil/SilcBufferUnformatFunc * * SYNOPSIS * @@ -128,7 +129,7 @@ typedef int (*SilcBufferUnformatFunc)(SilcStack stack, SilcBuffer buffer, /* Prototypes */ -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format +/****f* silcutil/silc_buffer_format * * SYNOPSIS * @@ -163,7 +164,7 @@ typedef int (*SilcBufferUnformatFunc)(SilcStack stack, SilcBuffer buffer, * 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), @@ -188,7 +189,7 @@ typedef int (*SilcBufferUnformatFunc)(SilcStack stack, SilcBuffer buffer, ***/ int silc_buffer_format(SilcBuffer dst, ...); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat +/****f* silcutil/silc_buffer_sformat * * SYNOPSIS * @@ -206,7 +207,7 @@ int silc_buffer_format(SilcBuffer dst, ...); ***/ int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_format_vp +/****f* silcutil/silc_buffer_format_vp * * SYNOPSIS * @@ -221,7 +222,7 @@ int silc_buffer_sformat(SilcStack stack, SilcBuffer dst, ...); ***/ int silc_buffer_format_vp(SilcBuffer dst, va_list ap); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sformat_vp +/****f* silcutil/silc_buffer_sformat_vp * * SYNOPSIS * @@ -239,7 +240,7 @@ int silc_buffer_format_vp(SilcBuffer dst, va_list ap); ***/ int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat +/****f* silcutil/silc_buffer_unformat * * SYNOPSIS * @@ -265,7 +266,7 @@ int silc_buffer_sformat_vp(SilcStack stack, SilcBuffer dst, va_list ap); ***/ int silc_buffer_unformat(SilcBuffer src, ...); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat +/****f* silcutil/silc_buffer_sunformat * * SYNOPSIS * @@ -282,7 +283,7 @@ int silc_buffer_unformat(SilcBuffer src, ...); ***/ int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_unformat_vp +/****f* silcutil/silc_buffer_unformat_vp * * SYNOPSIS * @@ -296,7 +297,7 @@ int silc_buffer_sunformat(SilcStack stack, SilcBuffer src, ...); ***/ int silc_buffer_unformat_vp(SilcBuffer src, va_list ap); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sunformat_vp +/****f* silcutil/silc_buffer_sunformat_vp * * SYNOPSIS * @@ -313,7 +314,7 @@ int silc_buffer_unformat_vp(SilcBuffer src, va_list ap); ***/ int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_strformat +/****f* silcutil/silc_buffer_strformat * * SYNOPSIS * @@ -338,7 +339,7 @@ int silc_buffer_sunformat_vp(SilcStack stack, SilcBuffer src, va_list ap); ***/ int silc_buffer_strformat(SilcBuffer dst, ...); -/****f* silcutil/SilcBufferFormatAPI/silc_buffer_sstrformat +/****f* silcutil/silc_buffer_sstrformat * * SYNOPSIS * @@ -361,7 +362,7 @@ int silc_buffer_strformat(SilcBuffer dst, ...); ***/ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_SINT8 +/****d* silcutil/SILC_STR_SINT8 * * NAME * @@ -371,13 +372,13 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 * @@ -387,8 +388,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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) @@ -397,7 +398,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -407,13 +408,13 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 * @@ -423,8 +424,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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) @@ -433,7 +434,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -443,13 +444,13 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 * @@ -459,8 +460,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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) @@ -469,7 +470,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -479,13 +480,13 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 * @@ -495,8 +496,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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) @@ -505,7 +506,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -515,14 +516,14 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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), ... @@ -531,7 +532,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); ***/ #define SILC_STR_STRING(x) SILC_PARAM_UI8_STRING, (x) -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_*_STRING +/****d* silcutil/SILC_STR_*_STRING * * NAME * @@ -548,8 +549,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * 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 @@ -558,7 +559,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * length of the string because unformatting procedure will take it * automatically. * - * Example: + * EXAMPLE * * Formatting: ..., SILC_STR_UINT32(strlen(string)), * SILC_STR_UI32_STRING(string), ... @@ -580,7 +581,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -595,8 +596,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 @@ -605,7 +606,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * 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)), ... @@ -632,7 +633,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -643,8 +644,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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. @@ -660,7 +661,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -671,8 +672,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 @@ -686,7 +687,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #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 * @@ -716,9 +717,9 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * Use this only for formatting. * - * Formatting: SILC_STR_REPLACE(unsigned char *, SilcUInt32) + * Formatting: SILC_STR_REPLACE(unsigned char *, SilcUInt32) * - * Example: + * EXAMPLE * * Before replacing * ------------------------- @@ -738,7 +739,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); ***/ #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 * @@ -748,8 +749,8 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); * * 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 @@ -791,7 +792,7 @@ int silc_buffer_sstrformat(SilcStack stack, SilcBuffer dst, ...); #define SILC_STR_FUNC(func, val, context) SILC_PARAM_FUNC, \ func, (val), (context) -/****d* silcutil/SilcBufferFormatAPI/SilcBufferRegexFlags +/****d* silcutil/SilcBufferRegexFlags * * NAME * @@ -847,7 +848,7 @@ typedef enum { } SilcBufferRegexFlags; /***/ -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_REGEX +/****d* silcutil/SILC_STR_REGEX * * NAME * @@ -857,8 +858,8 @@ typedef enum { * * 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 @@ -935,7 +936,7 @@ typedef enum { ***/ #define SILC_STR_REGEX(regex, flags) SILC_PARAM_REGEX, (regex), (flags) -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_DELETE +/****d* silcutil/SILC_STR_DELETE * * NAME * @@ -954,12 +955,12 @@ typedef enum { * * 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 * @@ -972,7 +973,7 @@ typedef enum { * 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), ... @@ -984,7 +985,7 @@ typedef enum { ***/ #define SILC_STR_OFFSET(x) SILC_PARAM_OFFSET, (x) -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_OFFSET_START +/****d* silcutil/SILC_STR_OFFSET_START * * NAME * @@ -994,14 +995,14 @@ typedef enum { * * 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 * @@ -1011,14 +1012,14 @@ typedef enum { * * 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 * @@ -1051,7 +1052,7 @@ typedef enum { ***/ #define SILC_STR_ADVANCE SILC_PARAM_ADVANCE -/****d* silcutil/SilcBufferFormatAPI/SILC_STR_END +/****d* silcutil/SILC_STR_END * * NAME * @@ -1065,7 +1066,7 @@ typedef enum { ***/ #define SILC_STR_END SILC_PARAM_END -/****d* silcutil/SilcBufferFormatAPI/SILC_STRFMT_END +/****d* silcutil/SILC_STRFMT_END * * NAME * diff --git a/lib/silcutil/silccond.h b/lib/silcutil/silccond.h index 59918a48..3774be21 100644 --- a/lib/silcutil/silccond.h +++ b/lib/silcutil/silccond.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Condition Variable Interface +/****h* silcutil/Condition Variable Interface * * DESCRIPTION * @@ -49,7 +49,7 @@ #ifndef SILCCOND_H #define SILCCOND_H -/****s* silcutil/SilcCondAPI/SilcCond +/****s* silcutil/SilcCond * * NAME * @@ -64,7 +64,7 @@ ***/ typedef struct SilcCondStruct *SilcCond; -/****s* silcutil/SilcCondAPI/silc_cond_alloc +/****f* silcutil/silc_cond_alloc * * SYNOPSIS * @@ -81,7 +81,7 @@ typedef struct SilcCondStruct *SilcCond; ***/ SilcBool silc_cond_alloc(SilcCond *cond); -/****s* silcutil/SilcCondAPI/silc_cond_free +/****f* silcutil/silc_cond_free * * SYNOPSIS * @@ -95,7 +95,7 @@ SilcBool silc_cond_alloc(SilcCond *cond); ***/ void silc_cond_free(SilcCond cond); -/****s* silcutil/SilcCondAPI/silc_cond_wait +/****f* silcutil/silc_cond_wait * * SYNOPSIS * @@ -120,7 +120,7 @@ void silc_cond_free(SilcCond cond); ***/ void silc_cond_wait(SilcCond cond, SilcMutex mutex); -/****s* silcutil/SilcCondAPI/silc_cond_timedwait +/****f* silcutil/silc_cond_timedwait * * SYNOPSIS * @@ -140,7 +140,7 @@ void silc_cond_wait(SilcCond cond, SilcMutex mutex); ***/ SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex, int timeout); -/****s* silcutil/SilcCondAPI/silc_cond_signal +/****f* silcutil/silc_cond_signal * * SYNOPSIS * @@ -167,7 +167,7 @@ SilcBool silc_cond_timedwait(SilcCond cond, SilcMutex mutex, int timeout); ***/ void silc_cond_signal(SilcCond cond); -/****s* silcutil/SilcCondAPI/silc_cond_broadcast +/****f* silcutil/silc_cond_broadcast * * SYNOPSIS * diff --git a/lib/silcutil/silcconfig.h b/lib/silcutil/silcconfig.h index 4d4be425..c4824886 100644 --- a/lib/silcutil/silcconfig.h +++ b/lib/silcutil/silcconfig.h @@ -4,7 +4,7 @@ Author: Giovanni Giacobbi - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Config Interface +/****h* silcutil/Config File Interface * * DESCRIPTION * @@ -75,7 +75,7 @@ #ifndef SILCCONFIG_H #define SILCCONFIG_H -/****d* silcutil/SilcConfigAPI/SilcConfigErrno +/****d* silcutil/SilcConfigErrno * * NAME * @@ -111,7 +111,7 @@ enum { }; /***/ -/****d* silcutil/SilcConfigAPI/SilcConfigType +/****d* silcutil/SilcConfigType * * NAME * @@ -138,7 +138,7 @@ typedef enum { } SilcConfigType; /***/ -/****f* silcutil/SilcConfigAPI/SilcConfigCallback +/****f* silcutil/SilcConfigCallback * * SYNOPSIS * @@ -157,7 +157,7 @@ typedef enum { typedef int (*SilcConfigCallback)(SilcConfigType type, const char *name, SilcUInt32 line, void *val, void *context); -/****s* silcutil/SilcConfigAPI/SilcConfigTable +/****s* silcutil/SilcConfigTable * * SYNOPSIS * @@ -203,7 +203,7 @@ typedef struct SilcConfigTableStruct { const struct SilcConfigTableStruct *subtable; } SilcConfigTable; -/****s* silcutil/SilcConfigAPI/SilcConfigFile +/****s* silcutil/SilcConfigFile * * SYNOPSIS * @@ -219,7 +219,7 @@ typedef struct SilcConfigTableStruct { ***/ typedef struct SilcConfigFileObject SilcConfigFile; -/****s* silcutil/SilcConfigAPI/SilcConfigEntity +/****s* silcutil/SilcConfigEntity * * SYNOPSIS * @@ -235,7 +235,7 @@ typedef struct SilcConfigEntityObject *SilcConfigEntity; /* Macros */ -/****d* silcutil/SilcConfigAPI/SILC_CONFIG_CALLBACK +/****d* silcutil/SILC_CONFIG_CALLBACK * * NAME * @@ -255,7 +255,7 @@ static int func(SilcConfigType type, const char *name, \ /* Prototypes */ -/****f* silcutil/SilcConfigAPI/silc_config_open +/****f* silcutil/silc_config_open * * SYNOPSIS * @@ -271,7 +271,7 @@ static int func(SilcConfigType type, const char *name, \ ***/ SilcConfigFile *silc_config_open(const char *configfile); -/****f* silcutil/SilcConfigAPI/silc_config_close +/****f* silcutil/silc_config_close * * SYNOPSIS * @@ -288,7 +288,7 @@ SilcConfigFile *silc_config_open(const char *configfile); ***/ void silc_config_close(SilcConfigFile *file); -/****f* silcutil/SilcConfigAPI/silc_config_init +/****f* silcutil/silc_config_init * * SYNOPSIS * @@ -306,7 +306,7 @@ void silc_config_close(SilcConfigFile *file); ***/ SilcConfigEntity silc_config_init(SilcConfigFile *file); -/****f* silcutil/SilcConfigAPI/silc_config_strerror +/****f* silcutil/silc_config_strerror * * SYNOPSIS * @@ -320,7 +320,7 @@ SilcConfigEntity silc_config_init(SilcConfigFile *file); ***/ char *silc_config_strerror(int errnum); -/****f* silcutil/SilcConfigAPI/silc_config_get_filename +/****f* silcutil/silc_config_get_filename * * SYNOPSIS * @@ -335,7 +335,7 @@ char *silc_config_strerror(int errnum); ***/ char *silc_config_get_filename(SilcConfigFile *file); -/****f* silcutil/SilcConfigAPI/silc_config_get_line +/****f* silcutil/silc_config_get_line * * SYNOPSIS * @@ -348,7 +348,7 @@ char *silc_config_get_filename(SilcConfigFile *file); ***/ SilcUInt32 silc_config_get_line(SilcConfigFile *file); -/****f* silcutil/SilcConfigAPI/silc_config_read_line +/****f* silcutil/silc_config_read_line * * SYNOPSIS * @@ -366,7 +366,7 @@ SilcUInt32 silc_config_get_line(SilcConfigFile *file); ***/ 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 * @@ -382,7 +382,7 @@ char *silc_config_read_line(SilcConfigFile *file, SilcUInt32 line); ***/ char *silc_config_read_current_line(SilcConfigFile *file); -/****f* silcutil/SilcConfigAPI/silc_config_register +/****f* silcutil/silc_config_register * * SYNOPSIS * @@ -413,7 +413,7 @@ SilcBool silc_config_register(SilcConfigEntity ent, const char *name, SilcConfigType type, SilcConfigCallback cb, const SilcConfigTable *subtable, void *context); -/****f* silcutil/SilcConfigAPI/silc_config_register_table +/****f* silcutil/silc_config_register_table * * SYNOPSIS * @@ -442,7 +442,7 @@ SilcBool silc_config_register(SilcConfigEntity ent, const char *name, SilcBool silc_config_register_table(SilcConfigEntity ent, const SilcConfigTable table[], void *context); -/****f* silcutil/SilcConfigAPI/silc_config_main +/****f* silcutil/silc_config_main * * SYNOPSIS * diff --git a/lib/silcutil/silcdir.h b/lib/silcutil/silcdir.h index 2868d203..739d94a6 100644 --- a/lib/silcutil/silcdir.h +++ b/lib/silcutil/silcdir.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Directory Interface +/****h* silcutil/Directory Interface * * DESCRIPTION * @@ -32,7 +32,7 @@ * 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); * @@ -41,7 +41,7 @@ #ifndef SILCDIR_H #define SILCDIR_H -/****s* silcutil/SilcDirAPI/SilcDir +/****s* silcutil/SilcDir * * NAME * @@ -55,7 +55,7 @@ ***/ typedef struct SilcDirStruct *SilcDir; -/****s* silcutil/SilcDirAPI/SilcDirEntry +/****s* silcutil/SilcDirEntry * * NAME * @@ -69,67 +69,7 @@ typedef struct SilcDirStruct *SilcDir; ***/ 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 * @@ -144,7 +84,7 @@ typedef struct SilcDirEntryStatObject { ***/ SilcDir silc_dir_open(const char *name); -/****f* silcutil/SilcDirAPI/silc_dir_close +/****f* silcutil/silc_dir_close * * SYNOPSIS * @@ -157,11 +97,11 @@ SilcDir silc_dir_open(const char *name); ***/ 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 * @@ -170,16 +110,16 @@ void silc_dir_close(SilcDir dir); * 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 * @@ -193,7 +133,7 @@ SilcDirEntry silc_dir_read(SilcDir dir, SilcDirEntryStat *status); ***/ void silc_dir_rewind(SilcDir dir); -/****f* silcutil/SilcDirAPI/silc_dir_name +/****f* silcutil/silc_dir_name * * SYNOPSIS * @@ -206,7 +146,7 @@ void silc_dir_rewind(SilcDir dir); ***/ const char *silc_dir_name(SilcDir dir); -/****f* silcutil/SilcDirAPI/silc_dir_entry_name +/****f* silcutil/silc_dir_entry_name * * SYNOPSIS * @@ -220,21 +160,4 @@ const char *silc_dir_name(SilcDir dir); ***/ 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 */ diff --git a/lib/silcutil/silcdlist.h b/lib/silcutil/silcdlist.h index a27aaad4..e20cdb38 100644 --- a/lib/silcutil/silcdlist.h +++ b/lib/silcutil/silcdlist.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -22,7 +22,7 @@ #include "silclist.h" -/****h* silcutil/SILC Dynamic List Interface +/****h* silcutil/Dynamic List Interface * * DESCRIPTION * @@ -53,7 +53,7 @@ * ***/ -/****s* silcutil/SilcDListAPI/SilcDList +/****s* silcutil/SilcDList * * NAME * @@ -81,7 +81,7 @@ typedef struct SilcDListEntryStruct { struct SilcDListEntryStruct *prev; } *SilcDListEntry; -/****f* silcutil/SilcDListAPI/silc_dlist_init +/****f* silcutil/silc_dlist_init * * SYNOPSIS * @@ -109,7 +109,7 @@ SilcDList silc_dlist_init(void) return list; } -/****f* silcutil/SilcDListAPI/silc_dlist_sinit +/****f* silcutil/silc_dlist_sinit * * SYNOPSIS * @@ -143,7 +143,7 @@ SilcDList silc_dlist_sinit(SilcStack stack) return list; } -/****f* silcutil/SilcDListAPI/silc_dlist_uninit +/****f* silcutil/silc_dlist_uninit * * SYNOPSIS * @@ -175,7 +175,7 @@ void silc_dlist_uninit(SilcDList list) } } -/****f* silcutil/SilcDListAPI/silc_dlist_count +/****f* silcutil/silc_dlist_count * * SYNOPSIS * @@ -194,7 +194,7 @@ int silc_dlist_count(SilcDList list) return silc_list_count(list->list); } -/****f* silcutil/SilcDListAPI/silc_dlist_start +/****f* silcutil/silc_dlist_start * * SYNOPSIS * @@ -215,7 +215,7 @@ void silc_dlist_start(SilcDList list) list->current = list->prev = NULL; } -/****f* silcutil/SilcDListAPI/silc_dlist_end +/****f* silcutil/silc_dlist_end * * SYNOPSIS * @@ -236,7 +236,7 @@ void silc_dlist_end(SilcDList list) list->current = list->prev = NULL; } -/****f* silcutil/SilcDListAPI/silc_dlist_add +/****f* silcutil/silc_dlist_add * * SYNOPSIS * @@ -261,7 +261,7 @@ SilcBool silc_dlist_add(SilcDList list, void *context) return TRUE; } -/****f* silcutil/SilcDList/silc_dlist_insert +/****f* silcutil/silc_dlist_insert * * SYNOPSIS * @@ -287,7 +287,7 @@ SilcBool silc_dlist_insert(SilcDList list, void *context) return TRUE; } -/****f* silcutil/SilcDListAPI/silc_dlist_del +/****f* silcutil/silc_dlist_del * * SYNOPSIS * @@ -322,7 +322,7 @@ void silc_dlist_del(SilcDList list, void *entry) } } -/****f* silcutil/SilcDListAPI/silc_dlist_get +/****f* silcutil/silc_dlist_get * * SYNOPSIS * diff --git a/lib/silcutil/silcdll.h b/lib/silcutil/silcdll.h index d0d2adf8..3f3b8cae 100644 --- a/lib/silcutil/silcdll.h +++ b/lib/silcutil/silcdll.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -42,7 +42,7 @@ #ifndef SILCDLL_H #define SILCDLL_H -/****s* silcutil/SilcDLLAPI/SilcDll +/****s* silcutil/SilcDll * * NAME * @@ -63,7 +63,7 @@ typedef HMODULE SilcDll; typedef void *SilcDll; #endif /* SILC_UNIX */ -/****f* silcutil/SilcDLLAPI/silc_dll_load +/****f* silcutil/silc_dll_load * * SYNOPSIS * @@ -80,7 +80,7 @@ typedef void *SilcDll; ***/ SilcDll silc_dll_load(const char *object_path); -/****f* silcutil/SilcDLLAPI/silc_dll_close +/****f* silcutil/silc_dll_close * * SYNOPSIS * @@ -95,7 +95,7 @@ SilcDll silc_dll_load(const char *object_path); ***/ void silc_dll_close(SilcDll dll); -/****f* silcutil/SilcDLLAPI/silc_dll_getsym +/****f* silcutil/silc_dll_getsym * * SYNOPSIS * @@ -110,7 +110,7 @@ void silc_dll_close(SilcDll dll); ***/ void *silc_dll_getsym(SilcDll dll, const char *symbol); -/****f* silcutil/SilcDLLAPI/silc_dll_error +/****f* silcutil/silc_dll_error * * SYNOPSIS * diff --git a/lib/silcutil/silcenv.h b/lib/silcutil/silcenv.h index 97dd6630..bd140f8c 100644 --- a/lib/silcutil/silcenv.h +++ b/lib/silcutil/silcenv.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/Environment Manipulation Interface +/****h* silcutil/Environment Interface * * DESCRIPTION * @@ -30,7 +30,7 @@ #ifndef SILCENV_H #define SILCENV_H -/****f* silcutil/SilcEnvAPI/silc_setenv +/****f* silcutil/silc_setenv * * SYNOPSIS * @@ -46,7 +46,7 @@ ***/ SilcBool silc_setenv(const char *variable, const char *value); -/****f* silcutil/SilcEnvAPI/silc_getenv +/****f* silcutil/silc_getenv * * SYNOPSIS * @@ -60,7 +60,7 @@ SilcBool silc_setenv(const char *variable, const char *value); ***/ const char *silc_getenv(const char *variable); -/****f* silcutil/SilcEnvAPI/silc_unsetenv +/****f* silcutil/silc_unsetenv * * SYNOPSIS * @@ -75,7 +75,7 @@ const char *silc_getenv(const char *variable); ***/ SilcBool silc_unsetenv(const char *variable); -/****f* silcutil/SilcEnvAPI/silc_clearenv +/****f* silcutil/silc_clearenv * * SYNOPSIS * diff --git a/lib/silcutil/silcerrno.h b/lib/silcutil/silcerrno.h index f4760d8a..f3c355c9 100644 --- a/lib/silcutil/silcerrno.h +++ b/lib/silcutil/silcerrno.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Errno +/****h* silcutil/Errno Interface * * DESCRIPTION * @@ -53,7 +53,7 @@ #ifndef SILCERRNO_H #define SILCERRNO_H -/****d* silcutil/SilcErrnoAPI/SilcResult +/****d* silcutil/SilcResult * * NAME * @@ -140,7 +140,7 @@ typedef enum { } SilcResult; /***/ -/****d* silcutil/SilcErrnoAPI/silc_errno +/****d* silcutil/silc_errno * * NAME * @@ -154,7 +154,7 @@ typedef enum { ***/ #define silc_errno silc_get_errno() -/****f* silcutil/SilcErrnoAPI/silc_errno_string +/****f* silcutil/silc_errno_string * * NAME * @@ -168,7 +168,7 @@ typedef enum { ***/ const char *silc_errno_string(SilcResult error); -/****d* silcutil/SilcErrnoAPI/silc_errno_string +/****d* silcutil/silc_errno_reason * * NAME * diff --git a/lib/silcutil/silcfdstream.h b/lib/silcutil/silcfdstream.h index 285c796d..c516505b 100644 --- a/lib/silcutil/silcfdstream.h +++ b/lib/silcutil/silcfdstream.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC File Descriptor Stream Interface +/****h* silcutil/Fd Stream Interface * * DESCRIPTION * @@ -34,7 +34,7 @@ #ifndef SILCFDSTREAM_H #define SILCFDSTREAM_H -/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create +/****f* silcutil/silc_fd_stream_create * * SYNOPSIS * @@ -55,7 +55,7 @@ ***/ SilcStream silc_fd_stream_create(int fd, SilcStack stack); -/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create2 +/****f* silcutil/silc_fd_stream_create2 * * SYNOPSIS * @@ -79,7 +79,7 @@ SilcStream silc_fd_stream_create(int fd, SilcStack stack); ***/ 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 * @@ -103,7 +103,7 @@ SilcStream silc_fd_stream_create2(int read_fd, int write_fd, SilcStack stack); 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 * @@ -127,7 +127,7 @@ SilcStream silc_fd_stream_file(const char *filename, SilcBool reading, 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 * diff --git a/lib/silcutil/silcfsm.h b/lib/silcutil/silcfsm.h index 3b1a0d4b..0ac6b9bd 100644 --- a/lib/silcutil/silcfsm.h +++ b/lib/silcutil/silcfsm.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Finite State Machine +/****h* silcutil/Finite State Machine * * DESCRIPTION * @@ -44,7 +44,7 @@ #ifndef SILCFSM_H #define SILCFSM_H -/****s* silcutil/SilcFSMAPI/SilcFSM +/****s* silcutil/SilcFSM * * NAME * @@ -60,7 +60,7 @@ ***/ typedef struct SilcFSMObject *SilcFSM; -/****s* silcutil/SilcFSMAPI/SilcFSMStruct +/****s* silcutil/SilcFSMStruct * * NAME * @@ -75,7 +75,7 @@ typedef struct SilcFSMObject *SilcFSM; ***/ typedef struct SilcFSMObject SilcFSMStruct; -/****s* silcutil/SilcFSMAPI/SilcFSMThread +/****s* silcutil/SilcFSMThread * * NAME * @@ -94,7 +94,7 @@ typedef struct SilcFSMObject SilcFSMStruct; ***/ typedef struct SilcFSMObject *SilcFSMThread; -/****s* silcutil/SilcFSMAPI/SilcFSMThreadStruct +/****s* silcutil/SilcFSMThreadStruct * * NAME * @@ -109,7 +109,7 @@ typedef struct SilcFSMObject *SilcFSMThread; ***/ typedef struct SilcFSMObject SilcFSMThreadStruct; -/****d* silcutil/SilcFSMAPI/SILC_FSM_CONTINUE +/****d* silcutil/SILC_FSM_CONTINUE * * NAME * @@ -139,7 +139,7 @@ typedef struct SilcFSMObject SilcFSMThreadStruct; #define SILC_FSM_CONTINUE SILC_FSM_ST_CONTINUE; #endif /* SILC_DEBUG */ -/****d* silcutil/SilcFSMAPI/SILC_FSM_YIELD +/****d* silcutil/SILC_FSM_YIELD * * NAME * @@ -155,7 +155,7 @@ typedef struct SilcFSMObject SilcFSMThreadStruct; ***/ #define SILC_FSM_YIELD SILC_FSM_ST_YIELD; -/****d* silcutil/SilcFSMAPI/SILC_FSM_WAIT +/****d* silcutil/SILC_FSM_WAIT * * NAME * @@ -170,7 +170,7 @@ typedef struct SilcFSMObject SilcFSMThreadStruct; ***/ #define SILC_FSM_WAIT SILC_FSM_ST_WAIT -/****d* silcutil/SilcFSMAPI/SILC_FSM_FINISH +/****d* silcutil/SILC_FSM_FINISH * * NAME * @@ -186,7 +186,7 @@ typedef struct SilcFSMObject SilcFSMThreadStruct; ***/ #define SILC_FSM_FINISH SILC_FSM_ST_FINISH -/****f* silcutil/SilcFSMAPI/SilcFSMDestructor +/****f* silcutil/SilcFSMDestructor * * SYNOPSIS * @@ -206,7 +206,7 @@ typedef struct SilcFSMObject SilcFSMThreadStruct; typedef void (*SilcFSMDestructor)(SilcFSM fsm, void *fsm_context, void *destructor_context); -/****f* silcutil/SilcFSMAPI/SilcFSMThreadDestructor +/****f* silcutil/SilcFSMThreadDestructor * * SYNOPSIS * @@ -234,7 +234,7 @@ typedef void (*SilcFSMThreadDestructor)(SilcFSMThread thread, void *thread_context, void *destructor_context); -/****d* silcutil/SilcFSMAPI/SILC_FSM_STATE +/****d* silcutil/SILC_FSM_STATE * * NAME * @@ -259,7 +259,7 @@ typedef int (*SilcFSMStateCallback)(struct SilcFSMObject *fsm, void *fsm_context, void *state_context); -/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL +/****d* silcutil/SILC_FSM_CALL * * NAME * @@ -298,7 +298,7 @@ do { \ return SILC_FSM_WAIT; \ } while(0) -/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE +/****d* silcutil/SILC_FSM_CALL_CONTINUE * * NAME * @@ -325,7 +325,7 @@ do { \ silc_fsm_continue(fsm); \ } while(0) -/****d* silcutil/SilcFSMAPI/SILC_FSM_CALL_CONTINUE_SYNC +/****d* silcutil/SILC_FSM_CALL_CONTINUE_SYNC * * NAME * @@ -354,7 +354,7 @@ do { \ silc_fsm_continue_sync(fsm); \ } while(0) -/****d* silcutil/SilcFSMAPI/SILC_FSM_THREAD_WAIT +/****d* silcutil/SILC_FSM_THREAD_WAIT * * NAME * @@ -387,7 +387,7 @@ do { \ return SILC_FSM_WAIT; \ } while(0) -/****f* silcutil/SilcFSMAPI/silc_fsm_alloc +/****f* silcutil/silc_fsm_alloc * * SYNOPSIS * @@ -434,7 +434,7 @@ SilcFSM silc_fsm_alloc(void *fsm_context, void *destructor_context, SilcSchedule schedule); -/****f* silcutil/SilcFSMAPI/silc_fsm_init +/****f* silcutil/silc_fsm_init * * SYNOPSIS * @@ -469,7 +469,7 @@ SilcBool silc_fsm_init(SilcFSM fsm, void *destructor_context, SilcSchedule schedule); -/****f* silcutil/SilcFSMAPI/silc_fsm_thread_alloc +/****f* silcutil/silc_fsm_thread_alloc * * SYNOPSIS * @@ -532,7 +532,7 @@ SilcFSMThread silc_fsm_thread_alloc(SilcFSM fsm, void *destructor_context, SilcBool real_thread); -/****f* silcutil/SilcFSMAPI/silc_fsm_thread_init +/****f* silcutil/silc_fsm_thread_init * * SYNOPSIS * @@ -571,7 +571,7 @@ void silc_fsm_thread_init(SilcFSMThread thread, void *destructor_context, SilcBool real_thread); -/****f* silcutil/SilcFSMAPI/silc_fsm_free +/****f* silcutil/silc_fsm_free * * SYNOPSIS * @@ -591,7 +591,7 @@ void silc_fsm_thread_init(SilcFSMThread thread, ***/ void silc_fsm_free(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_start +/****f* silcutil/silc_fsm_start * * SYNOPSIS * @@ -615,7 +615,7 @@ void silc_fsm_free(void *fsm); ***/ void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state); -/****f* silcutil/SilcFSMAPI/silc_fsm_start_sync +/****f* silcutil/silc_fsm_start_sync * * SYNOPSIS * @@ -635,7 +635,7 @@ void silc_fsm_start(void *fsm, SilcFSMStateCallback start_state); ***/ void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state); -/****f* silcutil/SilcFSMAPI/silc_fsm_next +/****f* silcutil/silc_fsm_next * * SYNOPSIS * @@ -660,7 +660,7 @@ void silc_fsm_start_sync(void *fsm, SilcFSMStateCallback start_state); ***/ void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state); -/****f* silcutil/SilcFSMAPI/silc_fsm_next_later +/****f* silcutil/silc_fsm_next_later * * SYNOPSIS * @@ -695,7 +695,7 @@ void silc_fsm_next(void *fsm, SilcFSMStateCallback next_state); 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 * @@ -713,7 +713,7 @@ void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state, ***/ void silc_fsm_continue(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_continue_sync +/****f* silcutil/silc_fsm_continue_sync * * SYNOPSIS * @@ -731,7 +731,7 @@ void silc_fsm_continue(void *fsm); ***/ void silc_fsm_continue_sync(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_finish +/****f* silcutil/silc_fsm_finish * * SYNOPSIS * @@ -752,7 +752,7 @@ void silc_fsm_continue_sync(void *fsm); ***/ void silc_fsm_finish(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_set_context +/****f* silcutil/silc_fsm_set_context * * SYNOPSIS * @@ -768,7 +768,7 @@ void silc_fsm_finish(void *fsm); ***/ void silc_fsm_set_context(void *fsm, void *fsm_context); -/****f* silcutil/SilcFSMAPI/silc_fsm_get_context +/****f* silcutil/silc_fsm_get_context * * SYNOPSIS * @@ -784,7 +784,7 @@ void silc_fsm_set_context(void *fsm, void *fsm_context); ***/ void *silc_fsm_get_context(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_set_state_context +/****f* silcutil/silc_fsm_set_state_context * * SYNOPSIS * @@ -800,7 +800,7 @@ void *silc_fsm_get_context(void *fsm); ***/ 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 * @@ -815,7 +815,7 @@ void silc_fsm_set_state_context(void *fsm, void *state_context); ***/ void *silc_fsm_get_state_context(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_get_schedule +/****f* silcutil/silc_fsm_get_schedule * * SYNOPSIS * @@ -840,7 +840,7 @@ void *silc_fsm_get_state_context(void *fsm); ***/ SilcSchedule silc_fsm_get_schedule(void *fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_get_machine +/****f* silcutil/silc_fsm_get_machine * * SYNOPSIS * @@ -853,7 +853,7 @@ SilcSchedule silc_fsm_get_schedule(void *fsm); ***/ SilcFSM silc_fsm_get_machine(SilcFSMThread thread); -/****f* silcutil/SilcFSMAPI/silc_fsm_is_started +/****f* silcutil/silc_fsm_is_started * * SYNOPSIS * @@ -870,7 +870,7 @@ SilcBool silc_fsm_is_started(void *fsm); /* FSM Events */ -/****s* silcutil/SilcFSMAPI/SilcFSMEvent +/****s* silcutil/SilcFSMEvent * * NAME * @@ -885,7 +885,7 @@ SilcBool silc_fsm_is_started(void *fsm); ***/ typedef struct SilcFSMEventObject *SilcFSMEvent; -/****s* silcutil/SilcFSMAPI/SilcFSMEventStruct +/****s* silcutil/SilcFSMEventStruct * * NAME * @@ -900,7 +900,7 @@ typedef struct SilcFSMEventObject *SilcFSMEvent; ***/ typedef struct SilcFSMEventObject SilcFSMEventStruct; -/****f* silcutil/SilcFSMAPI/silc_fsm_event_alloc +/****f* silcutil/silc_fsm_event_alloc * * SYNOPSIS * @@ -924,7 +924,7 @@ typedef struct SilcFSMEventObject SilcFSMEventStruct; ***/ SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_event_init +/****f* silcutil/silc_fsm_event_init * * SYNOPSIS * @@ -940,7 +940,7 @@ SilcFSMEvent silc_fsm_event_alloc(SilcFSM fsm); ***/ void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm); -/****f* silcutil/SilcFSMAPI/silc_fsm_event_free +/****f* silcutil/silc_fsm_event_free * * SYNOPSIS * @@ -953,7 +953,7 @@ void silc_fsm_event_init(SilcFSMEvent event, SilcFSM fsm); ***/ void silc_fsm_event_free(SilcFSMEvent event); -/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_WAIT +/****d* silcutil/SILC_FSM_EVENT_WAIT * * NAME * @@ -993,7 +993,7 @@ do { \ return SILC_FSM_WAIT; \ } while(0) -/****d* silcutil/SilcFSMAPI/SILC_FSM_EVENT_TIMEDWAIT +/****d* silcutil/SILC_FSM_EVENT_TIMEDWAIT * * NAME * @@ -1038,7 +1038,7 @@ do { \ return SILC_FSM_WAIT; \ } while(0) -/****f* silcutil/SilcFSMAPI/SILC_FSM_EVENT_SIGNAL +/****f* silcutil/SILC_FSM_EVENT_SIGNAL * * SYNOPSIS * diff --git a/lib/silcutil/silcgetopt.h b/lib/silcutil/silcgetopt.h index ac6b2168..991c4759 100644 --- a/lib/silcutil/silcgetopt.h +++ b/lib/silcutil/silcgetopt.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,10 +17,19 @@ */ +/****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 * @@ -44,7 +53,7 @@ typedef struct SilcGetOptObject { } *SilcGetOpt, SilcGetOptStruct; /***/ -/****d* silcutil/SilcGetOptAPI/SILC_GETOPT_INIT +/****d* silcutil/SILC_GETOPT_INIT * * NAME * @@ -61,7 +70,7 @@ typedef struct SilcGetOptObject { ***/ #define SILC_GETOPT_INIT { 1, 0, NULL, TRUE, 1 } -/****f* silcutil/SilcGetOptAPI/silc_getopt +/****f* silcutil/silc_getopt * * SYNOPSIS * diff --git a/lib/silcutil/silcglobal.h b/lib/silcutil/silcglobal.h index 4895af5f..4e8c33a6 100644 --- a/lib/silcutil/silcglobal.h +++ b/lib/silcutil/silcglobal.h @@ -29,8 +29,7 @@ * 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); @@ -69,7 +68,7 @@ * 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. @@ -77,8 +76,7 @@ * 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); @@ -92,7 +90,7 @@ * *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); @@ -130,7 +128,8 @@ void *silc_global_get_var(const char *name, SilcBool tls); * 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); diff --git a/lib/silcutil/silchashtable.h b/lib/silcutil/silchashtable.h index 624d18a4..975644c4 100644 --- a/lib/silcutil/silchashtable.h +++ b/lib/silcutil/silchashtable.h @@ -21,13 +21,12 @@ * * 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 diff --git a/lib/silcutil/silclist.h b/lib/silcutil/silclist.h index 66efd22f..14fab3f5 100644 --- a/lib/silcutil/silclist.h +++ b/lib/silcutil/silclist.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC List Interface +/****h* silcutil/List Interface * * DESCRIPTION * @@ -45,7 +45,7 @@ #ifndef SILCLIST_H #define SILCLIST_H -/****s* silcutil/SilcList/SilcList +/****s* silcutil/SilcList * * NAME * @@ -68,11 +68,11 @@ typedef struct SilcListStruct { 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 * @@ -84,7 +84,7 @@ typedef struct SilcListStruct { #define SILC_LIST_END NULL /***/ -/****f* silcutil/SilcList/silc_list_init +/****f* silcutil/silc_list_init * * SYNOPSIS * @@ -121,7 +121,7 @@ do { \ (list).head = (list).tail = (list).current = NULL; \ } while(0) -/****f* silcutil/SilcList/silc_list_init_prev +/****f* silcutil/silc_list_init_prev * * SYNOPSIS * @@ -161,7 +161,7 @@ do { \ (list).head = (list).tail = (list).current = NULL; \ } while(0) -/****f* silcutil/SilcList/silc_list_count +/****f* silcutil/silc_list_count * * SYNOPSIS * @@ -174,7 +174,7 @@ do { \ ***/ #define silc_list_count(list) (list).count -/****f* silcutil/SilcList/silc_list_start +/****f* silcutil/silc_list_start * * SYNOPSIS * @@ -189,7 +189,7 @@ do { \ #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 * @@ -215,7 +215,7 @@ do { \ #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 * @@ -240,7 +240,7 @@ do { \ (list).count++; \ } while(0) -/****f* silcutil/SilcList/silc_list_insert +/****f* silcutil/silc_list_insert * * SYNOPSIS * @@ -282,7 +282,7 @@ do { \ (list).count++; \ } while(0) -/****f* silcutil/SilcList/silc_list_del +/****f* silcutil/silc_list_del * * SYNOPSIS * @@ -313,7 +313,7 @@ do { \ (list).tail = prev; \ } while(0) -/****f* silcutil/SilcList/silc_list_get +/****f* silcutil/silc_list_get * * SYNOPSIS * diff --git a/lib/silcutil/silclog.h b/lib/silcutil/silclog.h index 56c58ec3..59bcac6e 100644 --- a/lib/silcutil/silclog.h +++ b/lib/silcutil/silclog.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Logging Interface +/****h* silcutil/Logging Interface * * DESCRIPTION * @@ -29,7 +29,7 @@ #ifndef SILCLOG_H #define SILCLOG_H -/****d* silcutil/SilcLogAPI/SilcLogType +/****d* silcutil/SilcLogType * * NAME * @@ -51,7 +51,7 @@ typedef enum { #include "silclog_i.h" -/****f* silcutil/SilcLogAPI/SilcLogCb +/****f* silcutil/SilcLogCb * * SYNOPSIS * @@ -76,7 +76,7 @@ typedef enum { ***/ typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context); -/****f* silcutil/SilcLogAPI/SilcLogDebugCb +/****f* silcutil/SilcLogDebugCb * * SYNOPSIS * @@ -102,7 +102,7 @@ typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context); typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line, char *message, void *context); -/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb +/****f* silcutil/SilcLogHexdumpCb * * SYNOPSIS * @@ -136,7 +136,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, /* Macros */ -/****d* silcutil/SilcLogAPI/SILC_LOG_INFO +/****d* silcutil/SILC_LOG_INFO * * NAME * @@ -162,7 +162,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #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 * @@ -181,7 +181,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #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 * @@ -200,7 +200,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #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 * @@ -219,7 +219,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #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 * @@ -250,7 +250,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #endif /* SILC_DEBUG */ /***/ -/****d* silcutil/SilcLogAPI/SILC_LOG_HEXDUMP +/****d* silcutil/SILC_LOG_HEXDUMP * * NAME * @@ -288,60 +288,9 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #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 * @@ -366,7 +315,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, 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 * @@ -385,7 +334,7 @@ SilcBool silc_log_set_file(SilcLogType type, char *filename, ***/ char *silc_log_get_file(SilcLogType type); -/****f* silcutil/SilcLogAPI/silc_log_set_callback +/****f* silcutil/silc_log_set_callback * * SYNOPSIS * @@ -410,7 +359,7 @@ char *silc_log_get_file(SilcLogType type); ***/ 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 * @@ -425,7 +374,7 @@ void silc_log_set_callback(SilcLogType type, SilcLogCb cb, void *context); ***/ void silc_log_reset_callbacks(void); -/****f* silcutil/SilcLogAPI/silc_log_flush_all +/****f* silcutil/silc_log_flush_all * * SYNOPSIS * @@ -442,7 +391,7 @@ void silc_log_reset_callbacks(void); ***/ void silc_log_flush_all(void); -/****f* silcutil/SilcLogAPI/silc_log_reset_all +/****f* silcutil/silc_log_reset_all * * SYNOPSIS * @@ -459,7 +408,7 @@ void silc_log_flush_all(void); ***/ void silc_log_reset_all(void); -/****f* silcutil/SilcLogAPI/silc_log_set_debug_callbacks +/****f* silcutil/silc_log_set_debug_callbacks * * SYNOPSIS * @@ -488,7 +437,7 @@ void silc_log_set_debug_callbacks(SilcLogDebugCb debug_cb, SilcLogHexdumpCb hexdump_cb, void *hexdump_context); -/****f* silcutil/SilcLogAPI/silc_log_reset_debug_callbacks +/****f* silcutil/silc_log_reset_debug_callbacks * * SYNOPSIS * @@ -501,7 +450,7 @@ void silc_log_set_debug_callbacks(SilcLogDebugCb debug_cb, ***/ void silc_log_reset_debug_callbacks(void); -/****f* silcutil/SilcLogAPI/silc_log_set_debug_string +/****f* silcutil/silc_log_set_debug_string * * SYNOPSIS * @@ -516,7 +465,7 @@ void silc_log_reset_debug_callbacks(void); ***/ void silc_log_set_debug_string(const char *debug_string); -/****f* silcutil/SilcLogAPI/silc_log_timestamp +/****f* silcutil/silc_log_timestamp * * NAME * @@ -530,7 +479,7 @@ void silc_log_set_debug_string(const char *debug_string); ***/ void silc_log_timestamp(SilcBool enable); -/****f* silcutil/SilcLogAPI/silc_log_flushdelay +/****f* silcutil/silc_log_flushdelay * * NAME * @@ -543,7 +492,7 @@ void silc_log_timestamp(SilcBool enable); ***/ void silc_log_flushdelay(SilcUInt32 flushdelay); -/****f* silcutil/SilcLogAPI/silc_log_quick +/****f* silcutil/silc_log_quick * * NAME * @@ -567,7 +516,7 @@ void silc_log_flushdelay(SilcUInt32 flushdelay); ***/ void silc_log_quick(SilcBool enable); -/****v* silcutil/SilcLogAPI/silc_log_debug +/****v* silcutil/silc_log_debug * * NAME * @@ -585,7 +534,7 @@ void silc_log_quick(SilcBool enable); ***/ void silc_log_debug(SilcBool enable); -/****v* silcutil/SilcLogAPI/silc_log_debug_hexdump +/****v* silcutil/silc_log_debug_hexdump * * NAME * diff --git a/lib/silcutil/silcmemory.h b/lib/silcutil/silcmemory.h index 632af872..2389a4bf 100644 --- a/lib/silcutil/silcmemory.h +++ b/lib/silcutil/silcmemory.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,13 +17,11 @@ */ -/****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. * ***/ @@ -34,7 +32,7 @@ #ifndef SILC_STACKTRACE -/****f* silcutil/SilcMemoryAPI/silc_malloc +/****f* silcutil/silc_malloc * * SYNOPSIS * @@ -49,7 +47,7 @@ ***/ void *silc_malloc(size_t size); -/****f* silcutil/SilcMemoryAPI/silc_calloc +/****f* silcutil/silc_calloc * * SYNOPSIS * @@ -65,7 +63,7 @@ void *silc_malloc(size_t size); ***/ void *silc_calloc(size_t items, size_t size); -/****f* silcutil/SilcMemoryAPI/silc_realloc +/****f* silcutil/silc_realloc * * SYNOPSIS * @@ -87,7 +85,7 @@ void *silc_calloc(size_t items, size_t size); ***/ void *silc_realloc(void *ptr, size_t size); -/****f* silcutil/SilcMemoryAPI/silc_free +/****f* silcutil/silc_free * * SYNOPSIS * @@ -101,7 +99,7 @@ void *silc_realloc(void *ptr, size_t size); ***/ void silc_free(void *ptr); -/****f* silcutil/SilcMemoryAPI/silc_memdup +/****f* silcutil/silc_memdup * * SYNOPSIS * @@ -118,7 +116,7 @@ void silc_free(void *ptr); ***/ void *silc_memdup(const void *ptr, size_t size); -/****f* silcutil/SilcMemoryAPI/silc_strdup +/****f* silcutil/silc_strdup * * SYNOPSIS * @@ -143,7 +141,7 @@ char *silc_strdup(const char *str); /* Following functions that use SilcStack as memory source. */ -/****f* silcutil/SilcMemoryAPI/silc_smalloc +/****f* silcutil/silc_smalloc * * SYNOPSIS * @@ -167,7 +165,7 @@ char *silc_strdup(const char *str); ***/ void *silc_smalloc(SilcStack stack, SilcUInt32 size); -/****f* silcutil/SilcMemoryAPI/silc_scalloc +/****f* silcutil/silc_scalloc * * SYNOPSIS * @@ -190,7 +188,7 @@ void *silc_smalloc(SilcStack stack, SilcUInt32 size); ***/ void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size); -/****f* silcutil/SilcMemoryAPI/silc_srealloc +/****f* silcutil/silc_srealloc * * SYNOPSIS * @@ -217,7 +215,7 @@ void *silc_scalloc(SilcStack stack, SilcUInt32 items, SilcUInt32 size); void *silc_srealloc(SilcStack stack, SilcUInt32 old_size, void *ptr, SilcUInt32 size); -/****f* silcutil/SilcMemoryAPI/silc_smemdup +/****f* silcutil/silc_smemdup * * SYNOPSIS * @@ -243,7 +241,7 @@ void *silc_srealloc(SilcStack stack, SilcUInt32 old_size, ***/ void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size); -/****f* silcutil/SilcMemoryAPI/silc_sfree +/****f* silcutil/silc_sfree * * SYNOPSIS * @@ -258,7 +256,7 @@ void *silc_smemdup(SilcStack stack, const void *ptr, SilcUInt32 size); ***/ void silc_sfree(SilcStack stack, void *ptr); -/****f* silcutil/SilcMemoryAPI/silc_sstrdup +/****f* silcutil/silc_sstrdup * * SYNOPSIS * diff --git a/lib/silcutil/silcmime.c b/lib/silcutil/silcmime.c index 293393bc..9ea1ef4f 100644 --- a/lib/silcutil/silcmime.c +++ b/lib/silcutil/silcmime.c @@ -29,14 +29,6 @@ typedef struct { /************************ 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, @@ -91,7 +83,7 @@ SilcMime silc_mime_alloc(void) 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; diff --git a/lib/silcutil/silcmime.h b/lib/silcutil/silcmime.h index 3b22e618..e2831e6a 100644 --- a/lib/silcutil/silcmime.h +++ b/lib/silcutil/silcmime.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC MIME Interface +/****h* silcutil/MIME Interface * * DESCRIPTION * @@ -33,7 +33,7 @@ #ifndef SILCMIME_H #define SILCMIME_H -/****s* silcutil/SILCMIMEAPI/SilcMime +/****s* silcutil/SilcMime * * NAME * @@ -48,7 +48,7 @@ ***/ typedef struct SilcMimeStruct *SilcMime; -/****s* silcutil/SILCMIMEAPI/SilcMimeAssembler +/****s* silcutil/SilcMimeAssembler * * NAME * @@ -63,7 +63,7 @@ typedef struct SilcMimeStruct *SilcMime; ***/ typedef struct SilcMimeAssemblerStruct *SilcMimeAssembler; -/****f* silcutil/SILCMIMEAPI/silc_mime_alloc +/****f* silcutil/silc_mime_alloc * * SYNOPSIS * @@ -77,7 +77,7 @@ typedef struct SilcMimeAssemblerStruct *SilcMimeAssembler; ***/ SilcMime silc_mime_alloc(void); -/****f* silcutil/SILCMIMEAPI/silc_mime_free +/****f* silcutil/silc_mime_free * * SYNOPSIS * @@ -90,7 +90,7 @@ SilcMime silc_mime_alloc(void); ***/ void silc_mime_free(SilcMime mime); -/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_alloc +/****f* silcutil/silc_mime_assembler_alloc * * SYNOPSIS * @@ -104,7 +104,7 @@ void silc_mime_free(SilcMime mime); ***/ SilcMimeAssembler silc_mime_assembler_alloc(void); -/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_free +/****f* silcutil/silc_mime_assembler_free * * SYNOPSIS * @@ -117,7 +117,7 @@ SilcMimeAssembler silc_mime_assembler_alloc(void); ***/ void silc_mime_assembler_free(SilcMimeAssembler assembler); -/****f* silcutil/SILCMIMEAPI/silc_mime_assembler_purge +/****f* silcutil/silc_mime_assembler_purge * * SYNOPSIS * @@ -140,7 +140,7 @@ void silc_mime_assembler_free(SilcMimeAssembler assembler); void silc_mime_assembler_purge(SilcMimeAssembler assembler, SilcUInt32 purge_minutes); -/****f* silcutil/SILCMIMEAPI/silc_mime_decode +/****f* silcutil/silc_mime_decode * * SYNOPSIS * @@ -171,7 +171,7 @@ void silc_mime_assembler_purge(SilcMimeAssembler assembler, 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 * @@ -190,7 +190,7 @@ SilcMime silc_mime_decode(SilcMime mime, const unsigned char *data, ***/ unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len); -/****f* silcutil/SILCMIMEAPI/silc_mime_assemble +/****f* silcutil/silc_mime_assemble * * SYNOPSIS * @@ -220,7 +220,7 @@ unsigned char *silc_mime_encode(SilcMime mime, SilcUInt32 *encoded_len); ***/ SilcMime silc_mime_assemble(SilcMimeAssembler assembler, SilcMime partial); -/****f* silcutil/SILCMIMEAPI/silc_mime_encode_partial +/****f* silcutil/silc_mime_encode_partial * * SYNOPSIS * @@ -240,7 +240,7 @@ SilcMime silc_mime_assemble(SilcMimeAssembler assembler, SilcMime partial); ***/ SilcDList silc_mime_encode_partial(SilcMime mime, int max_size); -/****f* silcutil/SILCMIMEAPI/silc_mime_partial_free +/****f* silcutil/silc_mime_partial_free * * SYNOPSIS * @@ -254,7 +254,7 @@ SilcDList silc_mime_encode_partial(SilcMime mime, int max_size); ***/ void silc_mime_partial_free(SilcDList partials); -/****f* silcutil/SILCMIMEAPI/silc_mime_add_field +/****f* silcutil/silc_mime_add_field * * SYNOPSIS * @@ -275,7 +275,7 @@ void silc_mime_partial_free(SilcDList partials); ***/ 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 * @@ -289,7 +289,7 @@ void silc_mime_add_field(SilcMime mime, const char *field, const char *value); ***/ 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 * @@ -304,7 +304,7 @@ const char *silc_mime_get_field(SilcMime mime, const char *field); 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 * @@ -318,7 +318,7 @@ void silc_mime_add_data(SilcMime mime, const unsigned char *data, ***/ 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 * @@ -334,7 +334,7 @@ const unsigned char *silc_mime_get_data(SilcMime mime, SilcUInt32 *data_len); ***/ 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 * @@ -347,7 +347,7 @@ unsigned char *silc_mime_steal_data(SilcMime mime, SilcUInt32 *data_len); ***/ SilcBool silc_mime_is_partial(SilcMime mime); -/****f* silcutil/SILCMIMEAPI/silc_mime_set_multipart +/****f* silcutil/silc_mime_set_multipart * * SYNOPSIS * @@ -364,7 +364,7 @@ SilcBool silc_mime_is_partial(SilcMime mime); 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 * @@ -394,7 +394,7 @@ void silc_mime_set_multipart(SilcMime mime, const char *type, ***/ SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part); -/****f* silcutil/SILCMIMEAPI/silc_mime_is_multipart +/****f* silcutil/silc_mime_is_multipart * * SYNOPSIS * @@ -408,7 +408,7 @@ SilcBool silc_mime_add_multipart(SilcMime mime, SilcMime part); ***/ SilcBool silc_mime_is_multipart(SilcMime mime); -/****f* silcutil/SILCMIMEAPI/silc_mime_get_multiparts +/****f* silcutil/silc_mime_get_multiparts * * SYNOPSIS * diff --git a/lib/silcutil/silcmutex.h b/lib/silcutil/silcmutex.h index 6e8efeb2..878d37de 100644 --- a/lib/silcutil/silcmutex.h +++ b/lib/silcutil/silcmutex.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Mutex Interface +/****h* silcutil/Mutex Interface * * DESCRIPTION * @@ -30,7 +30,7 @@ #ifndef SILCMUTEX_H #define SILCMUTEX_H -/****s* silcutil/SilcMutexAPI/SilcMutex +/****s* silcutil/SilcMutex * * NAME * @@ -45,7 +45,7 @@ ***/ typedef struct SilcMutexStruct *SilcMutex; -/****s* silcutil/SilcMutexAPI/SilcRwLock +/****s* silcutil/SilcRwLock * * NAME * @@ -60,7 +60,7 @@ typedef struct SilcMutexStruct *SilcMutex; ***/ typedef struct SilcRwLockStruct *SilcRwLock; -/****f* silcutil/SilcMutexAPI/silc_mutex_alloc +/****f* silcutil/silc_mutex_alloc * * SYNOPSIS * @@ -77,7 +77,7 @@ typedef struct SilcRwLockStruct *SilcRwLock; ***/ SilcBool silc_mutex_alloc(SilcMutex *mutex); -/****f* silcutil/SilcMutexAPI/silc_mutex_free +/****f* silcutil/silc_mutex_free * * SYNOPSIS * @@ -91,7 +91,7 @@ SilcBool silc_mutex_alloc(SilcMutex *mutex); ***/ void silc_mutex_free(SilcMutex mutex); -/****f* silcutil/SilcMutexAPI/silc_mutex_lock +/****f* silcutil/silc_mutex_lock * * SYNOPSIS * @@ -113,7 +113,7 @@ void silc_mutex_free(SilcMutex mutex); ***/ void silc_mutex_lock(SilcMutex mutex); -/****f* silcutil/SilcMutexAPI/silc_mutex_unlock +/****f* silcutil/silc_mutex_unlock * * SYNOPSIS * @@ -133,7 +133,7 @@ void silc_mutex_lock(SilcMutex mutex); ***/ void silc_mutex_unlock(SilcMutex mutex); -/****f* silcutil/SilcMutexAPI/silc_mutex_assert_locked +/****f* silcutil/silc_mutex_assert_locked * * SYNOPSIS * @@ -148,7 +148,7 @@ void silc_mutex_unlock(SilcMutex mutex); ***/ void silc_mutex_assert_locked(SilcMutex mutex); -/****f* silcutil/SilcMutexAPI/silc_rwlock_alloc +/****f* silcutil/silc_rwlock_alloc * * SYNOPSIS * @@ -164,7 +164,7 @@ void silc_mutex_assert_locked(SilcMutex mutex); ***/ SilcBool silc_rwlock_alloc(SilcRwLock *rwlock); -/****f* silcutil/SilcRwLockAPI/silc_rwlock_free +/****f* silcutil/silc_rwlock_free * * SYNOPSIS * @@ -178,7 +178,7 @@ SilcBool silc_rwlock_alloc(SilcRwLock *rwlock); ***/ void silc_rwlock_free(SilcRwLock rwlock); -/****f* silcutil/SilcRwLockAPI/silc_rwlock_rdlock +/****f* silcutil/silc_rwlock_rdlock * * SYNOPSIS * @@ -196,7 +196,7 @@ void silc_rwlock_free(SilcRwLock rwlock); ***/ void silc_rwlock_rdlock(SilcRwLock rwlock); -/****f* silcutil/SilcRwLockAPI/silc_rwlock_wrlock +/****f* silcutil/silc_rwlock_wrlock * * SYNOPSIS * @@ -214,7 +214,7 @@ void silc_rwlock_rdlock(SilcRwLock rwlock); ***/ void silc_rwlock_wrlock(SilcRwLock rwlock); -/****f* silcutil/SilcRwLockAPI/silc_rwlock_unlock +/****f* silcutil/silc_rwlock_unlock * * SYNOPSIS * diff --git a/lib/silcutil/silcnet.h b/lib/silcutil/silcnet.h index b8db06f8..7172338d 100644 --- a/lib/silcutil/silcnet.h +++ b/lib/silcutil/silcnet.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,14 +17,25 @@ */ -/****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); * ***/ @@ -33,7 +44,7 @@ /* Prototypes */ -/****s* silcutil/SilcNetAPI/SilcNetListener +/****s* silcutil/SilcNetListener * * NAME * @@ -48,7 +59,7 @@ ***/ typedef struct SilcNetListenerStruct *SilcNetListener; -/****f* silcutil/SilcNetAPI/SilcNetCallback +/****f* silcutil/SilcNetCallback * * SYNOPSIS * @@ -73,7 +84,7 @@ typedef struct SilcNetListenerStruct *SilcNetListener; 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 * @@ -109,7 +120,7 @@ silc_net_tcp_create_listener(const char **local_ip_addr, SilcSchedule schedule, SilcNetCallback callback, void *context); -/****f* silcutil/SilcNetAPI/silc_net_tcp_create_listener2 +/****f* silcutil/silc_net_tcp_create_listener2 * * SYNOPSIS * @@ -149,11 +160,12 @@ silc_net_tcp_create_listener2(const char *local_ip_addr, int *ports, 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 * @@ -162,13 +174,13 @@ silc_net_tcp_create_listener2(const char *local_ip_addr, int *ports, * 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 * @@ -178,14 +190,14 @@ SilcUInt16 *silc_net_listener_get_port(SilcNetListener listener, * 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 * @@ -195,14 +207,14 @@ char **silc_net_listener_get_ip(SilcNetListener listener, * 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 * @@ -215,7 +227,7 @@ char **silc_net_listener_get_hostname(SilcNetListener listener, ***/ void silc_net_close_listener(SilcNetListener listener); -/****f* silcutil/SilcNetAPI/silc_net_tcp_connect +/****f* silcutil/silc_net_tcp_connect * * SYNOPSIS * @@ -251,7 +263,7 @@ SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr, SilcNetCallback callback, void *context); -/****f* silcutil/SilcNetAPI/silc_net_udp_connect +/****f* silcutil/silc_net_udp_connect * * SYNOPSIS * @@ -276,8 +288,8 @@ SilcAsyncOperation silc_net_tcp_connect(const char *local_ip_addr, * * 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 @@ -305,7 +317,7 @@ SilcStream silc_net_udp_connect(const char *local_ip_addr, int local_port, const char *remote_ip_addr, int remote_port, SilcSchedule schedule); -/****f* silcutil/SilcNetAPI/silc_net_udp_receive +/****f* silcutil/silc_net_udp_receive * * SYNOPSIS * @@ -321,13 +333,16 @@ SilcStream silc_net_udp_connect(const char *local_ip_addr, int local_port, * 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 * @@ -339,9 +354,11 @@ int silc_net_udp_receive(SilcStream stream, char *remote_ip_addr, * * 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 @@ -353,7 +370,7 @@ int silc_net_udp_send(SilcStream stream, 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 * @@ -367,7 +384,7 @@ int silc_net_udp_send(SilcStream stream, ***/ void silc_net_close_connection(int sock); -/****f* silcutil/SilcNetAPI/silc_net_accept_connection +/****f* silcutil/silc_net_accept_connection * * SYNOPSIS * @@ -382,7 +399,7 @@ void silc_net_close_connection(int sock); ***/ int silc_net_accept_connection(int sock); -/****f* silcutil/SilcNetAPI/silc_net_set_socket_opt +/****f* silcutil/silc_net_set_socket_opt * * SYNOPSIS * @@ -398,7 +415,7 @@ int silc_net_accept_connection(int sock); ***/ 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 * @@ -415,7 +432,7 @@ int silc_net_set_socket_opt(int sock, int level, int option, int on); 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 * @@ -428,7 +445,7 @@ int silc_net_get_socket_opt(int sock, int level, int option, ***/ int silc_net_set_socket_nonblock(SilcSocket sock); -/****f* silcutil/SilcNetAPI/silc_net_is_ip4 +/****f* silcutil/silc_net_is_ip4 * * SYNOPSIS * @@ -441,7 +458,7 @@ int silc_net_set_socket_nonblock(SilcSocket sock); ***/ SilcBool silc_net_is_ip4(const char *addr); -/****f* silcutil/SilcNetAPI/silc_net_is_ip6 +/****f* silcutil/silc_net_is_ip6 * * SYNOPSIS * @@ -454,7 +471,7 @@ SilcBool silc_net_is_ip4(const char *addr); ***/ SilcBool silc_net_is_ip6(const char *addr); -/****f* silcutil/SilcNetAPI/silc_net_is_ip +/****f* silcutil/silc_net_is_ip * * SYNOPSIS * @@ -468,7 +485,7 @@ SilcBool silc_net_is_ip6(const char *addr); ***/ SilcBool silc_net_is_ip(const char *addr); -/****f* silcutil/SilcNetAPI/silc_net_addr2bin +/****f* silcutil/silc_net_addr2bin * * SYNOPSIS * @@ -484,7 +501,7 @@ SilcBool silc_net_is_ip(const char *addr); ***/ SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len); -/****f* silcutil/SilcNetAPI/SilcNetResolveCallback +/****f* silcutil/SilcNetResolveCallback * * SYNOPSIS * @@ -500,7 +517,7 @@ SilcBool silc_net_addr2bin(const char *addr, void *bin, SilcUInt32 bin_len); ***/ typedef void (*SilcNetResolveCallback)(const char *result, void *context); -/****f* silcutil/SilcNetAPI/silc_net_gethostbyname +/****f* silcutil/silc_net_gethostbyname * * SYNOPSIS * @@ -521,7 +538,7 @@ typedef void (*SilcNetResolveCallback)(const char *result, void *context); 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 * @@ -550,7 +567,7 @@ void silc_net_gethostbyname_async(const char *name, SilcNetResolveCallback completion, void *context); -/****f* silcutil/SilcNetAPI/silc_net_gethostbyaddr +/****f* silcutil/silc_net_gethostbyaddr * * SYNOPSIS * @@ -568,7 +585,7 @@ x * DESCRIPTION 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 * @@ -591,7 +608,7 @@ void silc_net_gethostbyaddr_async(const char *addr, SilcNetResolveCallback completion, void *context); -/****f* silcutil/SilcNetAPI/silc_net_check_host_by_sock +/****f* silcutil/silc_net_check_host_by_sock * * SYNOPSIS * @@ -607,7 +624,7 @@ void silc_net_gethostbyaddr_async(const char *addr, 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 * @@ -623,7 +640,7 @@ SilcBool silc_net_check_host_by_sock(SilcSocket sock, char **hostname, 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 * @@ -636,7 +653,7 @@ SilcBool silc_net_check_local_by_sock(SilcSocket sock, char **hostname, ***/ SilcUInt16 silc_net_get_remote_port(SilcSocket sock); -/****f* silcutil/SilcNetAPI/silc_net_get_local_port +/****f* silcutil/silc_net_get_local_port * * SYNOPSIS * @@ -649,7 +666,7 @@ SilcUInt16 silc_net_get_remote_port(SilcSocket sock); ***/ SilcUInt16 silc_net_get_local_port(SilcSocket sock); -/****f* silcutil/SilcNetAPI/silc_net_localhost +/****f* silcutil/silc_net_localhost * * SYNOPSIS * @@ -665,7 +682,7 @@ SilcUInt16 silc_net_get_local_port(SilcSocket sock); ***/ char *silc_net_localhost(void); -/****f* silcutil/SilcNetAPI/silc_net_localip +/****f* silcutil/silc_net_localip * * SYNOPSIS * diff --git a/lib/silcutil/silcregex.h b/lib/silcutil/silcregex.h index 8b5a6654..451ea3c3 100644 --- a/lib/silcutil/silcregex.h +++ b/lib/silcutil/silcregex.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Regular Expression Interface +/****h* silcutil/Regex Interface * * DESCRIPTION * @@ -90,12 +90,19 @@ * // 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 * @@ -122,7 +129,7 @@ typedef struct SilcRegexObject { char anchor; /* anchor: 0=none 1=begline 2=begbuf */ } *SilcRegex, SilcRegexStruct; -/****s* silcutil/SilcRegexAPI/SilcRegexMatch +/****s* silcutil/SilcRegexMatch * * NAME * @@ -142,7 +149,7 @@ typedef struct SilcRegexMatchObject { } *SilcRegexMatch, SilcRegexMatchStruct; /***/ -/****d* silcutil/SilcRegexAPI/SilcRegexFlags +/****d* silcutil/SilcRegexFlags * * NAME * @@ -169,7 +176,7 @@ typedef enum { } SilcRegexFlags; /***/ -/****f* silcutil/SilcRegexAPI/silc_regex_compile +/****f* silcutil/silc_regex_compile * * SYNOPSIS * @@ -190,7 +197,7 @@ typedef enum { SilcBool silc_regex_compile(SilcRegex regexp, const char *regex, SilcRegexFlags flags); -/****f* silcutil/SilcRegexAPI/silc_regex_compile +/****f* silcutil/silc_regex_match * * SYNOPSIS * @@ -245,7 +252,7 @@ SilcBool silc_regex_match(SilcRegex regexp, const char *string, SilcUInt32 string_len, SilcUInt32 num_match, SilcRegexMatch match, SilcRegexFlags flags); -/****f* silcutil/SilcRegexAPI/silc_regex_free +/****f* silcutil/silc_regex_free * * SYNOPSIS * @@ -260,7 +267,7 @@ SilcBool silc_regex_match(SilcRegex regexp, const char *string, ***/ void silc_regex_free(SilcRegex regexp); -/****f* silcutil/SilcRegexAPI/silc_regex +/****f* silcutil/silc_regex * * SYNOPSIS * @@ -305,7 +312,7 @@ void silc_regex_free(SilcRegex regexp); SilcBool silc_regex(const char *string, const char *regex, SilcBuffer match, ...); -/****f* silcutil/SilcRegexAPI/silc_regex_buffer +/****f* silcutil/silc_regex_buffer * * SYNOPSIS * @@ -323,7 +330,7 @@ SilcBool silc_regex(const char *string, const char *regex, SilcBool silc_regex_buffer(SilcBuffer buffer, const char *regex, SilcBuffer match, ...); -/****f* silcutil/SilcRegexAPI/silc_subst +/****f* silcutil/silc_subst * * SYNOPSIS * @@ -336,12 +343,12 @@ SilcBool silc_regex_buffer(SilcBuffer buffer, const char *regex, * 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 @@ -349,14 +356,14 @@ SilcBool silc_regex_buffer(SilcBuffer buffer, const char *regex, * * 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. * diff --git a/lib/silcutil/silcruntime.h.in b/lib/silcutil/silcruntime.h.in index 9736eed5..1c8ad886 100644 --- a/lib/silcutil/silcruntime.h.in +++ b/lib/silcutil/silcruntime.h.in @@ -17,6 +17,17 @@ */ +/****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 @@ -202,6 +213,54 @@ extern "C" { #include #include +/* 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 diff --git a/lib/silcutil/silcschedule.h b/lib/silcutil/silcschedule.h index 9cb47540..5afc1455 100644 --- a/lib/silcutil/silcschedule.h +++ b/lib/silcutil/silcschedule.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Schedule Interface +/****h* silcutil/Scheduler Interface * * DESCRIPTION * @@ -25,11 +25,12 @@ * 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, @@ -37,11 +38,6 @@ * 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 @@ -50,22 +46,22 @@ * 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 * @@ -81,7 +77,7 @@ ***/ typedef struct SilcScheduleStruct *SilcSchedule; -/****s* silcutil/SilcScheduleAPI/SilcTask +/****s* silcutil/SilcTask * * NAME * @@ -96,7 +92,7 @@ typedef struct SilcScheduleStruct *SilcSchedule; ***/ typedef struct SilcTaskStruct *SilcTask; -/****d* silcutil/SilcScheduleAPI/SilcTaskEvent +/****d* silcutil/SilcTaskEvent * * NAME * @@ -123,7 +119,7 @@ typedef enum { } SilcTaskEvent; /***/ -/****f* silcutil/SilcScheduleAPI/SilcTaskCallback +/****f* silcutil/SilcTaskCallback * * SYNOPSIS * @@ -159,7 +155,7 @@ typedef void (*SilcTaskCallback)(SilcSchedule schedule, void *app_context, SilcTaskEvent type, SilcUInt32 fd, void *context); -/****f* silcutil/SilcScheduleAPI/SilcTaskEventCallback +/****f* silcutil/SilcTaskEventCallback * * SYNOPSIS * @@ -192,7 +188,7 @@ typedef SilcBool (*SilcTaskEventCallback)(SilcSchedule schedule, SilcTask task, void *context, va_list va); -/****f* silcutil/SilcScheduleAPI/SilcTaskNotifyCb +/****f* silcutil/SilcTaskNotifyCb * * SYNOPSIS * @@ -237,7 +233,7 @@ typedef void (*SilcTaskNotifyCb)(SilcSchedule schedule, /* Macros */ -/****d* silcutil/SilcScheduleAPI/SILC_ALL_TASKS +/****d* silcutil/SILC_ALL_TASKS * * NAME * @@ -253,7 +249,7 @@ typedef void (*SilcTaskNotifyCb)(SilcSchedule schedule, #define SILC_ALL_TASKS ((SilcTask)1) /***/ -/****d* silcutil/SilcScheduleAPI/SILC_TASK_CALLBACK +/****d* silcutil/SILC_TASK_CALLBACK * * NAME * @@ -271,7 +267,7 @@ void func(SilcSchedule schedule, void *app_context, SilcTaskEvent type, \ SilcUInt32 fd, void *context) /***/ -/****d* silcutil/SilcScheduleAPI/SILC_TASK_EVENT_CALLBACK +/****d* silcutil/SILC_TASK_EVENT_CALLBACK * * NAME * @@ -294,7 +290,7 @@ SilcBool func(SilcSchedule schedule, void *app_context, \ #include "silcschedule_i.h" -/****f* silcutil/SilcScheduleAPI/silc_schedule_init +/****f* silcutil/silc_schedule_init * * SYNOPSIS * @@ -333,7 +329,7 @@ SilcBool func(SilcSchedule schedule, void *app_context, \ 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 * @@ -353,7 +349,7 @@ SilcSchedule silc_schedule_init(int max_tasks, void *app_context, ***/ SilcBool silc_schedule_uninit(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_stop +/****f* silcutil/silc_schedule_stop * * SYNOPSIS * @@ -371,7 +367,7 @@ SilcBool silc_schedule_uninit(SilcSchedule schedule); ***/ void silc_schedule_stop(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule +/****f* silcutil/silc_schedule * * SYNOPSIS * @@ -395,7 +391,7 @@ void silc_schedule_stop(SilcSchedule schedule); ***/ void silc_schedule(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_one +/****f* silcutil/silc_schedule_one * * SYNOPSIS * @@ -418,7 +414,7 @@ void silc_schedule(SilcSchedule schedule); ***/ SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs); -/****f* silcutil/SilcScheduleAPI/silc_schedule_wakeup +/****f* silcutil/silc_schedule_wakeup * * SYNOPSIS * @@ -435,7 +431,7 @@ SilcBool silc_schedule_one(SilcSchedule schedule, int timeout_usecs); ***/ void silc_schedule_wakeup(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_get_parent +/****f* silcutil/silc_schedule_get_parent * * SYNOPSIS * @@ -448,7 +444,7 @@ void silc_schedule_wakeup(SilcSchedule schedule); ***/ SilcSchedule silc_schedule_get_parent(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_get_context +/****f* silcutil/silc_schedule_get_context * * SYNOPSIS * @@ -464,7 +460,7 @@ SilcSchedule silc_schedule_get_parent(SilcSchedule schedule); ***/ void *silc_schedule_get_context(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_get_stack +/****f* silcutil/silc_schedule_get_stack * * SYNOPSIS * @@ -480,7 +476,7 @@ void *silc_schedule_get_context(SilcSchedule schedule); ***/ SilcStack silc_schedule_get_stack(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_set_notify +/****f* silcutil/silc_schedule_set_notify * * SYNOPSIS * @@ -496,7 +492,7 @@ SilcStack silc_schedule_get_stack(SilcSchedule schedule); 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 * @@ -523,7 +519,7 @@ void silc_schedule_set_notify(SilcSchedule schedule, ***/ void silc_schedule_set_global(SilcSchedule schedule); -/****f* silcutil/SilcScheduleAPI/silc_schedule_get_global +/****f* silcutil/silc_schedule_get_global * * SYNOPSIS * @@ -537,7 +533,7 @@ void silc_schedule_set_global(SilcSchedule schedule); ***/ SilcSchedule silc_schedule_get_global(void); -/****f* silcutil/SilcScheduleAPI/silc_schedule_task_add_fd +/****f* silcutil/silc_schedule_task_add_fd * * SYNOPSIS * @@ -565,7 +561,7 @@ SilcSchedule silc_schedule_get_global(void); #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 * @@ -590,7 +586,7 @@ SilcSchedule silc_schedule_get_global(void); 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 * @@ -622,7 +618,7 @@ SilcSchedule silc_schedule_get_global(void); 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 * @@ -653,14 +649,16 @@ SilcSchedule silc_schedule_get_global(void); * * 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, @@ -685,7 +683,7 @@ SilcSchedule silc_schedule_get_global(void); 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 * @@ -708,7 +706,7 @@ SilcTask silc_schedule_task_add_event(SilcSchedule schedule, ***/ 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 * @@ -730,7 +728,7 @@ SilcBool silc_schedule_task_del(SilcSchedule schedule, SilcTask task); ***/ 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 * @@ -754,7 +752,7 @@ SilcBool silc_schedule_task_del_by_fd(SilcSchedule schedule, SilcUInt32 fd); 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 * @@ -777,7 +775,7 @@ SilcBool silc_schedule_task_del_by_callback(SilcSchedule schedule, 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 * @@ -802,7 +800,7 @@ SilcBool silc_schedule_task_del_by_all(SilcSchedule schedule, int fd, SilcTaskCallback callback, void *context); -/****f* silcutil/SilcScheduleAPI/silc_schedule_task_del_event +/****f* silcutil/silc_schedule_task_del_event * * SYNOPSIS * @@ -822,7 +820,7 @@ SilcBool silc_schedule_task_del_by_all(SilcSchedule schedule, int fd, 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 * @@ -857,7 +855,7 @@ SilcBool silc_schedule_task_del_event(SilcSchedule schedule, 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 * @@ -876,7 +874,7 @@ SilcBool silc_schedule_set_listen_fd(SilcSchedule schedule, SilcUInt32 fd, 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 * @@ -894,7 +892,7 @@ SilcTaskEvent silc_schedule_get_fd_events(SilcSchedule schedule, ***/ void silc_schedule_unset_listen_fd(SilcSchedule schedule, SilcUInt32 fd); -/****f* silcutil/SilcScheduleAPI/silc_schedule_event_connect +/****f* silcutil/silc_schedule_event_connect * * SYNOPSIS * @@ -928,7 +926,7 @@ SilcBool silc_schedule_event_connect(SilcSchedule schedule, SilcTaskEventCallback callback, void *context); -/****f* silcutil/SilcScheduleAPI/silc_schedule_event_disconnect +/****f* silcutil/silc_schedule_event_disconnect * * SYNOPSIS * @@ -952,7 +950,7 @@ SilcBool silc_schedule_event_disconnect(SilcSchedule schedule, SilcTaskEventCallback callback, void *context); -/****f* silcutil/SilcScheduleAPI/silc_schedule_event_signal +/****f* silcutil/silc_schedule_event_signal * * SYNOPSIS * @@ -964,12 +962,15 @@ SilcBool silc_schedule_event_disconnect(SilcSchedule schedule, * * 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 diff --git a/lib/silcutil/silcsnprintf.h b/lib/silcutil/silcsnprintf.h index abc1e751..fd89b721 100644 --- a/lib/silcutil/silcsnprintf.h +++ b/lib/silcutil/silcsnprintf.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/Snprintf +/****h* silcutil/Snprintf Interface * * DESCRIPTION * @@ -29,7 +29,7 @@ #ifndef SILCSNPRINTF_H #define SILCSNPRINTF_H -/****f* silcutil/SilcSnprintf/SilcSnprintfRender +/****f* silcutil/SilcSnprintfRender * * SYNOPSIS * @@ -57,7 +57,7 @@ ***/ typedef char *(*SilcSnprintfRender)(void *data); -/****f* silcutil/SilcSnprintf/silc_snprintf +/****f* silcutil/silc_snprintf * * SYNOPSIS * @@ -76,7 +76,7 @@ typedef char *(*SilcSnprintfRender)(void *data); ***/ int silc_snprintf(char *str, size_t count, const char *fmt, ...); -/****f* silcutil/SilcSnprintf/silc_vsnprintf +/****f* silcutil/silc_vsnprintf * * SYNOPSIS * @@ -91,7 +91,7 @@ int silc_snprintf(char *str, size_t count, const char *fmt, ...); ***/ int silc_vsnprintf(char *str, size_t count, const char *fmt, va_list args); -/****f* silcutil/SilcSnprintf/silc_asprintf +/****f* silcutil/silc_asprintf * * SYNOPSIS * @@ -105,7 +105,7 @@ int silc_vsnprintf(char *str, size_t count, const char *fmt, va_list args); ***/ int silc_asprintf(char **ptr, const char *format, ...); -/****f* silcutil/SilcSnprintf/silc_vasprintf +/****f* silcutil/silc_vasprintf * * SYNOPSIS * diff --git a/lib/silcutil/silcsocketstream.h b/lib/silcutil/silcsocketstream.h index ad7ce71d..c642796b 100644 --- a/lib/silcutil/silcsocketstream.h +++ b/lib/silcutil/silcsocketstream.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Socket Stream Interface +/****h* silcutil/Socket Stream Interface * * DESCRIPTION * @@ -35,7 +35,7 @@ #ifndef SILCSOCKETSTREAM_H #define SILCSOCKETSTREAM_H -/****f* silcutil/SilcSocketStreamAPI/SilcSocketStreamCallback +/****f* silcutil/SilcSocketStreamCallback * * SYNOPSIS * @@ -62,7 +62,7 @@ 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 * @@ -104,7 +104,7 @@ silc_socket_tcp_stream_create(SilcSocket sock, SilcBool lookup, SilcSocketStreamCallback callback, void *context); -/****f* silcutil/SilcSocketStreamAPI/silc_socket_udp_stream_create +/****f* silcutil/silc_socket_udp_stream_create * * SYNOPSIS * @@ -146,7 +146,7 @@ SilcStream silc_socket_udp_stream_create(SilcSocket sock, SilcBool connected, SilcSchedule schedule); -/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_is_udp +/****f* silcutil/silc_socket_stream_is_udp * * SYNOPSIS * @@ -165,7 +165,7 @@ SilcStream silc_socket_udp_stream_create(SilcSocket sock, ***/ 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 * @@ -185,7 +185,7 @@ SilcBool silc_socket_stream_get_info(SilcStream stream, 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 * @@ -210,7 +210,7 @@ SilcBool silc_socket_stream_set_info(SilcStream stream, const char *hostname, const char *ip, SilcUInt16 port); -/****f* silcutil/SilcSocketStreamAPI/silc_socket_stream_set_qos +/****f* silcutil/silc_socket_stream_set_qos * * SYNOPSIS * diff --git a/lib/silcutil/silcstack.h b/lib/silcutil/silcstack.h index 0a41e6ba..f978f1bc 100644 --- a/lib/silcutil/silcstack.h +++ b/lib/silcutil/silcstack.h @@ -17,17 +17,15 @@ */ -/****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 @@ -44,14 +42,14 @@ * * 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 @@ -63,7 +61,7 @@ #ifndef SILCSTACK_H #define SILCSTACK_H -/****s* silcutil/SilcStackAPI/SilcStack +/****s* silcutil/SilcStack * * NAME * @@ -79,7 +77,7 @@ ***/ typedef struct SilcStackStruct *SilcStack; -/****s* silcutil/SilcStackAPI/SilcStackFrame +/****s* silcutil/SilcStackFrame * * NAME * @@ -97,7 +95,7 @@ typedef struct SilcStackStruct *SilcStack; ***/ typedef struct SilcStackFrameStruct SilcStackFrame; -/****f* silcutil/SilcStackAPI/SilcStackOomHandler +/****f* silcutil/SilcStackOomHandler * * SYNOPSIS * @@ -113,7 +111,7 @@ typedef struct SilcStackFrameStruct SilcStackFrame; ***/ typedef void (*SilcStackOomHandler)(SilcStack stack, void *context); -/****f* silcutil/SilcStackAPI/silc_stack_alloc +/****f* silcutil/silc_stack_alloc * * SYNOPSIS * @@ -133,12 +131,12 @@ typedef void (*SilcStackOomHandler)(SilcStack stack, void *context); * 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 * @@ -155,7 +153,7 @@ SilcStack silc_stack_alloc(SilcUInt32 stack_size, SilcStack parent); ***/ void silc_stack_free(SilcStack stack); -/****f* silcutil/SilcStackAPI/silc_stack_push +/****f* silcutil/silc_stack_push * * SYNOPSIS * @@ -215,7 +213,7 @@ void silc_stack_free(SilcStack stack); ***/ SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame); -/****f* silcutil/SilcStackAPI/silc_stack_pop +/****f* silcutil/silc_stack_pop * * SYNOPSIS * @@ -252,7 +250,7 @@ SilcUInt32 silc_stack_push(SilcStack stack, SilcStackFrame *frame); ***/ SilcUInt32 silc_stack_pop(SilcStack stack); -/****f* silcutil/SilcStackAPI/silc_stack_malloc +/****f* silcutil/silc_stack_malloc * * SYNOPSIS * @@ -275,7 +273,7 @@ SilcUInt32 silc_stack_pop(SilcStack stack); ***/ void *silc_stack_malloc(SilcStack stack, SilcUInt32 size); -/****f* silcutil/SilcStackAPI/silc_stack_realloc +/****f* silcutil/silc_stack_realloc * * SYNOPSIS * @@ -302,7 +300,7 @@ void *silc_stack_malloc(SilcStack stack, SilcUInt32 size); 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 * @@ -326,7 +324,7 @@ void silc_stack_set_oom_handler(SilcStack stack, SilcStackOomHandler oom_handler, void *context); -/****f* silcutil/SilcStackAPI/silc_stack_set_alignment +/****f* silcutil/silc_stack_set_alignment * * SYNOPSIS * @@ -352,7 +350,7 @@ void silc_stack_set_oom_handler(SilcStack stack, ***/ void silc_stack_set_alignment(SilcStack stack, SilcUInt32 alignment); -/****f* silcutil/SilcStackAPI/silc_stack_get_alignment +/****f* silcutil/silc_stack_get_alignment * * SYNOPSIS * @@ -366,7 +364,7 @@ void silc_stack_set_alignment(SilcStack stack, SilcUInt32 alignment); ***/ SilcUInt32 silc_stack_get_alignment(SilcStack stack); -/****f* silcutil/SilcStackAPI/silc_stack_purge +/****f* silcutil/silc_stack_purge * * SYNOPSIS * @@ -385,7 +383,7 @@ SilcUInt32 silc_stack_get_alignment(SilcStack stack); ***/ SilcBool silc_stack_purge(SilcStack stack); -/****f* silcutil/SilcStackAPI/silc_stack_set_global +/****f* silcutil/silc_stack_set_global * * SYNOPSIS * @@ -407,7 +405,7 @@ SilcBool silc_stack_purge(SilcStack stack); ***/ void silc_stack_set_global(SilcStack stack); -/****f* silcutil/SilcStackAPI/silc_stack_get_global +/****f* silcutil/silc_stack_get_global * * SYNOPSIS * diff --git a/lib/silcutil/silcstream.h b/lib/silcutil/silcstream.h index d88efa92..4440fa5d 100644 --- a/lib/silcutil/silcstream.h +++ b/lib/silcutil/silcstream.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Stream Interface +/****h* silcutil/Stream Interface * * DESCRIPTION * @@ -26,8 +26,9 @@ * 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 @@ -38,7 +39,7 @@ #ifndef SILCSTREAM_H #define SILCSTREAM_H -/****s* silcutil/SilcStreamAPI/SilcStream +/****s* silcutil/SilcStream * * NAME * @@ -54,7 +55,7 @@ ***/ typedef void *SilcStream; -/****d* silcutil/SilcStreamAPI/SilcStreamStatus +/****d* silcutil/SilcStreamStatus * * NAME * @@ -74,7 +75,7 @@ typedef enum { } SilcStreamStatus; /***/ -/****f* silcutil/SilcStreamAPI/SilcStreamNotifier +/****f* silcutil/SilcStreamNotifier * * SYNOPSIS * @@ -94,7 +95,7 @@ typedef void (*SilcStreamNotifier)(SilcStream stream, SilcStreamStatus status, void *context); -/****s* silcutil/SilcStreamAPI/SilcStreamOps +/****s* silcutil/SilcStreamOps * * NAME * @@ -120,7 +121,7 @@ typedef void (*SilcStreamNotifier)(SilcStream stream, * } *SilcFooStream; * * SilcFooStream foo; - * silc_stream_write(foo, data, data_len); + * silc_stream_write((SilcStream)foo, data, data_len); * * SOURCE */ @@ -156,7 +157,7 @@ typedef struct { } SilcStreamOps; /***/ -/****f* silcutil/SilcStreamAPI/silc_stream_read +/****f* silcutil/silc_stream_read * * SYNOPSIS * @@ -178,7 +179,7 @@ typedef struct { int silc_stream_read(SilcStream stream, unsigned char *buf, SilcUInt32 buf_len); -/****f* silcutil/SilcStreamAPI/silc_stream_write +/****f* silcutil/silc_stream_write * * SYNOPSIS * @@ -200,7 +201,7 @@ int silc_stream_read(SilcStream stream, unsigned char *buf, 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 * @@ -216,7 +217,7 @@ int silc_stream_write(SilcStream stream, const unsigned char *data, ***/ SilcBool silc_stream_close(SilcStream stream); -/****f* silcutil/SilcStreamAPI/silc_stream_destroy +/****f* silcutil/silc_stream_destroy * * SYNOPSIS * @@ -233,7 +234,7 @@ SilcBool silc_stream_close(SilcStream stream); ***/ void silc_stream_destroy(SilcStream stream); -/****f* silcutil/SilcStreamAPI/silc_stream_set_notifier +/****f* silcutil/silc_stream_set_notifier * * SYNOPSIS * @@ -261,7 +262,7 @@ void silc_stream_destroy(SilcStream stream); 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 * diff --git a/lib/silcutil/silcstringprep.h b/lib/silcutil/silcstringprep.h index 21bc331b..418dab71 100644 --- a/lib/silcutil/silcstringprep.h +++ b/lib/silcutil/silcstringprep.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Stringprep +/****h* silcutil/Stringprep Interface * * DESCRIPTION * @@ -32,7 +32,7 @@ #ifndef SILCSTRINGPREP_H #define SILCSTRINGPREP_H -/****d* silcutil/SilcStringprep/SilcStringprepStatus +/****d* silcutil/SilcStringprepStatus * * NAME * @@ -60,7 +60,7 @@ typedef enum { } SilcStringprepStatus; /***/ -/****d* silcutil/SilcStringprep/SilcStringprepFlags +/****d* silcutil/SilcStringprepFlags * * NAME * @@ -85,7 +85,7 @@ typedef enum { #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 * diff --git a/lib/silcutil/silcstrutil.h b/lib/silcutil/silcstrutil.h index 2caeb4c7..a9f08fe0 100644 --- a/lib/silcutil/silcstrutil.h +++ b/lib/silcutil/silcstrutil.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC String Utilities +/****h* silcutil/String Utilities * * DESCRIPTION * @@ -28,7 +28,7 @@ #ifndef SILCSTRUTIL_H #define SILCSTRUTIL_H -/****d* silcutil/SilcStrUtilAPI/SilcStringEncoding +/****d* silcutil/SilcStringEncoding * * NAME * @@ -65,7 +65,7 @@ typedef enum { } SilcStringEncoding; /***/ -/****f* silcutil/SilcStrStrUtilAPI/silc_strncat +/****f* silcutil/silc_strncat * * SYNOPSIS * @@ -82,7 +82,7 @@ typedef enum { 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 * @@ -97,7 +97,7 @@ char *silc_strncat(char *dest, SilcUInt32 dest_size, ***/ char *silc_string_regexify(const char *string); -/****f* silcutil/SilcStrUtilAPI/silc_string_match +/****f* silcutil/silc_string_match * * SYNOPSIS * @@ -111,7 +111,7 @@ char *silc_string_regexify(const char *string); ***/ int silc_string_match(const char *string1, const char *string2); -/****f* silcutil/SilcStrUtilAPI/silc_string_compare +/****f* silcutil/silc_string_compare * * SYNOPSIS * @@ -125,7 +125,7 @@ int silc_string_match(const char *string1, const char *string2); ***/ int silc_string_compare(char *string1, char *string2); -/****f* silcutil/SilcStrUtilAPI/silc_string_split +/****f* silcutil/silc_string_split * * SYNOPSIS * diff --git a/lib/silcutil/silcthread.h b/lib/silcutil/silcthread.h index 5afc0a03..c16dbd95 100644 --- a/lib/silcutil/silcthread.h +++ b/lib/silcutil/silcthread.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Thread Interface +/****h* silcutil/Thread Interface * * DESCRIPTION * @@ -42,7 +42,7 @@ /* Prototypes */ -/****s* silcutil/SilcThreadAPI/SilcThread +/****s* silcutil/SilcThread * * NAME * @@ -58,7 +58,7 @@ ***/ typedef void *SilcThread; -/****f* silcutil/SilcThreadAPI/SilcThreadStart +/****f* silcutil/SilcThreadStart * * SYNOPSIS * @@ -76,7 +76,7 @@ typedef void *SilcThread; ***/ typedef void *(*SilcThreadStart)(void *context); -/****f* silcutil/SilcThreadAPI/silc_thread_create +/****f* silcutil/silc_thread_create * * SYNOPSIS * @@ -109,7 +109,7 @@ typedef void *(*SilcThreadStart)(void *context); SilcThread silc_thread_create(SilcThreadStart start_func, void *context, SilcBool waitable); -/****f* silcutil/SilcThreadAPI/silc_thread_exit +/****f* silcutil/silc_thread_exit * * SYNOPSIS * @@ -126,7 +126,7 @@ SilcThread silc_thread_create(SilcThreadStart start_func, void *context, ***/ void silc_thread_exit(void *exit_value); -/****f* silcutil/SilcThreadAPI/silc_thread_self +/****f* silcutil/silc_thread_self * * SYNOPSIS * @@ -139,7 +139,7 @@ void silc_thread_exit(void *exit_value); ***/ SilcThread silc_thread_self(void); -/****f* silcutil/SilcThreadAPI/silc_thread_wait +/****f* silcutil/silc_thread_wait * * SYNOPSIS * @@ -157,7 +157,7 @@ SilcThread silc_thread_self(void); ***/ SilcBool silc_thread_wait(SilcThread thread, void **exit_value); -/****f* silcutil/SilcThreadAPI/silc_thread_yield +/****f* silcutil/silc_thread_yield * * SYNOPSIS * @@ -171,7 +171,7 @@ SilcBool silc_thread_wait(SilcThread thread, void **exit_value); ***/ void silc_thread_yield(void); -/****s* silcutil/SilcThreadAPI/SilcThreadPool +/****s* silcutil/SilcThreadPool * * NAME * @@ -187,7 +187,7 @@ void silc_thread_yield(void); ***/ typedef struct SilcThreadPoolStruct *SilcThreadPool; -/****f* silcutil/SilcThreadAPI/SilcThreadPoolFunc +/****f* silcutil/SilcThreadPoolFunc * * SYNOPSIS * @@ -204,7 +204,7 @@ typedef struct SilcThreadPoolStruct *SilcThreadPool; ***/ typedef void (*SilcThreadPoolFunc)(SilcSchedule schedule, void *context); -/****f* silcutil/SilcThreadAPI/silc_thread_pool_alloc +/****f* silcutil/silc_thread_pool_alloc * * SYNOPSIS * @@ -243,7 +243,7 @@ SilcThreadPool silc_thread_pool_alloc(SilcStack stack, SilcUInt32 max_threads, SilcBool start_min_threads); -/****f* silcutil/SilcThreadAPI/silc_thread_pool_free +/****f* silcutil/silc_thread_pool_free * * SYNOPSIS * @@ -258,7 +258,7 @@ SilcThreadPool silc_thread_pool_alloc(SilcStack stack, ***/ void silc_thread_pool_free(SilcThreadPool tp, SilcBool wait_unfinished); -/****f* silcutil/SilcThreadAPI/silc_thread_pool_run +/****f* silcutil/silc_thread_pool_run * * SYNOPSIS * @@ -294,7 +294,7 @@ SilcBool silc_thread_pool_run(SilcThreadPool tp, SilcTaskCallback completion, void *completion_context); -/****f* silcutil/SilcThreadAPI/silc_thread_pool_set_max_threads +/****f* silcutil/silc_thread_pool_set_max_threads * * SYNOPSIS * @@ -310,7 +310,7 @@ SilcBool silc_thread_pool_run(SilcThreadPool tp, 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 * @@ -323,7 +323,7 @@ void silc_thread_pool_set_max_threads(SilcThreadPool tp, ***/ 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 * @@ -337,7 +337,7 @@ SilcUInt32 silc_thread_pool_get_max_threads(SilcThreadPool tp); ***/ SilcUInt32 silc_thread_pool_num_free_threads(SilcThreadPool tp); -/****f* silcutil/SilcThreadAPI/silc_thread_pool_purge +/****f* silcutil/silc_thread_pool_purge * * SYNOPSIS * @@ -352,7 +352,7 @@ SilcUInt32 silc_thread_pool_num_free_threads(SilcThreadPool tp); ***/ void silc_thread_pool_purge(SilcThreadPool tp); -/****f* silcutil/SilcThreadAPI/silc_thread_tls_set +/****f* silcutil/silc_thread_tls_set * * SYNOPSIS * @@ -370,7 +370,7 @@ void silc_thread_pool_purge(SilcThreadPool tp); ***/ void silc_thread_tls_set(void *context); -/****f* silcutil/SilcThreadAPI/silc_thread_tls_get +/****f* silcutil/silc_thread_tls_get * * SYNOPSIS * diff --git a/lib/silcutil/silcthreadqueue.h b/lib/silcutil/silcthreadqueue.h index c6355a89..87cf7445 100644 --- a/lib/silcutil/silcthreadqueue.h +++ b/lib/silcutil/silcthreadqueue.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Thread Queue Interface +/****h* silcutil/Thread Queue Interface * * DESCRIPTION * @@ -48,7 +48,7 @@ #ifndef SILCTHREADQUEUE_H #define SILCTHREADQUEUE_H -/****s* silcutil/SilcThreadQueueAPI/SilcThreadQueue +/****s* silcutil/SilcThreadQueue * * NAME * @@ -62,7 +62,7 @@ ***/ typedef struct SilcThreadQueueStruct *SilcThreadQueue; -/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_alloc +/****f* silcutil/silc_thread_queue_alloc * * SYNOPSIS * @@ -79,7 +79,7 @@ typedef struct SilcThreadQueueStruct *SilcThreadQueue; ***/ SilcThreadQueue silc_thread_queue_alloc(void); -/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_connect +/****f* silcutil/silc_thread_queue_connect * * SYNOPSIS * @@ -95,7 +95,7 @@ SilcThreadQueue silc_thread_queue_alloc(void); ***/ void silc_thread_queue_connect(SilcThreadQueue queue); -/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_disconnect +/****f* silcutil/silc_thread_queue_disconnect * * SYNOPSIS * @@ -112,7 +112,7 @@ void silc_thread_queue_connect(SilcThreadQueue queue); ***/ void silc_thread_queue_disconnect(SilcThreadQueue queue); -/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_push +/****f* silcutil/silc_thread_queue_push * * SYNOPSIS * @@ -126,7 +126,7 @@ void silc_thread_queue_disconnect(SilcThreadQueue queue); ***/ void silc_thread_queue_push(SilcThreadQueue queue, void *data); -/****f* silcutil/SilcThreadQueueAPI/silc_thread_queue_pop +/****f* silcutil/silc_thread_queue_pop * * SYNOPSIS * @@ -142,7 +142,7 @@ void silc_thread_queue_push(SilcThreadQueue queue, void *data); ***/ 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 * @@ -159,7 +159,7 @@ void *silc_thread_queue_pop(SilcThreadQueue queue, SilcBool block); 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 * diff --git a/lib/silcutil/silctime.h b/lib/silcutil/silctime.h index e01e1ae7..a049cca4 100644 --- a/lib/silcutil/silctime.h +++ b/lib/silcutil/silctime.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Time Interface +/****h* silcutil/Time Interface * * DESCRIPTION * @@ -30,7 +30,7 @@ #ifndef SILCTIME_H #define SILCTIME_H -/****s* silcutil/SilcTimeAPI/SilcTime +/****s* silcutil/SilcTime * * NAME * @@ -43,7 +43,7 @@ * * SOURCE * - ***/ + */ typedef struct SilcTimeObject { unsigned int year : 15; /* Year, 0 - 32768 */ unsigned int month : 4; /* Month, 1 - 12 */ @@ -59,7 +59,7 @@ typedef struct SilcTimeObject { } *SilcTime, SilcTimeStruct; /***/ -/****f* silcutil/SilcTimeAPI/silc_time +/****f* silcutil/silc_time * * SYNOPSIS * @@ -73,7 +73,7 @@ typedef struct SilcTimeObject { ***/ SilcInt64 silc_time(void); -/****f* silcutil/SilcTimeAPI/silc_time_msec +/****f* silcutil/silc_time_msec * * SYNOPSIS * @@ -87,7 +87,7 @@ SilcInt64 silc_time(void); ***/ SilcInt64 silc_time_msec(void); -/****f* silcutil/SilcTimeAPI/silc_time_usec +/****f* silcutil/silc_time_usec * * SYNOPSIS * @@ -101,7 +101,7 @@ SilcInt64 silc_time_msec(void); ***/ SilcInt64 silc_time_usec(void); -/****f* silcutil/SilcTimeAPI/silc_time_string +/****f* silcutil/silc_time_string * * SYNOPSIS * @@ -118,7 +118,7 @@ SilcInt64 silc_time_usec(void); ***/ const char *silc_time_string(SilcInt64 time_val_sec); -/****f* silcutil/SilcTimeAPI/silc_time_value +/****f* silcutil/silc_time_value * * SYNOPSIS * @@ -134,7 +134,7 @@ const char *silc_time_string(SilcInt64 time_val_sec); ***/ SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time); -/****f* silcutil/SilcTimeAPI/silc_timezone +/****f* silcutil/silc_timezone * * SYNOPSIS * @@ -153,7 +153,7 @@ SilcBool silc_time_value(SilcInt64 time_val_msec, SilcTime ret_time); ***/ SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size); -/****f* silcutil/SilcTimeAPI/silc_time_universal +/****f* silcutil/silc_time_universal * * SYNOPSIS * @@ -179,7 +179,7 @@ SilcBool silc_timezone(char *timezone, SilcUInt32 timezone_size); ***/ 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 * @@ -195,7 +195,7 @@ SilcBool silc_time_universal(const char *universal_time, SilcTime ret_time); 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 * @@ -226,7 +226,7 @@ SilcBool silc_time_universal_string(SilcTime time_val, char *ret_string, 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 * @@ -243,7 +243,7 @@ silc_time_generalized(const char *generalized_time, SilcTime ret_time); 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 * @@ -258,7 +258,7 @@ SilcBool silc_time_generalized_string(SilcTime time_val, char *ret_string, ***/ int silc_compare_timeval(struct timeval *t1, struct timeval *t2); -/****f* silcutil/SilcTimeAPI/silc_gettimeofday +/****f* silcutil/silc_gettimeofday * * SYNOPSIS * @@ -272,47 +272,4 @@ int silc_compare_timeval(struct timeval *t1, struct timeval *t2); ***/ 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 */ diff --git a/lib/silcutil/silctimer.h b/lib/silcutil/silctimer.h index 30debf07..bc908ee7 100644 --- a/lib/silcutil/silctimer.h +++ b/lib/silcutil/silctimer.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,13 +17,16 @@ */ -/****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; @@ -38,7 +41,7 @@ #ifndef SILCTIMER_H #define SILCTIMER_H -/****s* silcutil/SilcTimerAPI/SilcTimer +/****s* silcutil/SilcTimer * * NAME * @@ -52,7 +55,7 @@ ***/ typedef struct SilcTimerObject *SilcTimer, SilcTimerStruct; -/****f* silcutil/SilcTimerAPI/silc_timer_start +/****f* silcutil/silc_timer_start * * SYNOPSIS * @@ -75,7 +78,7 @@ typedef struct SilcTimerObject *SilcTimer, SilcTimerStruct; ***/ void silc_timer_start(SilcTimer timer); -/****f* silcutil/SilcTimerAPI/silc_timer_stop +/****f* silcutil/silc_timer_stop * * SYNOPSIS * @@ -89,7 +92,7 @@ void silc_timer_start(SilcTimer timer); ***/ void silc_timer_stop(SilcTimer timer); -/****f* silcutil/SilcTimerAPI/silc_timer_continue +/****f* silcutil/silc_timer_continue * * SYNOPSIS * @@ -102,7 +105,7 @@ void silc_timer_stop(SilcTimer timer); ***/ void silc_timer_continue(SilcTimer timer); -/****f* silcutil/SilcTimerAPI/silc_timer_value +/****f* silcutil/silc_timer_value * * SYNOPSIS * @@ -121,7 +124,7 @@ void silc_timer_value(SilcTimer timer, SilcUInt64 *elapsed_time_seconds, SilcUInt32 *elapsed_time_microseconds); -/****f* silcutil/SilcTimerAPI/silc_timer_value_time +/****f* silcutil/silc_timer_value_time * * SYNOPSIS * @@ -137,7 +140,7 @@ void silc_timer_value(SilcTimer timer, ***/ void silc_timer_value_time(SilcTimer timer, SilcTime ret_time); -/****f* silcutil/SilcTimerAPI/silc_timer_start_time +/****f* silcutil/silc_timer_start_time * * SYNOPSIS * @@ -150,7 +153,7 @@ void silc_timer_value_time(SilcTimer timer, SilcTime ret_time); ***/ 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 * @@ -165,7 +168,7 @@ SilcBool silc_timer_is_running(SilcTimer timer); #include "silctimer_i.h" -/****f* silcutil/SilcTimerAPI/silc_timer_tick +/****f* silcutil/silc_timer_tick * * SYNOPSIS * @@ -179,7 +182,7 @@ SilcBool silc_timer_is_running(SilcTimer timer); * 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); @@ -226,7 +229,7 @@ SilcUInt64 silc_timer_tick(SilcTimer timer, SilcBool adjust) #endif /* __GNUC__ || __ICC */ } -/****f* silcutil/SilcTimerAPI/silc_timer_synchronize +/****f* silcutil/silc_timer_synchronize * * SYNOPSIS * @@ -286,4 +289,47 @@ void silc_timer_synchronize(SilcTimer timer) 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 */ diff --git a/lib/silcutil/silctypes.h b/lib/silcutil/silctypes.h index 8cbb20d0..8a9c53bc 100644 --- a/lib/silcutil/silctypes.h +++ b/lib/silcutil/silctypes.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Types +/****h* silcutil/Types and Definitions * * DESCRIPTION * @@ -44,9 +44,7 @@ #error "size of the short must be 2 bytes" #endif -/******************************* Public API *********************************/ - -/****d* silcutil/SILCTypes/SilcBool +/****d* silcutil/SilcBool * * NAME * @@ -59,7 +57,7 @@ ***/ typedef unsigned char SilcBool; -/****d* silcutil/SILCTypes/TRUE +/****d* silcutil/TRUE * * NAME * @@ -76,7 +74,7 @@ typedef unsigned char SilcBool; #endif /***/ -/****d* silcutil/SILCTypes/FALSE +/****d* silcutil/FALSE * * NAME * @@ -93,7 +91,7 @@ typedef unsigned char SilcBool; #endif /***/ -/****d* silcutil/SILCTypes/SilcUInt8 +/****d* silcutil/SilcUInt8 * * NAME * @@ -108,7 +106,7 @@ typedef unsigned char SilcBool; typedef unsigned char SilcUInt8; /***/ -/****d* silcutil/SILCTypes/SilcInt8 +/****d* silcutil/SilcInt8 * * NAME * @@ -123,7 +121,7 @@ typedef unsigned char SilcUInt8; typedef signed char SilcInt8; /***/ -/****d* silcutil/SILCTypes/SilcUInt16 +/****d* silcutil/SilcUInt16 * * NAME * @@ -138,7 +136,7 @@ typedef signed char SilcInt8; typedef unsigned short SilcUInt16; /***/ -/****d* silcutil/SILCTypes/SilcInt16 +/****d* silcutil/SilcInt16 * * NAME * @@ -153,7 +151,7 @@ typedef unsigned short SilcUInt16; typedef signed short SilcInt16; /***/ -/****d* silcutil/SILCTypes/SilcUInt32 +/****d* silcutil/SilcUInt32 * * NAME * @@ -183,7 +181,7 @@ typedef signed long long SilcInt32; #endif /***/ -/****d* silcutil/SILCTypes/SilcInt32 +/****d* silcutil/SilcInt32 * * NAME * @@ -195,7 +193,7 @@ typedef signed long long SilcInt32; * ***/ -/****d* silcutil/SILCTypes/SilcUInt64 +/****d* silcutil/SilcUInt64 * * NAME * @@ -227,7 +225,7 @@ typedef SilcInt32 SilcInt64; #endif /***/ -/****d* silcutil/SILCTypes/SilcInt64 +/****d* silcutil/SilcInt64 * * NAME * @@ -244,7 +242,7 @@ typedef SilcInt32 SilcInt64; typedef SilcUInt32 * void *; #endif -/****d* silcutil/SILCTypes/SilcSocket +/****d* silcutil/SilcSocket * * NAME * @@ -268,7 +266,7 @@ typedef void * SilcSocket; #endif /***/ -/****d* silcutil/SILCTypes/SilcParam +/****d* silcutil/SilcParam * * NAME * @@ -334,7 +332,7 @@ typedef SilcUInt32 SilcParam; | ((SilcUInt32)(SilcUInt8)(cp)[3]) #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ -/****d* silcutil/SILCTypes/SILC_GET16_MSB +/****d* silcutil/SILC_GET16_MSB * * NAME * @@ -359,7 +357,7 @@ do { \ #endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_GET32_MSB +/****d* silcutil/SILC_GET32_MSB * * NAME * @@ -404,7 +402,7 @@ do { \ | ((SilcUInt32)(SilcUInt8)(cp)[3]); #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ -/****d* silcutil/SILCTypes/SILC_GET64_MSB +/****d* silcutil/SILC_GET64_MSB * * NAME * @@ -429,7 +427,7 @@ do { \ #endif /* SILC_X86_64 && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_GET16_LSB +/****d* silcutil/SILC_GET16_LSB * * NAME * @@ -452,7 +450,7 @@ do { \ #endif /* SILC_I386 || SILC_X86_64 */ /***/ -/****d* silcutil/SILCTypes/SILC_GET32_LSB +/****d* silcutil/SILC_GET32_LSB * * NAME * @@ -488,7 +486,7 @@ do { \ | ((SilcUInt32)(SilcUInt8)(cp)[3] << 24) #endif /* SILC_I386 || SILC_X86_64 */ -/****d* silcutil/SILCTypes/SILC_PUT16_MSB +/****d* silcutil/SILC_PUT16_MSB * * NAME * @@ -513,7 +511,7 @@ do { \ #endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_PUT32_MSB +/****d* silcutil/SILC_PUT32_MSB * * NAME * @@ -540,7 +538,7 @@ do { \ #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_PUT64_MSB +/****d* silcutil/SILC_PUT64_MSB * * NAME * @@ -565,7 +563,7 @@ do { \ #endif /* SILC_X86_64 && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_PUT16_LSB +/****d* silcutil/SILC_PUT16_LSB * * NAME * @@ -588,7 +586,7 @@ do { \ #endif /* SILC_I386 || SILC_X86_64 */ /***/ -/****d* silcutil/SILCTypes/SILC_PUT32_LSB +/****d* silcutil/SILC_PUT32_LSB * * NAME * @@ -613,7 +611,7 @@ do { \ #endif /* SILC_I386 || SILC_X86_64 */ /***/ -/****d* silcutil/SILCTypes/SILC_SWAB_16 +/****d* silcutil/SILC_SWAB_16 * * NAME * @@ -640,7 +638,7 @@ do { \ #endif /* (SILC_I386 || SILC_X86_64) && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_SWAB_32 +/****d* silcutil/SILC_SWAB_32 * * NAME * @@ -669,7 +667,7 @@ do { \ #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ /***/ -/****d* silcutil/SILCTypes/SILC_PTR_TO_32 +/****d* silcutil/SILC_PTR_TO_32 * * NAME * @@ -691,7 +689,7 @@ do { \ #endif /***/ -/****d* silcutil/SILCTypes/SILC_PTR_TO_64 +/****d* silcutil/SILC_PTR_TO_64 * * NAME * @@ -712,7 +710,7 @@ do { \ #endif /***/ -/****d* silcutil/SILCTypes/SILC_32_TO_PTR +/****d* silcutil/SILC_32_TO_PTR * * NAME * @@ -733,7 +731,7 @@ do { \ #endif /***/ -/****d* silcutil/SILCTypes/SILC_64_TO_PTR +/****d* silcutil/SILC_64_TO_PTR * * NAME * @@ -755,7 +753,58 @@ do { \ #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 * @@ -779,7 +828,7 @@ static inline SilcUInt32 silc_rol(SilcUInt32 val, int num) #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ } -/****d* silcutil/SILCTypes/silc_ror +/****d* silcutil/silc_ror * * NAME * @@ -803,7 +852,7 @@ static inline SilcUInt32 silc_ror(SilcUInt32 val, int num) #endif /* (SILC_I486 || SILC_X86_64) && __GNUC__ */ } -/****d* silcutil/SILCTypes/silc_rol64 +/****d* silcutil/silc_rol64 * * NAME * @@ -827,7 +876,7 @@ static inline SilcUInt64 silc_rol64(SilcUInt64 val, int num) #endif /* SILC_X86_64 && __GNUC__ */ } -/****d* silcutil/SILCTypes/silc_ror64 +/****d* silcutil/silc_ror64 * * NAME * @@ -851,7 +900,7 @@ static inline SilcUInt64 silc_ror64(SilcUInt64 val, int num) #endif /* SILC_X86_64 && __GNUC__ */ } -/****d* silcutil/SILCTypes/silc_offsetof +/****d* silcutil/silc_offsetof * * NAME * @@ -864,7 +913,7 @@ static inline SilcUInt64 silc_ror64(SilcUInt64 val, int num) ***/ #define silc_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) -/****d* silcutil/SILCTypes/silc_attribute +/****d* silcutil/silc_attribute * * NAME * @@ -887,7 +936,7 @@ static inline SilcUInt64 silc_ror64(SilcUInt64 val, int num) #define silc_attribute(attrlist) #endif /* __GNUC__ */ -/****d* silcutil/SILCTypes/silc_likely +/****d* silcutil/silc_likely * * NAME * @@ -902,7 +951,7 @@ static inline SilcUInt64 silc_ror64(SilcUInt64 val, int num) * ***/ -/****d* silcutil/SILCTypes/silc_unlikely +/****d* silcutil/silc_unlikely * * NAME * @@ -928,7 +977,7 @@ static inline SilcUInt64 silc_ror64(SilcUInt64 val, int num) 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 * @@ -960,7 +1009,7 @@ void silc_prefetch(void *addr, int rw, int locality) #endif /* __GNUC__ */ } -/****d* silcutil/SILCTypes/silc_prefetch_block +/****d* silcutil/silc_prefetch_block * * NAME * diff --git a/lib/silcutil/silcutf8.h b/lib/silcutil/silcutf8.h index 1f6fe4de..47e951bc 100644 --- a/lib/silcutil/silcutf8.h +++ b/lib/silcutil/silcutf8.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC UTF-8 Interface +/****h* silcutil/UTF-8 Interface * * DESCRIPTION * @@ -30,7 +30,7 @@ #ifndef SILCUTF8_H #define SILCUTF8_H -/****f* silcutil/SilcUTF8API/silc_utf8_encode +/****f* silcutil/silc_utf8_encode * * SYNOPSIS * @@ -51,7 +51,7 @@ SilcUInt32 silc_utf8_encode(const unsigned char *bin, SilcUInt32 bin_len, SilcStringEncoding bin_encoding, unsigned char *utf8, SilcUInt32 utf8_size); -/****f* silcutil/SilcStrUtilAPI/silc_utf8_decode +/****f* silcutil/silc_utf8_decode * * SYNOPSIS * @@ -74,7 +74,7 @@ SilcUInt32 silc_utf8_decode(const unsigned char *utf8, SilcUInt32 utf8_len, SilcStringEncoding bin_encoding, unsigned char *bin, SilcUInt32 bin_size); -/****f* silcutil/SilcStrUtilAPI/silc_utf8_c2w +/****f* silcutil/silc_utf8_c2w * * SYNOPSIS * @@ -98,7 +98,7 @@ SilcUInt32 silc_utf8_decode(const unsigned char *utf8, SilcUInt32 utf8_len, 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 * @@ -119,7 +119,7 @@ SilcUInt32 silc_utf8_c2w(const unsigned char *utf8, SilcUInt32 utf8_len, 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 * @@ -137,7 +137,7 @@ SilcUInt32 silc_utf8_w2c(const SilcUInt16 *wide_str, SilcUInt32 wide_str_len, 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 * @@ -155,7 +155,7 @@ SilcUInt32 silc_utf8_encoded_len(const unsigned char *bin, SilcUInt32 bin_len, 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 * @@ -169,7 +169,7 @@ SilcUInt32 silc_utf8_decoded_len(const unsigned char *bin, SilcUInt32 bin_len, ***/ SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len); -/****f* silcutil/SilcStrUtilAPI/silc_utf8_strcasecmp +/****f* silcutil/silc_utf8_strcasecmp * * SYNOPSIS * @@ -188,7 +188,7 @@ SilcBool silc_utf8_valid(const unsigned char *utf8, SilcUInt32 utf8_len); ***/ SilcBool silc_utf8_strcasecmp(const char *s1, const char *s2); -/****f* silcutil/SilcStrUtilAPI/silc_utf8_strncasecmp +/****f* silcutil/silc_utf8_strncasecmp * * SYNOPSIS * diff --git a/lib/silcutil/silcutil.h b/lib/silcutil/silcutil.h index 726c67f4..14e6adf5 100644 --- a/lib/silcutil/silcutil.h +++ b/lib/silcutil/silcutil.h @@ -17,7 +17,7 @@ */ -/****h* silcutil/SILC Utilities +/****h* silcutil/Misc Utilities * * DESCRIPTION * @@ -28,7 +28,7 @@ #ifndef SILCUTIL_H #define SILCUTIL_H -/****f* silcutil/SilcUtilAPI/silc_gets +/****f* silcutil/silc_gets * * SYNOPSIS * @@ -44,7 +44,7 @@ ***/ 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 * @@ -58,7 +58,7 @@ int silc_gets(char *dest, int destlen, const char *src, int srclen, int begin); ***/ SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size); -/****f* silcutil/SilcUtilAPI/silc_to_lower +/****f* silcutil/silc_to_lower * * SYNOPSIS * @@ -72,7 +72,7 @@ SilcBool silc_to_upper(const char *string, char *dest, SilcUInt32 dest_size); ***/ SilcBool silc_to_lower(const char *string, char *dest, SilcUInt32 dest_size); -/****f* silcutil/SilcUtilAPI/silc_parse_userfqdn +/****f* silcutil/silc_parse_userfqdn * * SYNOPSIS * @@ -91,7 +91,7 @@ int silc_parse_userfqdn(const char *string, char *user, SilcUInt32 user_size, char *fqdn, SilcUInt32 fqdn_size); -/****f* silcutil/SilcUtilAPI/silc_parse_command_line +/****f* silcutil/silc_parse_command_line * * SYNOPSIS * @@ -117,7 +117,7 @@ void silc_parse_command_line(unsigned char *buffer, SilcUInt32 *parsed_num, SilcUInt32 max_args); -/****f* silcutil/SilcUtilAPI/silc_format +/****f* silcutil/silc_format * * SYNOPSIS * @@ -131,7 +131,7 @@ void silc_parse_command_line(unsigned char *buffer, ***/ char *silc_format(char *fmt, ...); -/****f* silcutil/SilcUtilAPI/silc_fingerprint +/****f* silcutil/silc_fingerprint * * SYNOPSIS * @@ -147,7 +147,7 @@ char *silc_format(char *fmt, ...); ***/ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len); -/****f* silcutil/SilcUtilAPI/silc_string_is_ascii +/****f* silcutil/silc_string_is_ascii * * SYNOPSIS * @@ -161,7 +161,7 @@ char *silc_fingerprint(const unsigned char *data, SilcUInt32 data_len); ***/ SilcBool silc_string_is_ascii(const unsigned char *data, SilcUInt32 data_len); -/****f* silcutil/SilcUtilAPI/silc_get_input +/****f* silcutil/silc_get_input * * SYNOPSIS * @@ -176,7 +176,7 @@ char *silc_get_input(const char *prompt, SilcBool echo_off); /* System dependant prototypes */ -/****f* silcutil/SilcUtilAPI/silc_get_username +/****f* silcutil/silc_get_username * * SYNOPSIS * @@ -193,7 +193,7 @@ char *silc_get_input(const char *prompt, SilcBool echo_off); ***/ char *silc_get_username(); -/****f* silcutil/SilcUtilAPI/silc_get_real_name +/****f* silcutil/silc_get_real_name * * SYNOPSIS * @@ -209,7 +209,7 @@ char *silc_get_username(); ***/ char *silc_get_real_name(); -/****f* silcutil/SilcUtilAPI/silc_va_copy +/****f* silcutil/silc_va_copy * * SYNOPSIS * @@ -233,7 +233,7 @@ char *silc_get_real_name(); #define silc_va_copy(dest, src) dest = src; #endif -/****f* silcutil/SilcUtilAPI/silc_hexdump +/****f* silcutil/silc_hexdump * * SYNOPSIS * @@ -249,7 +249,7 @@ char *silc_get_real_name(); void silc_hexdump(const unsigned char *data, SilcUInt32 data_len, FILE *output); -/****f* silcutil/SilcUtilAPI/silc_hex2data +/****f* silcutil/silc_hex2data * * SYNOPSIS * @@ -265,7 +265,7 @@ void silc_hexdump(const unsigned char *data, SilcUInt32 data_len, 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 * diff --git a/lib/silcutil/symbian/.gitignore b/lib/silcutil/symbian/.gitignore deleted file mode 100644 index a501f929..00000000 --- a/lib/silcutil/symbian/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -*.in -*.am -*.o -*.lo -*.la -*.a -*.pc diff --git a/lib/silcutil/symbian/silcsymbiannet.cpp b/lib/silcutil/symbian/silcsymbiannet.cpp index c665b3d3..3667825c 100644 --- a/lib/silcutil/symbian/silcsymbiannet.cpp +++ b/lib/silcutil/symbian/silcsymbiannet.cpp @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -#include "silc.h" +#include "silcruntime.h" #include "silcsymbiansocketstream.h" /************************ Static utility functions **************************/ diff --git a/lib/silcutil/symbian/silcsymbianscheduler.cpp b/lib/silcutil/symbian/silcsymbianscheduler.cpp index 631a0a9b..8f1cd5cf 100644 --- a/lib/silcutil/symbian/silcsymbianscheduler.cpp +++ b/lib/silcutil/symbian/silcsymbianscheduler.cpp @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -#include "silc.h" +#include "silcruntime.h" #include /* The SILC Scheduler for Symbian handles only timeout tasks. Fd tasks are diff --git a/lib/silcutil/symbian/silcsymbiansocketstream.cpp b/lib/silcutil/symbian/silcsymbiansocketstream.cpp index b2362784..343076c5 100644 --- a/lib/silcutil/symbian/silcsymbiansocketstream.cpp +++ b/lib/silcutil/symbian/silcsymbiansocketstream.cpp @@ -5,7 +5,7 @@ Author: Pekka Riikonen - 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 @@ -25,7 +25,7 @@ socket, which is done automatically by the Active Scheduler in blocking mode. */ -#include "silc.h" +#include "silcruntime.h" #include "silcsymbiansocketstream.h" /***************************** Socket Classes *******************************/ diff --git a/lib/silcutil/symbian/silcsymbianutil.cpp b/lib/silcutil/symbian/silcsymbianutil.cpp index 691ec677..9b56425a 100644 --- a/lib/silcutil/symbian/silcsymbianutil.cpp +++ b/lib/silcutil/symbian/silcsymbianutil.cpp @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -#include "silc.h" +#include "silcruntime.h" #include #include diff --git a/lib/silcutil/tests/test_silcglobal.c b/lib/silcutil/tests/test_silcglobal.c index 6ca7e728..138b55f4 100644 --- a/lib/silcutil/tests/test_silcglobal.c +++ b/lib/silcutil/tests/test_silcglobal.c @@ -7,6 +7,7 @@ int main(int argc, char **argv) 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); @@ -15,6 +16,18 @@ int main(int argc, char **argv) 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; diff --git a/lib/silcutil/unix/.gitignore b/lib/silcutil/unix/.gitignore deleted file mode 100644 index a501f929..00000000 --- a/lib/silcutil/unix/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -*.in -*.am -*.o -*.lo -*.la -*.a -*.pc diff --git a/lib/silcutil/win32/.gitignore b/lib/silcutil/win32/.gitignore deleted file mode 100644 index a501f929..00000000 --- a/lib/silcutil/win32/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -Makefile -*.in -*.am -*.o -*.lo -*.la -*.a -*.pc diff --git a/lib/silcutil/win32/silcwin32net.c b/lib/silcutil/win32/silcwin32net.c index 0501ab82..ee8f10d3 100644 --- a/lib/silcutil/win32/silcwin32net.c +++ b/lib/silcutil/win32/silcwin32net.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -16,9 +16,8 @@ GNU General Public License for more details. */ -/* $Id$ */ -#include "silc.h" +#include "silcruntime.h" /************************** Types and definitions ***************************/ diff --git a/lib/silcutil/win32/silcwin32schedule.c b/lib/silcutil/win32/silcwin32schedule.c index 0a050522..93b7fc64 100644 --- a/lib/silcutil/win32/silcwin32schedule.c +++ b/lib/silcutil/win32/silcwin32schedule.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -16,9 +16,8 @@ GNU General Public License for more details. */ -/* $Id$ */ -#include "silc.h" +#include "silcruntime.h" const SilcScheduleOps schedule_ops; diff --git a/lib/silcutil/win32/silcwin32socketstream.c b/lib/silcutil/win32/silcwin32socketstream.c index 035c1618..dd53a14c 100644 --- a/lib/silcutil/win32/silcwin32socketstream.c +++ b/lib/silcutil/win32/silcwin32socketstream.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -17,7 +17,7 @@ */ -#include "silc.h" +#include "silcruntime.h" /************************ Static utility functions **************************/ diff --git a/lib/silcutil/win32/silcwin32util.c b/lib/silcutil/win32/silcwin32util.c index 0148a8e0..da2ebae5 100644 --- a/lib/silcutil/win32/silcwin32util.c +++ b/lib/silcutil/win32/silcwin32util.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - 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 @@ -16,9 +16,8 @@ GNU General Public License for more details. */ -/* $Id$ */ -#include "silc.h" +#include "silcruntime.h" #define FILETIME_1970 0x019db1ded53e8000 const BYTE DWLEN = sizeof(DWORD) * 8; diff --git a/lib/srt.pc.in b/lib/srt.pc.in new file mode 100644 index 00000000..69620a5b --- /dev/null +++ b/lib/srt.pc.in @@ -0,0 +1,10 @@ +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} diff --git a/srt.spec.in b/srt.spec.in index ea620ba8..ddfabba9 100644 --- a/srt.spec.in +++ b/srt.spec.in @@ -1,44 +1,44 @@ -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 @@ -46,7 +46,6 @@ 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 @@ -57,51 +56,20 @@ 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 -- Rewrote .spec for SILC Toolkit 1.1. Obsoletes libsilc. Renamed to - silc-toolkit. - -* Tue Sep 1 2004 Toni Willberg -- 0.9.12-0.fdr.6 - Had to remove smp_mflags because build fails with them - (Michael Schwendt) - -* Tue Aug 31 2004 Toni Willberg -- 0.9.12-0.fdr.5 - corrections to lib and include path (from Michael Schwendt) - -* Tue Aug 31 2004 Toni Willberg -- 0.9.12-0.fdr.4 - post/postun /sbin/ldconfig - (Patch 823 from Stu Tomlinson) - -* Tue Aug 31 2004 Toni Willberg -- 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 -- fix so permissions and hardcoded paths (patch from Michael Schwendt) - -* Mon Jul 5 2004 Toni Willberg -- Fixed various errors - -* Sun Jul 4 2004 Toni Willberg +* Sun Jan 27 2008 Pekka Riikonen - Initial version for Fedora diff --git a/win32/Makefile.am b/win32/Makefile.am index 26d56ef4..5f4949c9 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -21,8 +21,7 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign 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 diff --git a/win32/README b/win32/README index 658f9c22..8cb80c60 100644 --- a/win32/README +++ b/win32/README @@ -1,12 +1,10 @@ -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. diff --git a/win32/silc.dsw b/win32/srt.dsw similarity index 100% rename from win32/silc.dsw rename to win32/srt.dsw -- 2.24.0